Merge remote-tracking branch 'origin/merge-to-testing' into testing
authorMathieu <mbaudier@argeo.org>
Tue, 6 Dec 2022 05:47:51 +0000 (06:47 +0100)
committerMathieu <mbaudier@argeo.org>
Tue, 6 Dec 2022 05:47:51 +0000 (06:47 +0100)
438 files changed:
.project
Makefile
branch.mk
cnf/build.bnd [deleted file]
cnf/testing.bnd [deleted file]
cnf/unstable.bnd [deleted file]
configure [changed mode: 0644->0755]
org.argeo.app.api/.classpath
org.argeo.app.api/src/org/argeo/app/api/EntityNames.java
org.argeo.app.api/src/org/argeo/app/api/EntityType.java
org.argeo.app.api/src/org/argeo/app/api/EntityTypes.java [deleted file]
org.argeo.app.api/src/org/argeo/app/api/IdRange.java [new file with mode: 0644]
org.argeo.app.api/src/org/argeo/app/api/JcrName.java [deleted file]
org.argeo.app.api/src/org/argeo/app/api/RankedObject.java
org.argeo.app.api/src/org/argeo/app/api/RankingKey.java [deleted file]
org.argeo.app.api/src/org/argeo/app/api/SuiteRole.java
org.argeo.app.api/src/org/argeo/app/api/entity.cnd
org.argeo.app.core/.classpath
org.argeo.app.core/OSGI-INF/geoToolsTest.xml [new file with mode: 0644]
org.argeo.app.core/OSGI-INF/maintenanceService.xml
org.argeo.app.core/OSGI-INF/termsManager.xml
org.argeo.app.core/bnd.bnd
org.argeo.app.core/build.properties
org.argeo.app.core/src/org/argeo/app/core/CustomMaintenanceService.java
org.argeo.app.core/src/org/argeo/app/core/SuiteContentNamespace.java [new file with mode: 0644]
org.argeo.app.core/src/org/argeo/app/core/SuiteMaintenanceService.java
org.argeo.app.core/src/org/argeo/app/core/SuiteUtils.java
org.argeo.app.core/src/org/argeo/app/core/XPathUtils.java
org.argeo.app.core/src/org/argeo/app/core/schemas/XForms-11-Schema.xsd [new file with mode: 0644]
org.argeo.app.core/src/org/argeo/app/core/schemas/XMLSchema.dtd [new file with mode: 0644]
org.argeo.app.core/src/org/argeo/app/core/schemas/XMLSchema.xsd [new file with mode: 0644]
org.argeo.app.core/src/org/argeo/app/core/schemas/datatypes.dtd [new file with mode: 0644]
org.argeo.app.core/src/org/argeo/app/core/schemas/docbook.xsd [new file with mode: 0644]
org.argeo.app.core/src/org/argeo/app/core/schemas/entity.xsd [new file with mode: 0644]
org.argeo.app.core/src/org/argeo/app/core/schemas/fop.xsd [new file with mode: 0644]
org.argeo.app.core/src/org/argeo/app/core/schemas/xCal-2.0-RFC6321.rnc [new file with mode: 0644]
org.argeo.app.core/src/org/argeo/app/core/schemas/xCal-2.0.rnc [new file with mode: 0644]
org.argeo.app.core/src/org/argeo/app/core/schemas/xCal-2.0.xsd [new file with mode: 0644]
org.argeo.app.core/src/org/argeo/app/core/schemas/xCard-4.0-RFC6351.rnc [new file with mode: 0644]
org.argeo.app.core/src/org/argeo/app/core/schemas/xCard-4.0.rnc [new file with mode: 0644]
org.argeo.app.core/src/org/argeo/app/core/schemas/xCard-4.0.xsd [new file with mode: 0644]
org.argeo.app.core/src/org/argeo/app/core/schemas/xlink.xsd [new file with mode: 0644]
org.argeo.app.core/src/org/argeo/app/core/schemas/xml-events-attribs-1.xsd [new file with mode: 0644]
org.argeo.app.core/src/org/argeo/app/core/schemas/xml.xsd [new file with mode: 0644]
org.argeo.app.core/src/org/argeo/app/docbook/DbkAcrUtils.java [new file with mode: 0644]
org.argeo.app.core/src/org/argeo/app/docbook/DbkAttr.java
org.argeo.app.core/src/org/argeo/app/docbook/DbkType.java
org.argeo.app.core/src/org/argeo/app/docbook/DbkUtils.java
org.argeo.app.core/src/org/argeo/app/geo/GeoToolsTest.java [new file with mode: 0644]
org.argeo.app.core/src/org/argeo/app/geo/GeoUtils.java [new file with mode: 0644]
org.argeo.app.core/src/org/argeo/app/geo/GmlAttr.java [new file with mode: 0644]
org.argeo.app.core/src/org/argeo/app/geo/GmlType.java [new file with mode: 0644]
org.argeo.app.core/src/org/argeo/app/geo/GpxUtils.java [new file with mode: 0644]
org.argeo.app.core/src/org/argeo/app/geo/geonames/ImportGeonamesAdmin.java
org.argeo.app.core/src/org/argeo/app/image/ImageProcessor.java
org.argeo.app.core/src/org/argeo/app/library/DocxExtractor.java
org.argeo.app.core/src/org/argeo/app/mail/EmailMigration.java [new file with mode: 0644]
org.argeo.app.core/src/org/argeo/app/mail/EmailUtils.java [new file with mode: 0644]
org.argeo.app.core/src/org/argeo/app/odk/OdkUtils.java
org.argeo.app.core/src/org/argeo/app/odk/OrxListName.java
org.argeo.app.core/src/org/argeo/app/odk/OrxManifestName.java
org.argeo.app.core/src/org/argeo/app/odk/OrxType.java
org.argeo.app.core/src/org/argeo/app/xforms/FormSubmissionListener.java
org.argeo.app.profile.acr.fs/.classpath [new file with mode: 0644]
org.argeo.app.profile.acr.fs/.project [new file with mode: 0644]
org.argeo.app.profile.acr.fs/OSGI-INF/srvContentProvider.xml [new file with mode: 0644]
org.argeo.app.profile.acr.fs/OSGI-INF/sysContentProvider.xml [new file with mode: 0644]
org.argeo.app.profile.acr.fs/bnd.bnd [new file with mode: 0644]
org.argeo.app.profile.acr.fs/build.properties [new file with mode: 0644]
org.argeo.app.profile.acr.fs/src/.gitignore [new file with mode: 0644]
org.argeo.app.profile.acr.jcr/.classpath [new file with mode: 0644]
org.argeo.app.profile.acr.jcr/.project [new file with mode: 0644]
org.argeo.app.profile.acr.jcr/OSGI-INF/srvContentProvider.xml [new file with mode: 0644]
org.argeo.app.profile.acr.jcr/OSGI-INF/sysContentProvider.xml [new file with mode: 0644]
org.argeo.app.profile.acr.jcr/bnd.bnd [new file with mode: 0644]
org.argeo.app.profile.acr.jcr/build.properties [new file with mode: 0644]
org.argeo.app.profile.acr.jcr/src/.gitignore [new file with mode: 0644]
org.argeo.app.servlet.odk/.classpath
org.argeo.app.servlet.odk/OSGI-INF/odkFormListServlet.xml
org.argeo.app.servlet.odk/OSGI-INF/odkFormServlet.xml
org.argeo.app.servlet.odk/OSGI-INF/odkManifestServlet.xml
org.argeo.app.servlet.odk/OSGI-INF/odkSubmissionServlet.xml
org.argeo.app.servlet.odk/bnd.bnd
org.argeo.app.servlet.odk/src/org/argeo/app/servlet/odk/OdkFormListServlet.java
org.argeo.app.servlet.odk/src/org/argeo/app/servlet/odk/OdkManifestServlet.java
org.argeo.app.servlet.odk/src/org/argeo/app/servlet/odk/OdkServletContext.java
org.argeo.app.servlet.odk/src/org/argeo/app/servlet/odk/OdkSubmissionServlet.java
org.argeo.app.servlet.publish/.classpath
org.argeo.app.servlet.publish/bnd.bnd
org.argeo.app.servlet.publish/src/org/argeo/app/servlet/publish/DbkServlet.java
org.argeo.app.servlet.publish/src/org/argeo/app/servlet/publish/FontsServlet.java
org.argeo.app.servlet.publish/src/org/argeo/app/servlet/publish/FopServlet.java [new file with mode: 0644]
org.argeo.app.servlet.publish/src/org/argeo/app/servlet/publish/GeoToSvgServlet.java [new file with mode: 0644]
org.argeo.app.theme.default/.classpath
org.argeo.app.theme.default/OSGI-INF/cmsTheme.xml
org.argeo.app.theme.default/bnd.bnd
org.argeo.app.theme.default/icons/types/.gitignore [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/activity.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/add.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/addressBook.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/ascending.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/calendar.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/close.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/closeAll.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/dashboard.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/delete.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/descending.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/document.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/documents.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/email.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/fav.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/favNot.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/folder.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/group.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/historyAscending.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/historyDescending.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/home.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/inbox.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/license.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/location.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/logout.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/map.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/milestone.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/mobile.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/note.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/openUserMenu.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/organisation.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/organisationContact.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/people.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/person.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/project-01.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/refresh.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/report.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/save.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/saveAll.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/search.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/settings.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/tag.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/task.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/task_1.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/telephone.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/timeLine.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/todo.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/user.svg [new file with mode: 0644]
org.argeo.app.theme.default/icons/types/svg/users.svg [new file with mode: 0644]
org.argeo.app.theme.default/rap/argeo.css [new file with mode: 0644]
org.argeo.app.theme.default/rap/defaults.css [new file with mode: 0644]
org.argeo.app.theme.default/rap/work.css [deleted file]
org.argeo.app.ui.rap/.gitignore [deleted file]
org.argeo.app.ui.rap/.project [deleted file]
org.argeo.app.ui.rap/META-INF/.gitignore [deleted file]
org.argeo.app.ui.rap/OSGI-INF/cmsWebApp.xml [deleted file]
org.argeo.app.ui.rap/bnd.bnd [deleted file]
org.argeo.app.ui.rap/build.properties [deleted file]
org.argeo.app.ui.rap/src/.gitignore [deleted file]
org.argeo.app.ui/.classpath [deleted file]
org.argeo.app.ui/.gitignore [deleted file]
org.argeo.app.ui/.project [deleted file]
org.argeo.app.ui/META-INF/.gitignore [deleted file]
org.argeo.app.ui/OSGI-INF/adminLeadPane.xml [deleted file]
org.argeo.app.ui/OSGI-INF/cmsApp.xml [deleted file]
org.argeo.app.ui/OSGI-INF/contentEntryArea.xml [deleted file]
org.argeo.app.ui/OSGI-INF/contentLayer.xml [deleted file]
org.argeo.app.ui/OSGI-INF/dashboard.xml [deleted file]
org.argeo.app.ui/OSGI-INF/dashboardLayer.xml [deleted file]
org.argeo.app.ui/OSGI-INF/documentUiProvider.xml [deleted file]
org.argeo.app.ui/OSGI-INF/documentsFolder.xml [deleted file]
org.argeo.app.ui/OSGI-INF/eventRecorder.xml [deleted file]
org.argeo.app.ui/OSGI-INF/footer.xml [deleted file]
org.argeo.app.ui/OSGI-INF/fsEntryArea.xml [deleted file]
org.argeo.app.ui/OSGI-INF/header.xml [deleted file]
org.argeo.app.ui/OSGI-INF/l10n/bundle.properties [deleted file]
org.argeo.app.ui/OSGI-INF/l10n/bundle_de.properties [deleted file]
org.argeo.app.ui/OSGI-INF/l10n/bundle_fr.properties [deleted file]
org.argeo.app.ui/OSGI-INF/leadPane.xml [deleted file]
org.argeo.app.ui/OSGI-INF/loginScreen.xml [deleted file]
org.argeo.app.ui/OSGI-INF/mapLayer.xml [deleted file]
org.argeo.app.ui/OSGI-INF/overviewMap.xml [deleted file]
org.argeo.app.ui/OSGI-INF/peopleEntryArea.xml [deleted file]
org.argeo.app.ui/OSGI-INF/peopleLayer.xml [deleted file]
org.argeo.app.ui/OSGI-INF/personUiProvider.xml [deleted file]
org.argeo.app.ui/OSGI-INF/recentItems.xml [deleted file]
org.argeo.app.ui/OSGI-INF/termsEntryArea.xml [deleted file]
org.argeo.app.ui/OSGI-INF/termsLayer.xml [deleted file]
org.argeo.app.ui/OSGI-INF/wwwLayer.xml [deleted file]
org.argeo.app.ui/bnd.bnd [deleted file]
org.argeo.app.ui/build.properties [deleted file]
org.argeo.app.ui/config/adminLeadPane.properties [deleted file]
org.argeo.app.ui/config/cmsApp.properties [deleted file]
org.argeo.app.ui/config/contentEntryArea.properties [deleted file]
org.argeo.app.ui/config/contentLayer.properties [deleted file]
org.argeo.app.ui/config/dashboard.properties [deleted file]
org.argeo.app.ui/config/dashboardLayer.properties [deleted file]
org.argeo.app.ui/config/documentUiProvider.properties [deleted file]
org.argeo.app.ui/config/documentsFolder.properties [deleted file]
org.argeo.app.ui/config/eventRecorder.properties [deleted file]
org.argeo.app.ui/config/footer.properties [deleted file]
org.argeo.app.ui/config/fsEntryArea.properties [deleted file]
org.argeo.app.ui/config/header.properties [deleted file]
org.argeo.app.ui/config/leadPane.properties [deleted file]
org.argeo.app.ui/config/loginScreen.properties [deleted file]
org.argeo.app.ui/config/mapLayer.properties [deleted file]
org.argeo.app.ui/config/overviewMap.properties [deleted file]
org.argeo.app.ui/config/peopleEntryArea.properties [deleted file]
org.argeo.app.ui/config/peopleLayer.properties [deleted file]
org.argeo.app.ui/config/personUiProvider.properties [deleted file]
org.argeo.app.ui/config/recentItems.properties [deleted file]
org.argeo.app.ui/config/termsEntryArea.properties [deleted file]
org.argeo.app.ui/config/termsLayer.properties [deleted file]
org.argeo.app.ui/config/wwwLayer.properties [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/DefaultDashboard.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/DefaultEditionLayer.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/DefaultFooter.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/DefaultHeader.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/DefaultLeadPane.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/DefaultLoginScreen.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/EventRecorder.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/RecentItems.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/SuiteApp.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/SuiteEvent.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/SuiteIcon.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/SuiteLayer.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/SuiteMsg.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/SuiteStyle.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/SuiteUi.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/SuiteUiUtils.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/TermsEntryArea.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/dialogs/NewPersonPage.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/dialogs/NewPersonWizard.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/dialogs/NewUserWizard.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/docbook/AbstractDbkViewer.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/docbook/CustomDbkEditor.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkContextMenu.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkImageManager.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkImg.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkSectionTitle.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkTextInterpreter.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkVideo.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/docbook/DocumentPage.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/docbook/DocumentTextEditor.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/docbook/Paragraph.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/docbook/TextEditorHeader.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/docbook/TextInterpreter.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/docbook/TextSection.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/forms/AbstractTermsPart.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/forms/MultiTermsPart.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/forms/SingleTermPart.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/library/ContentEntryArea.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsContextMenu.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsFileComposite.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsFolderComposite.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsFolderUiProvider.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsTreeUiProvider.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsUiService.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/openlayers/OLMap.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/openlayers/OpenLayersMap.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/openlayers/OverviewMap.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/openlayers/map-osm.html [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/openlayers/map.js [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/people/PeopleEntryArea.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/people/PersonUiProvider.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/people/SuiteUserUiProvider.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/people/SuiteUsersEntryArea.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/publish/DocumentUiProvider.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/publish/PublishingApp.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/publish/PublishingStyle.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/widgets/AbstractConnectContextMenu.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/widgets/ConnectAbstractDropDown.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/widgets/DelayedText.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/widgets/TabbedArea.java [deleted file]
org.argeo.app.ui/src/org/argeo/app/ui/widgets/TreeOrSearchArea.java [deleted file]
sdk/argeo-build
sdk/argeo-suite-rap.properties [deleted file]
sdk/argeo-suite-rcp.properties
sdk/argeo-suite.properties [new file with mode: 0644]
sdk/branches/testing.bnd [new file with mode: 0644]
sdk/branches/unstable.bnd [new file with mode: 0644]
sdk/deploy/.gitignore [new file with mode: 0644]
sdk/deploy/argeo-desktop/etc/argeo.user.d/desktop/config.ini [new file with mode: 0644]
sdk/deploy/argeo-desktop/etc/argeo.user.d/desktop/jvm.args [new file with mode: 0644]
sdk/deploy/argeo-desktop/etc/argeo.user.d/desktop/system.properties [new file with mode: 0644]
sdk/deploy/argeo-desktop/usr/share/applications/argeo.desktop [new file with mode: 0644]
sdk/deploy/argeo-server/etc/argeo.d/server/config.ini [new file with mode: 0644]
sdk/deploy/argeo-server/etc/argeo.d/server/jvm.args [new file with mode: 0644]
sdk/deploy/argeo-server/etc/argeo.d/server/system.properties [new file with mode: 0644]
sdk/init/node/dc=example,dc=com.ldif [deleted file]
sdk/init/node/ou=roles,ou=node.ldif [deleted file]
sdk/init/private/dc=example,dc=com.ldif [new file with mode: 0644]
sdk/init/private/ou=roles,ou=node.ldif [new file with mode: 0644]
sdk/output-cms-rap.target
sdk/output-cms-rcp.target
sdk/output-suite-rcp.target [new file with mode: 0644]
swt/org.argeo.app.swt/.classpath [new file with mode: 0644]
swt/org.argeo.app.swt/.project [new file with mode: 0644]
swt/org.argeo.app.swt/bnd.bnd [new file with mode: 0644]
swt/org.argeo.app.swt/build.properties [new file with mode: 0644]
swt/org.argeo.app.swt/src/org/argeo/app/swt/docbook/DbkImageManager.java [new file with mode: 0644]
swt/org.argeo.app.swt/src/org/argeo/app/swt/docbook/DbkImg.java [new file with mode: 0644]
swt/org.argeo.app.swt/src/org/argeo/app/swt/docbook/DbkSectionTitle.java [new file with mode: 0644]
swt/org.argeo.app.swt/src/org/argeo/app/swt/docbook/DbkTextInterpreter.java [new file with mode: 0644]
swt/org.argeo.app.swt/src/org/argeo/app/swt/docbook/DbkVideo.java [new file with mode: 0644]
swt/org.argeo.app.swt/src/org/argeo/app/swt/docbook/DocBookViewer.java [new file with mode: 0644]
swt/org.argeo.app.swt/src/org/argeo/app/swt/docbook/Paragraph.java [new file with mode: 0644]
swt/org.argeo.app.swt/src/org/argeo/app/swt/docbook/TextInterpreter.java [new file with mode: 0644]
swt/org.argeo.app.swt/src/org/argeo/app/swt/docbook/TextSection.java [new file with mode: 0644]
swt/org.argeo.app.ui/.classpath [new file with mode: 0644]
swt/org.argeo.app.ui/.gitignore [new file with mode: 0644]
swt/org.argeo.app.ui/.project [new file with mode: 0644]
swt/org.argeo.app.ui/META-INF/.gitignore [new file with mode: 0644]
swt/org.argeo.app.ui/OSGI-INF/adminLeadPane.xml [new file with mode: 0644]
swt/org.argeo.app.ui/OSGI-INF/cmsApp.xml [new file with mode: 0644]
swt/org.argeo.app.ui/OSGI-INF/contentEntryArea.xml [new file with mode: 0644]
swt/org.argeo.app.ui/OSGI-INF/contentLayer.xml [new file with mode: 0644]
swt/org.argeo.app.ui/OSGI-INF/dashboard.xml [new file with mode: 0644]
swt/org.argeo.app.ui/OSGI-INF/dashboardLayer.xml [new file with mode: 0644]
swt/org.argeo.app.ui/OSGI-INF/documentUiProvider.xml [new file with mode: 0644]
swt/org.argeo.app.ui/OSGI-INF/documentsFolder.xml [new file with mode: 0644]
swt/org.argeo.app.ui/OSGI-INF/eventRecorder.xml [new file with mode: 0644]
swt/org.argeo.app.ui/OSGI-INF/footer.xml [new file with mode: 0644]
swt/org.argeo.app.ui/OSGI-INF/fsEntryArea.xml [new file with mode: 0644]
swt/org.argeo.app.ui/OSGI-INF/groupUiProvider.xml [new file with mode: 0644]
swt/org.argeo.app.ui/OSGI-INF/header.xml [new file with mode: 0644]
swt/org.argeo.app.ui/OSGI-INF/hierarchyUnitUiProvider.xml [new file with mode: 0644]
swt/org.argeo.app.ui/OSGI-INF/l10n/bundle.properties [new file with mode: 0644]
swt/org.argeo.app.ui/OSGI-INF/l10n/bundle_de.properties [new file with mode: 0644]
swt/org.argeo.app.ui/OSGI-INF/l10n/bundle_fr.properties [new file with mode: 0644]
swt/org.argeo.app.ui/OSGI-INF/leadPane.xml [new file with mode: 0644]
swt/org.argeo.app.ui/OSGI-INF/loginScreen.xml [new file with mode: 0644]
swt/org.argeo.app.ui/OSGI-INF/mapLayer.xml [new file with mode: 0644]
swt/org.argeo.app.ui/OSGI-INF/overviewMap.xml [new file with mode: 0644]
swt/org.argeo.app.ui/OSGI-INF/peopleEntryArea.xml [new file with mode: 0644]
swt/org.argeo.app.ui/OSGI-INF/peopleLayer.xml [new file with mode: 0644]
swt/org.argeo.app.ui/OSGI-INF/personUiProvider.xml [new file with mode: 0644]
swt/org.argeo.app.ui/OSGI-INF/publishEntryArea.xml [new file with mode: 0644]
swt/org.argeo.app.ui/OSGI-INF/publishUiProvider.xml [new file with mode: 0644]
swt/org.argeo.app.ui/OSGI-INF/recentItems.xml [new file with mode: 0644]
swt/org.argeo.app.ui/OSGI-INF/termsEntryArea.xml [new file with mode: 0644]
swt/org.argeo.app.ui/OSGI-INF/termsLayer.xml [new file with mode: 0644]
swt/org.argeo.app.ui/OSGI-INF/wwwLayer.xml [new file with mode: 0644]
swt/org.argeo.app.ui/bnd.bnd [new file with mode: 0644]
swt/org.argeo.app.ui/build.properties [new file with mode: 0644]
swt/org.argeo.app.ui/config/adminLeadPane.properties [new file with mode: 0644]
swt/org.argeo.app.ui/config/cmsApp.properties [new file with mode: 0644]
swt/org.argeo.app.ui/config/contentEntryArea.properties [new file with mode: 0644]
swt/org.argeo.app.ui/config/contentLayer.properties [new file with mode: 0644]
swt/org.argeo.app.ui/config/dashboard.properties [new file with mode: 0644]
swt/org.argeo.app.ui/config/dashboardLayer.properties [new file with mode: 0644]
swt/org.argeo.app.ui/config/documentUiProvider.properties [new file with mode: 0644]
swt/org.argeo.app.ui/config/documentsFolder.properties [new file with mode: 0644]
swt/org.argeo.app.ui/config/eventRecorder.properties [new file with mode: 0644]
swt/org.argeo.app.ui/config/footer.properties [new file with mode: 0644]
swt/org.argeo.app.ui/config/fsEntryArea.properties [new file with mode: 0644]
swt/org.argeo.app.ui/config/groupUiProvider.properties [new file with mode: 0644]
swt/org.argeo.app.ui/config/header.properties [new file with mode: 0644]
swt/org.argeo.app.ui/config/hierarchyUnitUiProvider.properties [new file with mode: 0644]
swt/org.argeo.app.ui/config/leadPane.properties [new file with mode: 0644]
swt/org.argeo.app.ui/config/loginScreen.properties [new file with mode: 0644]
swt/org.argeo.app.ui/config/mapLayer.properties [new file with mode: 0644]
swt/org.argeo.app.ui/config/overviewMap.properties [new file with mode: 0644]
swt/org.argeo.app.ui/config/peopleEntryArea.properties [new file with mode: 0644]
swt/org.argeo.app.ui/config/peopleLayer.properties [new file with mode: 0644]
swt/org.argeo.app.ui/config/personUiProvider.properties [new file with mode: 0644]
swt/org.argeo.app.ui/config/publishEntryArea.properties [new file with mode: 0644]
swt/org.argeo.app.ui/config/publishUiProvider.properties [new file with mode: 0644]
swt/org.argeo.app.ui/config/recentItems.properties [new file with mode: 0644]
swt/org.argeo.app.ui/config/termsEntryArea.properties [new file with mode: 0644]
swt/org.argeo.app.ui/config/termsLayer.properties [new file with mode: 0644]
swt/org.argeo.app.ui/config/wwwLayer.properties [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/DefaultDashboard.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/DefaultEditionLayer.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/DefaultFooter.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/DefaultHeader.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/DefaultLeadPane.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/DefaultLoginScreen.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/EventRecorder.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/RecentItems.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteApp.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteIcon.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteLayer.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteMsg.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteStyle.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteUi.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteUiUtils.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteUxEvent.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/TermsEntryArea.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/dialogs/NewPersonPage.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/dialogs/NewPersonWizard.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/AbstractDbkViewer.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/CustomDbkEditor.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkContextMenu.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkImageManager.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkImg.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkSectionTitle.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkTextInterpreter.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkVideo.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DocumentPage.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DocumentTextEditor.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/Paragraph.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/TextEditorHeader.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/TextInterpreter.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/TextSection.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/forms/AbstractTermsPart.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/forms/MultiTermsPart.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/forms/SingleTermPart.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/library/ContentEntryArea.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsContextMenu.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsFileComposite.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsFolderComposite.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsFolderUiProvider.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsTreeUiProvider.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsUiService.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/library/JcrContentEntryArea.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/openlayers/OLMap.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/openlayers/OpenLayersMap.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/openlayers/OverviewMap.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/openlayers/map-osm.html [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/openlayers/map.js [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/people/ChooseUserDialog.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/people/GroupUiProvider.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/people/HierarchyUnitPart.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/people/HierarchyUnitUiProvider.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/people/NewOrgForm.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/people/NewUserForm.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/people/PeopleEntryArea.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/people/PersonUiProvider.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/people/UserColumn.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/people/UsersPart.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/people/vcard/VCardExporter.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/publish/DocumentUiProvider.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/publish/PdfViewer.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/publish/PublishEntryArea.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/publish/PublishUiProvider.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/publish/PublishingApp.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/publish/PublishingStyle.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/widgets/AbstractConnectContextMenu.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/widgets/ConnectAbstractDropDown.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/widgets/DelayedText.java [new file with mode: 0644]
swt/org.argeo.app.ui/src/org/argeo/app/ui/widgets/TreeOrSearchArea.java [new file with mode: 0644]

index ff418936f2de03c4250f3d5a808862b33bc3faf5..4106bf47e4b1a1afb0ce94cd9d171d7a07467204 100644 (file)
--- a/.project
+++ b/.project
@@ -5,6 +5,11 @@
        <projects>
        </projects>
        <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.pde.ds.core.builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
        </buildSpec>
        <natures>
        </natures>
index c1803c93b347559a47cf03c55429098335fc8ee1..1a573a58ace6828bd7b23a408d53f2b48103ebed 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -10,24 +10,30 @@ org.argeo.app.api \
 org.argeo.app.core \
 org.argeo.app.servlet.odk \
 org.argeo.app.servlet.publish \
-org.argeo.app.ui \
 org.argeo.app.theme.default \
-org.argeo.app.ui.rap \
+org.argeo.app.profile.acr.fs \
+org.argeo.app.profile.acr.jcr \
+swt/org.argeo.app.swt \
+swt/org.argeo.app.ui \
 
 A2_OUTPUT = $(SDK_BUILD_BASE)/a2
 A2_BASE = $(A2_OUTPUT)
 
 DEP_CATEGORIES = \
 org.argeo.tp \
-org.argeo.tp.apache \
 org.argeo.tp.jetty \
-org.argeo.tp.eclipse.equinox \
-org.argeo.tp.eclipse.rap \
 org.argeo.tp.jcr \
-org.argeo.tp.formats \
+org.argeo.tp.utils \
 org.argeo.tp.gis \
+osgi/api/org.argeo.tp.osgi \
+osgi/equinox/org.argeo.tp.eclipse \
+swt/rap/org.argeo.tp.swt \
+swt/rap/org.argeo.tp.swt.workbench \
 org.argeo.cms \
-org.argeo.cms.eclipse.rap \
+org.argeo.cms.jcr \
+swt/org.argeo.cms \
+swt/org.argeo.cms.jcr \
+swt/rap/org.argeo.cms \
 
 clean:
        rm -rf $(BUILD_BASE)
index 936a67569f072bfad1eeb935aca211a0e0530e86..dbecaaa4bb30c9a334af654716d6bb4acc1dfbf0 100644 (file)
--- a/branch.mk
+++ b/branch.mk
@@ -1 +1 @@
-include $(SDK_SRC_BASE)/cnf/testing.bnd
+BRANCH=testing
\ No newline at end of file
diff --git a/cnf/build.bnd b/cnf/build.bnd
deleted file mode 100644 (file)
index a464edc..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
--include: \
-${workspace}/cnf/testing.bnd, \
-${workspace}/sdk/argeo-build/argeo.bnd, \
diff --git a/cnf/testing.bnd b/cnf/testing.bnd
deleted file mode 100644 (file)
index cae4d91..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-MAJOR=2
-MINOR=1
-MICRO=25
-qualifier=.next
-
-category=org.argeo.suite
-Bundle-RequiredExecutionEnvironment=JavaSE-11
-
-argeo.rpm.stagingRepository=/srv/rpmfactory/testing/argeo-osgi-2/argeo
-argeo.rpm.suffix=
diff --git a/cnf/unstable.bnd b/cnf/unstable.bnd
deleted file mode 100644 (file)
index 1f15381..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-MAJOR=2
-MINOR=3
-MICRO=5
-qualifier=.next
-
-category=org.argeo.suite
-Bundle-RequiredExecutionEnvironment=JavaSE-11
-
-argeo.rpm.stagingRepository=/srv/rpmfactory/unstable/argeo-osgi-2/argeo
-argeo.rpm.suffix=-unstable
old mode 100644 (file)
new mode 100755 (executable)
index 9b3e980..9f49215
--- a/configure
+++ b/configure
@@ -1,55 +1,7 @@
 #!/bin/sh
 
-# We build where we are
-SDK_BUILD_BASE=$(pwd -P)/output
-
 # Source are located where this script is
 SDK_SRC_BASE="$(cd "$(dirname "$0")"; pwd -P)"
 
-SDK_MK=$SDK_SRC_BASE/sdk.mk
-
-#echo SDK_BUILD_BASE=$SDK_BUILD_BASE
-#echo SDK_SRC_BASE=$SDK_SRC_BASE
-#echo SDK_MK=$SDK_MK
-
-if [ -f "$SDK_MK" ]; 
-then
-
-echo "File $SDK_MK already exists. Remove it in order to configure a new build location:"
-echo "rm $SDK_MK"
-exit 1
-
-else
-
-if [ -z "$JAVA_HOME" ]
-then
-echo "Environment variable JAVA_HOME must be set"
-exit 1
-fi
-
-# Create build directory, so that it can be used right away
-# and we check whether we have the rights
-mkdir -p $SDK_BUILD_BASE
-if [ -f "$SDK_MK" ];
-then
-echo "Cannot create $SDK_BUILD_BASE, SDK configuration has failed."
-exit 2
-fi
-
-# Generate sdk.mk
-cat > "$SDK_MK" <<EOF
-SDK_SRC_BASE := $SDK_SRC_BASE
-SDK_BUILD_BASE := $SDK_BUILD_BASE
-JAVA_HOME := $JAVA_HOME
-
-include \$(SDK_SRC_BASE)/branch.mk
-EOF
-
-
-echo SDK was configured.
-echo "JAVA_HOME        : $JAVA_HOME"
-echo "Base for sources : $SDK_SRC_BASE"
-echo "Base for builds  : $SDK_BUILD_BASE"
-exit 0
-fi
-
+# Source the configure script
+. $SDK_SRC_BASE/sdk/argeo-build/configure
\ No newline at end of file
index e801ebfb4680123285c15553dc70584276fe0057..81fe078c20c05db46a8281fbb1a72875a5322b45 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
        <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
        <classpathentry kind="src" path="src"/>
        <classpathentry kind="output" path="bin"/>
index 77760568f982667f9734f1e9da49367963497586..b60a436d28b4f333affa6015140ffaccc0e9c7de 100644 (file)
@@ -1,6 +1,6 @@
 package org.argeo.app.api;
 
-import org.argeo.util.naming.LdapAttrs;
+import org.argeo.api.acr.ldap.LdapAttr;
 
 /** Constants used to name entity structures. */
 public interface EntityNames {
@@ -35,16 +35,16 @@ public interface EntityNames {
 
        // LDAP-LIKE ENTITIES
        @Deprecated
-       final String DISPLAY_NAME = LdapAttrs.displayName.property();
+       final String DISPLAY_NAME = LdapAttr.displayName.property();
        // Persons
        @Deprecated
-       final String GIVEN_NAME = LdapAttrs.givenName.property();
+       final String GIVEN_NAME = LdapAttr.givenName.property();
        @Deprecated
-       final String SURNAME = LdapAttrs.sn.property();
+       final String SURNAME = LdapAttr.sn.property();
        @Deprecated
-       final String EMAIL = LdapAttrs.mail.property();
+       final String EMAIL = LdapAttr.mail.property();
        @Deprecated
-       final String OU = LdapAttrs.ou.property();
+       final String OU = LdapAttr.ou.property();
 
        // WGS84
        final String GEO_LAT = "geo:lat";
index 48b1266b00edfc3e7f118c8a072e4d1d9ce0bc88..8b9164a77d86aca468b0417d5712e0a6f4babd48 100644 (file)
@@ -1,7 +1,9 @@
 package org.argeo.app.api;
 
+import org.argeo.api.acr.QNamed;
+
 /** Types related to entities. */
-public enum EntityType implements JcrName {
+public enum EntityType implements QNamed {
        // entity
        entity, local, relatedTo,
        // structure
@@ -18,25 +20,30 @@ public enum EntityType implements JcrName {
        person, user;
 
        @Override
-       public String getPrefix() {
-               return prefix();
-       }
-
-       public static String prefix() {
+       public String getDefaultPrefix() {
                return "entity";
        }
 
+//     @Override
+//     public String getPrefix() {
+//             return getDefaultPrefix();
+//     }
+//
+//     public static String prefix() {
+//             return "entity";
+//     }
+
        public String basePath() {
                return '/' + name();
        }
 
        @Override
        public String getNamespace() {
-               return namespace();
-       }
-
-       public static String namespace() {
                return "http://www.argeo.org/ns/entity";
        }
 
+//     public static String namespace() {
+//             return "http://www.argeo.org/ns/entity";
+//     }
+
 }
diff --git a/org.argeo.app.api/src/org/argeo/app/api/EntityTypes.java b/org.argeo.app.api/src/org/argeo/app/api/EntityTypes.java
deleted file mode 100644 (file)
index f320794..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.argeo.app.api;
-
-/** Types related to entities. */
-@Deprecated
-public interface EntityTypes {
-       final static String ENTITY_ENTITY = "entity:entity";
-       final static String ENTITY_DEFINITION = "entity:definition";
-
-       final static String ENTITY_PERSON = "entity:person";
-}
diff --git a/org.argeo.app.api/src/org/argeo/app/api/IdRange.java b/org.argeo.app.api/src/org/argeo/app/api/IdRange.java
new file mode 100644 (file)
index 0000000..e47eb5e
--- /dev/null
@@ -0,0 +1,133 @@
+package org.argeo.app.api;
+
+import java.util.HashSet;
+import java.util.Set;
+import java.util.concurrent.ThreadLocalRandom;
+
+/** A range of numerical IDs (typically numerical uid or gid). */
+public class IdRange {
+       // see https://systemd.io/UIDS-GIDS/#special-distribution-uid-ranges
+       final static long MIN_INCLUDED = Long.parseUnsignedLong("66000");
+       final static long MAX_EXCLUDED = Long.parseUnsignedLong("4294967294");
+
+       // We use long as a de facto unsigned int
+       
+       /** included */
+       private final long min;
+       /** included */
+       private final long max;
+
+       public IdRange(long min, long max) {
+               this.min = min;
+               this.max = max;
+       }
+
+       public IdRange(long minPow10) {
+               this(minPow10, maxFromMinPow10(minPow10));
+       }
+
+       public long getMin() {
+               return min;
+       }
+
+       public long getMax() {
+               return max;
+       }
+
+       @Override
+       public int hashCode() {
+               return (int) min;
+       }
+
+       @Override
+       public boolean equals(Object obj) {
+               if (obj instanceof IdRange idRange) {
+                       return min == idRange.min && max == idRange.max;
+               } else
+                       return false;
+       }
+
+       @Override
+       public String toString() {
+               return "[" + Long.toUnsignedString(min) + "," + Long.toUnsignedString(max) + "]";
+       }
+
+       /*
+        * RANGE GENERATION
+        */
+       public static synchronized Set<IdRange> randomRanges10000(int count, Set<IdRange> forbiddenRanges) {
+               Set<IdRange> res = new HashSet<>();
+
+               for (int i = 0; i < count; i++) {
+                       IdRange newRange = null;
+                       do {
+                               newRange = randomRange10000();
+                       } while (overlap(newRange, res) || overlap(newRange, forbiddenRanges));
+                       res.add(newRange);
+               }
+               return res;
+       }
+
+       public static synchronized IdRange randomRange10000() {
+               // TODO make it more generic
+               long minPred = 7l;
+               long maxPred = 429496l;
+
+               long rand = ThreadLocalRandom.current().nextLong(minPred, maxPred);
+               long min = rand * 10000l;
+               return new IdRange(min);
+       }
+
+       public static boolean overlap(IdRange idRange, Set<IdRange> idRanges) {
+               for (IdRange other : idRanges) {
+                       if (overlap(idRange, other))
+                               return true;
+               }
+               return false;
+       }
+
+       public static boolean overlap(IdRange idRange, IdRange other) {
+               // see
+               // https://stackoverflow.com/questions/3269434/whats-the-most-efficient-way-to-test-if-two-ranges-overlap
+               return idRange.min <= other.max && other.min <= idRange.max;
+       }
+
+       /*
+        * UTILITIES
+        */
+
+       private static long maxFromMinPow10(long minPow10) {
+               if ((minPow10 % 100) != 0) {
+                       throw new IllegalArgumentException(minPow10 + " must at least ends with two zeroes");
+               }
+               int exp = 2;
+               exp: for (int i = exp + 1; i < 10; i++) {
+                       if ((minPow10 % pow10(i)) != 0)
+                               break exp;
+                       exp++;
+               }
+//             System.out.println(exp);
+
+               long max = minPow10 + pow10(exp) - 1;
+               return max;
+       }
+
+       /** Power of 10. */
+       private static long pow10(int exp) {
+               if (exp == 0)
+                       return 1;
+               else
+                       return 10 * pow10(exp - 1);
+       }
+
+       public static void main(String... args) {
+               System.out.println(maxFromMinPow10(100));
+               System.out.println(maxFromMinPow10(78500));
+               System.out.println(maxFromMinPow10(716850000));
+
+//             System.out.println(pow10(6));
+//             System.out.println(maxFromMinPow10(12));
+//             System.out.println(maxFromMinPow10(124));
+//             System.out.println(maxFromMinPow10(99814565));
+       }
+}
diff --git a/org.argeo.app.api/src/org/argeo/app/api/JcrName.java b/org.argeo.app.api/src/org/argeo/app/api/JcrName.java
deleted file mode 100644 (file)
index 182494a..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-package org.argeo.app.api;
-
-import java.util.function.Supplier;
-
-/** Can be applied to {@link Enum}s in order to generate prefixed names. */
-@FunctionalInterface
-public interface JcrName extends Supplier<String> {
-       String name();
-
-       default String getPrefix() {
-               return null;
-       }
-
-       default String getNamespace() {
-               return null;
-       }
-
-       @Override
-       default String get() {
-               String prefix = getPrefix();
-               return prefix != null ? prefix + ":" + name() : name();
-       }
-
-       default String withNamespace() {
-               String namespace = getNamespace();
-               if (namespace == null)
-                       throw new UnsupportedOperationException("No namespace is specified for " + getClass());
-               return "{" + namespace + "}" + name();
-       }
-}
index 31c43a781770a62b059fccf8be21c976201854a5..fab42d7ea6401ad878eec8ee255ed7eae37b8d72 100644 (file)
@@ -16,28 +16,28 @@ public class RankedObject<T> {
 
        private T object;
        private Map<String, Object> properties;
-       private final Long rank;
+       private final int rank;
 
        public RankedObject(T object, Map<String, Object> properties) {
                this(object, properties, extractRanking(properties));
        }
 
-       public RankedObject(T object, Map<String, Object> properties, Long rank) {
+       public RankedObject(T object, Map<String, Object> properties, int rank) {
                super();
                this.object = object;
                this.properties = properties;
                this.rank = rank;
        }
 
-       private static Long extractRanking(Map<String, Object> properties) {
+       private static int extractRanking(Map<String, Object> properties) {
                if (properties == null)
-                       return 0l;
+                       return 0;
                if (properties.containsKey(SERVICE_RANKING))
-                       return Long.valueOf(properties.get(SERVICE_RANKING).toString());
+                       return (Integer) properties.get(SERVICE_RANKING);
 //             else if (properties.containsKey(SERVICE_ID))
 //                     return (Long) properties.get(SERVICE_ID);
                else
-                       return 0l;
+                       return 0;
        }
 
        public T get() {
@@ -48,7 +48,7 @@ public class RankedObject<T> {
                return properties;
        }
 
-       public Long getRank() {
+       public int getRank() {
                return rank;
        }
 
@@ -62,7 +62,7 @@ public class RankedObject<T> {
                if (!(obj instanceof RankedObject))
                        return false;
                RankedObject<?> other = (RankedObject<?>) obj;
-               return rank.equals(other.rank) && object.equals(other.object);
+               return rank == other.rank && object.equals(other.object);
        }
 
        @Override
@@ -70,6 +70,18 @@ public class RankedObject<T> {
                return object.getClass().getName() + " with rank " + rank;
        }
 
+       public static <K, T> boolean hasHigherRank(Map<K, RankedObject<T>> map, K key, Map<String, Object> properties) {
+               if (!map.containsKey(key))
+                       return true;
+               RankedObject<T> rankedObject = new RankedObject<>(null, properties);
+               RankedObject<T> current = map.get(key);
+               return current.getRank() < rankedObject.getRank();
+       }
+
+       /**
+        * @return the {@link RankedObject}, or <code>null</code> if the current one was
+        *         kept
+        */
        public static <K, T> RankedObject<T> putIfHigherRank(Map<K, RankedObject<T>> map, K key, T object,
                        Map<String, Object> properties) {
                RankedObject<T> rankedObject = new RankedObject<>(object, properties);
@@ -81,14 +93,18 @@ public class RankedObject<T> {
                        return rankedObject;
                } else {
                        RankedObject<T> current = map.get(key);
-                       if (current.getRank() <= rankedObject.getRank()) {
+                       if (current.getRank() < rankedObject.getRank()) {
                                map.put(key, rankedObject);
-                               if (log.isTraceEnabled())
-                                       log.trace("Replaced " + key + " by " + object.getClass().getName() + " with rank "
+                               if (log.isDebugEnabled())
+                                       log.debug("Replaced " + key + " by " + object.getClass().getName() + " with rank "
                                                        + rankedObject.getRank());
                                return rankedObject;
+                       } else if (current.getRank() == rankedObject.getRank()) {
+                               log.error("Already " + key + " by " + current.get().getClass().getName() + " with rank "
+                                               + rankedObject.getRank() + ", ignoring " + rankedObject.get().getClass().getName());
+                               return null;
                        } else {
-                               return current;
+                               return null;
                        }
                }
 
diff --git a/org.argeo.app.api/src/org/argeo/app/api/RankingKey.java b/org.argeo.app.api/src/org/argeo/app/api/RankingKey.java
deleted file mode 100644 (file)
index 691570c..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-package org.argeo.app.api;
-
-import java.util.Map;
-
-/**
- * Key used to classify and filter available components (typically provided by
- * OSGi services).
- */
-@Deprecated
-public class RankingKey implements Comparable<RankingKey> {
-       public final static String SERVICE_PID = "service.pid";
-       public final static String SERVICE_ID = "service.id";
-       public final static String SERVICE_RANKING = "service.ranking";
-       public final static String DATA_TYPE = "data.type";
-
-       private String pid;
-       private Integer ranking = 0;
-       private Long id = 0l;
-       private String dataType;
-       private String dataPath;
-
-       public RankingKey(String pid, Integer ranking, Long id, String dataType, String dataPath) {
-               super();
-               this.pid = pid;
-               this.ranking = ranking;
-               this.id = id;
-               this.dataType = dataType;
-               this.dataPath = dataPath;
-       }
-
-       public RankingKey(Map<String, Object> properties) {
-               this.pid = properties.containsKey(SERVICE_PID) ? properties.get(SERVICE_PID).toString() : null;
-               this.ranking = properties.containsKey(SERVICE_RANKING)
-                               ? Integer.parseInt(properties.get(SERVICE_RANKING).toString())
-                               : 0;
-               this.id = properties.containsKey(SERVICE_ID) ? (Long) properties.get(SERVICE_ID) : null;
-
-               // Argeo specific
-               this.dataType = properties.containsKey(DATA_TYPE) ? properties.get(DATA_TYPE).toString() : null;
-       }
-
-       @Override
-       public int hashCode() {
-               Integer result = 0;
-               if (pid != null)
-                       result = +pid.hashCode();
-               if (ranking != null)
-                       result = +ranking;
-               if (dataType != null)
-                       result = +dataType.hashCode();
-               return result;
-       }
-
-       @Override
-       protected Object clone() throws CloneNotSupportedException {
-               return new RankingKey(pid, ranking, id, dataType, dataPath);
-       }
-
-       @Override
-       public String toString() {
-               StringBuilder sb = new StringBuilder("");
-               if (pid != null)
-                       sb.append(pid);
-               if (ranking != null && ranking != 0)
-                       sb.append(' ').append(ranking);
-               if (dataType != null)
-                       sb.append(' ').append(dataType);
-               return sb.toString();
-       }
-
-       @Override
-       public boolean equals(Object obj) {
-               if (!(obj instanceof RankingKey))
-                       return false;
-               RankingKey other = (RankingKey) obj;
-               return equalsOrBothNull(pid, other.pid) && equalsOrBothNull(ranking, other.ranking)
-                               && equalsOrBothNull(id, other.id) && equalsOrBothNull(dataType, other.dataType)
-                               && equalsOrBothNull(dataPath, other.dataPath);
-       }
-
-       @Override
-       public int compareTo(RankingKey o) {
-               if (pid != null && o.pid != null) {
-                       if (pid.equals(o.pid)) {
-                               if (ranking.equals(o.ranking))
-                                       if (id != null && o.id != null)
-                                               return id.compareTo(o.id);
-                                       else
-                                               return 0;
-                               else
-                                       return ranking.compareTo(o.ranking);
-                       } else {
-                               return pid.compareTo(o.pid);
-                       }
-
-               } else {
-                       if (dataType != null && o.dataType != null) {
-                               if (dataType.equals(o.dataType)) {
-                                       // TODO factorise
-                                       if (ranking.equals(o.ranking))
-                                               if (id != null && o.id != null)
-                                                       return id.compareTo(o.id);
-                                               else
-                                                       return 0;
-                                       else
-                                               return ranking.compareTo(o.ranking);
-                               } else {
-                                       return dataPath.compareTo(o.dataType);
-                               }
-                       }
-               }
-               return -1;
-       }
-
-       public String getPid() {
-               return pid;
-       }
-
-       public Integer getRanking() {
-               return ranking;
-       }
-
-       public Long getId() {
-               return id;
-       }
-
-       public String getDataType() {
-               return dataType;
-       }
-
-       public String getDataPath() {
-               return dataPath;
-       }
-
-       public static RankingKey minPid(String pid) {
-               return new RankingKey(pid, Integer.MIN_VALUE, null, null, null);
-       }
-
-       public static RankingKey maxPid(String pid) {
-               return new RankingKey(pid, Integer.MAX_VALUE, null, null, null);
-       }
-
-       public static RankingKey minDataType(String dataType) {
-               return new RankingKey(null, Integer.MIN_VALUE, null, dataType, null);
-       }
-
-       public static RankingKey maxDataType(String dataType) {
-               return new RankingKey(null, Integer.MAX_VALUE, null, dataType, null);
-       }
-
-       private static boolean equalsOrBothNull(Object o1, Object o2) {
-               if (o1 == null && o2 == null)
-                       return true;
-               if (o1 == null && o2 != null)
-                       return false;
-               if (o1 != null && o2 == null)
-                       return false;
-               return o2.equals(o1);
-       }
-}
index 38ce11fdd573ba3c7259bf804069b1f7d5ebda87..5a2fc6b43cf983c8edc349c3665365a89038649b 100644 (file)
@@ -1,19 +1,47 @@
 package org.argeo.app.api;
 
+import javax.xml.namespace.QName;
+
+import org.argeo.api.acr.ArgeoNamespace;
+import org.argeo.api.acr.ContentName;
+import org.argeo.api.acr.ldap.LdapAttr;
 import org.argeo.api.cms.CmsConstants;
-import org.argeo.util.naming.Distinguished;
-import org.argeo.util.naming.LdapAttrs;
+import org.argeo.cms.SystemRole;
+
+/** Standard suite system roles. */
+public enum SuiteRole implements SystemRole {
+       /** An external person who has read access to part of the information. */
+       observer,
+       /** An active coworker. */
+       coworker,
+       /** Someone who is allowed validate and publish information. */
+       publisher,
+       /** Someone with manager status within an organisation. Does not necessarily give more rights. */
+       manager,
+       //
+       ;
+
+       private final static String QUALIFIER = "app.";
+
+       private final ContentName name;
 
-/** Office specific roles used in the code */
-public enum SuiteRole implements Distinguished {
-       coworker, manager;
+       SuiteRole() {
+               name = new ContentName(ArgeoNamespace.ROLE_NAMESPACE_URI, QUALIFIER + name());
+       }
+
+       @Override
+       public QName qName() {
+               return name;
+       }
 
-       public String getRolePrefix() {
+       @Deprecated
+       private String getRolePrefix() {
                return "org.argeo.suite";
        }
 
+       @Deprecated
        public String dn() {
-               return new StringBuilder(LdapAttrs.cn.name()).append("=").append(getRolePrefix()).append(".").append(name())
-                               .append(",").append(CmsConstants.ROLES_BASEDN).toString();
+               return new StringBuilder(LdapAttr.cn.name()).append("=").append(getRolePrefix()).append(".").append(name())
+                               .append(",").append(CmsConstants.SYSTEM_ROLES_BASEDN).toString();
        }
 }
index 2ea89f9b533d177d08217797184745ef1809b27e..396b6f203187a4b2f0220b915323b6d5de47707f 100644 (file)
@@ -4,6 +4,7 @@
 // see https://www.w3.org/2003/01/geo/
 <geo = "http://www.w3.org/2003/01/geo/wgs84_pos#">
 <svg = "http://www.w3.org/2000/svg">
+<gml = "http://www.opengis.net/gml/3.2">
 
 <ldap = "http://www.argeo.org/ns/ldap">
 <entity = 'http://www.argeo.org/ns/entity'>
@@ -95,7 +96,9 @@ mixin
 mixin
 - ldap:sn (String)
 - ldap:givenName (String)
+- ldap:cn (String)
 - ldap:mail (String) *
+- ldap:description (String)
 
 [entity:user] > entity:person
 mixin
index e801ebfb4680123285c15553dc70584276fe0057..81fe078c20c05db46a8281fbb1a72875a5322b45 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
        <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
        <classpathentry kind="src" path="src"/>
        <classpathentry kind="output" path="bin"/>
diff --git a/org.argeo.app.core/OSGI-INF/geoToolsTest.xml b/org.argeo.app.core/OSGI-INF/geoToolsTest.xml
new file mode 100644 (file)
index 0000000..68a53ab
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init" deactivate="destroy" name="GeoTools Test">
+   <implementation class="org.djapps.on.apaf.GeoToolsTest"/>
+</scr:component>
index b88d68c967040bd5f825b8a525f10e81504662c7..965d82bdff4cbd904ff6176023e891bdd01a386e 100644 (file)
@@ -1,7 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init" deactivate="destroy" name="Suite Maintenance Service">
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init" deactivate="destroy" immediate="true"  name="Suite Maintenance Service">
    <implementation class="org.argeo.app.core.SuiteMaintenanceService"/>
-   <reference bind="setRepository" cardinality="1..1" interface="javax.jcr.Repository" name="Repository" policy="static" target="(cn=entity)"/>
-   <reference bind="setUserTransaction" cardinality="1..1" interface="org.argeo.osgi.transaction.WorkTransaction" name="WorkTransaction" policy="static"/>
+   <reference bind="setRepository" cardinality="1..1" interface="javax.jcr.Repository" name="Repository" policy="static" target="(cn=ego)"/>
+   <reference bind="setUserTransaction" cardinality="1..1" interface="org.argeo.api.cms.transaction.WorkTransaction" name="WorkTransaction" policy="static"/>
    <reference bind="setUserAdmin" cardinality="1..1" interface="org.osgi.service.useradmin.UserAdmin" name="UserAdmin" policy="static"/>
+   <reference bind="setContentRepository" cardinality="1..1" interface="org.argeo.api.acr.spi.ProvidedRepository" name="ContentRepository" policy="static"/>
 </scr:component>
index 92f84c6a92e1512d6f0eadd9e4f9cbf894be15d7..797c5a399144b614732d6ff70fe73c54da1d8154 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init" deactivate="destroy" name="Suite Terms Manager">
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init" deactivate="destroy" immediate="true" name="Suite Terms Manager">
    <implementation class="org.argeo.app.core.SuiteTermsManager"/>
-   <reference bind="setRepository" cardinality="1..1" interface="javax.jcr.Repository" name="Repository" policy="static" target="(cn=entity)"/>
+   <reference bind="setRepository" cardinality="1..1" interface="javax.jcr.Repository" name="Repository" policy="static" target="(cn=ego)"/>
    <service>
       <provide interface="org.argeo.app.api.TermsManager"/>
    </service>
index 8604ec964a88770bb2c93e014a80c3490b91a6af..9d8228bec121fb4c629a6beef6490639c6b4e4ed 100644 (file)
@@ -6,6 +6,7 @@ OSGI-INF/maintenanceService.xml,\
 OSGI-INF/dbk4Converter.xml,\
 
 Import-Package:\
+tech.units.indriya.unit,\
 org.osgi.service.useradmin,\
 javax.jcr.nodetype,\
 javax.jcr.security,\
index 6210e849b591d26fa9e17057ad3e8d09511917b6..76d3ee9df97a71ac3f1ba14e0e6b185c33bfbb01 100644 (file)
@@ -3,3 +3,4 @@ bin.includes = META-INF/,\
                .,\
                OSGI-INF/
 source.. = src/
+additional.bundles = org.argeo.init
index 4b69883961c01f7b12501d939bcedef8f94cd258..a4b1fff691520c09ad165b9792e0ed21125888c7 100644 (file)
@@ -25,7 +25,7 @@ public abstract class CustomMaintenanceService extends AbstractMaintenanceServic
        }
 
        protected String getTypologiesLoadBase() {
-               return "/sys/terms";
+               return "";
        }
 
        protected void loadTypologies(Node customBaseNode) throws RepositoryException, IOException {
@@ -44,9 +44,11 @@ public abstract class CustomMaintenanceService extends AbstractMaintenanceServic
                try {
 //                     if (termsBase.hasNode(name))
 //                             return;
-
-                       String termsLoadPath = getTypologiesLoadBase() + '/' + name + ".xml";
-                       URL termsUrl = getClass().getClassLoader().getResource(termsLoadPath);
+                       String typologiesLoadBase = getTypologiesLoadBase();
+                       if (typologiesLoadBase.contains("/") && !typologiesLoadBase.endsWith("/"))
+                               typologiesLoadBase = typologiesLoadBase + "/";
+                       String termsLoadPath = typologiesLoadBase + name + ".xml";
+                       URL termsUrl = getClass().getResource(termsLoadPath);
                        if (termsUrl == null)
                                throw new IllegalArgumentException("Terms '" + name + "' not found.");
                        try (InputStream in = termsUrl.openStream()) {
diff --git a/org.argeo.app.core/src/org/argeo/app/core/SuiteContentNamespace.java b/org.argeo.app.core/src/org/argeo/app/core/SuiteContentNamespace.java
new file mode 100644 (file)
index 0000000..48c508b
--- /dev/null
@@ -0,0 +1,95 @@
+package org.argeo.app.core;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Objects;
+
+import org.argeo.api.acr.spi.ContentNamespace;
+
+public enum SuiteContentNamespace implements ContentNamespace {
+       //
+       // ARGEO
+       //
+       ENTITY("entity", "http://www.argeo.org/ns/entity", "entity.xsd", null),
+       //
+       ARGEO_DBK("argeodbk", "http://www.argeo.org/ns/argeodbk", null, null),
+       //
+       // EXTERNAL
+       //
+       DOCBOOK5("dbk", "http://docbook.org/ns/docbook", "docbook.xsd", "http://docbook.org/xml/5.0.1/xsd/docbook.xsd"),
+       //
+       XML_EVENTS("ev", "http://www.w3.org/2001/xml-events", "xml-events-attribs-1.xsd",
+                       "http://www.w3.org/MarkUp/SCHEMA/xml-events-attribs-1.xsd"),
+       //
+       XFORMS("xforms", "http://www.w3.org/2002/xforms", "XForms-11-Schema.xsd",
+                       "https://www.w3.org/MarkUp/Forms/2007/XForms-11-Schema.xsd"),
+       //
+       XCARD("xcard", "urn:ietf:params:xml:ns:vcard-4.0", "xCard-4.0.xsd", null),
+       //
+       XSL_FO("fo", "http://www.w3.org/1999/XSL/Format", "fop.xsd",
+                       "https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk/fop/src/foschema/fop.xsd"),
+       //
+//     XCAL_2_0("xcal", "urn:ietf:params:xml:ns:icalendar-2.0", "xCal-2.0.xsd", null),
+       //
+       XHTML("h", "http://www.w3.org/1999/xhtml", null, "https://www.w3.org/MarkUp/SCHEMA/xhtml11.xsd"),
+       //
+       // ODK
+       //
+       JR("jr", "http://openrosa.org/javarosa", null, null),
+       //
+       ORX("orx", "http://openrosa.org/xforms", null, null),
+       //
+       ORX_LIST("orxList", "http://openrosa.org/xforms/xformsList", null, null),
+       //
+       ORX_MANIFEST("orxManifest", "http://openrosa.org/xforms/xformsManifest", null, null),
+       //
+       ODK("odk", "http://www.opendatakit.org/xforms", null, null),
+       //
+       WGS84("geo", "http://www.w3.org/2003/01/geo/wgs84_pos#", null, null),
+       //
+       ;
+
+       private final static String RESOURCE_BASE = "/org/argeo/app/core/schemas/";
+
+       private String defaultPrefix;
+       private String namespace;
+       private URL resource;
+       private URL publicUrl;
+
+       SuiteContentNamespace(String defaultPrefix, String namespace, String resourceFileName, String publicUrl) {
+               Objects.requireNonNull(namespace);
+               this.defaultPrefix = defaultPrefix;
+               Objects.requireNonNull(namespace);
+               this.namespace = namespace;
+               if (resourceFileName != null) {
+                       resource = getClass().getResource(RESOURCE_BASE + resourceFileName);
+                       Objects.requireNonNull(resource);
+               }
+               if (publicUrl != null)
+                       try {
+                               this.publicUrl = new URL(publicUrl);
+                       } catch (MalformedURLException e) {
+                               throw new IllegalArgumentException("Cannot interpret public URL", e);
+                       }
+       }
+
+       @Override
+       public String getDefaultPrefix() {
+               return defaultPrefix;
+       }
+
+       @Override
+       public String getNamespaceURI() {
+               return namespace;
+       }
+
+       @Override
+       public URL getSchemaResource() {
+               return resource;
+       }
+
+       public URL getPublicUrl() {
+               return publicUrl;
+       }
+
+}
index 532b7dd511f45b2bad990446079c148e5944ab5e..9c74ddee62d7c8502bae0733ac6244e19a417e54 100644 (file)
@@ -1,20 +1,65 @@
 package org.argeo.app.core;
 
 import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
 
 import javax.jcr.Node;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.nodetype.NodeType;
 import javax.jcr.security.Privilege;
+import javax.measure.Quantity;
+import javax.measure.quantity.Area;
 
+import org.argeo.api.acr.spi.ContentNamespace;
 import org.argeo.api.cms.CmsConstants;
 import org.argeo.app.api.EntityType;
 import org.argeo.jcr.JcrUtils;
 import org.argeo.maintenance.AbstractMaintenanceService;
+import org.geotools.gml3.v3_2.GML;
+
+import si.uom.SI;
+import tech.units.indriya.quantity.Quantities;
 
 /** Initialises an Argeo Suite backend. */
 public class SuiteMaintenanceService extends AbstractMaintenanceService {
+       @Override
+       public void init() {
+               // make sure that the unit system is initialised
+               Quantity<Area> dummy = Quantities.getQuantity(0, SI.SQUARE_METRE);
+
+               super.init();
+
+               getContentRepository().registerTypes(SuiteContentNamespace.values());
+//             for (SuiteContentTypes types : SuiteContentTypes.values()) {
+//                     getContentRepository().registerTypes(types.getDefaultPrefix(), types.getNamespace(),
+//                                     types.getResource() != null ? types.getResource().toExternalForm() : null);
+//             }
+
+               // GML schema import fails because of xlinks issues
+               getContentRepository().registerTypes(new ContentNamespace() {
+
+                       @Override
+                       public URL getSchemaResource() {
+                               try {
+                                       return new URL(GML.getInstance().getSchemaLocation());
+                               } catch (MalformedURLException e) {
+                                       throw new IllegalArgumentException(e);
+                               }
+                       }
+
+                       @Override
+                       public String getNamespaceURI() {
+                               return GML.getInstance().getNamespaceURI();
+                       }
+
+                       @Override
+                       public String getDefaultPrefix() {
+                               return "gml";
+                       }
+               });
+       }
 
        @Override
        public boolean prepareJcrTree(Session adminSession) throws RepositoryException, IOException {
@@ -33,7 +78,8 @@ public class SuiteMaintenanceService extends AbstractMaintenanceService {
        public void configurePrivileges(Session adminSession) throws RepositoryException {
                JcrUtils.addPrivilege(adminSession, EntityType.user.basePath(), CmsConstants.ROLE_USER_ADMIN,
                                Privilege.JCR_ALL);
-               //JcrUtils.addPrivilege(adminSession, "/", SuiteRole.coworker.dn(), Privilege.JCR_READ);
+               // JcrUtils.addPrivilege(adminSession, "/", SuiteRole.coworker.dn(),
+               // Privilege.JCR_READ);
        }
 
 }
index 0a31b1424e640df0d1aae1b4eaabbc011ba05659..f225064158ac6728486de7805764070e04936c2b 100644 (file)
@@ -4,50 +4,75 @@ import java.util.HashSet;
 import java.util.Set;
 
 import javax.jcr.Node;
+import javax.jcr.NodeIterator;
 import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.nodetype.NodeType;
 import javax.jcr.security.Privilege;
-import javax.naming.ldap.LdapName;
 import javax.security.auth.x500.X500Principal;
+import javax.xml.namespace.QName;
 
+import org.argeo.api.acr.Content;
+import org.argeo.api.acr.ldap.LdapAttr;
+import org.argeo.api.acr.ldap.LdapObj;
 import org.argeo.api.cms.CmsConstants;
 import org.argeo.api.cms.CmsSession;
 import org.argeo.app.api.EntityType;
-import org.argeo.app.api.SuiteRole;
-import org.argeo.jackrabbit.security.JackrabbitSecurityUtils;
+import org.argeo.cms.RoleNameUtils;
 import org.argeo.jcr.JcrException;
 import org.argeo.jcr.JcrUtils;
-import org.argeo.util.naming.LdapAttrs;
 
 /** Utilities around the Argeo Suite APIs. */
 public class SuiteUtils {
+       public final static String USER_STATE_NODE_NAME = "state";
+       public final static String USER_DEVICES_NODE_NAME = "devices";
+       public final static String USER_SESSIONS_NODE_NAME = "sessions";
 
-       public static String getUserNodePath(LdapName userDn) {
-               String uid = userDn.getRdn(userDn.size() - 1).getValue().toString();
+       public static String getUserNodePath(String userDn) {
+               String uid = RoleNameUtils.getLastRdnValue(userDn);
                return EntityType.user.basePath() + '/' + uid;
        }
 
-       public static Node getOrCreateUserNode(Session adminSession, LdapName userDn) {
+       public static Node getOrCreateUserNode(Session adminSession, String userDn) {
                try {
                        Node usersBase = adminSession.getNode(EntityType.user.basePath());
-                       String uid = userDn.getRdn(userDn.size() - 1).getValue().toString();
+                       String uid = RoleNameUtils.getLastRdnValue(userDn);
                        Node userNode;
                        if (!usersBase.hasNode(uid)) {
                                userNode = usersBase.addNode(uid, NodeType.NT_UNSTRUCTURED);
                                userNode.addMixin(EntityType.user.get());
                                userNode.addMixin(NodeType.MIX_CREATED);
-                               userNode.setProperty(LdapAttrs.distinguishedName.property(), userDn.toString());
-                               userNode.setProperty(LdapAttrs.uid.property(), uid);
+                               userNode.setProperty(LdapAttr.distinguishedName.get(), userDn.toString());
+                               userNode.setProperty(LdapAttr.uid.get(), uid);
+                       } else {
+                               userNode = usersBase.getNode(uid);
+                       }
+
+                       if (!userNode.hasNode(USER_SESSIONS_NODE_NAME)) {
+                               // Migrate existing user node
+                               Node sessionsNode = userNode.addNode(USER_SESSIONS_NODE_NAME, NodeType.NT_UNSTRUCTURED);
+                               oldSessions: for (NodeIterator nit = userNode.getNodes(); nit.hasNext();) {
+                                       Node child = nit.nextNode();
+                                       if (USER_SESSIONS_NODE_NAME.equals(child.getName()) || child.getName().startsWith("rep:")
+                                                       || child.getName().startsWith("jcr:"))
+                                               continue oldSessions;
+                                       Node target = sessionsNode.addNode(child.getName());
+                                       JcrUtils.copy(child, target);
+                               }
+
+                               Node userStateNode = userNode.addNode(USER_STATE_NODE_NAME, NodeType.NT_UNSTRUCTURED);
+                               Node userDevicesNode = userNode.addNode(USER_DEVICES_NODE_NAME, NodeType.NT_UNSTRUCTURED);
+
                                adminSession.save();
-                               JackrabbitSecurityUtils.denyPrivilege(adminSession, userNode.getPath(), SuiteRole.coworker.dn(),
-                                               Privilege.JCR_READ);
+//                             JackrabbitSecurityUtils.denyPrivilege(adminSession, userNode.getPath(), SuiteRole.coworker.dn(),
+//                                             Privilege.JCR_READ);
                                JcrUtils.addPrivilege(adminSession, userNode.getPath(), new X500Principal(userDn.toString()).getName(),
                                                Privilege.JCR_READ);
                                JcrUtils.addPrivilege(adminSession, userNode.getPath(), CmsConstants.ROLE_USER_ADMIN,
                                                Privilege.JCR_ALL);
-                       } else {
-                               userNode = usersBase.getNode(uid);
+
+                               JcrUtils.addPrivilege(adminSession, userStateNode.getPath(), userDn, Privilege.JCR_ALL);
+                               JcrUtils.addPrivilege(adminSession, userDevicesNode.getPath(), userDn, Privilege.JCR_ALL);
                        }
                        return userNode;
                } catch (RepositoryException e) {
@@ -57,7 +82,8 @@ public class SuiteUtils {
 
        public static Node getCmsSessionNode(Session session, CmsSession cmsSession) {
                try {
-                       return session.getNode(getUserNodePath(cmsSession.getUserDn()) + '/' + cmsSession.getUuid().toString());
+                       return session.getNode(getUserNodePath(cmsSession.getUserDn()) + '/' + USER_SESSIONS_NODE_NAME + '/'
+                                       + cmsSession.getUuid().toString());
                } catch (RepositoryException e) {
                        throw new JcrException("Cannot get session dir for " + cmsSession, e);
                }
@@ -65,29 +91,19 @@ public class SuiteUtils {
 
        public static Node getOrCreateCmsSessionNode(Session adminSession, CmsSession cmsSession) {
                try {
-                       LdapName userDn = cmsSession.getUserDn();
-//                     String uid = userDn.get(userDn.size() - 1);
+                       String userDn = cmsSession.getUserDn();
                        Node userNode = getOrCreateUserNode(adminSession, userDn);
-//                     if (!usersBase.hasNode(uid)) {
-//                             userNode = usersBase.addNode(uid, NodeType.NT_UNSTRUCTURED);
-//                             userNode.addMixin(EntityType.user.get());
-//                             userNode.addMixin(NodeType.MIX_CREATED);
-//                             usersBase.setProperty(LdapAttrs.uid.property(), uid);
-//                             usersBase.setProperty(LdapAttrs.distinguishedName.property(), userDn.toString());
-//                             adminSession.save();
-//                     } else {
-//                             userNode = usersBase.getNode(uid);
-//                     }
+                       Node sessionsNode = userNode.getNode(USER_SESSIONS_NODE_NAME);
                        String cmsSessionUuid = cmsSession.getUuid().toString();
                        Node cmsSessionNode;
-                       if (!userNode.hasNode(cmsSessionUuid)) {
-                               cmsSessionNode = userNode.addNode(cmsSessionUuid, NodeType.NT_UNSTRUCTURED);
+                       if (!sessionsNode.hasNode(cmsSessionUuid)) {
+                               cmsSessionNode = sessionsNode.addNode(cmsSessionUuid, NodeType.NT_UNSTRUCTURED);
                                cmsSessionNode.addMixin(NodeType.MIX_CREATED);
                                adminSession.save();
                                JcrUtils.addPrivilege(adminSession, cmsSessionNode.getPath(), cmsSession.getUserRole(),
                                                Privilege.JCR_ALL);
                        } else {
-                               cmsSessionNode = userNode.getNode(cmsSessionUuid);
+                               cmsSessionNode = sessionsNode.getNode(cmsSessionUuid);
                        }
                        return cmsSessionNode;
                } catch (RepositoryException e) {
@@ -95,11 +111,6 @@ public class SuiteUtils {
                }
        }
 
-       /** Singleton. */
-       private SuiteUtils() {
-
-       }
-
        public static Set<String> extractRoles(String[] semiColArr) {
                Set<String> res = new HashSet<>();
                // TODO factorize and make it more robust
@@ -120,4 +131,33 @@ public class SuiteUtils {
                return res;
        }
 
+       synchronized static public long findNextId(Content hierarchyUnit, QName cclass) {
+               if (!hierarchyUnit.hasContentClass(LdapObj.posixGroup.qName()))
+                       throw new IllegalArgumentException(hierarchyUnit + " is not a POSIX group");
+
+               long min = hierarchyUnit.get(LdapAttr.gidNumber.qName(), Long.class).orElseThrow();
+               long currentMax = 0l;
+               for (Content childHu : hierarchyUnit) {
+                       if (!childHu.hasContentClass(LdapObj.organizationalUnit.qName()))
+                               continue;
+                       // FIXME filter out functional hierarchy unit
+                       for (Content role : childHu) {
+                               if (role.hasContentClass(cclass)) {
+
+                                       if (LdapObj.posixAccount.qName().equals(cclass)) {
+                                               Long id = role.get(LdapAttr.uidNumber.qName(), Long.class).orElseThrow();
+                                               if (id > currentMax)
+                                                       currentMax = id;
+                                       }
+                               }
+                       }
+               }
+               if (currentMax == 0l)
+                       return min;
+               return currentMax + 1;
+       }
+
+       /** Singleton. */
+       private SuiteUtils() {
+       }
 }
index f86445c7072b09fa6a59a8f12db39171d4f61a1f..b0678cd3b2e126641114ef986c0239beb9d6c0e8 100644 (file)
@@ -78,7 +78,6 @@ public class XPathUtils {
         * @param propertyName
         * @param calendar       the reference date
         * @param lowerOrGreater "&lt;", "&gt;" TODO validate "&gt;="
-        * @return
         * @throws RepositoryException
         */
        public static String getPropertyDateComparaison(String propertyName, Calendar cal, String lowerOrGreater)
diff --git a/org.argeo.app.core/src/org/argeo/app/core/schemas/XForms-11-Schema.xsd b/org.argeo.app.core/src/org/argeo/app/core/schemas/XForms-11-Schema.xsd
new file mode 100644 (file)
index 0000000..881bfcb
--- /dev/null
@@ -0,0 +1,1571 @@
+<?xml version="1.0"?>
+<xsd:schema targetNamespace="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xforms="http://www.w3.org/2002/xforms" elementFormDefault="qualified">
+       <!--
+  Changes:
+26-Aug MJD fixed typo where more than one child allowed on <instance>
+04-Sep MJD fixed typo on <send> : attribute 'submission' is required
+04-Sep MJD fixed typo on <rebuild><recalculate><revalidate><refresh>: '' attribute is required
+06-Sep MJD clarified specific allowed values of @level on <message>
+06-Sep MJD removed UI Common attributes from <help><hint><alert><label>
+09-Sep MJD changed minOccurrs and maxOccurs to use XPath expressions, default values
+09-Sep MJD fixed typo: added linking attributes to <message>
+09-Sep MJD removed <extension> from content models of <mode> and UI common elements
+09-Sep MJD fixed typo: removed 'format' attribute
+17-Sep MJD fixed typo: <output> now uses the attribute group for binding attributes, instead of similarly named individual attrs
+17-Sep MJD added XPathExpression simpleType for internal use. This doesn't actually change anything, but makes
+the Schema a better documentation resource (instead of using xsd:string for everything)
+17-Sep MJD removed 'mediatype' attribute from <submission>, as it was unused
+17-Sep MJD fixed typo: only 'ref' and 'bind' attributes, not 'model' on <submission>
+17-Sep MJD added XML Events attributes to <model>
+17-Sep MJD in accordance with 3.2.1, removed all id attributes
+19-Sep MJD fixed typo: clarified that nested <action>s are permitted.
+19-Sep MJD factor UI.Inline into <group>. Renamed <group>s and <attributeGroup>s to match the prose names
+19-Sep MJD changed to agreed-upon namespace for CR
+25-Sep MJD fixed typo: added UI.Inlne to content model of <message>, enabled mixed content
+29-Sep MJD fixed typo: 'model' required on <reset>
+29-Sep MJD fixed typo: binding attributes allowed on <submit>
+29-Sep MJD fixed typo: explicit enumerated values for 'show' on <load>
+04-Oct MJD 'resource' attribute not required
+
+12-Nov 2002 : Published as CR
+
+13-Jan MJD added new attribute includenamespaceprefixes on <submission>
+13-Jan MJD added UI Common elements to content model of <group>
+03-Feb MJD synchoninzed duration types with 15 Nov Query Operators document
+31-Mar MJD added mediatype attribute on <submission>
+14-May MJD typo : "xsd:NCName"
+26-Jun MJD removed 'accesskey' and 'navindex' (over to host language definition)
+
+01-Aug 2003 : Published as PR
+
+15-Sep MJD final namespace
+15-Sep MJD corrected content model of <value>
+15-Sep MJD changed the name of the import for XML Events to highlight that only the attributes are used
+
+1.0 Second Edition errata
+
+16-Apr 2005 RAM - erratum E4 - optional @model
+16-Apr 2005 RAM - erratum E22 - default value for @show
+16-Apr 2005 RAM - erratum E54 - remove xforms:minOccurs and xforms:maxOccurs
+26-Jun 2005 RAM - erratum E71 - allow an empty case element
+
+16-Jun 2006 JMB - erratum E69 - instance attribute in submission; id in common attributes
+
+15-Aug-2006 CFW - erratum E18 on 2nd ed. Added Action to content model for Case
+
+09-Sep 2006 JMB - non-substantive: explicitly declared some use="optional" settings, 
+                  substantive: erratum E18 on 2nd ed. Declared default false for selected attribute of case
+                  substantive: erratum E21 on 2nd ed. Added multipart-post to enumeration of method attribute
+23-Nov 2006 JMB - substantive: erratum E32 on 2nd ed. switch in repeat
+17-Jul 2007 JMB - substantive: erratum E41 on 2nd ed. version attribute and associated simple types
+
+XForms 1.1
+
+25 Oct 2007 CFW, NvdB and JMB - Updated to XForms 1.1
+21 Nov 2007 JMB: Fixed description of card-number datatype
+08 Apr 2008 JMB: Fixed NCName (was NCNAME)
+30 MAY 2008 JMB: Changed card-number to allow zero or more digits
+22 JUN 2008 JMB: Renamed UI.Inline to UI.Content
+07 SEP 2008 LLK: Added element header attribute combine. header now allows one name, multiple value.
+09 MAR 2009 JMB: Changed @separator default to ampersand
+19 MAY 2009 JMB: Added submission/@targetref, dispatch/@targetid and dispatch/targetid
+10 JUN 2009 JMB: Moved switch/case from global space to being local to switch for clarity
+13 JAN 2010 JMB: Put maxOccurs=1 on instance content to limit to one child element in an instance
+16 SEP 2010 JBM: Added xforms:duration datatype (1.1 Erratum #1), added UICommon before ListUICommon on select/select1 (1.1 Erratum #2)
+-->
+       <xsd:import namespace="http://www.w3.org/2001/xml-events" schemaLocation="xml-events-attribs-1.xsd"/>
+       <xsd:import namespace="http://www.w3.org/2001/XMLSchema" schemaLocation="XMLSchema.xsd"/>
+
+       <!--
+structural elements
+-->
+       <xsd:attributeGroup name="Common.Attributes">
+               <xsd:annotation>
+                       <xsd:documentation>Attributes for _every_ element in XForms</xsd:documentation>
+               </xsd:annotation>
+               <xsd:attribute name="id" type="xsd:ID" use="optional"/>
+               <xsd:anyAttribute namespace="##other"/>
+       </xsd:attributeGroup>
+
+       <xsd:attributeGroup name="Single.Node.Binding.Attributes">
+               <xsd:attribute name="model" type="xsd:IDREF" use="optional"/>
+               <xsd:attribute name="ref" type="xforms:XPathExpression" use="optional"/>
+               <xsd:attribute name="bind" type="xsd:IDREF" use="optional"/>
+       </xsd:attributeGroup>
+
+       <xsd:attributeGroup name="Nodeset.Binding.Attributes">
+               <xsd:attribute name="model" type="xsd:IDREF" use="optional"/>
+               <xsd:attribute name="nodeset" type="xforms:XPathExpression" use="optional"/>
+               <xsd:attribute name="bind" type="xsd:IDREF" use="optional"/>
+       </xsd:attributeGroup>
+
+       <xsd:attributeGroup name="Linking.Attributes">
+               <xsd:attribute name="src" type="xsd:anyURI"/>
+       </xsd:attributeGroup>
+
+       <xsd:element name="model">
+               <xsd:complexType>
+                       <xsd:sequence minOccurs="0" maxOccurs="unbounded">
+                               <xsd:choice>
+                                       <xsd:element ref="xforms:instance"/>
+                                       <xsd:element ref="xsd:schema"/>
+                                       <xsd:element ref="xforms:submission"/>
+                                       <xsd:element ref="xforms:bind"/>
+                                       <xsd:group ref="xforms:Action"/>
+                               </xsd:choice>
+                       </xsd:sequence>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:XML.Events"/>
+                       <xsd:attribute name="functions" type="xforms:QNameList" use="optional"/>
+                       <xsd:attribute name="schema" type="xforms:anyURIList" use="optional"/>
+                       <xsd:attribute name="version" type="xforms:versionList" use="optional"/>
+               </xsd:complexType>
+       </xsd:element>
+
+       <xsd:element name="instance">
+               <xsd:annotation>
+                       <xsd:documentation>instance container.</xsd:documentation>
+               </xsd:annotation>
+               <xsd:complexType>
+                       <xsd:sequence>
+                               <xsd:any namespace="##any" processContents="skip" minOccurs="0" maxOccurs="1"/>
+                       </xsd:sequence>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:Linking.Attributes"/>
+                       <xsd:attribute name="resource" type="xsd:anyURI" use="optional"/>
+               </xsd:complexType>
+       </xsd:element>
+
+       <xsd:element name="bind">
+               <xsd:annotation>
+                       <xsd:documentation>Definition of bind container.</xsd:documentation>
+               </xsd:annotation>
+               <xsd:complexType>
+                       <xsd:sequence minOccurs="0" maxOccurs="unbounded">
+                               <xsd:element ref="xforms:bind"/>
+                       </xsd:sequence>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attribute name="nodeset" type="xforms:XPathExpression" use="optional"/>
+                       <xsd:attribute name="calculate" type="xforms:XPathExpression" use="optional"/>
+                       <xsd:attribute name="type" type="xsd:QName" use="optional"/>
+                       <xsd:attribute name="required" type="xforms:XPathExpression" use="optional"/>
+                       <xsd:attribute name="constraint" type="xforms:XPathExpression" use="optional"/>
+                       <xsd:attribute name="relevant" type="xforms:XPathExpression" use="optional"/>
+                       <xsd:attribute name="readonly" type="xforms:XPathExpression" use="optional"/>
+                       <xsd:attribute name="p3ptype" type="xsd:string" use="optional"/>
+               </xsd:complexType>
+       </xsd:element>
+
+       <xsd:element name="extension">
+               <xsd:complexType>
+                       <xsd:sequence>
+                               <xsd:any namespace="##other"/>
+                       </xsd:sequence>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+               </xsd:complexType>
+       </xsd:element>
+
+       <!--
+User Interface form controls
+-->
+       <xsd:group name="Core.Form.Controls">
+               <xsd:choice>
+                       <xsd:element ref="xforms:input"/>
+                       <xsd:element ref="xforms:secret"/>
+                       <xsd:element ref="xforms:textarea"/>
+                       <xsd:element ref="xforms:output"/>
+                       <xsd:element ref="xforms:upload"/>
+                       <xsd:element ref="xforms:select1"/>
+                       <xsd:element ref="xforms:select"/>
+                       <xsd:element ref="xforms:range"/>
+                       <xsd:element ref="xforms:submit"/>
+                       <xsd:element ref="xforms:trigger"/>
+               </xsd:choice>
+       </xsd:group>
+
+       <xsd:group name="Container.Form.Controls">
+               <xsd:choice>
+                       <xsd:element ref="xforms:group"/>
+                       <xsd:element ref="xforms:switch"/>
+                       <xsd:element ref="xforms:repeat"/>
+               </xsd:choice>
+       </xsd:group>
+
+       <xsd:attributeGroup name="UI.Common.Attrs">
+               <xsd:attribute name="appearance" type="xforms:appearanceType" use="optional"/>
+       </xsd:attributeGroup>
+
+       <xsd:group name="UI.Content">
+               <xsd:sequence>
+                       <xsd:choice minOccurs="0">
+                               <xsd:element ref="xforms:output"/>
+                               <!-- containing document language to add additional allowed content here -->
+                       </xsd:choice>
+               </xsd:sequence>
+       </xsd:group>
+
+       <xsd:group name="UI.Common">
+               <xsd:sequence>
+                       <xsd:choice minOccurs="0" maxOccurs="unbounded">
+                               <xsd:element ref="xforms:help"/>
+                               <xsd:element ref="xforms:hint"/>
+                               <xsd:element ref="xforms:alert"/>
+                               <xsd:group ref="xforms:Action"/>
+                       </xsd:choice>
+               </xsd:sequence>
+       </xsd:group>
+
+       <xsd:element name="label">
+               <xsd:complexType mixed="true">
+                       <xsd:group ref="xforms:UI.Content"/>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:Single.Node.Binding.Attributes"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="hint">
+               <xsd:complexType mixed="true">
+                       <xsd:group ref="xforms:UI.Content"/>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:Single.Node.Binding.Attributes"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="help">
+               <xsd:complexType mixed="true">
+                       <xsd:group ref="xforms:UI.Content"/>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:Single.Node.Binding.Attributes"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="alert">
+               <xsd:complexType mixed="true">
+                       <xsd:group ref="xforms:UI.Content"/>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:Single.Node.Binding.Attributes"/>
+               </xsd:complexType>
+       </xsd:element>
+
+       <xsd:group name="List.UI.Common">
+               <xsd:sequence>
+                       <xsd:choice>
+                               <xsd:element ref="xforms:item"/>
+                               <xsd:element ref="xforms:itemset"/>
+                               <xsd:element ref="xforms:choices"/>
+                       </xsd:choice>
+               </xsd:sequence>
+       </xsd:group>
+       <xsd:element name="item">
+               <xsd:complexType>
+                       <xsd:sequence>
+                               <xsd:element ref="xforms:label"/>
+                               <xsd:element ref="xforms:value"/>
+                               <xsd:group ref="xforms:UI.Common" minOccurs="0" maxOccurs="unbounded"/>
+                       </xsd:sequence>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="itemset">
+               <xsd:complexType>
+                       <xsd:sequence>
+                               <xsd:element ref="xforms:label"/>
+                               <xsd:choice>
+                                       <xsd:element ref="xforms:value"/>
+                                       <xsd:element ref="xforms:copy"/>
+                               </xsd:choice>
+                               <xsd:group ref="xforms:UI.Common" minOccurs="0" maxOccurs="unbounded"/>
+                       </xsd:sequence>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:Nodeset.Binding.Attributes"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="choices">
+               <xsd:complexType>
+                       <xsd:sequence>
+                               <xsd:element ref="xforms:label" minOccurs="0"/>
+                               <xsd:sequence maxOccurs="unbounded">
+                                       <xsd:choice>
+                                               <xsd:element ref="xforms:choices"/>
+                                               <xsd:element ref="xforms:item"/>
+                                               <xsd:element ref="xforms:itemset"/>
+                                       </xsd:choice>
+                               </xsd:sequence>
+                       </xsd:sequence>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+               </xsd:complexType>
+       </xsd:element>
+
+       <xsd:element name="value">
+               <xsd:complexType>
+                       <xsd:simpleContent>
+                               <xsd:extension base="xsd:string">
+                                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                                       <xsd:attributeGroup ref="xforms:Single.Node.Binding.Attributes"/>
+                                       <xsd:attribute name="value" type="xforms:XPathExpression" use="optional"/>
+                               </xsd:extension>
+                       </xsd:simpleContent>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="copy">
+               <xsd:complexType>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:Single.Node.Binding.Attributes"/>
+               </xsd:complexType>
+       </xsd:element>
+<!--
+       <xsd:element name="filename">
+               <xsd:complexType>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:Single.Node.Binding.Attributes"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="mediatype">
+               <xsd:complexType>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:Single.Node.Binding.Attributes"/>
+               </xsd:complexType>
+       </xsd:element>
+-->
+       <xsd:complexType name="filename">
+               <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+               <xsd:attributeGroup ref="xforms:Single.Node.Binding.Attributes"/>
+       </xsd:complexType>
+       <xsd:complexType name="mediatype">
+               <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+               <xsd:attributeGroup ref="xforms:Single.Node.Binding.Attributes"/>
+       </xsd:complexType>
+       <xsd:complexType name="mediatypeWithValue">
+               <xsd:complexContent>
+                       <xsd:extension base="xforms:mediatype">
+                               <xsd:attribute name="value" type="xforms:XPathExpression" use="optional"/>
+                       </xsd:extension>
+               </xsd:complexContent>
+       </xsd:complexType>
+
+       <xsd:element name="input">
+               <xsd:complexType>
+                       <xsd:sequence>
+                               <xsd:element ref="xforms:label"/>
+                               <xsd:group ref="xforms:UI.Common" minOccurs="0" maxOccurs="unbounded"/>
+                       </xsd:sequence>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:Single.Node.Binding.Attributes"/>
+                       <xsd:attribute name="inputmode" type="xsd:string" use="optional"/>
+                       <xsd:attributeGroup ref="xforms:UI.Common.Attrs"/>
+                       <xsd:attribute name="incremental" type="xsd:boolean" use="optional" default="false"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="secret">
+               <xsd:complexType>
+                       <xsd:sequence>
+                               <xsd:element ref="xforms:label"/>
+                               <xsd:group ref="xforms:UI.Common" minOccurs="0" maxOccurs="unbounded"/>
+                       </xsd:sequence>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:Single.Node.Binding.Attributes"/>
+                       <xsd:attribute name="inputmode" type="xsd:string" use="optional"/>
+                       <xsd:attributeGroup ref="xforms:UI.Common.Attrs"/>
+                       <xsd:attribute name="incremental" type="xsd:boolean" use="optional" default="false"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="textarea">
+               <xsd:complexType>
+                       <xsd:sequence>
+                               <xsd:element ref="xforms:label"/>
+                               <xsd:group ref="xforms:UI.Common" minOccurs="0" maxOccurs="unbounded"/>
+                       </xsd:sequence>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:Single.Node.Binding.Attributes"/>
+                       <xsd:attribute name="inputmode" type="xsd:string" use="optional"/>
+                       <xsd:attributeGroup ref="xforms:UI.Common.Attrs"/>
+                       <xsd:attribute name="incremental" type="xsd:boolean" use="optional" default="false"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="upload">
+               <xsd:complexType>
+                       <xsd:sequence>
+                               <xsd:element ref="xforms:label"/>
+                               <!--
+                               <xsd:element ref="xforms:filename" minOccurs="0"/>
+                               <xsd:element ref="xforms:mediatype" minOccurs="0"/>
+                               -->
+                               <xsd:element name="filename" type="xforms:filename" minOccurs="0"/>
+                               <xsd:element name="mediatype" type="xforms:mediatype" minOccurs="0"/>
+                               <xsd:group ref="xforms:UI.Common" minOccurs="0" maxOccurs="unbounded"/>
+                       </xsd:sequence>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:Single.Node.Binding.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:UI.Common.Attrs"/>
+                       <xsd:attribute name="mediatype" type="xsd:string" use="optional"/>
+                       <xsd:attribute name="incremental" type="xsd:boolean" use="optional" default="false"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="select1">
+               <xsd:complexType>
+                       <xsd:sequence>
+                               <xsd:element ref="xforms:label"/>
+                               <xsd:group ref="xforms:UI.Common" minOccurs="0" maxOccurs="unbounded"/>
+                               <xsd:group ref="xforms:List.UI.Common" maxOccurs="unbounded"/>
+                               <xsd:group ref="xforms:UI.Common" minOccurs="0" maxOccurs="unbounded"/>
+                       </xsd:sequence>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:Single.Node.Binding.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:UI.Common.Attrs"/>
+                       <xsd:attribute name="selection" use="optional" default="closed">
+                               <xsd:simpleType>
+                                       <xsd:restriction base="xsd:string">
+                                               <xsd:enumeration value="open"/>
+                                               <xsd:enumeration value="closed"/>
+                                       </xsd:restriction>
+                               </xsd:simpleType>
+                       </xsd:attribute>
+                       <xsd:attribute name="incremental" type="xsd:boolean" use="optional" default="true"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="select">
+               <xsd:complexType>
+                       <xsd:sequence>
+                               <xsd:element ref="xforms:label"/>
+                               <xsd:group ref="xforms:UI.Common" minOccurs="0" maxOccurs="unbounded"/>
+                               <xsd:group ref="xforms:List.UI.Common" maxOccurs="unbounded"/>
+                               <xsd:group ref="xforms:UI.Common" minOccurs="0" maxOccurs="unbounded"/>
+                       </xsd:sequence>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:Single.Node.Binding.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:UI.Common.Attrs"/>
+                       <xsd:attribute name="selection" use="optional" default="closed">
+                               <xsd:simpleType>
+                                       <xsd:restriction base="xsd:string">
+                                               <xsd:enumeration value="open"/>
+                                               <xsd:enumeration value="closed"/>
+                                       </xsd:restriction>
+                               </xsd:simpleType>
+                       </xsd:attribute>
+                       <xsd:attribute name="incremental" type="xsd:boolean" use="optional" default="true"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="range">
+               <xsd:complexType>
+                       <xsd:sequence>
+                               <xsd:element ref="xforms:label"/>
+                               <xsd:group ref="xforms:UI.Common" minOccurs="0" maxOccurs="unbounded"/>
+                       </xsd:sequence>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:Single.Node.Binding.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:UI.Common.Attrs"/>
+                       <xsd:attribute name="start" type="xsd:string" use="optional"/>
+                       <xsd:attribute name="end" type="xsd:string" use="optional"/>
+                       <xsd:attribute name="step" type="xsd:string" use="optional"/>
+                       <xsd:attribute name="incremental" type="xsd:boolean" use="optional" default="false"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="trigger">
+               <xsd:complexType>
+                       <xsd:sequence>
+                               <xsd:element ref="xforms:label"/>
+                               <xsd:group ref="xforms:UI.Common" minOccurs="0" maxOccurs="unbounded"/>
+                       </xsd:sequence>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:Single.Node.Binding.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:UI.Common.Attrs"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="output">
+               <xsd:complexType>
+                       <xsd:sequence minOccurs="0">
+                               <xsd:element ref="xforms:label"/>
+                               <!--
+                               <xsd:element ref="xforms:mediatype" minOccurs="0"/>
+                               -->
+                               <xsd:element name="mediatype" type="xforms:mediatypeWithValue" minOccurs="0"/>
+                               <xsd:group ref="xforms:UI.Common" minOccurs="0" maxOccurs="unbounded"/>
+                       </xsd:sequence>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:Single.Node.Binding.Attributes"/>
+                       <xsd:attribute name="appearance" type="xforms:appearanceType" use="optional"/>
+                       <xsd:attribute name="value" type="xforms:XPathExpression" use="optional"/>
+                       <xsd:attribute name="mediatype" type="xsd:string" use="optional"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="submit">
+               <xsd:complexType>
+                       <xsd:sequence>
+                               <xsd:element ref="xforms:label"/>
+                               <xsd:group ref="xforms:UI.Common" minOccurs="0" maxOccurs="unbounded"/>
+                       </xsd:sequence>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attribute name="submission" type="xsd:IDREF" use="optional"/>
+                       <xsd:attributeGroup ref="xforms:Single.Node.Binding.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:UI.Common.Attrs"/>
+               </xsd:complexType>
+       </xsd:element>
+
+       <!--
+Advanced User Interface
+-->
+       <xsd:attribute name="repeat-nodeset" type="xforms:XPathExpression"/>
+       <xsd:attribute name="repeat-model" type="xsd:IDREF"/>
+       <xsd:attribute name="repeat-bind" type="xsd:IDREF"/>
+       <xsd:attribute name="repeat-startindex" type="xsd:positiveInteger"/>
+       <xsd:attribute name="repeat-number" type="xsd:nonNegativeInteger"/>
+       
+       <xsd:element name="repeat">
+               <xsd:complexType>
+                       <xsd:sequence>
+                               <xsd:sequence minOccurs="0" maxOccurs="unbounded">
+                                       <xsd:choice>
+                                               <xsd:group ref="xforms:Core.Form.Controls"/>
+                                               <xsd:group ref="xforms:Container.Form.Controls"/>
+                                               <xsd:group ref="xforms:Action"/>
+                                               <!-- containing document language to add additional allowed content here -->
+                                       </xsd:choice>
+                               </xsd:sequence>
+                       </xsd:sequence>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:Nodeset.Binding.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:UI.Common.Attrs"/>
+                       <xsd:attribute name="startindex" type="xsd:positiveInteger"/>
+                       <xsd:attribute name="number" type="xsd:nonNegativeInteger"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="group">
+               <xsd:complexType>
+                       <xsd:sequence>
+                               <xsd:element ref="xforms:label" minOccurs="0"/>
+                               <xsd:sequence minOccurs="0" maxOccurs="unbounded">
+                                       <xsd:choice>
+                                               <xsd:group ref="xforms:Core.Form.Controls"/>
+                                               <xsd:group ref="xforms:Container.Form.Controls"/>
+                                               <xsd:group ref="xforms:UI.Common"/>
+                                               <!-- containing document language to add additional allowed content here -->
+                                       </xsd:choice>
+                               </xsd:sequence>
+                       </xsd:sequence>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:Single.Node.Binding.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:UI.Common.Attrs"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="switch">
+               <xsd:complexType>
+                       <xsd:sequence maxOccurs="unbounded">
+                               <xsd:element name="case">
+                                       <xsd:complexType>
+                                               <xsd:sequence>
+                                                       <xsd:element ref="xforms:label" minOccurs="0"/>
+                                                       <xsd:sequence minOccurs="0" maxOccurs="unbounded">
+                                                               <xsd:choice>
+                                                                       <xsd:group ref="xforms:Core.Form.Controls"/>
+                                                                       <xsd:group ref="xforms:Container.Form.Controls"/>
+                                                                       <xsd:group ref="xforms:Action"/>
+                                                                       <!-- containing document language to add additional allowed content here -->
+                                                               </xsd:choice>
+                                                       </xsd:sequence>
+                                               </xsd:sequence>
+                                               <xsd:attribute name="selected" type="xsd:boolean" use="optional" default="false"/>
+                                               <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                                       </xsd:complexType>
+                               </xsd:element>
+                       </xsd:sequence>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:Single.Node.Binding.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:UI.Common.Attrs"/>
+               </xsd:complexType>
+       </xsd:element>
+
+       <!--
+XForms Actions
+-->
+
+       <xsd:attributeGroup name="XML.Events">
+               <xsd:attribute ref="ev:event"/>
+               <xsd:attribute ref="ev:observer"/>
+               <xsd:attribute ref="ev:target"/>
+               <xsd:attribute ref="ev:handler"/>
+               <xsd:attribute ref="ev:phase"/>
+               <xsd:attribute ref="ev:propagate"/>
+               <xsd:attribute ref="ev:defaultAction"/>
+       </xsd:attributeGroup>
+
+       <xsd:attributeGroup name="Common.Action.Attributes">
+               <xsd:annotation>
+                       <xsd:documentation>Attributes for _every_ action in XForms</xsd:documentation>
+               </xsd:annotation>
+               <xsd:attribute name="if" type="xforms:XPathExpression" use="optional"/>
+               <xsd:attribute name="while" type="xforms:XPathExpression" use="optional"/>
+       </xsd:attributeGroup>
+
+       <xsd:group name="Action">
+               <xsd:sequence>
+                       <xsd:choice minOccurs="0" maxOccurs="unbounded">
+                               <xsd:element ref="xforms:action"/>
+                               <xsd:element ref="xforms:setvalue"/>
+                               <xsd:element ref="xforms:insert"/>
+                               <xsd:element ref="xforms:delete"/>
+                               <xsd:element ref="xforms:setindex"/>
+                               <xsd:element ref="xforms:toggle"/>
+                               <xsd:element ref="xforms:setfocus"/>
+                               <xsd:element ref="xforms:dispatch"/>
+                               <xsd:element ref="xforms:rebuild"/>
+                               <xsd:element ref="xforms:recalculate"/>
+                               <xsd:element ref="xforms:revalidate"/>
+                               <xsd:element ref="xforms:refresh"/>
+                               <xsd:element ref="xforms:reset"/>
+                               <xsd:element ref="xforms:load"/>
+                               <xsd:element ref="xforms:send"/>
+                               <xsd:element ref="xforms:message"/>
+                       </xsd:choice>
+               </xsd:sequence>
+       </xsd:group>
+
+       <xsd:element name="action">
+               <xsd:complexType>
+                       <xsd:sequence maxOccurs="unbounded">
+                               <xsd:group ref="xforms:Action"/>
+                       </xsd:sequence>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:XML.Events"/>
+                       <xsd:attributeGroup ref="xforms:Common.Action.Attributes"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="setvalue">
+               <xsd:complexType>
+                       <xsd:simpleContent>
+                               <xsd:extension base="xsd:string">
+                                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                                       <xsd:attributeGroup ref="xforms:Single.Node.Binding.Attributes"/>
+                                       <xsd:attribute name="value" type="xforms:XPathExpression" use="optional"/>
+                                       <xsd:attributeGroup ref="xforms:XML.Events"/>
+                                       <xsd:attributeGroup ref="xforms:Common.Action.Attributes"/>
+                               </xsd:extension>
+                       </xsd:simpleContent>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="insert">
+               <xsd:complexType>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:Nodeset.Binding.Attributes"/>
+                       <xsd:attribute name="at" type="xforms:XPathExpression" use="optional"/>
+                       <xsd:attribute name="context" type="xforms:XPathExpression" use="optional"/>
+                       <xsd:attribute name="origin" type="xforms:XPathExpression" use="optional"/>
+                       <xsd:attribute name="position" use="optional">
+                               <xsd:simpleType>
+                                       <xsd:restriction base="xsd:string">
+                                               <xsd:enumeration value="before"/>
+                                               <xsd:enumeration value="after"/>
+                                       </xsd:restriction>
+                               </xsd:simpleType>
+                       </xsd:attribute>
+                       <xsd:attributeGroup ref="xforms:XML.Events"/>
+                       <xsd:attributeGroup ref="xforms:Common.Action.Attributes"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="delete">
+               <xsd:complexType>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:Nodeset.Binding.Attributes"/>
+                       <xsd:attribute name="at" type="xforms:XPathExpression" use="optional"/>
+                       <xsd:attribute name="context" type="xforms:XPathExpression" use="optional"/>
+                       <xsd:attributeGroup ref="xforms:XML.Events"/>
+                       <xsd:attributeGroup ref="xforms:Common.Action.Attributes"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="setindex">
+               <xsd:complexType>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attribute name="repeat" type="xsd:IDREF" use="required"/>
+                       <xsd:attribute name="index" type="xforms:XPathExpression" use="required"/>
+                       <xsd:attributeGroup ref="xforms:XML.Events"/>
+                       <xsd:attributeGroup ref="xforms:Common.Action.Attributes"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="toggle">
+               <xsd:complexType>
+                       <xsd:sequence minOccurs="0" maxOccurs="1">
+                               <xsd:element name="case" type="xforms:ValueTemplate"/>
+                       </xsd:sequence>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attribute name="case" type="xsd:IDREF" use="optional"/>
+                       <xsd:attributeGroup ref="xforms:XML.Events"/>
+                       <xsd:attributeGroup ref="xforms:Common.Action.Attributes"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="setfocus">
+               <xsd:complexType>
+                       <xsd:sequence minOccurs="0" maxOccurs="1">
+                               <xsd:element name="control" type="xforms:ValueTemplate"/>
+                       </xsd:sequence>                 
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attribute name="control" type="xsd:IDREF" use="optional"/>
+                       <xsd:attributeGroup ref="xforms:XML.Events"/>
+                       <xsd:attributeGroup ref="xforms:Common.Action.Attributes"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="dispatch">
+               <xsd:complexType>
+                       <!-- Need to be able to say only zero or one of each child, but order independent.
+                            This gets as close as possible with schema. -->
+                       <xsd:sequence minOccurs="0" maxOccurs="3">
+                           <xsd:choice>
+                               <xsd:element name="name" type="xforms:ValueTemplate"/>
+                               <xsd:element name="targetid" type="xforms:ValueTemplate"/>
+                               <xsd:element name="target" type="xforms:ValueTemplate"/>
+                               <xsd:element name="delay" type="xforms:ValueTemplate"/>
+                           </xsd:choice>
+                       </xsd:sequence>                         
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attribute name="name" type="xsd:NMTOKEN" use="optional"/>
+                       <xsd:attribute name="targetid" type="xsd:IDREF" use="optional"/>
+                       <xsd:attribute name="target" type="xsd:IDREF" use="optional"/>
+                       <xsd:attribute name="delay" type="xsd:string" use="optional" default=""/>
+                       <xsd:attribute name="bubbles" type="xsd:boolean" use="optional" default="true"/>
+                       <xsd:attribute name="cancelable" type="xsd:boolean" use="optional" default="true"/>
+                       <xsd:attributeGroup ref="xforms:XML.Events"/>
+                       <xsd:attributeGroup ref="xforms:Common.Action.Attributes"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="rebuild">
+               <xsd:complexType>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attribute name="model" type="xsd:IDREF" use="optional"/>
+                       <xsd:attributeGroup ref="xforms:XML.Events"/>
+                       <xsd:attributeGroup ref="xforms:Common.Action.Attributes"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="recalculate">
+               <xsd:complexType>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attribute name="model" type="xsd:IDREF" use="optional"/>
+                       <xsd:attributeGroup ref="xforms:XML.Events"/>
+                       <xsd:attributeGroup ref="xforms:Common.Action.Attributes"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="revalidate">
+               <xsd:complexType>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attribute name="model" type="xsd:IDREF" use="optional"/>
+                       <xsd:attributeGroup ref="xforms:XML.Events"/>
+                       <xsd:attributeGroup ref="xforms:Common.Action.Attributes"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="refresh">
+               <xsd:complexType>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attribute name="model" type="xsd:IDREF" use="optional"/>
+                       <xsd:attributeGroup ref="xforms:XML.Events"/>
+                       <xsd:attributeGroup ref="xforms:Common.Action.Attributes"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="reset">
+               <xsd:complexType>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:XML.Events"/>
+                       <xsd:attributeGroup ref="xforms:Common.Action.Attributes"/>
+                       <xsd:attribute name="model" type="xsd:IDREF" use="optional"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="load">
+               <xsd:complexType>
+                       <xsd:sequence minOccurs="0" maxOccurs="1">
+                               <xsd:element name="resource" type="xforms:ValueTemplate"/>
+                       </xsd:sequence>                 
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:Single.Node.Binding.Attributes"/>
+                       <xsd:attribute name="resource" type="xsd:anyURI" use="optional"/>
+                       <xsd:attribute name="show" use="optional" default="replace">
+                               <xsd:simpleType>
+                                       <xsd:restriction base="xsd:string">
+                                               <xsd:enumeration value="new"/>
+                                               <xsd:enumeration value="replace"/>
+                                       </xsd:restriction>
+                               </xsd:simpleType>
+                       </xsd:attribute>
+                       <xsd:attributeGroup ref="xforms:XML.Events"/>
+                       <xsd:attributeGroup ref="xforms:Common.Action.Attributes"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="send">
+               <xsd:complexType>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attribute name="submission" type="xsd:IDREF" use="optional"/>
+                       <xsd:attributeGroup ref="xforms:XML.Events"/>
+                       <xsd:attributeGroup ref="xforms:Common.Action.Attributes"/>
+               </xsd:complexType>
+       </xsd:element>
+       <xsd:element name="message">
+               <xsd:complexType mixed="true">
+                       <xsd:group ref="xforms:UI.Content"/>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       <xsd:attributeGroup ref="xforms:Single.Node.Binding.Attributes"/>
+                       <xsd:attribute name="level" use="optional" default="modal">
+                               <xsd:simpleType>
+                                       <xsd:union memberTypes="xforms:QNameButNotNCNAME">
+                                               <xsd:simpleType>
+                                                       <xsd:restriction base="xsd:string">
+                                                               <xsd:enumeration value="ephemeral"/>
+                                                               <xsd:enumeration value="modeless"/>
+                                                               <xsd:enumeration value="modal"/>
+                                                       </xsd:restriction>
+                                               </xsd:simpleType>
+                                       </xsd:union>
+                               </xsd:simpleType>
+                       </xsd:attribute>
+                       <xsd:attributeGroup ref="xforms:XML.Events"/>
+                       <xsd:attributeGroup ref="xforms:Common.Action.Attributes"/>
+               </xsd:complexType>
+       </xsd:element>
+
+       <xsd:element name="submission">
+               <xsd:annotation>
+                       <xsd:documentation>submit info container.</xsd:documentation>
+               </xsd:annotation>
+               <xsd:complexType>
+                       <xsd:sequence>
+                               <!-- There should only be zero or one resource, zero or one method, and zero or more header 
+                                    We can't say exactly this, but we get as close as possible -->
+                               <xsd:choice minOccurs="0" maxOccurs="unbounded">
+                                       <xsd:element name="resource" type="xforms:ValueTemplate"/>
+                                       <xsd:element name="method" type="xforms:ValueTemplate"/>
+                                       <xsd:element name="header">
+                                               <xsd:complexType>
+                                                       <!-- Both name and value+ are required, but order independent -->
+                                                       <xsd:choice>
+                                                            <xsd:sequence>
+                                                                    <xsd:element name="name" type="xforms:ValueTemplate" />
+                                                                    <xsd:element name="value" type="xforms:ValueTemplate"
+                                        minOccurs="1" maxOccurs="unbounded" />
+                                                            </xsd:sequence>
+                                                            <xsd:sequence>
+                                                                    <xsd:element name="value" type="xforms:ValueTemplate"
+                                        minOccurs="1" maxOccurs="unbounded" />
+                                                                    <xsd:element name="name" type="xforms:ValueTemplate" />
+                                                            </xsd:sequence>
+                                                       </xsd:choice>
+                    <xsd:attribute name="combine" use="optional" default="append">
+                            <xsd:simpleType>
+                                    <xsd:restriction base="xsd:string">
+                                            <xsd:enumeration value="append"/>
+                                            <xsd:enumeration value="prepend"/>
+                                            <xsd:enumeration value="replace"/>
+                                    </xsd:restriction>
+                            </xsd:simpleType>
+                    </xsd:attribute>
+                                               </xsd:complexType>
+                                       </xsd:element>
+                               </xsd:choice>
+                               <!-- As is the case everywhere else, action handlers are last -->
+                               <xsd:group ref="xforms:Action"/>
+                       </xsd:sequence>
+                       <xsd:attributeGroup ref="xforms:Common.Attributes"/>
+                       
+                       <xsd:attribute name="ref" type="xforms:XPathExpression" use="optional"/>
+                       <xsd:attribute name="bind" type="xsd:IDREF" use="optional"/>
+                       
+                       <!-- Either the resource attribute, action attribute, or resource child element is required -->
+                       <xsd:attribute name="resource" type="xsd:anyURI" use="optional"/>
+                       <xsd:attribute name="action" type="xsd:anyURI" use="optional"/>
+                       
+                       <xsd:attribute name="mode" use="optional" default="asynchronous">
+                               <xsd:simpleType>
+                                       <xsd:restriction base="xsd:string">
+                                               <xsd:enumeration value="asynchronous"/>
+                                               <xsd:enumeration value="synchronous"/>
+                                       </xsd:restriction>
+                               </xsd:simpleType>
+                       </xsd:attribute>
+
+                       <!-- Either the method attribute or the method child element is required -->
+                       <xsd:attribute name="method" use="optional">
+                               <xsd:simpleType>
+                                       <xsd:union memberTypes="xforms:QNameButNotNCNAME xsd:NCName">
+                                               <xsd:simpleType>
+                                                       <xsd:restriction base="xsd:string">
+                                                               <xsd:enumeration value="post"/>
+                                                               <xsd:enumeration value="put"/>
+                                                               <xsd:enumeration value="get"/>
+                                                               <xsd:enumeration value="delete"/>
+                                                               <xsd:enumeration value="multipart-post"/>
+                                                               <xsd:enumeration value="form-data-post"/>
+                                                               <xsd:enumeration value="urlencoded-post"/>
+                                                       </xsd:restriction>
+                                               </xsd:simpleType>
+                                       </xsd:union>
+                               </xsd:simpleType>
+                       </xsd:attribute>
+
+                        <!-- The defaults for these are false if serialization is 'none' and true otherwise -->
+                       <xsd:attribute name="validate" type="xsd:boolean" use="optional"/>
+                       <xsd:attribute name="relevant" type="xsd:boolean" use="optional"/>
+                       
+                       <!-- The default is based on the selected method, e.g. application/xml for the post method -->
+                       <xsd:attribute name="serialization" type="xsd:string" use="optional"/>
+                       
+                       <xsd:attribute name="version" type="xsd:NMTOKEN" use="optional" default="1.0"/>
+                       <xsd:attribute name="indent" type="xsd:boolean" use="optional" default="false"/>
+                       <xsd:attribute name="mediatype" type="xsd:string" use="optional" default="application/xml"/>
+                       <xsd:attribute name="encoding" type="xsd:string" use="optional" default="UTF-8"/>
+                       
+                       <xsd:attribute name="omit-xml-declaration" type="xsd:boolean" use="optional" default="false"/>
+                       <!-- This is optional with no default because omitting the attribute behaves differently 
+                            than including it with any value -->
+                       <xsd:attribute name="standalone" type="xsd:boolean" use="optional"/>
+                       
+                       <xsd:attribute name="cdata-section-elements" type="xforms:QNameList" use="optional" default=""/>
+                       
+                       <xsd:attribute name="replace" use="optional" default="all">
+                               <xsd:simpleType>
+                                       <xsd:union memberTypes="xforms:QNameButNotNCNAME">
+                                               <xsd:simpleType>
+                                                       <xsd:restriction base="xsd:string">
+                                                               <xsd:enumeration value="all"/>
+                                                               <xsd:enumeration value="instance"/>
+                                                               <xsd:enumeration value="text"/>
+                                                               <xsd:enumeration value="none"/>
+                                                       </xsd:restriction>
+                                               </xsd:simpleType>
+                                       </xsd:union>
+                               </xsd:simpleType>
+                       </xsd:attribute>
+                       
+                       <!-- Default is not specified because the default is to replace the instance being submitted -->
+                       <xsd:attribute name="instance" type="xsd:IDREF" use="optional"/>
+                       
+                       <xsd:attribute name="separator" use="optional" default="&amp;">
+                               <xsd:simpleType>
+                                       <xsd:restriction base="xsd:string">
+                                               <xsd:enumeration value="&amp;"/>
+                                               <xsd:enumeration value=";"/>
+                                       </xsd:restriction>
+                               </xsd:simpleType>
+                       </xsd:attribute>
+                       
+                       <!-- Default is not specified because the defalut is to replace the whole instance indicated 
+                            by the instance attribute -->
+                       <xsd:attribute name="targetref" type="xforms:XPathExpression" use="optional"/>
+                       <xsd:attribute name="target" type="xforms:XPathExpression" use="optional"/>
+                       
+                       <!-- Default not specified because omitting the attribute behaves differently than
+                            including it with any value -->
+                       <xsd:attribute name="includenamespaceprefixes" use="optional">
+                               <xsd:simpleType>
+                                       <xsd:list>
+                                               <xsd:simpleType>
+                                                       <xsd:union memberTypes="xsd:NCName">
+                                                               <xsd:simpleType>
+                                                                       <xsd:restriction base="xsd:string">
+                                                                               <xsd:enumeration value="#default"/>
+                                                                       </xsd:restriction>
+                                                               </xsd:simpleType>
+                                                       </xsd:union>
+                                               </xsd:simpleType>
+                                       </xsd:list>
+                               </xsd:simpleType>
+                       </xsd:attribute>
+               </xsd:complexType>
+       </xsd:element>
+
+        <!-- 
+Internal helper types 
+-->
+
+       <xsd:simpleType name="versionList">
+               <xsd:list itemType="xforms:versionNumber"/>
+       </xsd:simpleType>
+       <xsd:simpleType name="versionNumber">
+               <xsd:restriction base="xsd:string">
+                       <xsd:pattern value="[1-9]\d*\.\d+"/>
+               </xsd:restriction>
+       </xsd:simpleType>
+       <xsd:simpleType name="XPathExpression">
+               <xsd:restriction base="xsd:string"/>
+       </xsd:simpleType>
+       <xsd:simpleType name="QNameList">
+               <xsd:list itemType="xsd:QName"/>
+       </xsd:simpleType>
+       <xsd:simpleType name="anyURIList">
+               <xsd:list itemType="xsd:anyURI"/>
+       </xsd:simpleType>
+       <xsd:simpleType name="QNameButNotNCNAME">
+               <xsd:restriction base="xsd:QName">
+                       <xsd:pattern value="[^:]+:[^:]+"/>
+               </xsd:restriction>
+       </xsd:simpleType>
+       <xsd:simpleType name="appearanceType">
+               <xsd:union memberTypes="xforms:QNameButNotNCNAME">
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:enumeration value="full"/>
+                                       <xsd:enumeration value="compact"/>
+                                       <xsd:enumeration value="minimal"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+
+       <xsd:complexType name="ValueTemplate">
+               <xsd:simpleContent>
+                       <xsd:extension base="xsd:string">
+                               <xsd:attribute name="value" type="xforms:XPathExpression" use="optional"/>
+                       </xsd:extension>
+               </xsd:simpleContent>
+       </xsd:complexType>
+
+        <!--
+New simpleTypes provided to form authors
+-->
+
+       <xsd:simpleType name="listItem">
+               <xsd:restriction base="xsd:string">
+                       <xsd:pattern value="\S+"/>
+               </xsd:restriction>
+       </xsd:simpleType>
+       <xsd:simpleType name="listItems">
+               <xsd:list itemType="xforms:listItem"/>
+        </xsd:simpleType>
+
+       <xsd:simpleType name="dateTime">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:dateTime"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="time">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:time"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="date">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:date"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="duration">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:duration"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="gYearMonth">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:gYearMonth"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="gYear">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:gYear"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="gMonthDay">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:gMonthDay"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="gDay">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:gDay"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="gMonth">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:gMonth"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="string">
+               <xsd:restriction base="xsd:string"/>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="boolean">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:boolean"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="base64Binary">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:base64Binary"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="hexBinary">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:hexBinary"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="float">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:float"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="decimal">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:decimal"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="double">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:double"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="anyURI">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:anyURI"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="QName">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:QName"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="normalizedString">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:normalizedString"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="token">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:token"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="language">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:language"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="Name">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:Name"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="NCName">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:NCName"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="ID">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:ID"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="IDREF">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:IDREF"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="IDREFS">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:IDREFS"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="NMTOKEN">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:NMTOKEN"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="NMTOKENS">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:NMTOKENS"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="integer">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:integer"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="negativeInteger">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:negativeInteger"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="long">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:long"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="int">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:int"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="short">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:short"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="byte">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:byte"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="nonNegativeInteger">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:nonNegativeInteger"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="unsignedLong">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:unsignedLong"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="unsignedInt">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:unsignedInt"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="unsignedShort">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:unsignedShort"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="unsignedByte">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:unsignedByte"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="positiveInteger">
+               <xsd:union>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:positiveInteger"/>
+                       </xsd:simpleType>
+                       <xsd:simpleType>
+                               <xsd:restriction base="xsd:string">
+                                       <xsd:length value="0"/>
+                               </xsd:restriction>
+                       </xsd:simpleType>
+               </xsd:union>
+       </xsd:simpleType>
+       
+       <xsd:simpleType name="dayTimeDuration">
+               <xsd:restriction base="xsd:duration">
+                       <xsd:pattern value="([\-]?P([0-9]+D(T([0-9]+(H([0-9]+(M([0-9]+(\.[0-9]*)?S
+                       |\.[0-9]+S)?|(\.[0-9]*)?S)|(\.[0-9]*)?S)?|M([0-9]+
+                       (\.[0-9]*)?S|\.[0-9]+S)?|(\.[0-9]*)?S)|\.[0-9]+S))?
+                       |T([0-9]+(H([0-9]+(M([0-9]+(\.[0-9]*)?S|\.[0-9]+S)?
+                       |(\.[0-9]*)?S)|(\.[0-9]*)?S)?|M([0-9]+(\.[0-9]*)?S|\.[0-9]+S)?
+                       |(\.[0-9]*)?S)|\.[0-9]+S)))?"/>
+               </xsd:restriction>
+       </xsd:simpleType>
+
+       <xsd:simpleType name="yearMonthDuration">
+               <xsd:restriction base="xsd:duration">
+                       <xsd:pattern value="([\-]?P[0-9]+(Y([0-9]+M)?|M))?"/>
+               </xsd:restriction>
+       </xsd:simpleType>
+       <xsd:simpleType name="email">
+               <xsd:restriction base="xsd:string">
+                       <xsd:pattern value="([A-Za-z0-9!#-'\*\+\-/=\?\^_`\{-~]+(\.[A-Za-z0-9!#-'\*\+\-/=\?\^_`\{-~]+)*@[A-Za-z0-9!#-'\*\+\-/=\?\^_`\{-~]+(\.[A-Za-z0-9!#-'\*\+\-/=\?\^_`\{-~]+)*)?"/>
+               </xsd:restriction>
+       </xsd:simpleType>
+
+       <xsd:simpleType name="card-number">
+               <xsd:annotation>
+                       <xsd:documentation>
+                       This type defines the basic lexical properties for a dataypte that can be used to represent
+                       various ID numbers such as for debit and credit cards.
+                       This type does not apply the Luhn checksum algorithm.
+                       </xsd:documentation>
+               </xsd:annotation>
+               <xsd:restriction base="xsd:string">
+                       <xsd:pattern value="[0-9]*"/>
+               </xsd:restriction>
+       </xsd:simpleType>
+
+
+</xsd:schema>
diff --git a/org.argeo.app.core/src/org/argeo/app/core/schemas/XMLSchema.dtd b/org.argeo.app.core/src/org/argeo/app/core/schemas/XMLSchema.dtd
new file mode 100644 (file)
index 0000000..e8e8f76
--- /dev/null
@@ -0,0 +1,402 @@
+<!-- DTD for XML Schemas: Part 1: Structures
+     Public Identifier: "-//W3C//DTD XMLSCHEMA 200102//EN"
+     Official Location: http://www.w3.org/2001/XMLSchema.dtd -->
+<!-- $Id: XMLSchema.dtd,v 1.31 2001/10/24 15:50:16 ht Exp $ -->
+<!-- Note this DTD is NOT normative, or even definitive. -->           <!--d-->
+<!-- prose copy in the structures REC is the definitive version -->    <!--d-->
+<!-- (which shouldn't differ from this one except for this -->         <!--d-->
+<!-- comment and entity expansions, but just in case) -->              <!--d-->
+<!-- With the exception of cases with multiple namespace
+     prefixes for the XML Schema namespace, any XML document which is
+     not valid per this DTD given redefinitions in its internal subset of the
+     'p' and 's' parameter entities below appropriate to its namespace
+     declaration of the XML Schema namespace is almost certainly not
+     a valid schema. -->
+
+<!-- The simpleType element and its constituent parts
+     are defined in XML Schema: Part 2: Datatypes -->
+<!ENTITY % xs-datatypes PUBLIC 'datatypes' 'datatypes.dtd' >
+
+<!ENTITY % p 'xs:'> <!-- can be overriden in the internal subset of a
+                         schema document to establish a different
+                         namespace prefix -->
+<!ENTITY % s ':xs'> <!-- if %p is defined (e.g. as foo:) then you must
+                         also define %s as the suffix for the appropriate
+                         namespace declaration (e.g. :foo) -->
+<!ENTITY % nds 'xmlns%s;'>
+
+<!-- Define all the element names, with optional prefix -->
+<!ENTITY % schema "%p;schema">
+<!ENTITY % complexType "%p;complexType">
+<!ENTITY % complexContent "%p;complexContent">
+<!ENTITY % simpleContent "%p;simpleContent">
+<!ENTITY % extension "%p;extension">
+<!ENTITY % element "%p;element">
+<!ENTITY % unique "%p;unique">
+<!ENTITY % key "%p;key">
+<!ENTITY % keyref "%p;keyref">
+<!ENTITY % selector "%p;selector">
+<!ENTITY % field "%p;field">
+<!ENTITY % group "%p;group">
+<!ENTITY % all "%p;all">
+<!ENTITY % choice "%p;choice">
+<!ENTITY % sequence "%p;sequence">
+<!ENTITY % any "%p;any">
+<!ENTITY % anyAttribute "%p;anyAttribute">
+<!ENTITY % attribute "%p;attribute">
+<!ENTITY % attributeGroup "%p;attributeGroup">
+<!ENTITY % include "%p;include">
+<!ENTITY % import "%p;import">
+<!ENTITY % redefine "%p;redefine">
+<!ENTITY % notation "%p;notation">
+
+<!-- annotation elements -->
+<!ENTITY % annotation "%p;annotation">
+<!ENTITY % appinfo "%p;appinfo">
+<!ENTITY % documentation "%p;documentation">
+
+<!-- Customisation entities for the ATTLIST of each element type.
+     Define one of these if your schema takes advantage of the
+     anyAttribute='##other' in the schema for schemas -->
+
+<!ENTITY % schemaAttrs ''>
+<!ENTITY % complexTypeAttrs ''>
+<!ENTITY % complexContentAttrs ''>
+<!ENTITY % simpleContentAttrs ''>
+<!ENTITY % extensionAttrs ''>
+<!ENTITY % elementAttrs ''>
+<!ENTITY % groupAttrs ''>
+<!ENTITY % allAttrs ''>
+<!ENTITY % choiceAttrs ''>
+<!ENTITY % sequenceAttrs ''>
+<!ENTITY % anyAttrs ''>
+<!ENTITY % anyAttributeAttrs ''>
+<!ENTITY % attributeAttrs ''>
+<!ENTITY % attributeGroupAttrs ''>
+<!ENTITY % uniqueAttrs ''>
+<!ENTITY % keyAttrs ''>
+<!ENTITY % keyrefAttrs ''>
+<!ENTITY % selectorAttrs ''>
+<!ENTITY % fieldAttrs ''>
+<!ENTITY % includeAttrs ''>
+<!ENTITY % importAttrs ''>
+<!ENTITY % redefineAttrs ''>
+<!ENTITY % notationAttrs ''>
+<!ENTITY % annotationAttrs ''>
+<!ENTITY % appinfoAttrs ''>
+<!ENTITY % documentationAttrs ''>
+
+<!ENTITY % complexDerivationSet "CDATA">
+      <!-- #all or space-separated list drawn from derivationChoice -->
+<!ENTITY % blockSet "CDATA">
+      <!-- #all or space-separated list drawn from
+                      derivationChoice + 'substitution' -->
+
+<!ENTITY % mgs '%all; | %choice; | %sequence;'>
+<!ENTITY % cs '%choice; | %sequence;'>
+<!ENTITY % formValues '(qualified|unqualified)'>
+
+
+<!ENTITY % attrDecls    '((%attribute;| %attributeGroup;)*,(%anyAttribute;)?)'>
+
+<!ENTITY % particleAndAttrs '((%mgs; | %group;)?, %attrDecls;)'>
+
+<!-- This is used in part2 -->
+<!ENTITY % restriction1 '((%mgs; | %group;)?)'>
+
+%xs-datatypes;
+
+<!-- the duplication below is to produce an unambiguous content model
+     which allows annotation everywhere -->
+<!ELEMENT %schema; ((%include; | %import; | %redefine; | %annotation;)*,
+                    ((%simpleType; | %complexType;
+                      | %element; | %attribute;
+                      | %attributeGroup; | %group;
+                      | %notation; ),
+                     (%annotation;)*)* )>
+<!ATTLIST %schema;
+   targetNamespace      %URIref;               #IMPLIED
+   version              CDATA                  #IMPLIED
+   %nds;                %URIref;               #FIXED 'http://www.w3.org/2001/XMLSchema'
+   xmlns                CDATA                  #IMPLIED
+   finalDefault         %complexDerivationSet; ''
+   blockDefault         %blockSet;             ''
+   id                   ID                     #IMPLIED
+   elementFormDefault   %formValues;           'unqualified'
+   attributeFormDefault %formValues;           'unqualified'
+   xml:lang             CDATA                  #IMPLIED
+   %schemaAttrs;>
+<!-- Note the xmlns declaration is NOT in the Schema for Schemas,
+     because at the Infoset level where schemas operate,
+     xmlns(:prefix) is NOT an attribute! -->
+<!-- The declaration of xmlns is a convenience for schema authors -->
+<!-- The id attribute here and below is for use in external references
+     from non-schemas using simple fragment identifiers.
+     It is NOT used for schema-to-schema reference, internal or
+     external. -->
+
+<!-- a type is a named content type specification which allows attribute
+     declarations-->
+<!-- -->
+
+<!ELEMENT %complexType; ((%annotation;)?,
+                         (%simpleContent;|%complexContent;|
+                          %particleAndAttrs;))>
+
+<!ATTLIST %complexType;
+          name      %NCName;                        #IMPLIED
+          id        ID                              #IMPLIED
+          abstract  %boolean;                       #IMPLIED
+          final     %complexDerivationSet;          #IMPLIED
+          block     %complexDerivationSet;          #IMPLIED
+          mixed (true|false) 'false'
+          %complexTypeAttrs;>
+
+<!-- particleAndAttrs is shorthand for a root type -->
+<!-- mixed is disallowed if simpleContent, overriden if complexContent
+     has one too. -->
+
+<!-- If anyAttribute appears in one or more referenced attributeGroups
+     and/or explicitly, the intersection of the permissions is used -->
+
+<!ELEMENT %complexContent; ((%annotation;)?, (%restriction;|%extension;))>
+<!ATTLIST %complexContent;
+          mixed (true|false) #IMPLIED
+          id    ID           #IMPLIED
+          %complexContentAttrs;>
+
+<!-- restriction should use the branch defined above, not the simple
+     one from part2; extension should use the full model  -->
+
+<!ELEMENT %simpleContent; ((%annotation;)?, (%restriction;|%extension;))>
+<!ATTLIST %simpleContent;
+          id    ID           #IMPLIED
+          %simpleContentAttrs;>
+
+<!-- restriction should use the simple branch from part2, not the 
+     one defined above; extension should have no particle  -->
+
+<!ELEMENT %extension; ((%annotation;)?, (%particleAndAttrs;))>
+<!ATTLIST %extension;
+          base  %QName;      #REQUIRED
+          id    ID           #IMPLIED
+          %extensionAttrs;>
+
+<!-- an element is declared by either:
+ a name and a type (either nested or referenced via the type attribute)
+ or a ref to an existing element declaration -->
+
+<!ELEMENT %element; ((%annotation;)?, (%complexType;| %simpleType;)?,
+                     (%unique; | %key; | %keyref;)*)>
+<!-- simpleType or complexType only if no type|ref attribute -->
+<!-- ref not allowed at top level -->
+<!ATTLIST %element;
+            name               %NCName;               #IMPLIED
+            id                 ID                     #IMPLIED
+            ref                %QName;                #IMPLIED
+            type               %QName;                #IMPLIED
+            minOccurs          %nonNegativeInteger;   #IMPLIED
+            maxOccurs          CDATA                  #IMPLIED
+            nillable           %boolean;              #IMPLIED
+            substitutionGroup  %QName;                #IMPLIED
+            abstract           %boolean;              #IMPLIED
+            final              %complexDerivationSet; #IMPLIED
+            block              %blockSet;             #IMPLIED
+            default            CDATA                  #IMPLIED
+            fixed              CDATA                  #IMPLIED
+            form               %formValues;           #IMPLIED
+            %elementAttrs;>
+<!-- type and ref are mutually exclusive.
+     name and ref are mutually exclusive, one is required -->
+<!-- In the absence of type AND ref, type defaults to type of
+     substitutionGroup, if any, else the ur-type, i.e. unconstrained -->
+<!-- default and fixed are mutually exclusive -->
+
+<!ELEMENT %group; ((%annotation;)?,(%mgs;)?)>
+<!ATTLIST %group; 
+          name        %NCName;               #IMPLIED
+          ref         %QName;                #IMPLIED
+          minOccurs   %nonNegativeInteger;   #IMPLIED
+          maxOccurs   CDATA                  #IMPLIED
+          id          ID                     #IMPLIED
+          %groupAttrs;>
+
+<!ELEMENT %all; ((%annotation;)?, (%element;)*)>
+<!ATTLIST %all;
+          minOccurs   (1)                    #IMPLIED
+          maxOccurs   (1)                    #IMPLIED
+          id          ID                     #IMPLIED
+          %allAttrs;>
+
+<!ELEMENT %choice; ((%annotation;)?, (%element;| %group;| %cs; | %any;)*)>
+<!ATTLIST %choice;
+          minOccurs   %nonNegativeInteger;   #IMPLIED
+          maxOccurs   CDATA                  #IMPLIED
+          id          ID                     #IMPLIED
+          %choiceAttrs;>
+
+<!ELEMENT %sequence; ((%annotation;)?, (%element;| %group;| %cs; | %any;)*)>
+<!ATTLIST %sequence;
+          minOccurs   %nonNegativeInteger;   #IMPLIED
+          maxOccurs   CDATA                  #IMPLIED
+          id          ID                     #IMPLIED
+          %sequenceAttrs;>
+
+<!-- an anonymous grouping in a model, or
+     a top-level named group definition, or a reference to same -->
+
+<!-- Note that if order is 'all', group is not allowed inside.
+     If order is 'all' THIS group must be alone (or referenced alone) at
+     the top level of a content model -->
+<!-- If order is 'all', minOccurs==maxOccurs==1 on element/any inside -->
+<!-- Should allow minOccurs=0 inside order='all' . . . -->
+
+<!ELEMENT %any; (%annotation;)?>
+<!ATTLIST %any;
+            namespace       CDATA                  '##any'
+            processContents (skip|lax|strict)      'strict'
+            minOccurs       %nonNegativeInteger;   '1'
+            maxOccurs       CDATA                  '1'
+            id              ID                     #IMPLIED
+            %anyAttrs;>
+
+<!-- namespace is interpreted as follows:
+                  ##any      - - any non-conflicting WFXML at all
+
+                  ##other    - - any non-conflicting WFXML from namespace other
+                                  than targetNamespace
+
+                  ##local    - - any unqualified non-conflicting WFXML/attribute
+                  one or     - - any non-conflicting WFXML from
+                  more URI        the listed namespaces
+                  references
+
+                  ##targetNamespace ##local may appear in the above list,
+                    with the obvious meaning -->
+
+<!ELEMENT %anyAttribute; (%annotation;)?>
+<!ATTLIST %anyAttribute;
+            namespace       CDATA              '##any'
+            processContents (skip|lax|strict)  'strict'
+            id              ID                 #IMPLIED
+            %anyAttributeAttrs;>
+<!-- namespace is interpreted as for 'any' above -->
+
+<!-- simpleType only if no type|ref attribute -->
+<!-- ref not allowed at top level, name iff at top level -->
+<!ELEMENT %attribute; ((%annotation;)?, (%simpleType;)?)>
+<!ATTLIST %attribute;
+          name      %NCName;      #IMPLIED
+          id        ID            #IMPLIED
+          ref       %QName;       #IMPLIED
+          type      %QName;       #IMPLIED
+          use       (prohibited|optional|required) #IMPLIED
+          default   CDATA         #IMPLIED
+          fixed     CDATA         #IMPLIED
+          form      %formValues;  #IMPLIED
+          %attributeAttrs;>
+<!-- type and ref are mutually exclusive.
+     name and ref are mutually exclusive, one is required -->
+<!-- default for use is optional when nested, none otherwise -->
+<!-- default and fixed are mutually exclusive -->
+<!-- type attr and simpleType content are mutually exclusive -->
+
+<!-- an attributeGroup is a named collection of attribute decls, or a
+     reference thereto -->
+<!ELEMENT %attributeGroup; ((%annotation;)?,
+                       (%attribute; | %attributeGroup;)*,
+                       (%anyAttribute;)?) >
+<!ATTLIST %attributeGroup;
+                 name       %NCName;       #IMPLIED
+                 id         ID             #IMPLIED
+                 ref        %QName;        #IMPLIED
+                 %attributeGroupAttrs;>
+
+<!-- ref iff no content, no name.  ref iff not top level -->
+
+<!-- better reference mechanisms -->
+<!ELEMENT %unique; ((%annotation;)?, %selector;, (%field;)+)>
+<!ATTLIST %unique;
+          name     %NCName;       #REQUIRED
+         id       ID             #IMPLIED
+         %uniqueAttrs;>
+
+<!ELEMENT %key;    ((%annotation;)?, %selector;, (%field;)+)>
+<!ATTLIST %key;
+          name     %NCName;       #REQUIRED
+         id       ID             #IMPLIED
+         %keyAttrs;>
+
+<!ELEMENT %keyref; ((%annotation;)?, %selector;, (%field;)+)>
+<!ATTLIST %keyref;
+          name     %NCName;       #REQUIRED
+         refer    %QName;        #REQUIRED
+         id       ID             #IMPLIED
+         %keyrefAttrs;>
+
+<!ELEMENT %selector; ((%annotation;)?)>
+<!ATTLIST %selector;
+          xpath %XPathExpr; #REQUIRED
+          id    ID          #IMPLIED
+          %selectorAttrs;>
+<!ELEMENT %field; ((%annotation;)?)>
+<!ATTLIST %field;
+          xpath %XPathExpr; #REQUIRED
+          id    ID          #IMPLIED
+          %fieldAttrs;>
+
+<!-- Schema combination mechanisms -->
+<!ELEMENT %include; (%annotation;)?>
+<!ATTLIST %include;
+          schemaLocation %URIref; #REQUIRED
+          id             ID       #IMPLIED
+          %includeAttrs;>
+
+<!ELEMENT %import; (%annotation;)?>
+<!ATTLIST %import;
+          namespace      %URIref; #IMPLIED
+          schemaLocation %URIref; #IMPLIED
+          id             ID       #IMPLIED
+          %importAttrs;>
+
+<!ELEMENT %redefine; (%annotation; | %simpleType; | %complexType; |
+                      %attributeGroup; | %group;)*>
+<!ATTLIST %redefine;
+          schemaLocation %URIref; #REQUIRED
+          id             ID       #IMPLIED
+          %redefineAttrs;>
+
+<!ELEMENT %notation; (%annotation;)?>
+<!ATTLIST %notation;
+         name        %NCName;    #REQUIRED
+         id          ID          #IMPLIED
+         public      CDATA       #REQUIRED
+         system      %URIref;    #IMPLIED
+         %notationAttrs;>
+
+<!-- Annotation is either application information or documentation -->
+<!-- By having these here they are available for datatypes as well
+     as all the structures elements -->
+
+<!ELEMENT %annotation; (%appinfo; | %documentation;)*>
+<!ATTLIST %annotation; %annotationAttrs;>
+
+<!-- User must define annotation elements in internal subset for this
+     to work -->
+<!ELEMENT %appinfo; ANY>   <!-- too restrictive -->
+<!ATTLIST %appinfo;
+          source     %URIref;      #IMPLIED
+          id         ID         #IMPLIED
+          %appinfoAttrs;>
+<!ELEMENT %documentation; ANY>   <!-- too restrictive -->
+<!ATTLIST %documentation;
+          source     %URIref;   #IMPLIED
+          id         ID         #IMPLIED
+          xml:lang   CDATA      #IMPLIED
+          %documentationAttrs;>
+
+<!NOTATION XMLSchemaStructures PUBLIC
+           'structures' 'http://www.w3.org/2001/XMLSchema.xsd' >
+<!NOTATION XML PUBLIC
+           'REC-xml-1998-0210' 'http://www.w3.org/TR/1998/REC-xml-19980210' >
diff --git a/org.argeo.app.core/src/org/argeo/app/core/schemas/XMLSchema.xsd b/org.argeo.app.core/src/org/argeo/app/core/schemas/XMLSchema.xsd
new file mode 100644 (file)
index 0000000..12c2209
--- /dev/null
@@ -0,0 +1,2534 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- XML Schema schema for XML Schemas: Part 1: Structures -->
+<!-- Note this schema is NOT the normative structures schema. -->
+<!-- The prose copy in the structures REC is the normative -->
+<!-- version (which shouldn't differ from this one except for -->
+<!-- this comment and entity expansions, but just in case -->
+<!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN" "XMLSchema.dtd" [
+
+<!-- provide ID type information even for parsers which only read the
+     internal subset -->
+<!ATTLIST xs:schema          id  ID  #IMPLIED>
+<!ATTLIST xs:complexType     id  ID  #IMPLIED>
+<!ATTLIST xs:complexContent  id  ID  #IMPLIED>
+<!ATTLIST xs:simpleContent   id  ID  #IMPLIED>
+<!ATTLIST xs:extension       id  ID  #IMPLIED>
+<!ATTLIST xs:element         id  ID  #IMPLIED>
+<!ATTLIST xs:group           id  ID  #IMPLIED> 
+<!ATTLIST xs:all             id  ID  #IMPLIED>
+<!ATTLIST xs:choice          id  ID  #IMPLIED>
+<!ATTLIST xs:sequence        id  ID  #IMPLIED>
+<!ATTLIST xs:any             id  ID  #IMPLIED>
+<!ATTLIST xs:anyAttribute    id  ID  #IMPLIED>
+<!ATTLIST xs:attribute       id  ID  #IMPLIED>
+<!ATTLIST xs:attributeGroup  id  ID  #IMPLIED>
+<!ATTLIST xs:unique          id  ID  #IMPLIED>
+<!ATTLIST xs:key             id  ID  #IMPLIED>
+<!ATTLIST xs:keyref          id  ID  #IMPLIED>
+<!ATTLIST xs:selector        id  ID  #IMPLIED>
+<!ATTLIST xs:field           id  ID  #IMPLIED>
+<!ATTLIST xs:include         id  ID  #IMPLIED>
+<!ATTLIST xs:import          id  ID  #IMPLIED>
+<!ATTLIST xs:redefine        id  ID  #IMPLIED>
+<!ATTLIST xs:notation        id  ID  #IMPLIED>
+<!--
+     keep this schema XML1.0 DTD valid
+  -->
+        <!ENTITY % schemaAttrs 'xmlns:hfp CDATA #IMPLIED'>
+
+        <!ELEMENT hfp:hasFacet EMPTY>
+        <!ATTLIST hfp:hasFacet
+                name NMTOKEN #REQUIRED>
+
+        <!ELEMENT hfp:hasProperty EMPTY>
+        <!ATTLIST hfp:hasProperty
+                name NMTOKEN #REQUIRED
+                value CDATA #REQUIRED>
+<!--
+        Make sure that processors that do not read the external
+        subset will know about the various IDs we declare
+  -->
+        <!ATTLIST xs:simpleType id ID #IMPLIED>
+        <!ATTLIST xs:maxExclusive id ID #IMPLIED>
+        <!ATTLIST xs:minExclusive id ID #IMPLIED>
+        <!ATTLIST xs:maxInclusive id ID #IMPLIED>
+        <!ATTLIST xs:minInclusive id ID #IMPLIED>
+        <!ATTLIST xs:totalDigits id ID #IMPLIED>
+        <!ATTLIST xs:fractionDigits id ID #IMPLIED>
+        <!ATTLIST xs:length id ID #IMPLIED>
+        <!ATTLIST xs:minLength id ID #IMPLIED>
+        <!ATTLIST xs:maxLength id ID #IMPLIED>
+        <!ATTLIST xs:enumeration id ID #IMPLIED>
+        <!ATTLIST xs:pattern id ID #IMPLIED>
+        <!ATTLIST xs:appinfo id ID #IMPLIED>
+        <!ATTLIST xs:documentation id ID #IMPLIED>
+        <!ATTLIST xs:list id ID #IMPLIED>
+        <!ATTLIST xs:union id ID #IMPLIED>
+        ]>
+<xs:schema targetNamespace="http://www.w3.org/2001/XMLSchema" blockDefault="#all" elementFormDefault="qualified" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xml:lang="EN" xmlns:hfp="http://www.w3.org/2001/XMLSchema-hasFacetAndProperty">
+ <xs:annotation>
+  <xs:documentation>
+    Part 1 version: Id: structures.xsd,v 1.2 2004/01/15 11:34:25 ht Exp 
+    Part 2 version: Id: datatypes.xsd,v 1.3 2004/01/23 18:11:13 ht Exp 
+  </xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/2004/PER-xmlschema-1-20040318/structures.html">
+   The schema corresponding to this document is normative,
+   with respect to the syntactic constraints it expresses in the
+   XML Schema language.  The documentation (within &lt;documentation> elements)
+   below, is not normative, but rather highlights important aspects of
+   the W3C Recommendation of which this is a part</xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+   <xs:documentation>
+   The simpleType element and all of its members are defined
+      towards the end of this schema document</xs:documentation>
+ </xs:annotation>
+
+ <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd">
+   <xs:annotation>
+     <xs:documentation>
+       Get access to the xml: attribute groups for xml:lang
+       as declared on 'schema' and 'documentation' below
+     </xs:documentation>
+   </xs:annotation>
+ </xs:import>
+
+ <xs:complexType name="openAttrs">
+   <xs:annotation>
+     <xs:documentation>
+       This type is extended by almost all schema types
+       to allow attributes from other namespaces to be
+       added to user schemas.
+     </xs:documentation>
+   </xs:annotation>
+   <xs:complexContent>
+     <xs:restriction base="xs:anyType">
+       <xs:anyAttribute namespace="##other" processContents="lax"/>
+     </xs:restriction>
+   </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="annotated">
+   <xs:annotation>
+     <xs:documentation>
+       This type is extended by all types which allow annotation
+       other than &lt;schema&gt; itself
+     </xs:documentation>
+   </xs:annotation>
+   <xs:complexContent>
+     <xs:extension base="xs:openAttrs">
+       <xs:sequence>
+         <xs:element ref="xs:annotation" minOccurs="0"/>
+       </xs:sequence>
+       <xs:attribute name="id" type="xs:ID"/>
+     </xs:extension>
+   </xs:complexContent>
+ </xs:complexType>
+
+ <xs:group name="schemaTop">
+  <xs:annotation>
+   <xs:documentation>
+   This group is for the
+   elements which occur freely at the top level of schemas.
+   All of their types are based on the "annotated" type by extension.</xs:documentation>
+  </xs:annotation>
+  <xs:choice>
+   <xs:group ref="xs:redefinable"/>
+   <xs:element ref="xs:element"/>
+   <xs:element ref="xs:attribute"/>
+   <xs:element ref="xs:notation"/>
+  </xs:choice>
+ </xs:group>
+ <xs:group name="redefinable">
+  <xs:annotation>
+   <xs:documentation>
+   This group is for the
+   elements which can self-redefine (see &lt;redefine> below).</xs:documentation>
+  </xs:annotation>
+  <xs:choice>
+   <xs:element ref="xs:simpleType"/>
+   <xs:element ref="xs:complexType"/>
+   <xs:element ref="xs:group"/>
+   <xs:element ref="xs:attributeGroup"/>
+  </xs:choice>
+ </xs:group>
+
+ <xs:simpleType name="formChoice">
+  <xs:annotation>
+   <xs:documentation>
+   A utility type, not for public use</xs:documentation>
+  </xs:annotation>
+  <xs:restriction base="xs:NMTOKEN">
+   <xs:enumeration value="qualified"/>
+   <xs:enumeration value="unqualified"/>
+  </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="reducedDerivationControl">
+  <xs:annotation>
+   <xs:documentation>
+   A utility type, not for public use</xs:documentation>
+  </xs:annotation>
+  <xs:restriction base="xs:derivationControl">
+   <xs:enumeration value="extension"/>
+   <xs:enumeration value="restriction"/>
+  </xs:restriction>
+ </xs:simpleType>
+
+ <xs:simpleType name="derivationSet">
+  <xs:annotation>
+   <xs:documentation>
+   A utility type, not for public use</xs:documentation>
+   <xs:documentation>
+   #all or (possibly empty) subset of {extension, restriction}</xs:documentation>
+  </xs:annotation>
+  <xs:union>
+   <xs:simpleType>    
+    <xs:restriction base="xs:token">
+     <xs:enumeration value="#all"/>
+    </xs:restriction>
+   </xs:simpleType>
+   <xs:simpleType>
+    <xs:list itemType="xs:reducedDerivationControl"/>
+   </xs:simpleType>
+  </xs:union>
+ </xs:simpleType>
+
+ <xs:simpleType name="typeDerivationControl">
+  <xs:annotation>
+   <xs:documentation>
+   A utility type, not for public use</xs:documentation>
+  </xs:annotation>
+  <xs:restriction base="xs:derivationControl">
+   <xs:enumeration value="extension"/>
+   <xs:enumeration value="restriction"/>
+   <xs:enumeration value="list"/>
+   <xs:enumeration value="union"/>
+  </xs:restriction>
+ </xs:simpleType>
+
+  <xs:simpleType name="fullDerivationSet">
+  <xs:annotation>
+   <xs:documentation>
+   A utility type, not for public use</xs:documentation>
+   <xs:documentation>
+   #all or (possibly empty) subset of {extension, restriction, list, union}</xs:documentation>
+  </xs:annotation>
+  <xs:union>
+   <xs:simpleType>    
+    <xs:restriction base="xs:token">
+     <xs:enumeration value="#all"/>
+    </xs:restriction>
+   </xs:simpleType>
+   <xs:simpleType>
+    <xs:list itemType="xs:typeDerivationControl"/>
+   </xs:simpleType>
+  </xs:union>
+ </xs:simpleType>
+
+ <xs:element name="schema" id="schema">
+  <xs:annotation>
+    <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-schema"/>
+  </xs:annotation>
+  <xs:complexType>
+   <xs:complexContent>
+    <xs:extension base="xs:openAttrs">
+     <xs:sequence>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+       <xs:element ref="xs:include"/>
+       <xs:element ref="xs:import"/>
+       <xs:element ref="xs:redefine"/>
+       <xs:element ref="xs:annotation"/>
+      </xs:choice>
+      <xs:sequence minOccurs="0" maxOccurs="unbounded">
+       <xs:group ref="xs:schemaTop"/>
+       <xs:element ref="xs:annotation" minOccurs="0" maxOccurs="unbounded"/>
+      </xs:sequence>
+     </xs:sequence>
+     <xs:attribute name="targetNamespace" type="xs:anyURI"/>
+     <xs:attribute name="version" type="xs:token"/>
+     <xs:attribute name="finalDefault" type="xs:fullDerivationSet" use="optional" default=""/>
+     <xs:attribute name="blockDefault" type="xs:blockSet" use="optional" default=""/>
+     <xs:attribute name="attributeFormDefault" type="xs:formChoice" use="optional" default="unqualified"/>
+     <xs:attribute name="elementFormDefault" type="xs:formChoice" use="optional" default="unqualified"/>
+     <xs:attribute name="id" type="xs:ID"/>
+     <xs:attribute ref="xml:lang"/>
+    </xs:extension>
+   </xs:complexContent>
+  </xs:complexType>
+
+  <xs:key name="element">
+   <xs:selector xpath="xs:element"/>
+   <xs:field xpath="@name"/>
+  </xs:key>
+
+  <xs:key name="attribute">
+   <xs:selector xpath="xs:attribute"/>
+   <xs:field xpath="@name"/>
+  </xs:key>
+
+  <xs:key name="type">
+   <xs:selector xpath="xs:complexType|xs:simpleType"/>
+   <xs:field xpath="@name"/>
+  </xs:key>
+  <xs:key name="group">
+   <xs:selector xpath="xs:group"/>
+   <xs:field xpath="@name"/>
+  </xs:key>
+  <xs:key name="attributeGroup">
+   <xs:selector xpath="xs:attributeGroup"/>
+   <xs:field xpath="@name"/>
+  </xs:key>
+  <xs:key name="notation">
+   <xs:selector xpath="xs:notation"/>
+   <xs:field xpath="@name"/>
+  </xs:key>
+
+  <xs:key name="identityConstraint">
+   <xs:selector xpath=".//xs:key|.//xs:unique|.//xs:keyref"/>
+   <xs:field xpath="@name"/>
+  </xs:key>
+
+ </xs:element>
+
+ <xs:simpleType name="allNNI">
+  <xs:annotation><xs:documentation>
+   for maxOccurs</xs:documentation></xs:annotation>
+  <xs:union memberTypes="xs:nonNegativeInteger">
+   <xs:simpleType>
+    <xs:restriction base="xs:NMTOKEN">
+     <xs:enumeration value="unbounded"/>
+    </xs:restriction>
+   </xs:simpleType>
+  </xs:union>
+ </xs:simpleType>
+
+ <xs:attributeGroup name="occurs">
+  <xs:annotation><xs:documentation>
+   for all particles</xs:documentation></xs:annotation>
+  <xs:attribute name="minOccurs" type="xs:nonNegativeInteger" use="optional" default="1"/>
+  <xs:attribute name="maxOccurs" type="xs:allNNI" use="optional" default="1"/>
+ </xs:attributeGroup>
+
+ <xs:attributeGroup name="defRef">
+  <xs:annotation><xs:documentation>
+   for element, group and attributeGroup,
+   which both define and reference</xs:documentation></xs:annotation>
+  <xs:attribute name="name" type="xs:NCName"/>
+  <xs:attribute name="ref" type="xs:QName"/>
+ </xs:attributeGroup>
+
+ <xs:group name="typeDefParticle">
+  <xs:annotation>
+    <xs:documentation>
+   'complexType' uses this</xs:documentation></xs:annotation>
+  <xs:choice>
+   <xs:element name="group" type="xs:groupRef"/>
+   <xs:element ref="xs:all"/>
+   <xs:element ref="xs:choice"/>
+   <xs:element ref="xs:sequence"/>
+  </xs:choice>
+ </xs:group>
+
+ <xs:group name="nestedParticle">
+  <xs:choice>
+   <xs:element name="element" type="xs:localElement"/>
+   <xs:element name="group" type="xs:groupRef"/>
+   <xs:element ref="xs:choice"/>
+   <xs:element ref="xs:sequence"/>
+   <xs:element ref="xs:any"/>
+  </xs:choice>
+ </xs:group>
+ <xs:group name="particle">
+  <xs:choice>
+   <xs:element name="element" type="xs:localElement"/>
+   <xs:element name="group" type="xs:groupRef"/>
+   <xs:element ref="xs:all"/>
+   <xs:element ref="xs:choice"/>
+   <xs:element ref="xs:sequence"/>
+   <xs:element ref="xs:any"/>
+  </xs:choice>
+ </xs:group>
+ <xs:complexType name="attribute">
+  <xs:complexContent>
+   <xs:extension base="xs:annotated">
+    <xs:sequence>
+     <xs:element name="simpleType" minOccurs="0" type="xs:localSimpleType"/>
+    </xs:sequence>
+    <xs:attributeGroup ref="xs:defRef"/>
+    <xs:attribute name="type" type="xs:QName"/>
+    <xs:attribute name="use" use="optional" default="optional">
+     <xs:simpleType>
+      <xs:restriction base="xs:NMTOKEN">
+       <xs:enumeration value="prohibited"/>
+       <xs:enumeration value="optional"/>
+       <xs:enumeration value="required"/>
+      </xs:restriction>
+     </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="default" type="xs:string"/>
+    <xs:attribute name="fixed" type="xs:string"/>
+    <xs:attribute name="form" type="xs:formChoice"/>
+   </xs:extension>
+  </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="topLevelAttribute">
+  <xs:complexContent>
+   <xs:restriction base="xs:attribute">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+     <xs:element name="simpleType" minOccurs="0" type="xs:localSimpleType"/>
+    </xs:sequence>
+    <xs:attribute name="ref" use="prohibited"/>
+    <xs:attribute name="form" use="prohibited"/>
+    <xs:attribute name="use" use="prohibited"/>
+    <xs:attribute name="name" use="required" type="xs:NCName"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+
+ <xs:group name="attrDecls">
+  <xs:sequence>
+   <xs:choice minOccurs="0" maxOccurs="unbounded">
+    <xs:element name="attribute" type="xs:attribute"/>
+    <xs:element name="attributeGroup" type="xs:attributeGroupRef"/>
+   </xs:choice>
+   <xs:element ref="xs:anyAttribute" minOccurs="0"/>
+  </xs:sequence>
+ </xs:group>
+
+ <xs:element name="anyAttribute" type="xs:wildcard" id="anyAttribute">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-anyAttribute"/>
+  </xs:annotation>
+ </xs:element>
+
+ <xs:group name="complexTypeModel">
+  <xs:choice>
+      <xs:element ref="xs:simpleContent"/>
+      <xs:element ref="xs:complexContent"/>
+      <xs:sequence>
+       <xs:annotation>
+        <xs:documentation>
+   This branch is short for
+   &lt;complexContent>
+   &lt;restriction base="xs:anyType">
+   ...
+   &lt;/restriction>
+   &lt;/complexContent></xs:documentation>
+       </xs:annotation>
+       <xs:group ref="xs:typeDefParticle" minOccurs="0"/>
+       <xs:group ref="xs:attrDecls"/>
+      </xs:sequence>
+  </xs:choice>
+ </xs:group>
+
+ <xs:complexType name="complexType" abstract="true">
+  <xs:complexContent>
+   <xs:extension base="xs:annotated">
+    <xs:group ref="xs:complexTypeModel"/>
+    <xs:attribute name="name" type="xs:NCName">
+     <xs:annotation>
+      <xs:documentation>
+      Will be restricted to required or forbidden</xs:documentation>
+     </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="mixed" type="xs:boolean" use="optional" default="false">
+     <xs:annotation>
+      <xs:documentation>
+      Not allowed if simpleContent child is chosen.
+      May be overriden by setting on complexContent child.</xs:documentation>
+    </xs:annotation>
+    </xs:attribute>
+    <xs:attribute name="abstract" type="xs:boolean" use="optional" default="false"/>
+    <xs:attribute name="final" type="xs:derivationSet"/>
+    <xs:attribute name="block" type="xs:derivationSet"/>
+   </xs:extension>
+  </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="topLevelComplexType">
+  <xs:complexContent>
+   <xs:restriction base="xs:complexType">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+     <xs:group ref="xs:complexTypeModel"/>
+    </xs:sequence>
+    <xs:attribute name="name" type="xs:NCName" use="required"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="localComplexType">
+  <xs:complexContent>
+   <xs:restriction base="xs:complexType">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+     <xs:group ref="xs:complexTypeModel"/>
+    </xs:sequence>
+    <xs:attribute name="name" use="prohibited"/>
+    <xs:attribute name="abstract" use="prohibited"/>
+    <xs:attribute name="final" use="prohibited"/>
+    <xs:attribute name="block" use="prohibited"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="restrictionType">
+  <xs:complexContent>
+   <xs:extension base="xs:annotated">
+    <xs:sequence>
+     <xs:choice minOccurs="0">
+      <xs:group ref="xs:typeDefParticle"/>
+      <xs:group ref="xs:simpleRestrictionModel"/>
+     </xs:choice>
+     <xs:group ref="xs:attrDecls"/>
+    </xs:sequence>
+    <xs:attribute name="base" type="xs:QName" use="required"/>
+   </xs:extension>
+  </xs:complexContent>       
+ </xs:complexType>
+
+ <xs:complexType name="complexRestrictionType">
+  <xs:complexContent>
+   <xs:restriction base="xs:restrictionType">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+     <xs:choice minOccurs="0">
+      <xs:annotation>
+       <xs:documentation>This choice is added simply to
+                   make this a valid restriction per the REC</xs:documentation>
+      </xs:annotation>
+      <xs:group ref="xs:typeDefParticle"/>
+     </xs:choice>
+     <xs:group ref="xs:attrDecls"/>
+    </xs:sequence>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>       
+ </xs:complexType>
+
+ <xs:complexType name="extensionType">
+  <xs:complexContent>
+   <xs:extension base="xs:annotated">
+    <xs:sequence>
+     <xs:group ref="xs:typeDefParticle" minOccurs="0"/>
+     <xs:group ref="xs:attrDecls"/>
+    </xs:sequence>
+    <xs:attribute name="base" type="xs:QName" use="required"/>
+   </xs:extension>
+  </xs:complexContent>       
+ </xs:complexType>
+
+ <xs:element name="complexContent" id="complexContent">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-complexContent"/>
+  </xs:annotation>
+  <xs:complexType>
+   <xs:complexContent>
+    <xs:extension base="xs:annotated">
+     <xs:choice>
+      <xs:element name="restriction" type="xs:complexRestrictionType"/>
+      <xs:element name="extension" type="xs:extensionType"/>
+     </xs:choice>     
+     <xs:attribute name="mixed" type="xs:boolean">
+      <xs:annotation>
+       <xs:documentation>
+       Overrides any setting on complexType parent.</xs:documentation>
+      </xs:annotation>
+    </xs:attribute>
+    </xs:extension>
+   </xs:complexContent>
+  </xs:complexType>
+ </xs:element>
+
+ <xs:complexType name="simpleRestrictionType">
+  <xs:complexContent>
+   <xs:restriction base="xs:restrictionType">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+     <xs:choice minOccurs="0">
+      <xs:annotation>
+       <xs:documentation>This choice is added simply to
+                   make this a valid restriction per the REC</xs:documentation>
+      </xs:annotation>
+      <xs:group ref="xs:simpleRestrictionModel"/>
+     </xs:choice>
+     <xs:group ref="xs:attrDecls"/>
+    </xs:sequence>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="simpleExtensionType">
+  <xs:complexContent>
+   <xs:restriction base="xs:extensionType">
+    <xs:sequence>
+     <xs:annotation>
+      <xs:documentation>
+      No typeDefParticle group reference</xs:documentation>
+     </xs:annotation>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+     <xs:group ref="xs:attrDecls"/>
+    </xs:sequence>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+
+ <xs:element name="simpleContent" id="simpleContent">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-simpleContent"/>
+  </xs:annotation>
+  <xs:complexType>
+   <xs:complexContent>
+    <xs:extension base="xs:annotated">
+     <xs:choice>
+      <xs:element name="restriction" type="xs:simpleRestrictionType"/>
+      <xs:element name="extension" type="xs:simpleExtensionType"/>
+     </xs:choice>
+    </xs:extension>
+   </xs:complexContent>
+  </xs:complexType>
+ </xs:element>
+ <xs:element name="complexType" type="xs:topLevelComplexType" id="complexType">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-complexType"/>
+  </xs:annotation>
+ </xs:element>
+
+
+  <xs:simpleType name="blockSet">
+   <xs:annotation>
+    <xs:documentation>
+    A utility type, not for public use</xs:documentation>
+    <xs:documentation>
+    #all or (possibly empty) subset of {substitution, extension,
+    restriction}</xs:documentation>
+   </xs:annotation>
+   <xs:union>
+    <xs:simpleType>    
+     <xs:restriction base="xs:token">
+      <xs:enumeration value="#all"/>
+     </xs:restriction>
+    </xs:simpleType>
+    <xs:simpleType>
+     <xs:list>
+      <xs:simpleType>
+       <xs:restriction base="xs:derivationControl">
+        <xs:enumeration value="extension"/>
+        <xs:enumeration value="restriction"/>
+        <xs:enumeration value="substitution"/>
+       </xs:restriction>
+      </xs:simpleType>
+     </xs:list>
+    </xs:simpleType>
+   </xs:union>  
+  </xs:simpleType>
+
+ <xs:complexType name="element" abstract="true">
+  <xs:annotation>
+   <xs:documentation>
+   The element element can be used either
+   at the top level to define an element-type binding globally,
+   or within a content model to either reference a globally-defined
+   element or type or declare an element-type binding locally.
+   The ref form is not allowed at the top level.</xs:documentation>
+  </xs:annotation>
+
+  <xs:complexContent>
+   <xs:extension base="xs:annotated">
+    <xs:sequence>
+     <xs:choice minOccurs="0">
+      <xs:element name="simpleType" type="xs:localSimpleType"/>
+      <xs:element name="complexType" type="xs:localComplexType"/>
+     </xs:choice>
+     <xs:group ref="xs:identityConstraint" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attributeGroup ref="xs:defRef"/>
+    <xs:attribute name="type" type="xs:QName"/>
+    <xs:attribute name="substitutionGroup" type="xs:QName"/>
+    <xs:attributeGroup ref="xs:occurs"/>
+    <xs:attribute name="default" type="xs:string"/>
+    <xs:attribute name="fixed" type="xs:string"/>
+    <xs:attribute name="nillable" type="xs:boolean" use="optional" default="false"/>
+    <xs:attribute name="abstract" type="xs:boolean" use="optional" default="false"/>
+    <xs:attribute name="final" type="xs:derivationSet"/>
+    <xs:attribute name="block" type="xs:blockSet"/>
+    <xs:attribute name="form" type="xs:formChoice"/>
+   </xs:extension>
+  </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="topLevelElement">
+  <xs:complexContent>
+   <xs:restriction base="xs:element">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+     <xs:choice minOccurs="0">
+      <xs:element name="simpleType" type="xs:localSimpleType"/>
+      <xs:element name="complexType" type="xs:localComplexType"/>
+     </xs:choice>
+     <xs:group ref="xs:identityConstraint" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attribute name="ref" use="prohibited"/>
+    <xs:attribute name="form" use="prohibited"/>
+    <xs:attribute name="minOccurs" use="prohibited"/>
+    <xs:attribute name="maxOccurs" use="prohibited"/>
+    <xs:attribute name="name" use="required" type="xs:NCName"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="localElement">
+  <xs:complexContent>
+   <xs:restriction base="xs:element">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+     <xs:choice minOccurs="0">
+      <xs:element name="simpleType" type="xs:localSimpleType"/>
+      <xs:element name="complexType" type="xs:localComplexType"/>
+     </xs:choice>
+     <xs:group ref="xs:identityConstraint" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attribute name="substitutionGroup" use="prohibited"/>
+    <xs:attribute name="final" use="prohibited"/>
+    <xs:attribute name="abstract" use="prohibited"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+
+ <xs:element name="element" type="xs:topLevelElement" id="element">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-element"/>
+  </xs:annotation>
+ </xs:element>
+
+ <xs:complexType name="group" abstract="true">
+  <xs:annotation>
+   <xs:documentation>
+   group type for explicit groups, named top-level groups and
+   group references</xs:documentation>
+  </xs:annotation>
+  <xs:complexContent>
+   <xs:extension base="xs:annotated">
+    <xs:group ref="xs:particle" minOccurs="0" maxOccurs="unbounded"/>
+    <xs:attributeGroup ref="xs:defRef"/>
+    <xs:attributeGroup ref="xs:occurs"/>
+   </xs:extension>
+  </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="realGroup">
+  <xs:complexContent>
+   <xs:restriction base="xs:group">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+     <xs:choice minOccurs="0" maxOccurs="1">
+      <xs:element ref="xs:all"/>
+      <xs:element ref="xs:choice"/>
+      <xs:element ref="xs:sequence"/>
+     </xs:choice>
+    </xs:sequence>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="namedGroup">
+  <xs:complexContent>
+   <xs:restriction base="xs:realGroup">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+     <xs:choice minOccurs="1" maxOccurs="1">
+      <xs:element name="all">
+       <xs:complexType>
+        <xs:complexContent>
+         <xs:restriction base="xs:all">
+          <xs:group ref="xs:allModel"/>
+          <xs:attribute name="minOccurs" use="prohibited"/>
+          <xs:attribute name="maxOccurs" use="prohibited"/>
+          <xs:anyAttribute namespace="##other" processContents="lax"/>
+         </xs:restriction>
+        </xs:complexContent>
+       </xs:complexType>
+      </xs:element>
+      <xs:element name="choice" type="xs:simpleExplicitGroup"/>
+      <xs:element name="sequence" type="xs:simpleExplicitGroup"/>
+     </xs:choice>
+    </xs:sequence>
+    <xs:attribute name="name" use="required" type="xs:NCName"/>
+    <xs:attribute name="ref" use="prohibited"/>
+    <xs:attribute name="minOccurs" use="prohibited"/>
+    <xs:attribute name="maxOccurs" use="prohibited"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="groupRef">
+  <xs:complexContent>
+   <xs:restriction base="xs:realGroup">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+    </xs:sequence>
+    <xs:attribute name="ref" use="required" type="xs:QName"/>
+    <xs:attribute name="name" use="prohibited"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="explicitGroup">
+  <xs:annotation>
+   <xs:documentation>
+   group type for the three kinds of group</xs:documentation>
+  </xs:annotation>
+  <xs:complexContent>
+   <xs:restriction base="xs:group">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+     <xs:group ref="xs:nestedParticle" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attribute name="name" type="xs:NCName" use="prohibited"/>
+    <xs:attribute name="ref" type="xs:QName" use="prohibited"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="simpleExplicitGroup">
+  <xs:complexContent>
+   <xs:restriction base="xs:explicitGroup">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+     <xs:group ref="xs:nestedParticle" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attribute name="minOccurs" use="prohibited"/>
+    <xs:attribute name="maxOccurs" use="prohibited"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+ <xs:group name="allModel">
+  <xs:sequence>
+      <xs:element ref="xs:annotation" minOccurs="0"/>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+       <xs:annotation>
+        <xs:documentation>This choice with min/max is here to
+                          avoid a pblm with the Elt:All/Choice/Seq
+                          Particle derivation constraint</xs:documentation>
+       </xs:annotation>
+       <xs:element name="element" type="xs:narrowMaxMin"/>
+      </xs:choice>
+     </xs:sequence>
+ </xs:group>
+ <xs:complexType name="narrowMaxMin">
+  <xs:annotation>
+   <xs:documentation>restricted max/min</xs:documentation>
+  </xs:annotation>
+  <xs:complexContent>
+   <xs:restriction base="xs:localElement">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+     <xs:choice minOccurs="0">
+      <xs:element name="simpleType" type="xs:localSimpleType"/>
+      <xs:element name="complexType" type="xs:localComplexType"/>
+     </xs:choice>
+     <xs:group ref="xs:identityConstraint" minOccurs="0" maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attribute name="minOccurs" use="optional" default="1">
+     <xs:simpleType>
+      <xs:restriction base="xs:nonNegativeInteger">
+       <xs:enumeration value="0"/>
+       <xs:enumeration value="1"/>
+      </xs:restriction>
+     </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="maxOccurs" use="optional" default="1">
+     <xs:simpleType>
+      <xs:restriction base="xs:allNNI">
+       <xs:enumeration value="0"/>
+       <xs:enumeration value="1"/>
+      </xs:restriction>
+     </xs:simpleType>
+    </xs:attribute>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+
+  <xs:complexType name="all">
+   <xs:annotation>
+    <xs:documentation>
+   Only elements allowed inside</xs:documentation>
+   </xs:annotation>
+   <xs:complexContent>
+    <xs:restriction base="xs:explicitGroup">
+     <xs:group ref="xs:allModel"/>
+     <xs:attribute name="minOccurs" use="optional" default="1">
+      <xs:simpleType>
+       <xs:restriction base="xs:nonNegativeInteger">
+        <xs:enumeration value="0"/>
+        <xs:enumeration value="1"/>
+       </xs:restriction>
+      </xs:simpleType>
+     </xs:attribute>
+     <xs:attribute name="maxOccurs" use="optional" default="1">
+      <xs:simpleType>
+       <xs:restriction base="xs:allNNI">
+        <xs:enumeration value="1"/>
+       </xs:restriction>
+      </xs:simpleType>
+     </xs:attribute>
+     <xs:anyAttribute namespace="##other" processContents="lax"/>
+    </xs:restriction>
+   </xs:complexContent>
+  </xs:complexType>
+
+ <xs:element name="all" id="all" type="xs:all">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-all"/>
+  </xs:annotation>
+ </xs:element>
+
+ <xs:element name="choice" type="xs:explicitGroup" id="choice">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-choice"/>
+  </xs:annotation>
+ </xs:element>
+
+ <xs:element name="sequence" type="xs:explicitGroup" id="sequence">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-sequence"/>
+  </xs:annotation>
+ </xs:element>
+
+ <xs:element name="group" type="xs:namedGroup" id="group">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-group"/>
+  </xs:annotation>
+ </xs:element>
+
+ <xs:complexType name="wildcard">
+  <xs:complexContent>
+   <xs:extension base="xs:annotated">
+    <xs:attribute name="namespace" type="xs:namespaceList" use="optional" default="##any"/>
+    <xs:attribute name="processContents" use="optional" default="strict">
+     <xs:simpleType>
+      <xs:restriction base="xs:NMTOKEN">
+       <xs:enumeration value="skip"/>
+       <xs:enumeration value="lax"/>
+       <xs:enumeration value="strict"/>
+      </xs:restriction>
+     </xs:simpleType>
+    </xs:attribute>
+   </xs:extension>
+  </xs:complexContent>
+ </xs:complexType>
+
+ <xs:element name="any" id="any">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-any"/>
+  </xs:annotation>
+  <xs:complexType>
+   <xs:complexContent>
+    <xs:extension base="xs:wildcard">
+     <xs:attributeGroup ref="xs:occurs"/>
+    </xs:extension>
+   </xs:complexContent>
+  </xs:complexType>
+ </xs:element>
+
+  <xs:annotation>
+   <xs:documentation>
+   simple type for the value of the 'namespace' attr of
+   'any' and 'anyAttribute'</xs:documentation>
+  </xs:annotation>
+  <xs:annotation>
+   <xs:documentation>
+   Value is
+              ##any      - - any non-conflicting WFXML/attribute at all
+
+              ##other    - - any non-conflicting WFXML/attribute from
+                              namespace other than targetNS
+
+              ##local    - - any unqualified non-conflicting WFXML/attribute 
+
+              one or     - - any non-conflicting WFXML/attribute from
+              more URI        the listed namespaces
+              references
+              (space separated)
+
+    ##targetNamespace or ##local may appear in the above list, to
+        refer to the targetNamespace of the enclosing
+        schema or an absent targetNamespace respectively</xs:documentation>
+  </xs:annotation>
+
+ <xs:simpleType name="namespaceList">
+  <xs:annotation>
+   <xs:documentation>
+   A utility type, not for public use</xs:documentation>
+  </xs:annotation>
+  <xs:union>
+   <xs:simpleType>
+    <xs:restriction base="xs:token">
+     <xs:enumeration value="##any"/>
+     <xs:enumeration value="##other"/>
+    </xs:restriction>
+   </xs:simpleType>
+   <xs:simpleType>
+    <xs:list>
+     <xs:simpleType>
+      <xs:union memberTypes="xs:anyURI">
+       <xs:simpleType>
+        <xs:restriction base="xs:token">
+         <xs:enumeration value="##targetNamespace"/>
+         <xs:enumeration value="##local"/>
+        </xs:restriction>
+       </xs:simpleType>
+      </xs:union>
+     </xs:simpleType>
+    </xs:list>
+   </xs:simpleType>
+  </xs:union>
+ </xs:simpleType>
+
+ <xs:element name="attribute" type="xs:topLevelAttribute" id="attribute">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-attribute"/>
+  </xs:annotation>
+ </xs:element>
+
+ <xs:complexType name="attributeGroup" abstract="true">
+  <xs:complexContent>
+   <xs:extension base="xs:annotated">
+    <xs:group ref="xs:attrDecls"/>
+    <xs:attributeGroup ref="xs:defRef"/>
+   </xs:extension>
+  </xs:complexContent>
+ </xs:complexType>
+ <xs:complexType name="namedAttributeGroup">
+  <xs:complexContent>
+   <xs:restriction base="xs:attributeGroup">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+     <xs:group ref="xs:attrDecls"/>
+    </xs:sequence>
+    <xs:attribute name="name" use="required" type="xs:NCName"/>
+    <xs:attribute name="ref" use="prohibited"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+
+ <xs:complexType name="attributeGroupRef">
+  <xs:complexContent>
+   <xs:restriction base="xs:attributeGroup">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+    </xs:sequence>
+    <xs:attribute name="ref" use="required" type="xs:QName"/>
+    <xs:attribute name="name" use="prohibited"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+
+ <xs:element name="attributeGroup" type="xs:namedAttributeGroup" id="attributeGroup">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-attributeGroup"/>
+  </xs:annotation>
+ </xs:element>
+
+ <xs:element name="include" id="include">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-include"/>
+  </xs:annotation>
+  <xs:complexType>
+   <xs:complexContent>
+    <xs:extension base="xs:annotated">
+     <xs:attribute name="schemaLocation" type="xs:anyURI" use="required"/>
+    </xs:extension>
+   </xs:complexContent>
+  </xs:complexType>
+ </xs:element>
+
+ <xs:element name="redefine" id="redefine">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-redefine"/>
+  </xs:annotation>
+  <xs:complexType>
+   <xs:complexContent>
+    <xs:extension base="xs:openAttrs">
+     <xs:choice minOccurs="0" maxOccurs="unbounded">
+      <xs:element ref="xs:annotation"/>
+      <xs:group ref="xs:redefinable"/>
+     </xs:choice>
+     <xs:attribute name="schemaLocation" type="xs:anyURI" use="required"/>
+     <xs:attribute name="id" type="xs:ID"/>
+    </xs:extension>
+   </xs:complexContent>
+  </xs:complexType>
+ </xs:element>
+
+ <xs:element name="import" id="import">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-import"/>
+  </xs:annotation>
+  <xs:complexType>
+   <xs:complexContent>
+    <xs:extension base="xs:annotated">
+     <xs:attribute name="namespace" type="xs:anyURI"/>
+     <xs:attribute name="schemaLocation" type="xs:anyURI"/>
+    </xs:extension>
+   </xs:complexContent>
+  </xs:complexType>
+ </xs:element>
+
+ <xs:element name="selector" id="selector">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-selector"/>
+  </xs:annotation>
+  <xs:complexType>
+  <xs:complexContent>
+   <xs:extension base="xs:annotated">
+     <xs:attribute name="xpath" use="required">
+      <xs:simpleType>
+       <xs:annotation>
+        <xs:documentation>A subset of XPath expressions for use
+in selectors</xs:documentation>
+        <xs:documentation>A utility type, not for public
+use</xs:documentation>
+       </xs:annotation>
+       <xs:restriction base="xs:token">
+        <xs:annotation>
+         <xs:documentation>The following pattern is intended to allow XPath
+                           expressions per the following EBNF:
+          Selector    ::=    Path ( '|' Path )*  
+          Path    ::=    ('.//')? Step ( '/' Step )*  
+          Step    ::=    '.' | NameTest  
+          NameTest    ::=    QName | '*' | NCName ':' '*'  
+                           child:: is also allowed
+         </xs:documentation>
+        </xs:annotation>
+        <xs:pattern value="(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*(\|(\.//)?(((child::)?((\i\c*:)?(\i\c*|\*)))|\.)(/(((child::)?((\i\c*:)?(\i\c*|\*)))|\.))*)*">
+        </xs:pattern>
+       </xs:restriction>
+      </xs:simpleType>
+     </xs:attribute>
+   </xs:extension>
+  </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:element name="field" id="field">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-field"/>
+  </xs:annotation>
+  <xs:complexType>
+  <xs:complexContent>
+   <xs:extension base="xs:annotated">
+     <xs:attribute name="xpath" use="required">
+      <xs:simpleType>
+       <xs:annotation>
+        <xs:documentation>A subset of XPath expressions for use
+in fields</xs:documentation>
+        <xs:documentation>A utility type, not for public
+use</xs:documentation>
+       </xs:annotation>
+       <xs:restriction base="xs:token">
+        <xs:annotation>
+         <xs:documentation>The following pattern is intended to allow XPath
+                           expressions per the same EBNF as for selector,
+                           with the following change:
+          Path    ::=    ('.//')? ( Step '/' )* ( Step | '@' NameTest ) 
+         </xs:documentation>
+        </xs:annotation>
+        <xs:pattern value="(\.//)?((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)/)*((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*))))(\|(\.//)?((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)/)*((((child::)?((\i\c*:)?(\i\c*|\*)))|\.)|((attribute::|@)((\i\c*:)?(\i\c*|\*)))))*">
+        </xs:pattern>
+       </xs:restriction>
+      </xs:simpleType>
+     </xs:attribute>
+   </xs:extension>
+  </xs:complexContent>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:complexType name="keybase">
+  <xs:complexContent>
+   <xs:extension base="xs:annotated">
+    <xs:sequence>
+     <xs:element ref="xs:selector"/>
+     <xs:element ref="xs:field" minOccurs="1" maxOccurs="unbounded"/>
+    </xs:sequence>
+    <xs:attribute name="name" type="xs:NCName" use="required"/>
+   </xs:extension>
+  </xs:complexContent>
+ </xs:complexType>
+
+ <xs:group name="identityConstraint">
+  <xs:annotation>
+   <xs:documentation>The three kinds of identity constraints, all with
+                     type of or derived from 'keybase'.
+   </xs:documentation>
+  </xs:annotation>
+  <xs:choice>
+   <xs:element ref="xs:unique"/>
+   <xs:element ref="xs:key"/>
+   <xs:element ref="xs:keyref"/>
+  </xs:choice>
+ </xs:group>
+
+ <xs:element name="unique" type="xs:keybase" id="unique">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-unique"/>
+  </xs:annotation>
+ </xs:element>
+ <xs:element name="key" type="xs:keybase" id="key">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-key"/>
+  </xs:annotation>
+ </xs:element>
+ <xs:element name="keyref" id="keyref">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-keyref"/>
+  </xs:annotation>
+  <xs:complexType>
+   <xs:complexContent>
+    <xs:extension base="xs:keybase">
+     <xs:attribute name="refer" type="xs:QName" use="required"/>
+    </xs:extension>
+   </xs:complexContent>
+  </xs:complexType>
+ </xs:element>
+
+ <xs:element name="notation" id="notation">
+  <xs:annotation>
+   <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-notation"/>
+  </xs:annotation>
+  <xs:complexType>
+   <xs:complexContent>
+    <xs:extension base="xs:annotated">
+     <xs:attribute name="name" type="xs:NCName" use="required"/>
+     <xs:attribute name="public" type="xs:public"/>
+     <xs:attribute name="system" type="xs:anyURI"/>
+    </xs:extension>
+   </xs:complexContent>
+  </xs:complexType>
+ </xs:element>
+
+ <xs:simpleType name="public">
+  <xs:annotation>
+   <xs:documentation>
+   A utility type, not for public use</xs:documentation>
+   <xs:documentation>
+   A public identifier, per ISO 8879</xs:documentation>
+  </xs:annotation>
+  <xs:restriction base="xs:token"/>
+ </xs:simpleType>
+
+ <xs:element name="appinfo" id="appinfo">
+   <xs:annotation>
+     <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-appinfo"/>
+   </xs:annotation>
+   <xs:complexType mixed="true">
+    <xs:sequence minOccurs="0" maxOccurs="unbounded">
+     <xs:any processContents="lax"/>
+    </xs:sequence>
+    <xs:attribute name="source" type="xs:anyURI"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:complexType>
+ </xs:element>
+
+ <xs:element name="documentation" id="documentation">
+   <xs:annotation>
+     <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-documentation"/>
+   </xs:annotation>
+   <xs:complexType mixed="true">
+    <xs:sequence minOccurs="0" maxOccurs="unbounded">
+     <xs:any processContents="lax"/>
+    </xs:sequence>
+    <xs:attribute name="source" type="xs:anyURI"/>
+    <xs:attribute ref="xml:lang"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:complexType>
+ </xs:element>
+
+ <xs:element name="annotation" id="annotation">
+   <xs:annotation>
+     <xs:documentation source="http://www.w3.org/TR/xmlschema-1/#element-annotation"/>
+   </xs:annotation>
+   <xs:complexType>
+    <xs:complexContent>
+     <xs:extension base="xs:openAttrs">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+       <xs:element ref="xs:appinfo"/>
+       <xs:element ref="xs:documentation"/>
+      </xs:choice>
+      <xs:attribute name="id" type="xs:ID"/>
+     </xs:extension>
+    </xs:complexContent>
+   </xs:complexType>
+ </xs:element>
+
+ <xs:annotation>
+  <xs:documentation>
+   notations for use within XML Schema schemas</xs:documentation>
+ </xs:annotation>
+
+ <xs:notation name="XMLSchemaStructures" public="structures" system="http://www.w3.org/2000/08/XMLSchema.xsd"/>
+ <xs:notation name="XML" public="REC-xml-19980210" system="http://www.w3.org/TR/1998/REC-xml-19980210"/>
+  
+ <xs:complexType name="anyType" mixed="true">
+  <xs:annotation>
+   <xs:documentation>
+   Not the real urType, but as close an approximation as we can
+   get in the XML representation</xs:documentation>
+  </xs:annotation>
+  <xs:sequence>
+   <xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
+  </xs:sequence>
+  <xs:anyAttribute processContents="lax"/>
+ </xs:complexType>
+
+  <xs:annotation>
+    <xs:documentation>
+      First the built-in primitive datatypes.  These definitions are for
+      information only, the real built-in definitions are magic.
+    </xs:documentation>
+
+    <xs:documentation>
+      For each built-in datatype in this schema (both primitive and
+      derived) can be uniquely addressed via a URI constructed
+      as follows:
+        1) the base URI is the URI of the XML Schema namespace
+        2) the fragment identifier is the name of the datatype
+
+      For example, to address the int datatype, the URI is:
+
+        http://www.w3.org/2001/XMLSchema#int
+
+      Additionally, each facet definition element can be uniquely
+      addressed via a URI constructed as follows:
+        1) the base URI is the URI of the XML Schema namespace
+        2) the fragment identifier is the name of the facet
+
+      For example, to address the maxInclusive facet, the URI is:
+
+        http://www.w3.org/2001/XMLSchema#maxInclusive
+
+      Additionally, each facet usage in a built-in datatype definition
+      can be uniquely addressed via a URI constructed as follows:
+        1) the base URI is the URI of the XML Schema namespace
+        2) the fragment identifier is the name of the datatype, followed
+           by a period (".") followed by the name of the facet
+
+      For example, to address the usage of the maxInclusive facet in
+      the definition of int, the URI is:
+
+        http://www.w3.org/2001/XMLSchema#int.maxInclusive
+
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:simpleType name="string" id="string">
+    <xs:annotation>
+      <xs:appinfo>
+        <hfp:hasFacet name="length"/>
+        <hfp:hasFacet name="minLength"/>
+        <hfp:hasFacet name="maxLength"/>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasProperty name="ordered" value="false"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality" value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+                source="http://www.w3.org/TR/xmlschema-2/#string"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="preserve" id="string.preserve"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="boolean" id="boolean">
+    <xs:annotation>
+      <xs:appinfo>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasProperty name="ordered" value="false"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality" value="finite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#boolean"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="collapse" fixed="true"
+        id="boolean.whiteSpace"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="float" id="float">
+    <xs:annotation>
+      <xs:appinfo>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasFacet name="maxInclusive"/>
+        <hfp:hasFacet name="maxExclusive"/>
+        <hfp:hasFacet name="minInclusive"/>
+        <hfp:hasFacet name="minExclusive"/>
+        <hfp:hasProperty name="ordered" value="total"/>
+        <hfp:hasProperty name="bounded" value="true"/>
+        <hfp:hasProperty name="cardinality" value="finite"/>
+        <hfp:hasProperty name="numeric" value="true"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#float"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="collapse" fixed="true"
+        id="float.whiteSpace"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="double" id="double">
+    <xs:annotation>
+      <xs:appinfo>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasFacet name="maxInclusive"/>
+        <hfp:hasFacet name="maxExclusive"/>
+        <hfp:hasFacet name="minInclusive"/>
+        <hfp:hasFacet name="minExclusive"/>
+        <hfp:hasProperty name="ordered" value="total"/>
+        <hfp:hasProperty name="bounded" value="true"/>
+        <hfp:hasProperty name="cardinality" value="finite"/>
+        <hfp:hasProperty name="numeric" value="true"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#double"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="collapse"  fixed="true"
+        id="double.whiteSpace"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="decimal" id="decimal">
+    <xs:annotation>
+      <xs:appinfo>
+        <hfp:hasFacet name="totalDigits"/>
+        <hfp:hasFacet name="fractionDigits"/>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="maxInclusive"/>
+        <hfp:hasFacet name="maxExclusive"/>
+        <hfp:hasFacet name="minInclusive"/>
+        <hfp:hasFacet name="minExclusive"/>
+        <hfp:hasProperty name="ordered" value="total"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="true"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#decimal"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="collapse"  fixed="true"
+        id="decimal.whiteSpace"/>
+    </xs:restriction>
+   </xs:simpleType>
+
+   <xs:simpleType name="duration" id="duration">
+    <xs:annotation>
+      <xs:appinfo>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasFacet name="maxInclusive"/>
+        <hfp:hasFacet name="maxExclusive"/>
+        <hfp:hasFacet name="minInclusive"/>
+        <hfp:hasFacet name="minExclusive"/>
+        <hfp:hasProperty name="ordered" value="partial"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#duration"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="collapse"  fixed="true"
+        id="duration.whiteSpace"/>
+    </xs:restriction>
+   </xs:simpleType>
+
+ <xs:simpleType name="dateTime" id="dateTime">
+    <xs:annotation>
+    <xs:appinfo>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasFacet name="maxInclusive"/>
+        <hfp:hasFacet name="maxExclusive"/>
+        <hfp:hasFacet name="minInclusive"/>
+        <hfp:hasFacet name="minExclusive"/>
+        <hfp:hasProperty name="ordered" value="partial"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#dateTime"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="collapse"  fixed="true"
+        id="dateTime.whiteSpace"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="time" id="time">
+    <xs:annotation>
+    <xs:appinfo>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasFacet name="maxInclusive"/>
+        <hfp:hasFacet name="maxExclusive"/>
+        <hfp:hasFacet name="minInclusive"/>
+        <hfp:hasFacet name="minExclusive"/>
+        <hfp:hasProperty name="ordered" value="partial"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#time"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="collapse"  fixed="true"
+        id="time.whiteSpace"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="date" id="date">
+   <xs:annotation>
+    <xs:appinfo>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasFacet name="maxInclusive"/>
+        <hfp:hasFacet name="maxExclusive"/>
+        <hfp:hasFacet name="minInclusive"/>
+        <hfp:hasFacet name="minExclusive"/>
+        <hfp:hasProperty name="ordered" value="partial"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#date"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="collapse"  fixed="true"
+        id="date.whiteSpace"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="gYearMonth" id="gYearMonth">
+   <xs:annotation>
+    <xs:appinfo>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasFacet name="maxInclusive"/>
+        <hfp:hasFacet name="maxExclusive"/>
+        <hfp:hasFacet name="minInclusive"/>
+        <hfp:hasFacet name="minExclusive"/>
+        <hfp:hasProperty name="ordered" value="partial"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#gYearMonth"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="collapse"  fixed="true"
+        id="gYearMonth.whiteSpace"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="gYear" id="gYear">
+    <xs:annotation>
+    <xs:appinfo>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasFacet name="maxInclusive"/>
+        <hfp:hasFacet name="maxExclusive"/>
+        <hfp:hasFacet name="minInclusive"/>
+        <hfp:hasFacet name="minExclusive"/>
+        <hfp:hasProperty name="ordered" value="partial"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#gYear"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="collapse"  fixed="true"
+        id="gYear.whiteSpace"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+ <xs:simpleType name="gMonthDay" id="gMonthDay">
+    <xs:annotation>
+      <xs:appinfo>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasFacet name="maxInclusive"/>
+        <hfp:hasFacet name="maxExclusive"/>
+        <hfp:hasFacet name="minInclusive"/>
+        <hfp:hasFacet name="minExclusive"/>
+        <hfp:hasProperty name="ordered" value="partial"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+       <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#gMonthDay"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+         <xs:whiteSpace value="collapse" fixed="true"
+                id="gMonthDay.whiteSpace"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="gDay" id="gDay">
+    <xs:annotation>
+  <xs:appinfo>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasFacet name="maxInclusive"/>
+        <hfp:hasFacet name="maxExclusive"/>
+        <hfp:hasFacet name="minInclusive"/>
+        <hfp:hasFacet name="minExclusive"/>
+        <hfp:hasProperty name="ordered" value="partial"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#gDay"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+         <xs:whiteSpace value="collapse"  fixed="true"
+                id="gDay.whiteSpace"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+ <xs:simpleType name="gMonth" id="gMonth">
+    <xs:annotation>
+  <xs:appinfo>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasFacet name="maxInclusive"/>
+        <hfp:hasFacet name="maxExclusive"/>
+        <hfp:hasFacet name="minInclusive"/>
+        <hfp:hasFacet name="minExclusive"/>
+        <hfp:hasProperty name="ordered" value="partial"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#gMonth"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+         <xs:whiteSpace value="collapse"  fixed="true"
+                id="gMonth.whiteSpace"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+   <xs:simpleType name="hexBinary" id="hexBinary">
+    <xs:annotation>
+      <xs:appinfo>
+        <hfp:hasFacet name="length"/>
+        <hfp:hasFacet name="minLength"/>
+        <hfp:hasFacet name="maxLength"/>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasProperty name="ordered" value="false"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#binary"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="collapse" fixed="true"
+        id="hexBinary.whiteSpace"/>
+    </xs:restriction>
+   </xs:simpleType>
+
+ <xs:simpleType name="base64Binary" id="base64Binary">
+    <xs:annotation>
+      <xs:appinfo>
+        <hfp:hasFacet name="length"/>
+        <hfp:hasFacet name="minLength"/>
+        <hfp:hasFacet name="maxLength"/>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasProperty name="ordered" value="false"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+                source="http://www.w3.org/TR/xmlschema-2/#base64Binary"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="collapse" fixed="true"
+        id="base64Binary.whiteSpace"/>
+    </xs:restriction>
+   </xs:simpleType>
+
+   <xs:simpleType name="anyURI" id="anyURI">
+    <xs:annotation>
+      <xs:appinfo>
+        <hfp:hasFacet name="length"/>
+        <hfp:hasFacet name="minLength"/>
+        <hfp:hasFacet name="maxLength"/>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasProperty name="ordered" value="false"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#anyURI"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="collapse"  fixed="true"
+        id="anyURI.whiteSpace"/>
+    </xs:restriction>
+   </xs:simpleType>
+
+  <xs:simpleType name="QName" id="QName">
+    <xs:annotation>
+        <xs:appinfo>
+        <hfp:hasFacet name="length"/>
+        <hfp:hasFacet name="minLength"/>
+        <hfp:hasFacet name="maxLength"/>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasProperty name="ordered" value="false"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#QName"/>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="collapse"  fixed="true"
+        id="QName.whiteSpace"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+   <xs:simpleType name="NOTATION" id="NOTATION">
+    <xs:annotation>
+        <xs:appinfo>
+        <hfp:hasFacet name="length"/>
+        <hfp:hasFacet name="minLength"/>
+        <hfp:hasFacet name="maxLength"/>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasProperty name="ordered" value="false"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#NOTATION"/>
+      <xs:documentation>
+        NOTATION cannot be used directly in a schema; rather a type
+        must be derived from it by specifying at least one enumeration
+        facet whose value is the name of a NOTATION declared in the
+        schema.
+      </xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:anySimpleType">
+      <xs:whiteSpace value="collapse"  fixed="true"
+        id="NOTATION.whiteSpace"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:annotation>
+    <xs:documentation>
+      Now the derived primitive types
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:simpleType name="normalizedString" id="normalizedString">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#normalizedString"/>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:whiteSpace value="replace"
+        id="normalizedString.whiteSpace"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="token" id="token">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#token"/>
+    </xs:annotation>
+    <xs:restriction base="xs:normalizedString">
+      <xs:whiteSpace value="collapse" id="token.whiteSpace"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="language" id="language">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#language"/>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:pattern
+        value="[a-zA-Z]{1,8}(-[a-zA-Z0-9]{1,8})*"
+                id="language.pattern">
+        <xs:annotation>
+          <xs:documentation
+                source="http://www.ietf.org/rfc/rfc3066.txt">
+            pattern specifies the content of section 2.12 of XML 1.0e2
+            and RFC 3066 (Revised version of RFC 1766).
+          </xs:documentation>
+        </xs:annotation>
+      </xs:pattern>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="IDREFS" id="IDREFS">
+    <xs:annotation>
+      <xs:appinfo>
+        <hfp:hasFacet name="length"/>
+        <hfp:hasFacet name="minLength"/>
+        <hfp:hasFacet name="maxLength"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasProperty name="ordered" value="false"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#IDREFS"/>
+    </xs:annotation>
+    <xs:restriction>
+      <xs:simpleType>
+        <xs:list itemType="xs:IDREF"/>
+      </xs:simpleType>
+        <xs:minLength value="1" id="IDREFS.minLength"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="ENTITIES" id="ENTITIES">
+    <xs:annotation>
+      <xs:appinfo>
+        <hfp:hasFacet name="length"/>
+        <hfp:hasFacet name="minLength"/>
+        <hfp:hasFacet name="maxLength"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasProperty name="ordered" value="false"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#ENTITIES"/>
+    </xs:annotation>
+    <xs:restriction>
+      <xs:simpleType>
+        <xs:list itemType="xs:ENTITY"/>
+      </xs:simpleType>
+        <xs:minLength value="1" id="ENTITIES.minLength"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="NMTOKEN" id="NMTOKEN">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#NMTOKEN"/>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:pattern value="\c+" id="NMTOKEN.pattern">
+        <xs:annotation>
+          <xs:documentation
+                source="http://www.w3.org/TR/REC-xml#NT-Nmtoken">
+            pattern matches production 7 from the XML spec
+          </xs:documentation>
+        </xs:annotation>
+      </xs:pattern>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="NMTOKENS" id="NMTOKENS">
+    <xs:annotation>
+      <xs:appinfo>
+        <hfp:hasFacet name="length"/>
+        <hfp:hasFacet name="minLength"/>
+        <hfp:hasFacet name="maxLength"/>
+        <hfp:hasFacet name="enumeration"/>
+        <hfp:hasFacet name="whiteSpace"/>
+        <hfp:hasFacet name="pattern"/>
+        <hfp:hasProperty name="ordered" value="false"/>
+        <hfp:hasProperty name="bounded" value="false"/>
+        <hfp:hasProperty name="cardinality"
+                value="countably infinite"/>
+        <hfp:hasProperty name="numeric" value="false"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#NMTOKENS"/>
+    </xs:annotation>
+    <xs:restriction>
+      <xs:simpleType>
+        <xs:list itemType="xs:NMTOKEN"/>
+      </xs:simpleType>
+        <xs:minLength value="1" id="NMTOKENS.minLength"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="Name" id="Name">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#Name"/>
+    </xs:annotation>
+    <xs:restriction base="xs:token">
+      <xs:pattern value="\i\c*" id="Name.pattern">
+        <xs:annotation>
+          <xs:documentation
+                        source="http://www.w3.org/TR/REC-xml#NT-Name">
+            pattern matches production 5 from the XML spec
+          </xs:documentation>
+        </xs:annotation>
+      </xs:pattern>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="NCName" id="NCName">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#NCName"/>
+    </xs:annotation>
+    <xs:restriction base="xs:Name">
+      <xs:pattern value="[\i-[:]][\c-[:]]*" id="NCName.pattern">
+        <xs:annotation>
+          <xs:documentation
+                source="http://www.w3.org/TR/REC-xml-names/#NT-NCName">
+            pattern matches production 4 from the Namespaces in XML spec
+          </xs:documentation>
+        </xs:annotation>
+      </xs:pattern>
+    </xs:restriction>
+  </xs:simpleType>
+
+   <xs:simpleType name="ID" id="ID">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#ID"/>
+    </xs:annotation>
+    <xs:restriction base="xs:NCName"/>
+   </xs:simpleType>
+
+   <xs:simpleType name="IDREF" id="IDREF">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#IDREF"/>
+    </xs:annotation>
+    <xs:restriction base="xs:NCName"/>
+   </xs:simpleType>
+
+   <xs:simpleType name="ENTITY" id="ENTITY">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#ENTITY"/>
+    </xs:annotation>
+    <xs:restriction base="xs:NCName"/>
+   </xs:simpleType>
+
+  <xs:simpleType name="integer" id="integer">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#integer"/>
+    </xs:annotation>
+    <xs:restriction base="xs:decimal">
+      <xs:fractionDigits value="0" fixed="true" id="integer.fractionDigits"/>
+      <xs:pattern value="[\-+]?[0-9]+"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="nonPositiveInteger" id="nonPositiveInteger">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#nonPositiveInteger"/>
+    </xs:annotation>
+    <xs:restriction base="xs:integer">
+      <xs:maxInclusive value="0" id="nonPositiveInteger.maxInclusive"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="negativeInteger" id="negativeInteger">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#negativeInteger"/>
+    </xs:annotation>
+    <xs:restriction base="xs:nonPositiveInteger">
+      <xs:maxInclusive value="-1" id="negativeInteger.maxInclusive"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="long" id="long">
+    <xs:annotation>
+      <xs:appinfo>
+        <hfp:hasProperty name="bounded" value="true"/>
+        <hfp:hasProperty name="cardinality" value="finite"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#long"/>
+    </xs:annotation>
+    <xs:restriction base="xs:integer">
+      <xs:minInclusive value="-9223372036854775808" id="long.minInclusive"/>
+      <xs:maxInclusive value="9223372036854775807" id="long.maxInclusive"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="int" id="int">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#int"/>
+    </xs:annotation>
+    <xs:restriction base="xs:long">
+      <xs:minInclusive value="-2147483648" id="int.minInclusive"/>
+      <xs:maxInclusive value="2147483647" id="int.maxInclusive"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="short" id="short">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#short"/>
+    </xs:annotation>
+    <xs:restriction base="xs:int">
+      <xs:minInclusive value="-32768" id="short.minInclusive"/>
+      <xs:maxInclusive value="32767" id="short.maxInclusive"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="byte" id="byte">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#byte"/>
+    </xs:annotation>
+    <xs:restriction base="xs:short">
+      <xs:minInclusive value="-128" id="byte.minInclusive"/>
+      <xs:maxInclusive value="127" id="byte.maxInclusive"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="nonNegativeInteger" id="nonNegativeInteger">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#nonNegativeInteger"/>
+    </xs:annotation>
+    <xs:restriction base="xs:integer">
+      <xs:minInclusive value="0" id="nonNegativeInteger.minInclusive"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="unsignedLong" id="unsignedLong">
+    <xs:annotation>
+      <xs:appinfo>
+        <hfp:hasProperty name="bounded" value="true"/>
+        <hfp:hasProperty name="cardinality" value="finite"/>
+      </xs:appinfo>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#unsignedLong"/>
+    </xs:annotation>
+    <xs:restriction base="xs:nonNegativeInteger">
+      <xs:maxInclusive value="18446744073709551615"
+        id="unsignedLong.maxInclusive"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="unsignedInt" id="unsignedInt">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#unsignedInt"/>
+    </xs:annotation>
+    <xs:restriction base="xs:unsignedLong">
+      <xs:maxInclusive value="4294967295"
+        id="unsignedInt.maxInclusive"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="unsignedShort" id="unsignedShort">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#unsignedShort"/>
+    </xs:annotation>
+    <xs:restriction base="xs:unsignedInt">
+      <xs:maxInclusive value="65535"
+        id="unsignedShort.maxInclusive"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="unsignedByte" id="unsignedByte">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#unsignedByte"/>
+    </xs:annotation>
+    <xs:restriction base="xs:unsignedShort">
+      <xs:maxInclusive value="255" id="unsignedByte.maxInclusive"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+  <xs:simpleType name="positiveInteger" id="positiveInteger">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#positiveInteger"/>
+    </xs:annotation>
+    <xs:restriction base="xs:nonNegativeInteger">
+      <xs:minInclusive value="1" id="positiveInteger.minInclusive"/>
+    </xs:restriction>
+  </xs:simpleType>
+
+ <xs:simpleType name="derivationControl">
+  <xs:annotation>
+   <xs:documentation>
+   A utility type, not for public use</xs:documentation>
+  </xs:annotation>
+  <xs:restriction base="xs:NMTOKEN">
+   <xs:enumeration value="substitution"/>
+   <xs:enumeration value="extension"/>
+   <xs:enumeration value="restriction"/>
+   <xs:enumeration value="list"/>
+   <xs:enumeration value="union"/>
+  </xs:restriction>
+ </xs:simpleType>
+
+ <xs:group name="simpleDerivation">
+  <xs:choice>
+    <xs:element ref="xs:restriction"/>
+    <xs:element ref="xs:list"/>
+    <xs:element ref="xs:union"/>
+  </xs:choice>
+ </xs:group>
+
+ <xs:simpleType name="simpleDerivationSet">
+  <xs:annotation>
+   <xs:documentation>
+   #all or (possibly empty) subset of {restriction, union, list}
+   </xs:documentation>
+   <xs:documentation>
+   A utility type, not for public use</xs:documentation>
+  </xs:annotation>
+  <xs:union>
+   <xs:simpleType>
+    <xs:restriction base="xs:token">
+     <xs:enumeration value="#all"/>
+    </xs:restriction>
+   </xs:simpleType>
+   <xs:simpleType>
+    <xs:list>
+     <xs:simpleType>
+      <xs:restriction base="xs:derivationControl">
+       <xs:enumeration value="list"/>
+       <xs:enumeration value="union"/>
+       <xs:enumeration value="restriction"/>
+      </xs:restriction>
+     </xs:simpleType>
+    </xs:list>
+   </xs:simpleType>
+  </xs:union>
+ </xs:simpleType>
+
+  <xs:complexType name="simpleType" abstract="true">
+    <xs:complexContent>
+      <xs:extension base="xs:annotated">
+        <xs:group ref="xs:simpleDerivation"/>
+        <xs:attribute name="final" type="xs:simpleDerivationSet"/>
+        <xs:attribute name="name" type="xs:NCName">
+          <xs:annotation>
+            <xs:documentation>
+              Can be restricted to required or forbidden
+            </xs:documentation>
+          </xs:annotation>
+        </xs:attribute>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="topLevelSimpleType">
+    <xs:complexContent>
+      <xs:restriction base="xs:simpleType">
+        <xs:sequence>
+          <xs:element ref="xs:annotation" minOccurs="0"/>
+          <xs:group ref="xs:simpleDerivation"/>
+        </xs:sequence>
+        <xs:attribute name="name" use="required"
+             type="xs:NCName">
+          <xs:annotation>
+            <xs:documentation>
+              Required at the top level
+            </xs:documentation>
+          </xs:annotation>
+        </xs:attribute>
+       <xs:anyAttribute namespace="##other" processContents="lax"/>
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:complexType name="localSimpleType">
+    <xs:complexContent>
+      <xs:restriction base="xs:simpleType">
+        <xs:sequence>
+          <xs:element ref="xs:annotation" minOccurs="0"/>
+          <xs:group ref="xs:simpleDerivation"/>
+        </xs:sequence>
+        <xs:attribute name="name" use="prohibited">
+          <xs:annotation>
+            <xs:documentation>
+              Forbidden when nested
+            </xs:documentation>
+          </xs:annotation>
+        </xs:attribute>
+        <xs:attribute name="final" use="prohibited"/>
+       <xs:anyAttribute namespace="##other" processContents="lax"/>
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:element name="simpleType" type="xs:topLevelSimpleType" id="simpleType">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#element-simpleType"/>
+    </xs:annotation>
+  </xs:element>
+
+  <xs:group name="facets">
+   <xs:annotation>
+    <xs:documentation>
+       We should use a substitution group for facets, but
+       that's ruled out because it would allow users to
+       add their own, which we're not ready for yet.
+    </xs:documentation>
+   </xs:annotation>
+   <xs:choice>
+    <xs:element ref="xs:minExclusive"/>
+    <xs:element ref="xs:minInclusive"/>
+    <xs:element ref="xs:maxExclusive"/>
+    <xs:element ref="xs:maxInclusive"/>
+    <xs:element ref="xs:totalDigits"/>
+    <xs:element ref="xs:fractionDigits"/>
+    <xs:element ref="xs:length"/>
+    <xs:element ref="xs:minLength"/>
+    <xs:element ref="xs:maxLength"/>
+    <xs:element ref="xs:enumeration"/>
+    <xs:element ref="xs:whiteSpace"/>
+    <xs:element ref="xs:pattern"/>
+   </xs:choice>
+  </xs:group>
+
+  <xs:group name="simpleRestrictionModel">
+   <xs:sequence>
+    <xs:element name="simpleType" type="xs:localSimpleType" minOccurs="0"/>
+    <xs:group ref="xs:facets" minOccurs="0" maxOccurs="unbounded"/>
+   </xs:sequence>
+  </xs:group>
+
+  <xs:element name="restriction" id="restriction">
+   <xs:complexType>
+    <xs:annotation>
+      <xs:documentation
+                source="http://www.w3.org/TR/xmlschema-2/#element-restriction">
+          base attribute and simpleType child are mutually
+          exclusive, but one or other is required
+        </xs:documentation>
+      </xs:annotation>
+      <xs:complexContent>
+        <xs:extension base="xs:annotated">
+         <xs:group ref="xs:simpleRestrictionModel"/>
+         <xs:attribute name="base" type="xs:QName" use="optional"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="list" id="list">
+   <xs:complexType>
+    <xs:annotation>
+      <xs:documentation
+                source="http://www.w3.org/TR/xmlschema-2/#element-list">
+          itemType attribute and simpleType child are mutually
+          exclusive, but one or other is required
+        </xs:documentation>
+      </xs:annotation>
+      <xs:complexContent>
+        <xs:extension base="xs:annotated">
+          <xs:sequence>
+            <xs:element name="simpleType" type="xs:localSimpleType"
+                minOccurs="0"/>
+          </xs:sequence>
+          <xs:attribute name="itemType" type="xs:QName" use="optional"/>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="union" id="union">
+   <xs:complexType>
+    <xs:annotation>
+      <xs:documentation
+                source="http://www.w3.org/TR/xmlschema-2/#element-union">
+          memberTypes attribute must be non-empty or there must be
+          at least one simpleType child
+        </xs:documentation>
+      </xs:annotation>
+      <xs:complexContent>
+        <xs:extension base="xs:annotated">
+          <xs:sequence>
+            <xs:element name="simpleType" type="xs:localSimpleType"
+                minOccurs="0" maxOccurs="unbounded"/>
+          </xs:sequence>
+          <xs:attribute name="memberTypes" use="optional">
+            <xs:simpleType>
+              <xs:list itemType="xs:QName"/>
+            </xs:simpleType>
+          </xs:attribute>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:complexType name="facet">
+    <xs:complexContent>
+      <xs:extension base="xs:annotated">
+        <xs:attribute name="value" use="required"/>
+        <xs:attribute name="fixed" type="xs:boolean" use="optional"
+                      default="false"/>
+      </xs:extension>
+    </xs:complexContent>
+  </xs:complexType>
+
+ <xs:complexType name="noFixedFacet">
+  <xs:complexContent>
+   <xs:restriction base="xs:facet">
+    <xs:sequence>
+     <xs:element ref="xs:annotation" minOccurs="0"/>
+    </xs:sequence>
+    <xs:attribute name="fixed" use="prohibited"/>
+    <xs:anyAttribute namespace="##other" processContents="lax"/>
+   </xs:restriction>
+  </xs:complexContent>
+ </xs:complexType>
+
+  <xs:element name="minExclusive" id="minExclusive" type="xs:facet">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#element-minExclusive"/>
+    </xs:annotation>
+  </xs:element>
+  <xs:element name="minInclusive" id="minInclusive" type="xs:facet">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#element-minInclusive"/>
+    </xs:annotation>
+  </xs:element>
+
+  <xs:element name="maxExclusive" id="maxExclusive" type="xs:facet">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#element-maxExclusive"/>
+    </xs:annotation>
+  </xs:element>
+  <xs:element name="maxInclusive" id="maxInclusive" type="xs:facet">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#element-maxInclusive"/>
+    </xs:annotation>
+  </xs:element>
+
+  <xs:complexType name="numFacet">
+    <xs:complexContent>
+      <xs:restriction base="xs:facet">
+       <xs:sequence>
+         <xs:element ref="xs:annotation" minOccurs="0"/>
+       </xs:sequence>
+       <xs:attribute name="value" type="xs:nonNegativeInteger" use="required"/>
+       <xs:anyAttribute namespace="##other" processContents="lax"/>
+      </xs:restriction>
+    </xs:complexContent>
+  </xs:complexType>
+
+  <xs:element name="totalDigits" id="totalDigits">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#element-totalDigits"/>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:restriction base="xs:numFacet">
+          <xs:sequence>
+            <xs:element ref="xs:annotation" minOccurs="0"/>
+          </xs:sequence>
+          <xs:attribute name="value" type="xs:positiveInteger" use="required"/>
+         <xs:anyAttribute namespace="##other" processContents="lax"/>
+        </xs:restriction>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="fractionDigits" id="fractionDigits" type="xs:numFacet">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#element-fractionDigits"/>
+    </xs:annotation>
+  </xs:element>
+
+  <xs:element name="length" id="length" type="xs:numFacet">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#element-length"/>
+    </xs:annotation>
+  </xs:element>
+  <xs:element name="minLength" id="minLength" type="xs:numFacet">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#element-minLength"/>
+    </xs:annotation>
+  </xs:element>
+  <xs:element name="maxLength" id="maxLength" type="xs:numFacet">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#element-maxLength"/>
+    </xs:annotation>
+  </xs:element>
+
+  <xs:element name="enumeration" id="enumeration" type="xs:noFixedFacet">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#element-enumeration"/>
+    </xs:annotation>
+  </xs:element>
+
+  <xs:element name="whiteSpace" id="whiteSpace">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#element-whiteSpace"/>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:restriction base="xs:facet">
+          <xs:sequence>
+            <xs:element ref="xs:annotation" minOccurs="0"/>
+          </xs:sequence>
+          <xs:attribute name="value" use="required">
+            <xs:simpleType>
+              <xs:restriction base="xs:NMTOKEN">
+                <xs:enumeration value="preserve"/>
+                <xs:enumeration value="replace"/>
+                <xs:enumeration value="collapse"/>
+              </xs:restriction>
+            </xs:simpleType>
+          </xs:attribute>
+         <xs:anyAttribute namespace="##other" processContents="lax"/>
+        </xs:restriction>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+  <xs:element name="pattern" id="pattern">
+    <xs:annotation>
+      <xs:documentation
+        source="http://www.w3.org/TR/xmlschema-2/#element-pattern"/>
+    </xs:annotation>
+    <xs:complexType>
+      <xs:complexContent>
+        <xs:restriction base="xs:noFixedFacet">
+          <xs:sequence>
+            <xs:element ref="xs:annotation" minOccurs="0"/>
+          </xs:sequence>
+          <xs:attribute name="value" type="xs:string" use="required"/>
+         <xs:anyAttribute namespace="##other" processContents="lax"/>
+        </xs:restriction>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:element>
+
+</xs:schema>
diff --git a/org.argeo.app.core/src/org/argeo/app/core/schemas/datatypes.dtd b/org.argeo.app.core/src/org/argeo/app/core/schemas/datatypes.dtd
new file mode 100644 (file)
index 0000000..8e48553
--- /dev/null
@@ -0,0 +1,203 @@
+<!--
+        DTD for XML Schemas: Part 2: Datatypes
+        $Id: datatypes.dtd,v 1.23 2001/03/16 17:36:30 ht Exp $
+        Note this DTD is NOT normative, or even definitive. - - the
+        prose copy in the datatypes REC is the definitive version
+        (which shouldn't differ from this one except for this comment
+        and entity expansions, but just in case)
+  -->
+
+<!--
+        This DTD cannot be used on its own, it is intended
+        only for incorporation in XMLSchema.dtd, q.v.
+  -->
+
+<!-- Define all the element names, with optional prefix -->
+<!ENTITY % simpleType "%p;simpleType">
+<!ENTITY % restriction "%p;restriction">
+<!ENTITY % list "%p;list">
+<!ENTITY % union "%p;union">
+<!ENTITY % maxExclusive "%p;maxExclusive">
+<!ENTITY % minExclusive "%p;minExclusive">
+<!ENTITY % maxInclusive "%p;maxInclusive">
+<!ENTITY % minInclusive "%p;minInclusive">
+<!ENTITY % totalDigits "%p;totalDigits">
+<!ENTITY % fractionDigits "%p;fractionDigits">
+<!ENTITY % length "%p;length">
+<!ENTITY % minLength "%p;minLength">
+<!ENTITY % maxLength "%p;maxLength">
+<!ENTITY % enumeration "%p;enumeration">
+<!ENTITY % whiteSpace "%p;whiteSpace">
+<!ENTITY % pattern "%p;pattern">
+
+<!--
+        Customisation entities for the ATTLIST of each element
+        type. Define one of these if your schema takes advantage
+        of the anyAttribute='##other' in the schema for schemas
+  -->
+
+<!ENTITY % simpleTypeAttrs "">
+<!ENTITY % restrictionAttrs "">
+<!ENTITY % listAttrs "">
+<!ENTITY % unionAttrs "">
+<!ENTITY % maxExclusiveAttrs "">
+<!ENTITY % minExclusiveAttrs "">
+<!ENTITY % maxInclusiveAttrs "">
+<!ENTITY % minInclusiveAttrs "">
+<!ENTITY % totalDigitsAttrs "">
+<!ENTITY % fractionDigitsAttrs "">
+<!ENTITY % lengthAttrs "">
+<!ENTITY % minLengthAttrs "">
+<!ENTITY % maxLengthAttrs "">
+<!ENTITY % enumerationAttrs "">
+<!ENTITY % whiteSpaceAttrs "">
+<!ENTITY % patternAttrs "">
+
+<!-- Define some entities for informative use as attribute
+        types -->
+<!ENTITY % URIref "CDATA">
+<!ENTITY % XPathExpr "CDATA">
+<!ENTITY % QName "NMTOKEN">
+<!ENTITY % QNames "NMTOKENS">
+<!ENTITY % NCName "NMTOKEN">
+<!ENTITY % nonNegativeInteger "NMTOKEN">
+<!ENTITY % boolean "(true|false)">
+<!ENTITY % simpleDerivationSet "CDATA">
+<!--
+        #all or space-separated list drawn from derivationChoice
+  -->
+
+<!--
+        Note that the use of 'facet' below is less restrictive
+        than is really intended:  There should in fact be no
+        more than one of each of minInclusive, minExclusive,
+        maxInclusive, maxExclusive, totalDigits, fractionDigits,
+        length, maxLength, minLength within datatype,
+        and the min- and max- variants of Inclusive and Exclusive
+        are mutually exclusive. On the other hand,  pattern and
+        enumeration may repeat.
+  -->
+<!ENTITY % minBound "(%minInclusive; | %minExclusive;)">
+<!ENTITY % maxBound "(%maxInclusive; | %maxExclusive;)">
+<!ENTITY % bounds "%minBound; | %maxBound;">
+<!ENTITY % numeric "%totalDigits; | %fractionDigits;">
+<!ENTITY % ordered "%bounds; | %numeric;">
+<!ENTITY % unordered
+   "%pattern; | %enumeration; | %whiteSpace; | %length; |
+   %maxLength; | %minLength;">
+<!ENTITY % facet "%ordered; | %unordered;">
+<!ENTITY % facetAttr 
+        "value CDATA #REQUIRED
+        id ID #IMPLIED">
+<!ENTITY % fixedAttr "fixed %boolean; #IMPLIED">
+<!ENTITY % facetModel "(%annotation;)?">
+<!ELEMENT %simpleType;
+        ((%annotation;)?, (%restriction; | %list; | %union;))>
+<!ATTLIST %simpleType;
+    name      %NCName; #IMPLIED
+    final     %simpleDerivationSet; #IMPLIED
+    id        ID       #IMPLIED
+    %simpleTypeAttrs;>
+<!-- name is required at top level -->
+<!ELEMENT %restriction; ((%annotation;)?,
+                         (%restriction1; |
+                          ((%simpleType;)?,(%facet;)*)),
+                         (%attrDecls;))>
+<!ATTLIST %restriction;
+    base      %QName;                  #IMPLIED
+    id        ID       #IMPLIED
+    %restrictionAttrs;>
+<!--
+        base and simpleType child are mutually exclusive,
+        one is required.
+
+        restriction is shared between simpleType and
+        simpleContent and complexContent (in XMLSchema.xsd).
+        restriction1 is for the latter cases, when this
+        is restricting a complex type, as is attrDecls.
+  -->
+<!ELEMENT %list; ((%annotation;)?,(%simpleType;)?)>
+<!ATTLIST %list;
+    itemType      %QName;             #IMPLIED
+    id        ID       #IMPLIED
+    %listAttrs;>
+<!--
+        itemType and simpleType child are mutually exclusive,
+        one is required
+  -->
+<!ELEMENT %union; ((%annotation;)?,(%simpleType;)*)>
+<!ATTLIST %union;
+    id            ID       #IMPLIED
+    memberTypes   %QNames;            #IMPLIED
+    %unionAttrs;>
+<!--
+        At least one item in memberTypes or one simpleType
+        child is required
+  -->
+
+<!ELEMENT %maxExclusive; %facetModel;>
+<!ATTLIST %maxExclusive;
+        %facetAttr;
+        %fixedAttr;
+        %maxExclusiveAttrs;>
+<!ELEMENT %minExclusive; %facetModel;>
+<!ATTLIST %minExclusive;
+        %facetAttr;
+        %fixedAttr;
+        %minExclusiveAttrs;>
+
+<!ELEMENT %maxInclusive; %facetModel;>
+<!ATTLIST %maxInclusive;
+        %facetAttr;
+        %fixedAttr;
+        %maxInclusiveAttrs;>
+<!ELEMENT %minInclusive; %facetModel;>
+<!ATTLIST %minInclusive;
+        %facetAttr;
+        %fixedAttr;
+        %minInclusiveAttrs;>
+
+<!ELEMENT %totalDigits; %facetModel;>
+<!ATTLIST %totalDigits;
+        %facetAttr;
+        %fixedAttr;
+        %totalDigitsAttrs;>
+<!ELEMENT %fractionDigits; %facetModel;>
+<!ATTLIST %fractionDigits;
+        %facetAttr;
+        %fixedAttr;
+        %fractionDigitsAttrs;>
+
+<!ELEMENT %length; %facetModel;>
+<!ATTLIST %length;
+        %facetAttr;
+        %fixedAttr;
+        %lengthAttrs;>
+<!ELEMENT %minLength; %facetModel;>
+<!ATTLIST %minLength;
+        %facetAttr;
+        %fixedAttr;
+        %minLengthAttrs;>
+<!ELEMENT %maxLength; %facetModel;>
+<!ATTLIST %maxLength;
+        %facetAttr;
+        %fixedAttr;
+        %maxLengthAttrs;>
+
+<!-- This one can be repeated -->
+<!ELEMENT %enumeration; %facetModel;>
+<!ATTLIST %enumeration;
+        %facetAttr;
+        %enumerationAttrs;>
+
+<!ELEMENT %whiteSpace; %facetModel;>
+<!ATTLIST %whiteSpace;
+        %facetAttr;
+        %fixedAttr;
+        %whiteSpaceAttrs;>
+
+<!-- This one can be repeated -->
+<!ELEMENT %pattern; %facetModel;>
+<!ATTLIST %pattern;
+        %facetAttr;
+        %patternAttrs;>
diff --git a/org.argeo.app.core/src/org/argeo/app/core/schemas/docbook.xsd b/org.argeo.app.core/src/org/argeo/app/core/schemas/docbook.xsd
new file mode 100644 (file)
index 0000000..f2c9aed
--- /dev/null
@@ -0,0 +1,17461 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:docbook="http://docbook.org/ns/docbook">
+  <xs:import namespace="http://www.w3.org/1999/xlink" schemaLocation="xlink.xsd"/>
+  <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>
+  <xs:attributeGroup name="db.common.attributes">
+    <xs:attribute ref="xml:id"/>
+    <xs:attribute name="version"/>
+    <xs:attribute ref="xml:lang"/>
+    <xs:attribute ref="xml:base"/>
+    <xs:attribute name="remap"/>
+    <xs:attribute name="xreflabel"/>
+    <xs:attribute name="revisionflag">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="changed"/>
+          <xs:enumeration value="added"/>
+          <xs:enumeration value="deleted"/>
+          <xs:enumeration value="off"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="dir">
+      <xs:simpleType>
+        <xs:restriction base="xs:token">
+          <xs:enumeration value="ltr"/>
+          <xs:enumeration value="rtl"/>
+          <xs:enumeration value="lro"/>
+          <xs:enumeration value="rlo"/>
+        </xs:restriction>
+      </xs:simpleType>
+    </xs:attribute>
+    <xs:attribute name="arch"/>
+    <xs:attribute name="audience"/>
+    <xs:attribute name="condition"/>
+    <xs:attribute name="conformance"/>
+    <xs:attribute name="os"/>
+    <xs:attribute name="revision"/>
+    <xs:attribute name="security"/>
+    <xs:attribute name="userlevel"/>
+    <xs:attribute name="vendor"/>
+    <xs:attribute name="wordsize"/>
+    <xs:attribute name="annotations"/>
+  </xs:attributeGroup>
+  <xs:attributeGroup name="db.common.linking.attributes">
+    <xs:attribute name="linkend" type="xs:IDREF"/>
+    <xs:attribute ref="xlink:href"/>
+    <xs:attribute ref="xlink:type"/>
+    <xs:attribute ref="xlink:role"/>
+    <xs:attribute ref="xlink:arcrole"/>
+    <xs:attribute ref="xlink:title"/>
+    <xs:attribute ref="xlink:show"/>
+    <xs:attribute ref="xlink:actuate"/>
+  </xs:attributeGroup>
+  <xs:element name="title">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="titleabbrev">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="subtitle">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="info">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:title"/>
+          <xs:element ref="docbook:titleabbrev"/>
+          <xs:element ref="docbook:subtitle"/>
+        </xs:choice>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:abstract"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:artpagenums"/>
+          <xs:element ref="docbook:author"/>
+          <xs:element ref="docbook:authorgroup"/>
+          <xs:element ref="docbook:authorinitials"/>
+          <xs:element ref="docbook:bibliocoverage"/>
+          <xs:element ref="docbook:biblioid"/>
+          <xs:element ref="docbook:bibliosource"/>
+          <xs:element ref="docbook:collab"/>
+          <xs:element ref="docbook:confgroup"/>
+          <xs:element ref="docbook:contractsponsor"/>
+          <xs:element ref="docbook:contractnum"/>
+          <xs:element ref="docbook:copyright"/>
+          <xs:element ref="docbook:cover"/>
+          <xs:element ref="docbook:date"/>
+          <xs:element ref="docbook:edition"/>
+          <xs:element ref="docbook:editor"/>
+          <xs:element ref="docbook:issuenum"/>
+          <xs:element ref="docbook:keywordset"/>
+          <xs:element ref="docbook:legalnotice"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:org"/>
+          <xs:element ref="docbook:orgname"/>
+          <xs:element ref="docbook:othercredit"/>
+          <xs:element ref="docbook:pagenums"/>
+          <xs:element ref="docbook:printhistory"/>
+          <xs:element ref="docbook:pubdate"/>
+          <xs:element ref="docbook:publisher"/>
+          <xs:element ref="docbook:publishername"/>
+          <xs:element ref="docbook:releaseinfo"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:seriesvolnums"/>
+          <xs:element ref="docbook:subjectset"/>
+          <xs:element ref="docbook:volumenum"/>
+          <xs:element ref="docbook:annotation"/>
+          <xs:element ref="docbook:extendedlink"/>
+          <xs:element ref="docbook:bibliomisc"/>
+          <xs:element ref="docbook:bibliomset"/>
+          <xs:element ref="docbook:bibliorelation"/>
+          <xs:element ref="docbook:biblioset"/>
+          <xs:element ref="docbook:itermset"/>
+          <xs:element ref="docbook:productname"/>
+          <xs:element ref="docbook:productnumber"/>
+        </xs:choice>
+        <xs:sequence>
+          <xs:any minOccurs="0" maxOccurs="unbounded" namespace="##other"/>
+        </xs:sequence>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="subjectset">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="docbook:subject"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="scheme" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="subject">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="docbook:subjectterm"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="weight"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="subjectterm">
+    <xs:complexType mixed="true">
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="keywordset">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="docbook:keyword"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="keyword">
+    <xs:complexType mixed="true">
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="procedure">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:element maxOccurs="unbounded" ref="docbook:step"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="step">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice>
+          <xs:sequence>
+            <xs:choice maxOccurs="unbounded">
+              <xs:element ref="docbook:itemizedlist"/>
+              <xs:element ref="docbook:orderedlist"/>
+              <xs:element ref="docbook:procedure"/>
+              <xs:element ref="docbook:simplelist"/>
+              <xs:element ref="docbook:variablelist"/>
+              <xs:element ref="docbook:segmentedlist"/>
+              <xs:element ref="docbook:glosslist"/>
+              <xs:element ref="docbook:bibliolist"/>
+              <xs:element ref="docbook:calloutlist"/>
+              <xs:element ref="docbook:qandaset"/>
+              <xs:element ref="docbook:example"/>
+              <xs:element ref="docbook:figure"/>
+              <xs:element ref="docbook:table"/>
+              <xs:element ref="docbook:equation"/>
+              <xs:element ref="docbook:informalexample"/>
+              <xs:element ref="docbook:informalfigure"/>
+              <xs:element ref="docbook:informaltable"/>
+              <xs:element ref="docbook:informalequation"/>
+              <xs:element ref="docbook:sidebar"/>
+              <xs:element ref="docbook:blockquote"/>
+              <xs:element ref="docbook:address"/>
+              <xs:element ref="docbook:epigraph"/>
+              <xs:element ref="docbook:mediaobject"/>
+              <xs:element ref="docbook:screenshot"/>
+              <xs:element ref="docbook:task"/>
+              <xs:element ref="docbook:productionset"/>
+              <xs:element ref="docbook:constraintdef"/>
+              <xs:element ref="docbook:msgset"/>
+              <xs:element ref="docbook:screen"/>
+              <xs:element ref="docbook:literallayout"/>
+              <xs:element ref="docbook:programlistingco"/>
+              <xs:element ref="docbook:screenco"/>
+              <xs:element ref="docbook:programlisting"/>
+              <xs:element ref="docbook:synopsis"/>
+              <xs:element ref="docbook:bridgehead"/>
+              <xs:element ref="docbook:remark"/>
+              <xs:element ref="docbook:revhistory"/>
+              <xs:element ref="docbook:indexterm"/>
+              <xs:element ref="docbook:funcsynopsis"/>
+              <xs:element ref="docbook:classsynopsis"/>
+              <xs:element ref="docbook:methodsynopsis"/>
+              <xs:element ref="docbook:constructorsynopsis"/>
+              <xs:element ref="docbook:destructorsynopsis"/>
+              <xs:element ref="docbook:fieldsynopsis"/>
+              <xs:element ref="docbook:cmdsynopsis"/>
+              <xs:element ref="docbook:caution"/>
+              <xs:element ref="docbook:important"/>
+              <xs:element ref="docbook:note"/>
+              <xs:element ref="docbook:tip"/>
+              <xs:element ref="docbook:warning"/>
+              <xs:element ref="docbook:anchor"/>
+              <xs:element ref="docbook:para"/>
+              <xs:element ref="docbook:formalpara"/>
+              <xs:element ref="docbook:simpara"/>
+              <xs:element ref="docbook:annotation"/>
+            </xs:choice>
+            <xs:sequence minOccurs="0">
+              <xs:choice>
+                <xs:element ref="docbook:substeps"/>
+                <xs:element ref="docbook:stepalternatives"/>
+              </xs:choice>
+              <xs:choice minOccurs="0" maxOccurs="unbounded">
+                <xs:element ref="docbook:itemizedlist"/>
+                <xs:element ref="docbook:orderedlist"/>
+                <xs:element ref="docbook:procedure"/>
+                <xs:element ref="docbook:simplelist"/>
+                <xs:element ref="docbook:variablelist"/>
+                <xs:element ref="docbook:segmentedlist"/>
+                <xs:element ref="docbook:glosslist"/>
+                <xs:element ref="docbook:bibliolist"/>
+                <xs:element ref="docbook:calloutlist"/>
+                <xs:element ref="docbook:qandaset"/>
+                <xs:element ref="docbook:example"/>
+                <xs:element ref="docbook:figure"/>
+                <xs:element ref="docbook:table"/>
+                <xs:element ref="docbook:equation"/>
+                <xs:element ref="docbook:informalexample"/>
+                <xs:element ref="docbook:informalfigure"/>
+                <xs:element ref="docbook:informaltable"/>
+                <xs:element ref="docbook:informalequation"/>
+                <xs:element ref="docbook:sidebar"/>
+                <xs:element ref="docbook:blockquote"/>
+                <xs:element ref="docbook:address"/>
+                <xs:element ref="docbook:epigraph"/>
+                <xs:element ref="docbook:mediaobject"/>
+                <xs:element ref="docbook:screenshot"/>
+                <xs:element ref="docbook:task"/>
+                <xs:element ref="docbook:productionset"/>
+                <xs:element ref="docbook:constraintdef"/>
+                <xs:element ref="docbook:msgset"/>
+                <xs:element ref="docbook:screen"/>
+                <xs:element ref="docbook:literallayout"/>
+                <xs:element ref="docbook:programlistingco"/>
+                <xs:element ref="docbook:screenco"/>
+                <xs:element ref="docbook:programlisting"/>
+                <xs:element ref="docbook:synopsis"/>
+                <xs:element ref="docbook:bridgehead"/>
+                <xs:element ref="docbook:remark"/>
+                <xs:element ref="docbook:revhistory"/>
+                <xs:element ref="docbook:indexterm"/>
+                <xs:element ref="docbook:funcsynopsis"/>
+                <xs:element ref="docbook:classsynopsis"/>
+                <xs:element ref="docbook:methodsynopsis"/>
+                <xs:element ref="docbook:constructorsynopsis"/>
+                <xs:element ref="docbook:destructorsynopsis"/>
+                <xs:element ref="docbook:fieldsynopsis"/>
+                <xs:element ref="docbook:cmdsynopsis"/>
+                <xs:element ref="docbook:caution"/>
+                <xs:element ref="docbook:important"/>
+                <xs:element ref="docbook:note"/>
+                <xs:element ref="docbook:tip"/>
+                <xs:element ref="docbook:warning"/>
+                <xs:element ref="docbook:anchor"/>
+                <xs:element ref="docbook:para"/>
+                <xs:element ref="docbook:formalpara"/>
+                <xs:element ref="docbook:simpara"/>
+                <xs:element ref="docbook:annotation"/>
+              </xs:choice>
+            </xs:sequence>
+          </xs:sequence>
+          <xs:sequence>
+            <xs:choice>
+              <xs:element ref="docbook:substeps"/>
+              <xs:element ref="docbook:stepalternatives"/>
+            </xs:choice>
+            <xs:choice minOccurs="0" maxOccurs="unbounded">
+              <xs:element ref="docbook:itemizedlist"/>
+              <xs:element ref="docbook:orderedlist"/>
+              <xs:element ref="docbook:procedure"/>
+              <xs:element ref="docbook:simplelist"/>
+              <xs:element ref="docbook:variablelist"/>
+              <xs:element ref="docbook:segmentedlist"/>
+              <xs:element ref="docbook:glosslist"/>
+              <xs:element ref="docbook:bibliolist"/>
+              <xs:element ref="docbook:calloutlist"/>
+              <xs:element ref="docbook:qandaset"/>
+              <xs:element ref="docbook:example"/>
+              <xs:element ref="docbook:figure"/>
+              <xs:element ref="docbook:table"/>
+              <xs:element ref="docbook:equation"/>
+              <xs:element ref="docbook:informalexample"/>
+              <xs:element ref="docbook:informalfigure"/>
+              <xs:element ref="docbook:informaltable"/>
+              <xs:element ref="docbook:informalequation"/>
+              <xs:element ref="docbook:sidebar"/>
+              <xs:element ref="docbook:blockquote"/>
+              <xs:element ref="docbook:address"/>
+              <xs:element ref="docbook:epigraph"/>
+              <xs:element ref="docbook:mediaobject"/>
+              <xs:element ref="docbook:screenshot"/>
+              <xs:element ref="docbook:task"/>
+              <xs:element ref="docbook:productionset"/>
+              <xs:element ref="docbook:constraintdef"/>
+              <xs:element ref="docbook:msgset"/>
+              <xs:element ref="docbook:screen"/>
+              <xs:element ref="docbook:literallayout"/>
+              <xs:element ref="docbook:programlistingco"/>
+              <xs:element ref="docbook:screenco"/>
+              <xs:element ref="docbook:programlisting"/>
+              <xs:element ref="docbook:synopsis"/>
+              <xs:element ref="docbook:bridgehead"/>
+              <xs:element ref="docbook:remark"/>
+              <xs:element ref="docbook:revhistory"/>
+              <xs:element ref="docbook:indexterm"/>
+              <xs:element ref="docbook:funcsynopsis"/>
+              <xs:element ref="docbook:classsynopsis"/>
+              <xs:element ref="docbook:methodsynopsis"/>
+              <xs:element ref="docbook:constructorsynopsis"/>
+              <xs:element ref="docbook:destructorsynopsis"/>
+              <xs:element ref="docbook:fieldsynopsis"/>
+              <xs:element ref="docbook:cmdsynopsis"/>
+              <xs:element ref="docbook:caution"/>
+              <xs:element ref="docbook:important"/>
+              <xs:element ref="docbook:note"/>
+              <xs:element ref="docbook:tip"/>
+              <xs:element ref="docbook:warning"/>
+              <xs:element ref="docbook:anchor"/>
+              <xs:element ref="docbook:para"/>
+              <xs:element ref="docbook:formalpara"/>
+              <xs:element ref="docbook:simpara"/>
+              <xs:element ref="docbook:annotation"/>
+            </xs:choice>
+          </xs:sequence>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="performance">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="optional"/>
+            <xs:enumeration value="required"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="stepalternatives">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:element maxOccurs="unbounded" ref="docbook:step"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="performance">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="optional"/>
+            <xs:enumeration value="required"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="substeps">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="docbook:step"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="performance">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="optional"/>
+            <xs:enumeration value="required"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="sidebar">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="abstract">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="personblurb">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="blockquote">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:attribution"/>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="attribution">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="bridgehead">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="renderas">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="sect1"/>
+            <xs:enumeration value="sect2"/>
+            <xs:enumeration value="sect3"/>
+            <xs:enumeration value="sect4"/>
+            <xs:enumeration value="sect5"/>
+            <xs:enumeration value="other"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="otherrenderas" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="remark">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="epigraph">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:element minOccurs="0" ref="docbook:attribution"/>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:literallayout"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="footnote">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:itemizedlist"/>
+        <xs:element ref="docbook:orderedlist"/>
+        <xs:element ref="docbook:procedure"/>
+        <xs:element ref="docbook:simplelist"/>
+        <xs:element ref="docbook:variablelist"/>
+        <xs:element ref="docbook:segmentedlist"/>
+        <xs:element ref="docbook:glosslist"/>
+        <xs:element ref="docbook:bibliolist"/>
+        <xs:element ref="docbook:calloutlist"/>
+        <xs:element ref="docbook:qandaset"/>
+        <xs:element ref="docbook:example"/>
+        <xs:element ref="docbook:figure"/>
+        <xs:element ref="docbook:table"/>
+        <xs:element ref="docbook:equation"/>
+        <xs:element ref="docbook:informalexample"/>
+        <xs:element ref="docbook:informalfigure"/>
+        <xs:element ref="docbook:informaltable"/>
+        <xs:element ref="docbook:informalequation"/>
+        <xs:element ref="docbook:sidebar"/>
+        <xs:element ref="docbook:blockquote"/>
+        <xs:element ref="docbook:address"/>
+        <xs:element ref="docbook:epigraph"/>
+        <xs:element ref="docbook:mediaobject"/>
+        <xs:element ref="docbook:screenshot"/>
+        <xs:element ref="docbook:task"/>
+        <xs:element ref="docbook:productionset"/>
+        <xs:element ref="docbook:constraintdef"/>
+        <xs:element ref="docbook:msgset"/>
+        <xs:element ref="docbook:screen"/>
+        <xs:element ref="docbook:literallayout"/>
+        <xs:element ref="docbook:programlistingco"/>
+        <xs:element ref="docbook:screenco"/>
+        <xs:element ref="docbook:programlisting"/>
+        <xs:element ref="docbook:synopsis"/>
+        <xs:element ref="docbook:bridgehead"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:revhistory"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:funcsynopsis"/>
+        <xs:element ref="docbook:classsynopsis"/>
+        <xs:element ref="docbook:methodsynopsis"/>
+        <xs:element ref="docbook:constructorsynopsis"/>
+        <xs:element ref="docbook:destructorsynopsis"/>
+        <xs:element ref="docbook:fieldsynopsis"/>
+        <xs:element ref="docbook:cmdsynopsis"/>
+        <xs:element ref="docbook:caution"/>
+        <xs:element ref="docbook:important"/>
+        <xs:element ref="docbook:note"/>
+        <xs:element ref="docbook:tip"/>
+        <xs:element ref="docbook:warning"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:para"/>
+        <xs:element ref="docbook:formalpara"/>
+        <xs:element ref="docbook:simpara"/>
+        <xs:element ref="docbook:annotation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="formalpara">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:indexterm"/>
+        <xs:element ref="docbook:para"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="para">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:info"/>
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:itemizedlist"/>
+        <xs:element ref="docbook:orderedlist"/>
+        <xs:element ref="docbook:procedure"/>
+        <xs:element ref="docbook:simplelist"/>
+        <xs:element ref="docbook:variablelist"/>
+        <xs:element ref="docbook:segmentedlist"/>
+        <xs:element ref="docbook:glosslist"/>
+        <xs:element ref="docbook:bibliolist"/>
+        <xs:element ref="docbook:calloutlist"/>
+        <xs:element ref="docbook:qandaset"/>
+        <xs:element ref="docbook:example"/>
+        <xs:element ref="docbook:figure"/>
+        <xs:element ref="docbook:table"/>
+        <xs:element ref="docbook:equation"/>
+        <xs:element ref="docbook:informalexample"/>
+        <xs:element ref="docbook:informalfigure"/>
+        <xs:element ref="docbook:informaltable"/>
+        <xs:element ref="docbook:informalequation"/>
+        <xs:element ref="docbook:sidebar"/>
+        <xs:element ref="docbook:blockquote"/>
+        <xs:element ref="docbook:address"/>
+        <xs:element ref="docbook:epigraph"/>
+        <xs:element ref="docbook:mediaobject"/>
+        <xs:element ref="docbook:screenshot"/>
+        <xs:element ref="docbook:task"/>
+        <xs:element ref="docbook:productionset"/>
+        <xs:element ref="docbook:constraintdef"/>
+        <xs:element ref="docbook:msgset"/>
+        <xs:element ref="docbook:screen"/>
+        <xs:element ref="docbook:literallayout"/>
+        <xs:element ref="docbook:programlistingco"/>
+        <xs:element ref="docbook:screenco"/>
+        <xs:element ref="docbook:programlisting"/>
+        <xs:element ref="docbook:synopsis"/>
+        <xs:element ref="docbook:bridgehead"/>
+        <xs:element ref="docbook:revhistory"/>
+        <xs:element ref="docbook:funcsynopsis"/>
+        <xs:element ref="docbook:classsynopsis"/>
+        <xs:element ref="docbook:methodsynopsis"/>
+        <xs:element ref="docbook:constructorsynopsis"/>
+        <xs:element ref="docbook:destructorsynopsis"/>
+        <xs:element ref="docbook:fieldsynopsis"/>
+        <xs:element ref="docbook:cmdsynopsis"/>
+        <xs:element ref="docbook:caution"/>
+        <xs:element ref="docbook:important"/>
+        <xs:element ref="docbook:note"/>
+        <xs:element ref="docbook:tip"/>
+        <xs:element ref="docbook:warning"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="simpara">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:info"/>
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="itemizedlist">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:element maxOccurs="unbounded" ref="docbook:listitem"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="spacing">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="compact"/>
+            <xs:enumeration value="normal"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="mark" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="orderedlist">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:element maxOccurs="unbounded" ref="docbook:listitem"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="spacing">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="compact"/>
+            <xs:enumeration value="normal"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="continuation">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="continues"/>
+            <xs:enumeration value="restarts"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="startingnumber" type="xs:NMTOKEN"/>
+      <xs:attribute name="inheritnum">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="ignore"/>
+            <xs:enumeration value="inherit"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="numeration">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="arabic"/>
+            <xs:enumeration value="upperalpha"/>
+            <xs:enumeration value="loweralpha"/>
+            <xs:enumeration value="upperroman"/>
+            <xs:enumeration value="lowerroman"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="listitem">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:itemizedlist"/>
+        <xs:element ref="docbook:orderedlist"/>
+        <xs:element ref="docbook:procedure"/>
+        <xs:element ref="docbook:simplelist"/>
+        <xs:element ref="docbook:variablelist"/>
+        <xs:element ref="docbook:segmentedlist"/>
+        <xs:element ref="docbook:glosslist"/>
+        <xs:element ref="docbook:bibliolist"/>
+        <xs:element ref="docbook:calloutlist"/>
+        <xs:element ref="docbook:qandaset"/>
+        <xs:element ref="docbook:example"/>
+        <xs:element ref="docbook:figure"/>
+        <xs:element ref="docbook:table"/>
+        <xs:element ref="docbook:equation"/>
+        <xs:element ref="docbook:informalexample"/>
+        <xs:element ref="docbook:informalfigure"/>
+        <xs:element ref="docbook:informaltable"/>
+        <xs:element ref="docbook:informalequation"/>
+        <xs:element ref="docbook:sidebar"/>
+        <xs:element ref="docbook:blockquote"/>
+        <xs:element ref="docbook:address"/>
+        <xs:element ref="docbook:epigraph"/>
+        <xs:element ref="docbook:mediaobject"/>
+        <xs:element ref="docbook:screenshot"/>
+        <xs:element ref="docbook:task"/>
+        <xs:element ref="docbook:productionset"/>
+        <xs:element ref="docbook:constraintdef"/>
+        <xs:element ref="docbook:msgset"/>
+        <xs:element ref="docbook:screen"/>
+        <xs:element ref="docbook:literallayout"/>
+        <xs:element ref="docbook:programlistingco"/>
+        <xs:element ref="docbook:screenco"/>
+        <xs:element ref="docbook:programlisting"/>
+        <xs:element ref="docbook:synopsis"/>
+        <xs:element ref="docbook:bridgehead"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:revhistory"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:funcsynopsis"/>
+        <xs:element ref="docbook:classsynopsis"/>
+        <xs:element ref="docbook:methodsynopsis"/>
+        <xs:element ref="docbook:constructorsynopsis"/>
+        <xs:element ref="docbook:destructorsynopsis"/>
+        <xs:element ref="docbook:fieldsynopsis"/>
+        <xs:element ref="docbook:cmdsynopsis"/>
+        <xs:element ref="docbook:caution"/>
+        <xs:element ref="docbook:important"/>
+        <xs:element ref="docbook:note"/>
+        <xs:element ref="docbook:tip"/>
+        <xs:element ref="docbook:warning"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:para"/>
+        <xs:element ref="docbook:formalpara"/>
+        <xs:element ref="docbook:simpara"/>
+        <xs:element ref="docbook:annotation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="override" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="segmentedlist">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="docbook:segtitle"/>
+        <xs:element maxOccurs="unbounded" ref="docbook:seglistitem"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="segtitle">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="seglistitem">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="docbook:seg"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="seg">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="simplelist">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="docbook:member"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="type" default="vert">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="horiz"/>
+            <xs:enumeration value="vert"/>
+            <xs:enumeration value="inline"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="columns" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="member">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="variablelist">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:element maxOccurs="unbounded" ref="docbook:varlistentry"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="spacing">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="compact"/>
+            <xs:enumeration value="normal"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="termlength"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="varlistentry">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="docbook:term"/>
+        <xs:element ref="docbook:listitem"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="term">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="example">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:element minOccurs="0" ref="docbook:caption"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="floatstyle"/>
+      <xs:attribute name="width" type="xs:NMTOKEN"/>
+      <xs:attribute name="pgwide">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="informalexample">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:element minOccurs="0" ref="docbook:caption"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="floatstyle"/>
+      <xs:attribute name="width" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="literallayout">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:info"/>
+        <xs:element ref="docbook:textobject"/>
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:lineannotation"/>
+        <xs:element ref="docbook:co"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="continuation">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="continues"/>
+            <xs:enumeration value="restarts"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="linenumbering">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="numbered"/>
+            <xs:enumeration value="unnumbered"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="startinglinenumber" type="xs:NMTOKEN"/>
+      <xs:attribute name="language"/>
+      <xs:attribute ref="xml:space"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="monospaced"/>
+            <xs:enumeration value="normal"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="screen">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:info"/>
+        <xs:element ref="docbook:textobject"/>
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:lineannotation"/>
+        <xs:element ref="docbook:co"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="continuation">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="continues"/>
+            <xs:enumeration value="restarts"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="linenumbering">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="numbered"/>
+            <xs:enumeration value="unnumbered"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="startinglinenumber" type="xs:NMTOKEN"/>
+      <xs:attribute name="language"/>
+      <xs:attribute ref="xml:space"/>
+      <xs:attribute name="width" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="screenshot">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:element ref="docbook:mediaobject"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="figure">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:element minOccurs="0" ref="docbook:caption"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="pgwide">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="floatstyle"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="informalfigure">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:element minOccurs="0" ref="docbook:caption"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="pgwide">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="floatstyle"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="mediaobject">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:element minOccurs="0" ref="docbook:alt"/>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:videoobject"/>
+          <xs:element ref="docbook:audioobject"/>
+          <xs:element ref="docbook:imageobject"/>
+          <xs:element ref="docbook:textobject"/>
+          <xs:element ref="docbook:imageobjectco"/>
+        </xs:choice>
+        <xs:element minOccurs="0" ref="docbook:caption"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="inlinemediaobject">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:element minOccurs="0" ref="docbook:alt"/>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:videoobject"/>
+          <xs:element ref="docbook:audioobject"/>
+          <xs:element ref="docbook:imageobject"/>
+          <xs:element ref="docbook:textobject"/>
+          <xs:element ref="docbook:imageobjectco"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="videoobject">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:element ref="docbook:videodata"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="audioobject">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:element ref="docbook:audiodata"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="imageobject">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:element ref="docbook:imagedata"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="textobject">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:choice>
+          <xs:element ref="docbook:phrase"/>
+          <xs:element ref="docbook:textdata"/>
+          <xs:choice maxOccurs="unbounded">
+            <xs:element ref="docbook:itemizedlist"/>
+            <xs:element ref="docbook:orderedlist"/>
+            <xs:element ref="docbook:procedure"/>
+            <xs:element ref="docbook:simplelist"/>
+            <xs:element ref="docbook:variablelist"/>
+            <xs:element ref="docbook:segmentedlist"/>
+            <xs:element ref="docbook:glosslist"/>
+            <xs:element ref="docbook:bibliolist"/>
+            <xs:element ref="docbook:calloutlist"/>
+            <xs:element ref="docbook:qandaset"/>
+            <xs:element ref="docbook:example"/>
+            <xs:element ref="docbook:figure"/>
+            <xs:element ref="docbook:table"/>
+            <xs:element ref="docbook:equation"/>
+            <xs:element ref="docbook:informalexample"/>
+            <xs:element ref="docbook:informalfigure"/>
+            <xs:element ref="docbook:informaltable"/>
+            <xs:element ref="docbook:informalequation"/>
+            <xs:element ref="docbook:sidebar"/>
+            <xs:element ref="docbook:blockquote"/>
+            <xs:element ref="docbook:address"/>
+            <xs:element ref="docbook:epigraph"/>
+            <xs:element ref="docbook:mediaobject"/>
+            <xs:element ref="docbook:screenshot"/>
+            <xs:element ref="docbook:task"/>
+            <xs:element ref="docbook:productionset"/>
+            <xs:element ref="docbook:constraintdef"/>
+            <xs:element ref="docbook:msgset"/>
+            <xs:element ref="docbook:screen"/>
+            <xs:element ref="docbook:literallayout"/>
+            <xs:element ref="docbook:programlistingco"/>
+            <xs:element ref="docbook:screenco"/>
+            <xs:element ref="docbook:programlisting"/>
+            <xs:element ref="docbook:synopsis"/>
+            <xs:element ref="docbook:bridgehead"/>
+            <xs:element ref="docbook:remark"/>
+            <xs:element ref="docbook:revhistory"/>
+            <xs:element ref="docbook:indexterm"/>
+            <xs:element ref="docbook:funcsynopsis"/>
+            <xs:element ref="docbook:classsynopsis"/>
+            <xs:element ref="docbook:methodsynopsis"/>
+            <xs:element ref="docbook:constructorsynopsis"/>
+            <xs:element ref="docbook:destructorsynopsis"/>
+            <xs:element ref="docbook:fieldsynopsis"/>
+            <xs:element ref="docbook:cmdsynopsis"/>
+            <xs:element ref="docbook:caution"/>
+            <xs:element ref="docbook:important"/>
+            <xs:element ref="docbook:note"/>
+            <xs:element ref="docbook:tip"/>
+            <xs:element ref="docbook:warning"/>
+            <xs:element ref="docbook:anchor"/>
+            <xs:element ref="docbook:para"/>
+            <xs:element ref="docbook:formalpara"/>
+            <xs:element ref="docbook:simpara"/>
+            <xs:element ref="docbook:annotation"/>
+          </xs:choice>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="videodata">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="format"/>
+      <xs:attribute name="fileref"/>
+      <xs:attribute name="entityref" type="xs:ENTITY"/>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="char"/>
+            <xs:enumeration value="justify"/>
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="right"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="valign">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="bottom"/>
+            <xs:enumeration value="middle"/>
+            <xs:enumeration value="top"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="width"/>
+      <xs:attribute name="contentwidth"/>
+      <xs:attribute name="scalefit">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="scale" type="xs:NMTOKEN"/>
+      <xs:attribute name="depth"/>
+      <xs:attribute name="contentdepth"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="audiodata">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="format"/>
+      <xs:attribute name="fileref"/>
+      <xs:attribute name="entityref" type="xs:ENTITY"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="imagedata">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="format"/>
+      <xs:attribute name="fileref"/>
+      <xs:attribute name="entityref" type="xs:ENTITY"/>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="char"/>
+            <xs:enumeration value="justify"/>
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="right"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="valign">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="bottom"/>
+            <xs:enumeration value="middle"/>
+            <xs:enumeration value="top"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="width"/>
+      <xs:attribute name="contentwidth"/>
+      <xs:attribute name="scalefit">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="scale" type="xs:NMTOKEN"/>
+      <xs:attribute name="depth"/>
+      <xs:attribute name="contentdepth"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="textdata">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="format"/>
+      <xs:attribute name="fileref"/>
+      <xs:attribute name="entityref" type="xs:ENTITY"/>
+      <xs:attribute name="encoding"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="caption">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:itemizedlist"/>
+        <xs:element ref="docbook:orderedlist"/>
+        <xs:element ref="docbook:procedure"/>
+        <xs:element ref="docbook:simplelist"/>
+        <xs:element ref="docbook:variablelist"/>
+        <xs:element ref="docbook:segmentedlist"/>
+        <xs:element ref="docbook:glosslist"/>
+        <xs:element ref="docbook:bibliolist"/>
+        <xs:element ref="docbook:calloutlist"/>
+        <xs:element ref="docbook:qandaset"/>
+        <xs:element ref="docbook:caution"/>
+        <xs:element ref="docbook:important"/>
+        <xs:element ref="docbook:note"/>
+        <xs:element ref="docbook:tip"/>
+        <xs:element ref="docbook:warning"/>
+        <xs:element ref="docbook:example"/>
+        <xs:element ref="docbook:figure"/>
+        <xs:element ref="docbook:table"/>
+        <xs:element ref="docbook:informalexample"/>
+        <xs:element ref="docbook:informalfigure"/>
+        <xs:element ref="docbook:informaltable"/>
+        <xs:element ref="docbook:sidebar"/>
+        <xs:element ref="docbook:blockquote"/>
+        <xs:element ref="docbook:address"/>
+        <xs:element ref="docbook:epigraph"/>
+        <xs:element ref="docbook:mediaobject"/>
+        <xs:element ref="docbook:screenshot"/>
+        <xs:element ref="docbook:task"/>
+        <xs:element ref="docbook:productionset"/>
+        <xs:element ref="docbook:constraintdef"/>
+        <xs:element ref="docbook:msgset"/>
+        <xs:element ref="docbook:programlisting"/>
+        <xs:element ref="docbook:screen"/>
+        <xs:element ref="docbook:literallayout"/>
+        <xs:element ref="docbook:synopsis"/>
+        <xs:element ref="docbook:programlistingco"/>
+        <xs:element ref="docbook:screenco"/>
+        <xs:element ref="docbook:cmdsynopsis"/>
+        <xs:element ref="docbook:funcsynopsis"/>
+        <xs:element ref="docbook:classsynopsis"/>
+        <xs:element ref="docbook:methodsynopsis"/>
+        <xs:element ref="docbook:constructorsynopsis"/>
+        <xs:element ref="docbook:destructorsynopsis"/>
+        <xs:element ref="docbook:fieldsynopsis"/>
+        <xs:element ref="docbook:bridgehead"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:revhistory"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:equation"/>
+        <xs:element ref="docbook:informalequation"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:para"/>
+        <xs:element ref="docbook:formalpara"/>
+        <xs:element ref="docbook:simpara"/>
+        <xs:element ref="docbook:annotation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class"/>
+      <xs:attribute name="style"/>
+      <xs:attribute name="title"/>
+      <xs:attribute name="lang"/>
+      <xs:attribute name="onclick"/>
+      <xs:attribute name="ondblclick"/>
+      <xs:attribute name="onmousedown"/>
+      <xs:attribute name="onmouseup"/>
+      <xs:attribute name="onmouseover"/>
+      <xs:attribute name="onmousemove"/>
+      <xs:attribute name="onmouseout"/>
+      <xs:attribute name="onkeypress"/>
+      <xs:attribute name="onkeydown"/>
+      <xs:attribute name="onkeyup"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="address">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:pob"/>
+        <xs:element ref="docbook:street"/>
+        <xs:element ref="docbook:city"/>
+        <xs:element ref="docbook:state"/>
+        <xs:element ref="docbook:postcode"/>
+        <xs:element ref="docbook:country"/>
+        <xs:element ref="docbook:phone"/>
+        <xs:element ref="docbook:fax"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:otheraddr"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="continuation">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="continues"/>
+            <xs:enumeration value="restarts"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="linenumbering">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="numbered"/>
+            <xs:enumeration value="unnumbered"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="startinglinenumber" type="xs:NMTOKEN"/>
+      <xs:attribute name="language"/>
+      <xs:attribute ref="xml:space"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="street">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="pob">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="postcode">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="city">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="state">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="country">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="phone">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="fax">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="otheraddr">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="affiliation">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:shortaffil"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:jobtitle"/>
+        <xs:choice>
+          <xs:element minOccurs="0" ref="docbook:org"/>
+          <xs:sequence>
+            <xs:element minOccurs="0" ref="docbook:orgname"/>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:orgdiv"/>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:address"/>
+          </xs:sequence>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="shortaffil">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="jobtitle">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="orgname">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="consortium"/>
+            <xs:enumeration value="corporation"/>
+            <xs:enumeration value="informal"/>
+            <xs:enumeration value="nonprofit"/>
+            <xs:enumeration value="other"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="otherclass"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="orgdiv">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="artpagenums">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="personname">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:honorific"/>
+        <xs:element ref="docbook:firstname"/>
+        <xs:element ref="docbook:surname"/>
+        <xs:element ref="docbook:lineage"/>
+        <xs:element ref="docbook:othername"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="author">
+    <xs:complexType>
+      <xs:choice>
+        <xs:sequence>
+          <xs:element ref="docbook:personname"/>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:personblurb"/>
+            <xs:element ref="docbook:affiliation"/>
+            <xs:element ref="docbook:email"/>
+            <xs:element ref="docbook:uri"/>
+            <xs:element ref="docbook:address"/>
+            <xs:element ref="docbook:contrib"/>
+          </xs:choice>
+        </xs:sequence>
+        <xs:sequence>
+          <xs:element ref="docbook:orgname"/>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:orgdiv"/>
+            <xs:element ref="docbook:affiliation"/>
+            <xs:element ref="docbook:email"/>
+            <xs:element ref="docbook:uri"/>
+            <xs:element ref="docbook:address"/>
+            <xs:element ref="docbook:contrib"/>
+          </xs:choice>
+        </xs:sequence>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="authorgroup">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:othercredit"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="collab">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:person"/>
+          <xs:element ref="docbook:personname"/>
+          <xs:element ref="docbook:org"/>
+          <xs:element ref="docbook:orgname"/>
+        </xs:choice>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:affiliation"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="authorinitials">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="person">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="docbook:personname"/>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:affiliation"/>
+          <xs:element ref="docbook:email"/>
+          <xs:element ref="docbook:uri"/>
+          <xs:element ref="docbook:personblurb"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="org">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="docbook:orgname"/>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:affiliation"/>
+          <xs:element ref="docbook:email"/>
+          <xs:element ref="docbook:uri"/>
+          <xs:element ref="docbook:orgdiv"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="confgroup">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:confdates"/>
+        <xs:element ref="docbook:conftitle"/>
+        <xs:element ref="docbook:confnum"/>
+        <xs:element ref="docbook:confsponsor"/>
+        <xs:element ref="docbook:address"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="confdates">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="conftitle">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="confnum">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="confsponsor">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="contractnum">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="contractsponsor">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="copyright">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="docbook:year"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:holder"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="year">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="holder">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="cover">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:para"/>
+        <xs:element ref="docbook:formalpara"/>
+        <xs:element ref="docbook:simpara"/>
+        <xs:element ref="docbook:itemizedlist"/>
+        <xs:element ref="docbook:orderedlist"/>
+        <xs:element ref="docbook:procedure"/>
+        <xs:element ref="docbook:simplelist"/>
+        <xs:element ref="docbook:variablelist"/>
+        <xs:element ref="docbook:segmentedlist"/>
+        <xs:element ref="docbook:glosslist"/>
+        <xs:element ref="docbook:bibliolist"/>
+        <xs:element ref="docbook:calloutlist"/>
+        <xs:element ref="docbook:qandaset"/>
+        <xs:element ref="docbook:informalexample"/>
+        <xs:element ref="docbook:informalfigure"/>
+        <xs:element ref="docbook:informaltable"/>
+        <xs:element ref="docbook:informalequation"/>
+        <xs:element ref="docbook:sidebar"/>
+        <xs:element ref="docbook:blockquote"/>
+        <xs:element ref="docbook:address"/>
+        <xs:element ref="docbook:epigraph"/>
+        <xs:element ref="docbook:mediaobject"/>
+        <xs:element ref="docbook:screenshot"/>
+        <xs:element ref="docbook:task"/>
+        <xs:element ref="docbook:productionset"/>
+        <xs:element ref="docbook:constraintdef"/>
+        <xs:element ref="docbook:msgset"/>
+        <xs:element ref="docbook:screen"/>
+        <xs:element ref="docbook:literallayout"/>
+        <xs:element ref="docbook:programlistingco"/>
+        <xs:element ref="docbook:screenco"/>
+        <xs:element ref="docbook:programlisting"/>
+        <xs:element ref="docbook:synopsis"/>
+        <xs:element ref="docbook:bridgehead"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:revhistory"/>
+        <xs:element ref="docbook:funcsynopsis"/>
+        <xs:element ref="docbook:classsynopsis"/>
+        <xs:element ref="docbook:methodsynopsis"/>
+        <xs:element ref="docbook:constructorsynopsis"/>
+        <xs:element ref="docbook:destructorsynopsis"/>
+        <xs:element ref="docbook:fieldsynopsis"/>
+        <xs:element ref="docbook:cmdsynopsis"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="date">
+    <xs:complexType mixed="true">
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="edition">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="editor">
+    <xs:complexType>
+      <xs:choice>
+        <xs:sequence>
+          <xs:element ref="docbook:personname"/>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:personblurb"/>
+            <xs:element ref="docbook:affiliation"/>
+            <xs:element ref="docbook:email"/>
+            <xs:element ref="docbook:uri"/>
+            <xs:element ref="docbook:address"/>
+            <xs:element ref="docbook:contrib"/>
+          </xs:choice>
+        </xs:sequence>
+        <xs:sequence>
+          <xs:element ref="docbook:orgname"/>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:orgdiv"/>
+            <xs:element ref="docbook:affiliation"/>
+            <xs:element ref="docbook:email"/>
+            <xs:element ref="docbook:uri"/>
+            <xs:element ref="docbook:address"/>
+            <xs:element ref="docbook:contrib"/>
+          </xs:choice>
+        </xs:sequence>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="biblioid">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="doi"/>
+            <xs:enumeration value="isbn"/>
+            <xs:enumeration value="isrn"/>
+            <xs:enumeration value="issn"/>
+            <xs:enumeration value="libraryofcongress"/>
+            <xs:enumeration value="pubsnumber"/>
+            <xs:enumeration value="uri"/>
+            <xs:enumeration value="other"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="otherclass" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="citebiblioid">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="doi"/>
+            <xs:enumeration value="isbn"/>
+            <xs:enumeration value="isrn"/>
+            <xs:enumeration value="issn"/>
+            <xs:enumeration value="libraryofcongress"/>
+            <xs:enumeration value="pubsnumber"/>
+            <xs:enumeration value="uri"/>
+            <xs:enumeration value="other"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="otherclass" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="bibliosource">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="doi"/>
+            <xs:enumeration value="isbn"/>
+            <xs:enumeration value="isrn"/>
+            <xs:enumeration value="issn"/>
+            <xs:enumeration value="libraryofcongress"/>
+            <xs:enumeration value="pubsnumber"/>
+            <xs:enumeration value="uri"/>
+            <xs:enumeration value="other"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="otherclass" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="bibliorelation">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="doi"/>
+            <xs:enumeration value="isbn"/>
+            <xs:enumeration value="isrn"/>
+            <xs:enumeration value="issn"/>
+            <xs:enumeration value="libraryofcongress"/>
+            <xs:enumeration value="pubsnumber"/>
+            <xs:enumeration value="uri"/>
+            <xs:enumeration value="other"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="otherclass" type="xs:NMTOKEN"/>
+      <xs:attribute name="type">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="hasformat"/>
+            <xs:enumeration value="haspart"/>
+            <xs:enumeration value="hasversion"/>
+            <xs:enumeration value="isformatof"/>
+            <xs:enumeration value="ispartof"/>
+            <xs:enumeration value="isreferencedby"/>
+            <xs:enumeration value="isreplacedby"/>
+            <xs:enumeration value="isrequiredby"/>
+            <xs:enumeration value="isversionof"/>
+            <xs:enumeration value="references"/>
+            <xs:enumeration value="replaces"/>
+            <xs:enumeration value="requires"/>
+            <xs:enumeration value="othertype"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="othertype" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="bibliocoverage">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="spatial">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="dcmipoint"/>
+            <xs:enumeration value="iso3166"/>
+            <xs:enumeration value="dcmibox"/>
+            <xs:enumeration value="tgn"/>
+            <xs:enumeration value="otherspatial"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="otherspatial" type="xs:NMTOKEN"/>
+      <xs:attribute name="temporal">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="dcmiperiod"/>
+            <xs:enumeration value="w3c-dtf"/>
+            <xs:enumeration value="othertemporal"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="othertemporal" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="legalnotice">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="othercredit">
+    <xs:complexType>
+      <xs:choice>
+        <xs:sequence>
+          <xs:element ref="docbook:personname"/>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:personblurb"/>
+            <xs:element ref="docbook:affiliation"/>
+            <xs:element ref="docbook:email"/>
+            <xs:element ref="docbook:uri"/>
+            <xs:element ref="docbook:address"/>
+            <xs:element ref="docbook:contrib"/>
+          </xs:choice>
+        </xs:sequence>
+        <xs:sequence>
+          <xs:element ref="docbook:orgname"/>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:orgdiv"/>
+            <xs:element ref="docbook:affiliation"/>
+            <xs:element ref="docbook:email"/>
+            <xs:element ref="docbook:uri"/>
+            <xs:element ref="docbook:address"/>
+            <xs:element ref="docbook:contrib"/>
+          </xs:choice>
+        </xs:sequence>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="copyeditor"/>
+            <xs:enumeration value="graphicdesigner"/>
+            <xs:enumeration value="other"/>
+            <xs:enumeration value="productioneditor"/>
+            <xs:enumeration value="technicaleditor"/>
+            <xs:enumeration value="translator"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="otherclass" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="pagenums">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="contrib">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="honorific">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="firstname">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="surname">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="lineage">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="othername">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="printhistory">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:para"/>
+        <xs:element ref="docbook:formalpara"/>
+        <xs:element ref="docbook:simpara"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="pubdate">
+    <xs:complexType mixed="true">
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="publisher">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="docbook:publishername"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:address"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="publishername">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="releaseinfo">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="revhistory">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="docbook:revision"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="revision">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:revnumber"/>
+        <xs:element ref="docbook:date"/>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:authorinitials"/>
+          <xs:element ref="docbook:author"/>
+        </xs:choice>
+        <xs:choice minOccurs="0">
+          <xs:element ref="docbook:revremark"/>
+          <xs:element ref="docbook:revdescription"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="revnumber">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="revremark">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="revdescription">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:itemizedlist"/>
+        <xs:element ref="docbook:orderedlist"/>
+        <xs:element ref="docbook:procedure"/>
+        <xs:element ref="docbook:simplelist"/>
+        <xs:element ref="docbook:variablelist"/>
+        <xs:element ref="docbook:segmentedlist"/>
+        <xs:element ref="docbook:glosslist"/>
+        <xs:element ref="docbook:bibliolist"/>
+        <xs:element ref="docbook:calloutlist"/>
+        <xs:element ref="docbook:qandaset"/>
+        <xs:element ref="docbook:example"/>
+        <xs:element ref="docbook:figure"/>
+        <xs:element ref="docbook:table"/>
+        <xs:element ref="docbook:equation"/>
+        <xs:element ref="docbook:informalexample"/>
+        <xs:element ref="docbook:informalfigure"/>
+        <xs:element ref="docbook:informaltable"/>
+        <xs:element ref="docbook:informalequation"/>
+        <xs:element ref="docbook:sidebar"/>
+        <xs:element ref="docbook:blockquote"/>
+        <xs:element ref="docbook:address"/>
+        <xs:element ref="docbook:epigraph"/>
+        <xs:element ref="docbook:mediaobject"/>
+        <xs:element ref="docbook:screenshot"/>
+        <xs:element ref="docbook:task"/>
+        <xs:element ref="docbook:productionset"/>
+        <xs:element ref="docbook:constraintdef"/>
+        <xs:element ref="docbook:msgset"/>
+        <xs:element ref="docbook:screen"/>
+        <xs:element ref="docbook:literallayout"/>
+        <xs:element ref="docbook:programlistingco"/>
+        <xs:element ref="docbook:screenco"/>
+        <xs:element ref="docbook:programlisting"/>
+        <xs:element ref="docbook:synopsis"/>
+        <xs:element ref="docbook:bridgehead"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:revhistory"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:funcsynopsis"/>
+        <xs:element ref="docbook:classsynopsis"/>
+        <xs:element ref="docbook:methodsynopsis"/>
+        <xs:element ref="docbook:constructorsynopsis"/>
+        <xs:element ref="docbook:destructorsynopsis"/>
+        <xs:element ref="docbook:fieldsynopsis"/>
+        <xs:element ref="docbook:cmdsynopsis"/>
+        <xs:element ref="docbook:caution"/>
+        <xs:element ref="docbook:important"/>
+        <xs:element ref="docbook:note"/>
+        <xs:element ref="docbook:tip"/>
+        <xs:element ref="docbook:warning"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:para"/>
+        <xs:element ref="docbook:formalpara"/>
+        <xs:element ref="docbook:simpara"/>
+        <xs:element ref="docbook:annotation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="seriesvolnums">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="volumenum">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="issuenum">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="package">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="email">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="lineannotation">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="parameter">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="command"/>
+            <xs:enumeration value="function"/>
+            <xs:enumeration value="option"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="replaceable">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:co"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="command"/>
+            <xs:enumeration value="function"/>
+            <xs:enumeration value="option"/>
+            <xs:enumeration value="parameter"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="uri">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="type"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="abbrev">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:trademark"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="acronym">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:trademark"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="citation">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="citerefentry">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="docbook:refentrytitle"/>
+        <xs:element minOccurs="0" ref="docbook:manvolnum"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="refentrytitle">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="manvolnum">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="citetitle">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="pubwork">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="article"/>
+            <xs:enumeration value="bbs"/>
+            <xs:enumeration value="book"/>
+            <xs:enumeration value="cdrom"/>
+            <xs:enumeration value="chapter"/>
+            <xs:enumeration value="dvd"/>
+            <xs:enumeration value="emailmessage"/>
+            <xs:enumeration value="gopher"/>
+            <xs:enumeration value="journal"/>
+            <xs:enumeration value="manuscript"/>
+            <xs:enumeration value="newsposting"/>
+            <xs:enumeration value="part"/>
+            <xs:enumeration value="refentry"/>
+            <xs:enumeration value="section"/>
+            <xs:enumeration value="series"/>
+            <xs:enumeration value="set"/>
+            <xs:enumeration value="webpage"/>
+            <xs:enumeration value="wiki"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="emphasis">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="foreignphrase">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="phrase">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="quote">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="subscript">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="superscript">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="trademark">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="copyright"/>
+            <xs:enumeration value="registered"/>
+            <xs:enumeration value="service"/>
+            <xs:enumeration value="trade"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="wordasword">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="footnoteref">
+    <xs:complexType>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="xref">
+    <xs:complexType>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="xrefstyle"/>
+      <xs:attribute name="endterm" type="xs:IDREF"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="link">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="xrefstyle"/>
+      <xs:attribute name="endterm" type="xs:IDREF"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="olink">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="targetdoc"/>
+      <xs:attribute name="role"/>
+      <xs:attribute name="xrefstyle"/>
+      <xs:attribute name="localinfo"/>
+      <xs:attribute name="targetptr"/>
+      <xs:attribute name="type"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="anchor">
+    <xs:complexType>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="alt">
+    <xs:complexType mixed="true">
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:inlinemediaobject"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="set">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:toc"/>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:set"/>
+          <xs:element ref="docbook:book"/>
+        </xs:choice>
+        <xs:element minOccurs="0" ref="docbook:setindex"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="book">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:glossary"/>
+          <xs:element ref="docbook:bibliography"/>
+          <xs:element ref="docbook:index"/>
+          <xs:element ref="docbook:toc"/>
+          <xs:element ref="docbook:dedication"/>
+          <xs:element ref="docbook:acknowledgements"/>
+          <xs:element ref="docbook:preface"/>
+          <xs:element ref="docbook:chapter"/>
+          <xs:element ref="docbook:appendix"/>
+          <xs:element ref="docbook:article"/>
+          <xs:element ref="docbook:colophon"/>
+          <xs:element ref="docbook:part"/>
+          <xs:element ref="docbook:reference"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="dedication">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="acknowledgements">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="colophon">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="appendix">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:glossary"/>
+            <xs:element ref="docbook:bibliography"/>
+            <xs:element ref="docbook:index"/>
+            <xs:element ref="docbook:toc"/>
+          </xs:choice>
+          <xs:choice>
+            <xs:sequence>
+              <xs:choice maxOccurs="unbounded">
+                <xs:element ref="docbook:itemizedlist"/>
+                <xs:element ref="docbook:orderedlist"/>
+                <xs:element ref="docbook:procedure"/>
+                <xs:element ref="docbook:simplelist"/>
+                <xs:element ref="docbook:variablelist"/>
+                <xs:element ref="docbook:segmentedlist"/>
+                <xs:element ref="docbook:glosslist"/>
+                <xs:element ref="docbook:bibliolist"/>
+                <xs:element ref="docbook:calloutlist"/>
+                <xs:element ref="docbook:qandaset"/>
+                <xs:element ref="docbook:example"/>
+                <xs:element ref="docbook:figure"/>
+                <xs:element ref="docbook:table"/>
+                <xs:element ref="docbook:equation"/>
+                <xs:element ref="docbook:informalexample"/>
+                <xs:element ref="docbook:informalfigure"/>
+                <xs:element ref="docbook:informaltable"/>
+                <xs:element ref="docbook:informalequation"/>
+                <xs:element ref="docbook:sidebar"/>
+                <xs:element ref="docbook:blockquote"/>
+                <xs:element ref="docbook:address"/>
+                <xs:element ref="docbook:epigraph"/>
+                <xs:element ref="docbook:mediaobject"/>
+                <xs:element ref="docbook:screenshot"/>
+                <xs:element ref="docbook:task"/>
+                <xs:element ref="docbook:productionset"/>
+                <xs:element ref="docbook:constraintdef"/>
+                <xs:element ref="docbook:msgset"/>
+                <xs:element ref="docbook:screen"/>
+                <xs:element ref="docbook:literallayout"/>
+                <xs:element ref="docbook:programlistingco"/>
+                <xs:element ref="docbook:screenco"/>
+                <xs:element ref="docbook:programlisting"/>
+                <xs:element ref="docbook:synopsis"/>
+                <xs:element ref="docbook:bridgehead"/>
+                <xs:element ref="docbook:remark"/>
+                <xs:element ref="docbook:revhistory"/>
+                <xs:element ref="docbook:indexterm"/>
+                <xs:element ref="docbook:funcsynopsis"/>
+                <xs:element ref="docbook:classsynopsis"/>
+                <xs:element ref="docbook:methodsynopsis"/>
+                <xs:element ref="docbook:constructorsynopsis"/>
+                <xs:element ref="docbook:destructorsynopsis"/>
+                <xs:element ref="docbook:fieldsynopsis"/>
+                <xs:element ref="docbook:cmdsynopsis"/>
+                <xs:element ref="docbook:caution"/>
+                <xs:element ref="docbook:important"/>
+                <xs:element ref="docbook:note"/>
+                <xs:element ref="docbook:tip"/>
+                <xs:element ref="docbook:warning"/>
+                <xs:element ref="docbook:anchor"/>
+                <xs:element ref="docbook:para"/>
+                <xs:element ref="docbook:formalpara"/>
+                <xs:element ref="docbook:simpara"/>
+                <xs:element ref="docbook:annotation"/>
+              </xs:choice>
+              <xs:choice minOccurs="0">
+                <xs:sequence>
+                  <xs:element maxOccurs="unbounded" ref="docbook:section"/>
+                  <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+                </xs:sequence>
+                <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+                <xs:sequence>
+                  <xs:element maxOccurs="unbounded" ref="docbook:sect1"/>
+                  <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+                </xs:sequence>
+                <xs:element maxOccurs="unbounded" ref="docbook:refentry"/>
+              </xs:choice>
+            </xs:sequence>
+            <xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="docbook:section"/>
+              <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+            </xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+            <xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="docbook:sect1"/>
+              <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+            </xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:refentry"/>
+          </xs:choice>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:glossary"/>
+            <xs:element ref="docbook:bibliography"/>
+            <xs:element ref="docbook:index"/>
+            <xs:element ref="docbook:toc"/>
+          </xs:choice>
+        </xs:sequence>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="chapter">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:glossary"/>
+            <xs:element ref="docbook:bibliography"/>
+            <xs:element ref="docbook:index"/>
+            <xs:element ref="docbook:toc"/>
+          </xs:choice>
+          <xs:choice>
+            <xs:sequence>
+              <xs:choice maxOccurs="unbounded">
+                <xs:element ref="docbook:itemizedlist"/>
+                <xs:element ref="docbook:orderedlist"/>
+                <xs:element ref="docbook:procedure"/>
+                <xs:element ref="docbook:simplelist"/>
+                <xs:element ref="docbook:variablelist"/>
+                <xs:element ref="docbook:segmentedlist"/>
+                <xs:element ref="docbook:glosslist"/>
+                <xs:element ref="docbook:bibliolist"/>
+                <xs:element ref="docbook:calloutlist"/>
+                <xs:element ref="docbook:qandaset"/>
+                <xs:element ref="docbook:example"/>
+                <xs:element ref="docbook:figure"/>
+                <xs:element ref="docbook:table"/>
+                <xs:element ref="docbook:equation"/>
+                <xs:element ref="docbook:informalexample"/>
+                <xs:element ref="docbook:informalfigure"/>
+                <xs:element ref="docbook:informaltable"/>
+                <xs:element ref="docbook:informalequation"/>
+                <xs:element ref="docbook:sidebar"/>
+                <xs:element ref="docbook:blockquote"/>
+                <xs:element ref="docbook:address"/>
+                <xs:element ref="docbook:epigraph"/>
+                <xs:element ref="docbook:mediaobject"/>
+                <xs:element ref="docbook:screenshot"/>
+                <xs:element ref="docbook:task"/>
+                <xs:element ref="docbook:productionset"/>
+                <xs:element ref="docbook:constraintdef"/>
+                <xs:element ref="docbook:msgset"/>
+                <xs:element ref="docbook:screen"/>
+                <xs:element ref="docbook:literallayout"/>
+                <xs:element ref="docbook:programlistingco"/>
+                <xs:element ref="docbook:screenco"/>
+                <xs:element ref="docbook:programlisting"/>
+                <xs:element ref="docbook:synopsis"/>
+                <xs:element ref="docbook:bridgehead"/>
+                <xs:element ref="docbook:remark"/>
+                <xs:element ref="docbook:revhistory"/>
+                <xs:element ref="docbook:indexterm"/>
+                <xs:element ref="docbook:funcsynopsis"/>
+                <xs:element ref="docbook:classsynopsis"/>
+                <xs:element ref="docbook:methodsynopsis"/>
+                <xs:element ref="docbook:constructorsynopsis"/>
+                <xs:element ref="docbook:destructorsynopsis"/>
+                <xs:element ref="docbook:fieldsynopsis"/>
+                <xs:element ref="docbook:cmdsynopsis"/>
+                <xs:element ref="docbook:caution"/>
+                <xs:element ref="docbook:important"/>
+                <xs:element ref="docbook:note"/>
+                <xs:element ref="docbook:tip"/>
+                <xs:element ref="docbook:warning"/>
+                <xs:element ref="docbook:anchor"/>
+                <xs:element ref="docbook:para"/>
+                <xs:element ref="docbook:formalpara"/>
+                <xs:element ref="docbook:simpara"/>
+                <xs:element ref="docbook:annotation"/>
+              </xs:choice>
+              <xs:choice minOccurs="0">
+                <xs:sequence>
+                  <xs:element maxOccurs="unbounded" ref="docbook:section"/>
+                  <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+                </xs:sequence>
+                <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+                <xs:sequence>
+                  <xs:element maxOccurs="unbounded" ref="docbook:sect1"/>
+                  <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+                </xs:sequence>
+                <xs:element maxOccurs="unbounded" ref="docbook:refentry"/>
+              </xs:choice>
+            </xs:sequence>
+            <xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="docbook:section"/>
+              <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+            </xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+            <xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="docbook:sect1"/>
+              <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+            </xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:refentry"/>
+          </xs:choice>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:glossary"/>
+            <xs:element ref="docbook:bibliography"/>
+            <xs:element ref="docbook:index"/>
+            <xs:element ref="docbook:toc"/>
+          </xs:choice>
+        </xs:sequence>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="part">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:partintro"/>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:glossary"/>
+          <xs:element ref="docbook:bibliography"/>
+          <xs:element ref="docbook:index"/>
+          <xs:element ref="docbook:toc"/>
+          <xs:element ref="docbook:dedication"/>
+          <xs:element ref="docbook:acknowledgements"/>
+          <xs:element ref="docbook:preface"/>
+          <xs:element ref="docbook:chapter"/>
+          <xs:element ref="docbook:appendix"/>
+          <xs:element ref="docbook:article"/>
+          <xs:element ref="docbook:colophon"/>
+          <xs:element ref="docbook:refentry"/>
+          <xs:element ref="docbook:reference"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="preface">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:glossary"/>
+            <xs:element ref="docbook:bibliography"/>
+            <xs:element ref="docbook:index"/>
+            <xs:element ref="docbook:toc"/>
+          </xs:choice>
+          <xs:choice>
+            <xs:sequence>
+              <xs:choice maxOccurs="unbounded">
+                <xs:element ref="docbook:itemizedlist"/>
+                <xs:element ref="docbook:orderedlist"/>
+                <xs:element ref="docbook:procedure"/>
+                <xs:element ref="docbook:simplelist"/>
+                <xs:element ref="docbook:variablelist"/>
+                <xs:element ref="docbook:segmentedlist"/>
+                <xs:element ref="docbook:glosslist"/>
+                <xs:element ref="docbook:bibliolist"/>
+                <xs:element ref="docbook:calloutlist"/>
+                <xs:element ref="docbook:qandaset"/>
+                <xs:element ref="docbook:example"/>
+                <xs:element ref="docbook:figure"/>
+                <xs:element ref="docbook:table"/>
+                <xs:element ref="docbook:equation"/>
+                <xs:element ref="docbook:informalexample"/>
+                <xs:element ref="docbook:informalfigure"/>
+                <xs:element ref="docbook:informaltable"/>
+                <xs:element ref="docbook:informalequation"/>
+                <xs:element ref="docbook:sidebar"/>
+                <xs:element ref="docbook:blockquote"/>
+                <xs:element ref="docbook:address"/>
+                <xs:element ref="docbook:epigraph"/>
+                <xs:element ref="docbook:mediaobject"/>
+                <xs:element ref="docbook:screenshot"/>
+                <xs:element ref="docbook:task"/>
+                <xs:element ref="docbook:productionset"/>
+                <xs:element ref="docbook:constraintdef"/>
+                <xs:element ref="docbook:msgset"/>
+                <xs:element ref="docbook:screen"/>
+                <xs:element ref="docbook:literallayout"/>
+                <xs:element ref="docbook:programlistingco"/>
+                <xs:element ref="docbook:screenco"/>
+                <xs:element ref="docbook:programlisting"/>
+                <xs:element ref="docbook:synopsis"/>
+                <xs:element ref="docbook:bridgehead"/>
+                <xs:element ref="docbook:remark"/>
+                <xs:element ref="docbook:revhistory"/>
+                <xs:element ref="docbook:indexterm"/>
+                <xs:element ref="docbook:funcsynopsis"/>
+                <xs:element ref="docbook:classsynopsis"/>
+                <xs:element ref="docbook:methodsynopsis"/>
+                <xs:element ref="docbook:constructorsynopsis"/>
+                <xs:element ref="docbook:destructorsynopsis"/>
+                <xs:element ref="docbook:fieldsynopsis"/>
+                <xs:element ref="docbook:cmdsynopsis"/>
+                <xs:element ref="docbook:caution"/>
+                <xs:element ref="docbook:important"/>
+                <xs:element ref="docbook:note"/>
+                <xs:element ref="docbook:tip"/>
+                <xs:element ref="docbook:warning"/>
+                <xs:element ref="docbook:anchor"/>
+                <xs:element ref="docbook:para"/>
+                <xs:element ref="docbook:formalpara"/>
+                <xs:element ref="docbook:simpara"/>
+                <xs:element ref="docbook:annotation"/>
+              </xs:choice>
+              <xs:choice minOccurs="0">
+                <xs:sequence>
+                  <xs:element maxOccurs="unbounded" ref="docbook:section"/>
+                  <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+                </xs:sequence>
+                <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+                <xs:sequence>
+                  <xs:element maxOccurs="unbounded" ref="docbook:sect1"/>
+                  <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+                </xs:sequence>
+                <xs:element maxOccurs="unbounded" ref="docbook:refentry"/>
+              </xs:choice>
+            </xs:sequence>
+            <xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="docbook:section"/>
+              <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+            </xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+            <xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="docbook:sect1"/>
+              <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+            </xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:refentry"/>
+          </xs:choice>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:glossary"/>
+            <xs:element ref="docbook:bibliography"/>
+            <xs:element ref="docbook:index"/>
+            <xs:element ref="docbook:toc"/>
+          </xs:choice>
+        </xs:sequence>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="partintro">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice>
+          <xs:sequence>
+            <xs:choice maxOccurs="unbounded">
+              <xs:element ref="docbook:itemizedlist"/>
+              <xs:element ref="docbook:orderedlist"/>
+              <xs:element ref="docbook:procedure"/>
+              <xs:element ref="docbook:simplelist"/>
+              <xs:element ref="docbook:variablelist"/>
+              <xs:element ref="docbook:segmentedlist"/>
+              <xs:element ref="docbook:glosslist"/>
+              <xs:element ref="docbook:bibliolist"/>
+              <xs:element ref="docbook:calloutlist"/>
+              <xs:element ref="docbook:qandaset"/>
+              <xs:element ref="docbook:example"/>
+              <xs:element ref="docbook:figure"/>
+              <xs:element ref="docbook:table"/>
+              <xs:element ref="docbook:equation"/>
+              <xs:element ref="docbook:informalexample"/>
+              <xs:element ref="docbook:informalfigure"/>
+              <xs:element ref="docbook:informaltable"/>
+              <xs:element ref="docbook:informalequation"/>
+              <xs:element ref="docbook:sidebar"/>
+              <xs:element ref="docbook:blockquote"/>
+              <xs:element ref="docbook:address"/>
+              <xs:element ref="docbook:epigraph"/>
+              <xs:element ref="docbook:mediaobject"/>
+              <xs:element ref="docbook:screenshot"/>
+              <xs:element ref="docbook:task"/>
+              <xs:element ref="docbook:productionset"/>
+              <xs:element ref="docbook:constraintdef"/>
+              <xs:element ref="docbook:msgset"/>
+              <xs:element ref="docbook:screen"/>
+              <xs:element ref="docbook:literallayout"/>
+              <xs:element ref="docbook:programlistingco"/>
+              <xs:element ref="docbook:screenco"/>
+              <xs:element ref="docbook:programlisting"/>
+              <xs:element ref="docbook:synopsis"/>
+              <xs:element ref="docbook:bridgehead"/>
+              <xs:element ref="docbook:remark"/>
+              <xs:element ref="docbook:revhistory"/>
+              <xs:element ref="docbook:indexterm"/>
+              <xs:element ref="docbook:funcsynopsis"/>
+              <xs:element ref="docbook:classsynopsis"/>
+              <xs:element ref="docbook:methodsynopsis"/>
+              <xs:element ref="docbook:constructorsynopsis"/>
+              <xs:element ref="docbook:destructorsynopsis"/>
+              <xs:element ref="docbook:fieldsynopsis"/>
+              <xs:element ref="docbook:cmdsynopsis"/>
+              <xs:element ref="docbook:caution"/>
+              <xs:element ref="docbook:important"/>
+              <xs:element ref="docbook:note"/>
+              <xs:element ref="docbook:tip"/>
+              <xs:element ref="docbook:warning"/>
+              <xs:element ref="docbook:anchor"/>
+              <xs:element ref="docbook:para"/>
+              <xs:element ref="docbook:formalpara"/>
+              <xs:element ref="docbook:simpara"/>
+              <xs:element ref="docbook:annotation"/>
+            </xs:choice>
+            <xs:choice minOccurs="0">
+              <xs:sequence>
+                <xs:element maxOccurs="unbounded" ref="docbook:section"/>
+                <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+              </xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+              <xs:sequence>
+                <xs:element maxOccurs="unbounded" ref="docbook:sect1"/>
+                <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+              </xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="docbook:refentry"/>
+            </xs:choice>
+          </xs:sequence>
+          <xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:section"/>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+          </xs:sequence>
+          <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+          <xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:sect1"/>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+          </xs:sequence>
+          <xs:element maxOccurs="unbounded" ref="docbook:refentry"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="section">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice>
+          <xs:sequence>
+            <xs:choice maxOccurs="unbounded">
+              <xs:element ref="docbook:itemizedlist"/>
+              <xs:element ref="docbook:orderedlist"/>
+              <xs:element ref="docbook:procedure"/>
+              <xs:element ref="docbook:simplelist"/>
+              <xs:element ref="docbook:variablelist"/>
+              <xs:element ref="docbook:segmentedlist"/>
+              <xs:element ref="docbook:glosslist"/>
+              <xs:element ref="docbook:bibliolist"/>
+              <xs:element ref="docbook:calloutlist"/>
+              <xs:element ref="docbook:qandaset"/>
+              <xs:element ref="docbook:example"/>
+              <xs:element ref="docbook:figure"/>
+              <xs:element ref="docbook:table"/>
+              <xs:element ref="docbook:equation"/>
+              <xs:element ref="docbook:informalexample"/>
+              <xs:element ref="docbook:informalfigure"/>
+              <xs:element ref="docbook:informaltable"/>
+              <xs:element ref="docbook:informalequation"/>
+              <xs:element ref="docbook:sidebar"/>
+              <xs:element ref="docbook:blockquote"/>
+              <xs:element ref="docbook:address"/>
+              <xs:element ref="docbook:epigraph"/>
+              <xs:element ref="docbook:mediaobject"/>
+              <xs:element ref="docbook:screenshot"/>
+              <xs:element ref="docbook:task"/>
+              <xs:element ref="docbook:productionset"/>
+              <xs:element ref="docbook:constraintdef"/>
+              <xs:element ref="docbook:msgset"/>
+              <xs:element ref="docbook:screen"/>
+              <xs:element ref="docbook:literallayout"/>
+              <xs:element ref="docbook:programlistingco"/>
+              <xs:element ref="docbook:screenco"/>
+              <xs:element ref="docbook:programlisting"/>
+              <xs:element ref="docbook:synopsis"/>
+              <xs:element ref="docbook:bridgehead"/>
+              <xs:element ref="docbook:remark"/>
+              <xs:element ref="docbook:revhistory"/>
+              <xs:element ref="docbook:indexterm"/>
+              <xs:element ref="docbook:funcsynopsis"/>
+              <xs:element ref="docbook:classsynopsis"/>
+              <xs:element ref="docbook:methodsynopsis"/>
+              <xs:element ref="docbook:constructorsynopsis"/>
+              <xs:element ref="docbook:destructorsynopsis"/>
+              <xs:element ref="docbook:fieldsynopsis"/>
+              <xs:element ref="docbook:cmdsynopsis"/>
+              <xs:element ref="docbook:caution"/>
+              <xs:element ref="docbook:important"/>
+              <xs:element ref="docbook:note"/>
+              <xs:element ref="docbook:tip"/>
+              <xs:element ref="docbook:warning"/>
+              <xs:element ref="docbook:anchor"/>
+              <xs:element ref="docbook:para"/>
+              <xs:element ref="docbook:formalpara"/>
+              <xs:element ref="docbook:simpara"/>
+              <xs:element ref="docbook:annotation"/>
+            </xs:choice>
+            <xs:choice minOccurs="0">
+              <xs:sequence>
+                <xs:element maxOccurs="unbounded" ref="docbook:section"/>
+                <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+              </xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+              <xs:element maxOccurs="unbounded" ref="docbook:refentry"/>
+            </xs:choice>
+          </xs:sequence>
+          <xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:section"/>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+          </xs:sequence>
+          <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+          <xs:element maxOccurs="unbounded" ref="docbook:refentry"/>
+        </xs:choice>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:glossary"/>
+          <xs:element ref="docbook:bibliography"/>
+          <xs:element ref="docbook:index"/>
+          <xs:element ref="docbook:toc"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="simplesect">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="article">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:glossary"/>
+          <xs:element ref="docbook:bibliography"/>
+          <xs:element ref="docbook:index"/>
+          <xs:element ref="docbook:toc"/>
+          <xs:element ref="docbook:appendix"/>
+          <xs:element ref="docbook:acknowledgements"/>
+          <xs:element ref="docbook:colophon"/>
+        </xs:choice>
+        <xs:choice>
+          <xs:sequence>
+            <xs:choice maxOccurs="unbounded">
+              <xs:element ref="docbook:itemizedlist"/>
+              <xs:element ref="docbook:orderedlist"/>
+              <xs:element ref="docbook:procedure"/>
+              <xs:element ref="docbook:simplelist"/>
+              <xs:element ref="docbook:variablelist"/>
+              <xs:element ref="docbook:segmentedlist"/>
+              <xs:element ref="docbook:glosslist"/>
+              <xs:element ref="docbook:bibliolist"/>
+              <xs:element ref="docbook:calloutlist"/>
+              <xs:element ref="docbook:qandaset"/>
+              <xs:element ref="docbook:example"/>
+              <xs:element ref="docbook:figure"/>
+              <xs:element ref="docbook:table"/>
+              <xs:element ref="docbook:equation"/>
+              <xs:element ref="docbook:informalexample"/>
+              <xs:element ref="docbook:informalfigure"/>
+              <xs:element ref="docbook:informaltable"/>
+              <xs:element ref="docbook:informalequation"/>
+              <xs:element ref="docbook:sidebar"/>
+              <xs:element ref="docbook:blockquote"/>
+              <xs:element ref="docbook:address"/>
+              <xs:element ref="docbook:epigraph"/>
+              <xs:element ref="docbook:mediaobject"/>
+              <xs:element ref="docbook:screenshot"/>
+              <xs:element ref="docbook:task"/>
+              <xs:element ref="docbook:productionset"/>
+              <xs:element ref="docbook:constraintdef"/>
+              <xs:element ref="docbook:msgset"/>
+              <xs:element ref="docbook:screen"/>
+              <xs:element ref="docbook:literallayout"/>
+              <xs:element ref="docbook:programlistingco"/>
+              <xs:element ref="docbook:screenco"/>
+              <xs:element ref="docbook:programlisting"/>
+              <xs:element ref="docbook:synopsis"/>
+              <xs:element ref="docbook:bridgehead"/>
+              <xs:element ref="docbook:remark"/>
+              <xs:element ref="docbook:revhistory"/>
+              <xs:element ref="docbook:indexterm"/>
+              <xs:element ref="docbook:funcsynopsis"/>
+              <xs:element ref="docbook:classsynopsis"/>
+              <xs:element ref="docbook:methodsynopsis"/>
+              <xs:element ref="docbook:constructorsynopsis"/>
+              <xs:element ref="docbook:destructorsynopsis"/>
+              <xs:element ref="docbook:fieldsynopsis"/>
+              <xs:element ref="docbook:cmdsynopsis"/>
+              <xs:element ref="docbook:caution"/>
+              <xs:element ref="docbook:important"/>
+              <xs:element ref="docbook:note"/>
+              <xs:element ref="docbook:tip"/>
+              <xs:element ref="docbook:warning"/>
+              <xs:element ref="docbook:anchor"/>
+              <xs:element ref="docbook:para"/>
+              <xs:element ref="docbook:formalpara"/>
+              <xs:element ref="docbook:simpara"/>
+              <xs:element ref="docbook:annotation"/>
+            </xs:choice>
+            <xs:choice minOccurs="0">
+              <xs:sequence>
+                <xs:element maxOccurs="unbounded" ref="docbook:section"/>
+                <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+              </xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+              <xs:sequence>
+                <xs:element maxOccurs="unbounded" ref="docbook:sect1"/>
+                <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+              </xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="docbook:refentry"/>
+            </xs:choice>
+          </xs:sequence>
+          <xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:section"/>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+          </xs:sequence>
+          <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+          <xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:sect1"/>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+          </xs:sequence>
+          <xs:element maxOccurs="unbounded" ref="docbook:refentry"/>
+        </xs:choice>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:glossary"/>
+          <xs:element ref="docbook:bibliography"/>
+          <xs:element ref="docbook:index"/>
+          <xs:element ref="docbook:toc"/>
+          <xs:element ref="docbook:appendix"/>
+          <xs:element ref="docbook:acknowledgements"/>
+          <xs:element ref="docbook:colophon"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="faq"/>
+            <xs:enumeration value="journalarticle"/>
+            <xs:enumeration value="productsheet"/>
+            <xs:enumeration value="specification"/>
+            <xs:enumeration value="techreport"/>
+            <xs:enumeration value="whitepaper"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="annotation">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attribute name="annotates"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="extendedlink">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:locator"/>
+        <xs:element ref="docbook:arc"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="locator">
+    <xs:complexType>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute ref="xlink:label"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="arc">
+    <xs:complexType>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute ref="xlink:from"/>
+      <xs:attribute ref="xlink:to"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="sect1">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice>
+          <xs:sequence>
+            <xs:choice maxOccurs="unbounded">
+              <xs:element ref="docbook:itemizedlist"/>
+              <xs:element ref="docbook:orderedlist"/>
+              <xs:element ref="docbook:procedure"/>
+              <xs:element ref="docbook:simplelist"/>
+              <xs:element ref="docbook:variablelist"/>
+              <xs:element ref="docbook:segmentedlist"/>
+              <xs:element ref="docbook:glosslist"/>
+              <xs:element ref="docbook:bibliolist"/>
+              <xs:element ref="docbook:calloutlist"/>
+              <xs:element ref="docbook:qandaset"/>
+              <xs:element ref="docbook:example"/>
+              <xs:element ref="docbook:figure"/>
+              <xs:element ref="docbook:table"/>
+              <xs:element ref="docbook:equation"/>
+              <xs:element ref="docbook:informalexample"/>
+              <xs:element ref="docbook:informalfigure"/>
+              <xs:element ref="docbook:informaltable"/>
+              <xs:element ref="docbook:informalequation"/>
+              <xs:element ref="docbook:sidebar"/>
+              <xs:element ref="docbook:blockquote"/>
+              <xs:element ref="docbook:address"/>
+              <xs:element ref="docbook:epigraph"/>
+              <xs:element ref="docbook:mediaobject"/>
+              <xs:element ref="docbook:screenshot"/>
+              <xs:element ref="docbook:task"/>
+              <xs:element ref="docbook:productionset"/>
+              <xs:element ref="docbook:constraintdef"/>
+              <xs:element ref="docbook:msgset"/>
+              <xs:element ref="docbook:screen"/>
+              <xs:element ref="docbook:literallayout"/>
+              <xs:element ref="docbook:programlistingco"/>
+              <xs:element ref="docbook:screenco"/>
+              <xs:element ref="docbook:programlisting"/>
+              <xs:element ref="docbook:synopsis"/>
+              <xs:element ref="docbook:bridgehead"/>
+              <xs:element ref="docbook:remark"/>
+              <xs:element ref="docbook:revhistory"/>
+              <xs:element ref="docbook:indexterm"/>
+              <xs:element ref="docbook:funcsynopsis"/>
+              <xs:element ref="docbook:classsynopsis"/>
+              <xs:element ref="docbook:methodsynopsis"/>
+              <xs:element ref="docbook:constructorsynopsis"/>
+              <xs:element ref="docbook:destructorsynopsis"/>
+              <xs:element ref="docbook:fieldsynopsis"/>
+              <xs:element ref="docbook:cmdsynopsis"/>
+              <xs:element ref="docbook:caution"/>
+              <xs:element ref="docbook:important"/>
+              <xs:element ref="docbook:note"/>
+              <xs:element ref="docbook:tip"/>
+              <xs:element ref="docbook:warning"/>
+              <xs:element ref="docbook:anchor"/>
+              <xs:element ref="docbook:para"/>
+              <xs:element ref="docbook:formalpara"/>
+              <xs:element ref="docbook:simpara"/>
+              <xs:element ref="docbook:annotation"/>
+            </xs:choice>
+            <xs:choice minOccurs="0">
+              <xs:sequence>
+                <xs:element maxOccurs="unbounded" ref="docbook:sect2"/>
+                <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+              </xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+            </xs:choice>
+          </xs:sequence>
+          <xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:sect2"/>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+          </xs:sequence>
+          <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+        </xs:choice>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:glossary"/>
+          <xs:element ref="docbook:bibliography"/>
+          <xs:element ref="docbook:index"/>
+          <xs:element ref="docbook:toc"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="sect2">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice>
+          <xs:sequence>
+            <xs:choice maxOccurs="unbounded">
+              <xs:element ref="docbook:itemizedlist"/>
+              <xs:element ref="docbook:orderedlist"/>
+              <xs:element ref="docbook:procedure"/>
+              <xs:element ref="docbook:simplelist"/>
+              <xs:element ref="docbook:variablelist"/>
+              <xs:element ref="docbook:segmentedlist"/>
+              <xs:element ref="docbook:glosslist"/>
+              <xs:element ref="docbook:bibliolist"/>
+              <xs:element ref="docbook:calloutlist"/>
+              <xs:element ref="docbook:qandaset"/>
+              <xs:element ref="docbook:example"/>
+              <xs:element ref="docbook:figure"/>
+              <xs:element ref="docbook:table"/>
+              <xs:element ref="docbook:equation"/>
+              <xs:element ref="docbook:informalexample"/>
+              <xs:element ref="docbook:informalfigure"/>
+              <xs:element ref="docbook:informaltable"/>
+              <xs:element ref="docbook:informalequation"/>
+              <xs:element ref="docbook:sidebar"/>
+              <xs:element ref="docbook:blockquote"/>
+              <xs:element ref="docbook:address"/>
+              <xs:element ref="docbook:epigraph"/>
+              <xs:element ref="docbook:mediaobject"/>
+              <xs:element ref="docbook:screenshot"/>
+              <xs:element ref="docbook:task"/>
+              <xs:element ref="docbook:productionset"/>
+              <xs:element ref="docbook:constraintdef"/>
+              <xs:element ref="docbook:msgset"/>
+              <xs:element ref="docbook:screen"/>
+              <xs:element ref="docbook:literallayout"/>
+              <xs:element ref="docbook:programlistingco"/>
+              <xs:element ref="docbook:screenco"/>
+              <xs:element ref="docbook:programlisting"/>
+              <xs:element ref="docbook:synopsis"/>
+              <xs:element ref="docbook:bridgehead"/>
+              <xs:element ref="docbook:remark"/>
+              <xs:element ref="docbook:revhistory"/>
+              <xs:element ref="docbook:indexterm"/>
+              <xs:element ref="docbook:funcsynopsis"/>
+              <xs:element ref="docbook:classsynopsis"/>
+              <xs:element ref="docbook:methodsynopsis"/>
+              <xs:element ref="docbook:constructorsynopsis"/>
+              <xs:element ref="docbook:destructorsynopsis"/>
+              <xs:element ref="docbook:fieldsynopsis"/>
+              <xs:element ref="docbook:cmdsynopsis"/>
+              <xs:element ref="docbook:caution"/>
+              <xs:element ref="docbook:important"/>
+              <xs:element ref="docbook:note"/>
+              <xs:element ref="docbook:tip"/>
+              <xs:element ref="docbook:warning"/>
+              <xs:element ref="docbook:anchor"/>
+              <xs:element ref="docbook:para"/>
+              <xs:element ref="docbook:formalpara"/>
+              <xs:element ref="docbook:simpara"/>
+              <xs:element ref="docbook:annotation"/>
+            </xs:choice>
+            <xs:choice minOccurs="0">
+              <xs:sequence>
+                <xs:element maxOccurs="unbounded" ref="docbook:sect3"/>
+                <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+              </xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+            </xs:choice>
+          </xs:sequence>
+          <xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:sect3"/>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+          </xs:sequence>
+          <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+        </xs:choice>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:glossary"/>
+          <xs:element ref="docbook:bibliography"/>
+          <xs:element ref="docbook:index"/>
+          <xs:element ref="docbook:toc"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="sect3">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice>
+          <xs:sequence>
+            <xs:choice maxOccurs="unbounded">
+              <xs:element ref="docbook:itemizedlist"/>
+              <xs:element ref="docbook:orderedlist"/>
+              <xs:element ref="docbook:procedure"/>
+              <xs:element ref="docbook:simplelist"/>
+              <xs:element ref="docbook:variablelist"/>
+              <xs:element ref="docbook:segmentedlist"/>
+              <xs:element ref="docbook:glosslist"/>
+              <xs:element ref="docbook:bibliolist"/>
+              <xs:element ref="docbook:calloutlist"/>
+              <xs:element ref="docbook:qandaset"/>
+              <xs:element ref="docbook:example"/>
+              <xs:element ref="docbook:figure"/>
+              <xs:element ref="docbook:table"/>
+              <xs:element ref="docbook:equation"/>
+              <xs:element ref="docbook:informalexample"/>
+              <xs:element ref="docbook:informalfigure"/>
+              <xs:element ref="docbook:informaltable"/>
+              <xs:element ref="docbook:informalequation"/>
+              <xs:element ref="docbook:sidebar"/>
+              <xs:element ref="docbook:blockquote"/>
+              <xs:element ref="docbook:address"/>
+              <xs:element ref="docbook:epigraph"/>
+              <xs:element ref="docbook:mediaobject"/>
+              <xs:element ref="docbook:screenshot"/>
+              <xs:element ref="docbook:task"/>
+              <xs:element ref="docbook:productionset"/>
+              <xs:element ref="docbook:constraintdef"/>
+              <xs:element ref="docbook:msgset"/>
+              <xs:element ref="docbook:screen"/>
+              <xs:element ref="docbook:literallayout"/>
+              <xs:element ref="docbook:programlistingco"/>
+              <xs:element ref="docbook:screenco"/>
+              <xs:element ref="docbook:programlisting"/>
+              <xs:element ref="docbook:synopsis"/>
+              <xs:element ref="docbook:bridgehead"/>
+              <xs:element ref="docbook:remark"/>
+              <xs:element ref="docbook:revhistory"/>
+              <xs:element ref="docbook:indexterm"/>
+              <xs:element ref="docbook:funcsynopsis"/>
+              <xs:element ref="docbook:classsynopsis"/>
+              <xs:element ref="docbook:methodsynopsis"/>
+              <xs:element ref="docbook:constructorsynopsis"/>
+              <xs:element ref="docbook:destructorsynopsis"/>
+              <xs:element ref="docbook:fieldsynopsis"/>
+              <xs:element ref="docbook:cmdsynopsis"/>
+              <xs:element ref="docbook:caution"/>
+              <xs:element ref="docbook:important"/>
+              <xs:element ref="docbook:note"/>
+              <xs:element ref="docbook:tip"/>
+              <xs:element ref="docbook:warning"/>
+              <xs:element ref="docbook:anchor"/>
+              <xs:element ref="docbook:para"/>
+              <xs:element ref="docbook:formalpara"/>
+              <xs:element ref="docbook:simpara"/>
+              <xs:element ref="docbook:annotation"/>
+            </xs:choice>
+            <xs:choice minOccurs="0">
+              <xs:sequence>
+                <xs:element maxOccurs="unbounded" ref="docbook:sect4"/>
+                <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+              </xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+            </xs:choice>
+          </xs:sequence>
+          <xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:sect4"/>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+          </xs:sequence>
+          <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+        </xs:choice>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:glossary"/>
+          <xs:element ref="docbook:bibliography"/>
+          <xs:element ref="docbook:index"/>
+          <xs:element ref="docbook:toc"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="sect4">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice>
+          <xs:sequence>
+            <xs:choice maxOccurs="unbounded">
+              <xs:element ref="docbook:itemizedlist"/>
+              <xs:element ref="docbook:orderedlist"/>
+              <xs:element ref="docbook:procedure"/>
+              <xs:element ref="docbook:simplelist"/>
+              <xs:element ref="docbook:variablelist"/>
+              <xs:element ref="docbook:segmentedlist"/>
+              <xs:element ref="docbook:glosslist"/>
+              <xs:element ref="docbook:bibliolist"/>
+              <xs:element ref="docbook:calloutlist"/>
+              <xs:element ref="docbook:qandaset"/>
+              <xs:element ref="docbook:example"/>
+              <xs:element ref="docbook:figure"/>
+              <xs:element ref="docbook:table"/>
+              <xs:element ref="docbook:equation"/>
+              <xs:element ref="docbook:informalexample"/>
+              <xs:element ref="docbook:informalfigure"/>
+              <xs:element ref="docbook:informaltable"/>
+              <xs:element ref="docbook:informalequation"/>
+              <xs:element ref="docbook:sidebar"/>
+              <xs:element ref="docbook:blockquote"/>
+              <xs:element ref="docbook:address"/>
+              <xs:element ref="docbook:epigraph"/>
+              <xs:element ref="docbook:mediaobject"/>
+              <xs:element ref="docbook:screenshot"/>
+              <xs:element ref="docbook:task"/>
+              <xs:element ref="docbook:productionset"/>
+              <xs:element ref="docbook:constraintdef"/>
+              <xs:element ref="docbook:msgset"/>
+              <xs:element ref="docbook:screen"/>
+              <xs:element ref="docbook:literallayout"/>
+              <xs:element ref="docbook:programlistingco"/>
+              <xs:element ref="docbook:screenco"/>
+              <xs:element ref="docbook:programlisting"/>
+              <xs:element ref="docbook:synopsis"/>
+              <xs:element ref="docbook:bridgehead"/>
+              <xs:element ref="docbook:remark"/>
+              <xs:element ref="docbook:revhistory"/>
+              <xs:element ref="docbook:indexterm"/>
+              <xs:element ref="docbook:funcsynopsis"/>
+              <xs:element ref="docbook:classsynopsis"/>
+              <xs:element ref="docbook:methodsynopsis"/>
+              <xs:element ref="docbook:constructorsynopsis"/>
+              <xs:element ref="docbook:destructorsynopsis"/>
+              <xs:element ref="docbook:fieldsynopsis"/>
+              <xs:element ref="docbook:cmdsynopsis"/>
+              <xs:element ref="docbook:caution"/>
+              <xs:element ref="docbook:important"/>
+              <xs:element ref="docbook:note"/>
+              <xs:element ref="docbook:tip"/>
+              <xs:element ref="docbook:warning"/>
+              <xs:element ref="docbook:anchor"/>
+              <xs:element ref="docbook:para"/>
+              <xs:element ref="docbook:formalpara"/>
+              <xs:element ref="docbook:simpara"/>
+              <xs:element ref="docbook:annotation"/>
+            </xs:choice>
+            <xs:choice minOccurs="0">
+              <xs:sequence>
+                <xs:element maxOccurs="unbounded" ref="docbook:sect5"/>
+                <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+              </xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+            </xs:choice>
+          </xs:sequence>
+          <xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:sect5"/>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+          </xs:sequence>
+          <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+        </xs:choice>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:glossary"/>
+          <xs:element ref="docbook:bibliography"/>
+          <xs:element ref="docbook:index"/>
+          <xs:element ref="docbook:toc"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="sect5">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice>
+          <xs:sequence>
+            <xs:choice maxOccurs="unbounded">
+              <xs:element ref="docbook:itemizedlist"/>
+              <xs:element ref="docbook:orderedlist"/>
+              <xs:element ref="docbook:procedure"/>
+              <xs:element ref="docbook:simplelist"/>
+              <xs:element ref="docbook:variablelist"/>
+              <xs:element ref="docbook:segmentedlist"/>
+              <xs:element ref="docbook:glosslist"/>
+              <xs:element ref="docbook:bibliolist"/>
+              <xs:element ref="docbook:calloutlist"/>
+              <xs:element ref="docbook:qandaset"/>
+              <xs:element ref="docbook:example"/>
+              <xs:element ref="docbook:figure"/>
+              <xs:element ref="docbook:table"/>
+              <xs:element ref="docbook:equation"/>
+              <xs:element ref="docbook:informalexample"/>
+              <xs:element ref="docbook:informalfigure"/>
+              <xs:element ref="docbook:informaltable"/>
+              <xs:element ref="docbook:informalequation"/>
+              <xs:element ref="docbook:sidebar"/>
+              <xs:element ref="docbook:blockquote"/>
+              <xs:element ref="docbook:address"/>
+              <xs:element ref="docbook:epigraph"/>
+              <xs:element ref="docbook:mediaobject"/>
+              <xs:element ref="docbook:screenshot"/>
+              <xs:element ref="docbook:task"/>
+              <xs:element ref="docbook:productionset"/>
+              <xs:element ref="docbook:constraintdef"/>
+              <xs:element ref="docbook:msgset"/>
+              <xs:element ref="docbook:screen"/>
+              <xs:element ref="docbook:literallayout"/>
+              <xs:element ref="docbook:programlistingco"/>
+              <xs:element ref="docbook:screenco"/>
+              <xs:element ref="docbook:programlisting"/>
+              <xs:element ref="docbook:synopsis"/>
+              <xs:element ref="docbook:bridgehead"/>
+              <xs:element ref="docbook:remark"/>
+              <xs:element ref="docbook:revhistory"/>
+              <xs:element ref="docbook:indexterm"/>
+              <xs:element ref="docbook:funcsynopsis"/>
+              <xs:element ref="docbook:classsynopsis"/>
+              <xs:element ref="docbook:methodsynopsis"/>
+              <xs:element ref="docbook:constructorsynopsis"/>
+              <xs:element ref="docbook:destructorsynopsis"/>
+              <xs:element ref="docbook:fieldsynopsis"/>
+              <xs:element ref="docbook:cmdsynopsis"/>
+              <xs:element ref="docbook:caution"/>
+              <xs:element ref="docbook:important"/>
+              <xs:element ref="docbook:note"/>
+              <xs:element ref="docbook:tip"/>
+              <xs:element ref="docbook:warning"/>
+              <xs:element ref="docbook:anchor"/>
+              <xs:element ref="docbook:para"/>
+              <xs:element ref="docbook:formalpara"/>
+              <xs:element ref="docbook:simpara"/>
+              <xs:element ref="docbook:annotation"/>
+            </xs:choice>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:simplesect"/>
+          </xs:sequence>
+          <xs:element maxOccurs="unbounded" ref="docbook:simplesect"/>
+        </xs:choice>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:glossary"/>
+          <xs:element ref="docbook:bibliography"/>
+          <xs:element ref="docbook:index"/>
+          <xs:element ref="docbook:toc"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="reference">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:partintro"/>
+        <xs:element maxOccurs="unbounded" ref="docbook:refentry"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="status"/>
+      <xs:attribute name="label"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="refentry">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:indexterm"/>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:element minOccurs="0" ref="docbook:refmeta"/>
+        <xs:element maxOccurs="unbounded" ref="docbook:refnamediv"/>
+        <xs:element minOccurs="0" ref="docbook:refsynopsisdiv"/>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="docbook:refsection"/>
+          <xs:element maxOccurs="unbounded" ref="docbook:refsect1"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="status"/>
+      <xs:attribute name="label"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="refmeta">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:indexterm"/>
+        <xs:element ref="docbook:refentrytitle"/>
+        <xs:element minOccurs="0" ref="docbook:manvolnum"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:refmiscinfo"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:indexterm"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="refmiscinfo">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="source"/>
+            <xs:enumeration value="version"/>
+            <xs:enumeration value="manual"/>
+            <xs:enumeration value="sectdesc"/>
+            <xs:enumeration value="software"/>
+            <xs:enumeration value="other"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="otherclass"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="refnamediv">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:refdescriptor"/>
+        <xs:element maxOccurs="unbounded" ref="docbook:refname"/>
+        <xs:element ref="docbook:refpurpose"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:refclass"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="refdescriptor">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="refname">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="refpurpose">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="refclass">
+    <xs:complexType mixed="true">
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:application"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="refsynopsisdiv">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice>
+          <xs:sequence>
+            <xs:choice maxOccurs="unbounded">
+              <xs:element ref="docbook:itemizedlist"/>
+              <xs:element ref="docbook:orderedlist"/>
+              <xs:element ref="docbook:procedure"/>
+              <xs:element ref="docbook:simplelist"/>
+              <xs:element ref="docbook:variablelist"/>
+              <xs:element ref="docbook:segmentedlist"/>
+              <xs:element ref="docbook:glosslist"/>
+              <xs:element ref="docbook:bibliolist"/>
+              <xs:element ref="docbook:calloutlist"/>
+              <xs:element ref="docbook:qandaset"/>
+              <xs:element ref="docbook:example"/>
+              <xs:element ref="docbook:figure"/>
+              <xs:element ref="docbook:table"/>
+              <xs:element ref="docbook:equation"/>
+              <xs:element ref="docbook:informalexample"/>
+              <xs:element ref="docbook:informalfigure"/>
+              <xs:element ref="docbook:informaltable"/>
+              <xs:element ref="docbook:informalequation"/>
+              <xs:element ref="docbook:sidebar"/>
+              <xs:element ref="docbook:blockquote"/>
+              <xs:element ref="docbook:address"/>
+              <xs:element ref="docbook:epigraph"/>
+              <xs:element ref="docbook:mediaobject"/>
+              <xs:element ref="docbook:screenshot"/>
+              <xs:element ref="docbook:task"/>
+              <xs:element ref="docbook:productionset"/>
+              <xs:element ref="docbook:constraintdef"/>
+              <xs:element ref="docbook:msgset"/>
+              <xs:element ref="docbook:screen"/>
+              <xs:element ref="docbook:literallayout"/>
+              <xs:element ref="docbook:programlistingco"/>
+              <xs:element ref="docbook:screenco"/>
+              <xs:element ref="docbook:programlisting"/>
+              <xs:element ref="docbook:synopsis"/>
+              <xs:element ref="docbook:bridgehead"/>
+              <xs:element ref="docbook:remark"/>
+              <xs:element ref="docbook:revhistory"/>
+              <xs:element ref="docbook:indexterm"/>
+              <xs:element ref="docbook:funcsynopsis"/>
+              <xs:element ref="docbook:classsynopsis"/>
+              <xs:element ref="docbook:methodsynopsis"/>
+              <xs:element ref="docbook:constructorsynopsis"/>
+              <xs:element ref="docbook:destructorsynopsis"/>
+              <xs:element ref="docbook:fieldsynopsis"/>
+              <xs:element ref="docbook:cmdsynopsis"/>
+              <xs:element ref="docbook:caution"/>
+              <xs:element ref="docbook:important"/>
+              <xs:element ref="docbook:note"/>
+              <xs:element ref="docbook:tip"/>
+              <xs:element ref="docbook:warning"/>
+              <xs:element ref="docbook:anchor"/>
+              <xs:element ref="docbook:para"/>
+              <xs:element ref="docbook:formalpara"/>
+              <xs:element ref="docbook:simpara"/>
+              <xs:element ref="docbook:annotation"/>
+            </xs:choice>
+            <xs:choice minOccurs="0">
+              <xs:element maxOccurs="unbounded" ref="docbook:refsection"/>
+              <xs:element maxOccurs="unbounded" ref="docbook:refsect2"/>
+            </xs:choice>
+          </xs:sequence>
+          <xs:element maxOccurs="unbounded" ref="docbook:refsection"/>
+          <xs:element maxOccurs="unbounded" ref="docbook:refsect2"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="refsection">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice>
+          <xs:sequence>
+            <xs:choice maxOccurs="unbounded">
+              <xs:element ref="docbook:itemizedlist"/>
+              <xs:element ref="docbook:orderedlist"/>
+              <xs:element ref="docbook:procedure"/>
+              <xs:element ref="docbook:simplelist"/>
+              <xs:element ref="docbook:variablelist"/>
+              <xs:element ref="docbook:segmentedlist"/>
+              <xs:element ref="docbook:glosslist"/>
+              <xs:element ref="docbook:bibliolist"/>
+              <xs:element ref="docbook:calloutlist"/>
+              <xs:element ref="docbook:qandaset"/>
+              <xs:element ref="docbook:example"/>
+              <xs:element ref="docbook:figure"/>
+              <xs:element ref="docbook:table"/>
+              <xs:element ref="docbook:equation"/>
+              <xs:element ref="docbook:informalexample"/>
+              <xs:element ref="docbook:informalfigure"/>
+              <xs:element ref="docbook:informaltable"/>
+              <xs:element ref="docbook:informalequation"/>
+              <xs:element ref="docbook:sidebar"/>
+              <xs:element ref="docbook:blockquote"/>
+              <xs:element ref="docbook:address"/>
+              <xs:element ref="docbook:epigraph"/>
+              <xs:element ref="docbook:mediaobject"/>
+              <xs:element ref="docbook:screenshot"/>
+              <xs:element ref="docbook:task"/>
+              <xs:element ref="docbook:productionset"/>
+              <xs:element ref="docbook:constraintdef"/>
+              <xs:element ref="docbook:msgset"/>
+              <xs:element ref="docbook:screen"/>
+              <xs:element ref="docbook:literallayout"/>
+              <xs:element ref="docbook:programlistingco"/>
+              <xs:element ref="docbook:screenco"/>
+              <xs:element ref="docbook:programlisting"/>
+              <xs:element ref="docbook:synopsis"/>
+              <xs:element ref="docbook:bridgehead"/>
+              <xs:element ref="docbook:remark"/>
+              <xs:element ref="docbook:revhistory"/>
+              <xs:element ref="docbook:indexterm"/>
+              <xs:element ref="docbook:funcsynopsis"/>
+              <xs:element ref="docbook:classsynopsis"/>
+              <xs:element ref="docbook:methodsynopsis"/>
+              <xs:element ref="docbook:constructorsynopsis"/>
+              <xs:element ref="docbook:destructorsynopsis"/>
+              <xs:element ref="docbook:fieldsynopsis"/>
+              <xs:element ref="docbook:cmdsynopsis"/>
+              <xs:element ref="docbook:caution"/>
+              <xs:element ref="docbook:important"/>
+              <xs:element ref="docbook:note"/>
+              <xs:element ref="docbook:tip"/>
+              <xs:element ref="docbook:warning"/>
+              <xs:element ref="docbook:anchor"/>
+              <xs:element ref="docbook:para"/>
+              <xs:element ref="docbook:formalpara"/>
+              <xs:element ref="docbook:simpara"/>
+              <xs:element ref="docbook:annotation"/>
+            </xs:choice>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:refsection"/>
+          </xs:sequence>
+          <xs:element maxOccurs="unbounded" ref="docbook:refsection"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="status"/>
+      <xs:attribute name="label"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="refsect1">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice>
+          <xs:sequence>
+            <xs:choice maxOccurs="unbounded">
+              <xs:element ref="docbook:itemizedlist"/>
+              <xs:element ref="docbook:orderedlist"/>
+              <xs:element ref="docbook:procedure"/>
+              <xs:element ref="docbook:simplelist"/>
+              <xs:element ref="docbook:variablelist"/>
+              <xs:element ref="docbook:segmentedlist"/>
+              <xs:element ref="docbook:glosslist"/>
+              <xs:element ref="docbook:bibliolist"/>
+              <xs:element ref="docbook:calloutlist"/>
+              <xs:element ref="docbook:qandaset"/>
+              <xs:element ref="docbook:example"/>
+              <xs:element ref="docbook:figure"/>
+              <xs:element ref="docbook:table"/>
+              <xs:element ref="docbook:equation"/>
+              <xs:element ref="docbook:informalexample"/>
+              <xs:element ref="docbook:informalfigure"/>
+              <xs:element ref="docbook:informaltable"/>
+              <xs:element ref="docbook:informalequation"/>
+              <xs:element ref="docbook:sidebar"/>
+              <xs:element ref="docbook:blockquote"/>
+              <xs:element ref="docbook:address"/>
+              <xs:element ref="docbook:epigraph"/>
+              <xs:element ref="docbook:mediaobject"/>
+              <xs:element ref="docbook:screenshot"/>
+              <xs:element ref="docbook:task"/>
+              <xs:element ref="docbook:productionset"/>
+              <xs:element ref="docbook:constraintdef"/>
+              <xs:element ref="docbook:msgset"/>
+              <xs:element ref="docbook:screen"/>
+              <xs:element ref="docbook:literallayout"/>
+              <xs:element ref="docbook:programlistingco"/>
+              <xs:element ref="docbook:screenco"/>
+              <xs:element ref="docbook:programlisting"/>
+              <xs:element ref="docbook:synopsis"/>
+              <xs:element ref="docbook:bridgehead"/>
+              <xs:element ref="docbook:remark"/>
+              <xs:element ref="docbook:revhistory"/>
+              <xs:element ref="docbook:indexterm"/>
+              <xs:element ref="docbook:funcsynopsis"/>
+              <xs:element ref="docbook:classsynopsis"/>
+              <xs:element ref="docbook:methodsynopsis"/>
+              <xs:element ref="docbook:constructorsynopsis"/>
+              <xs:element ref="docbook:destructorsynopsis"/>
+              <xs:element ref="docbook:fieldsynopsis"/>
+              <xs:element ref="docbook:cmdsynopsis"/>
+              <xs:element ref="docbook:caution"/>
+              <xs:element ref="docbook:important"/>
+              <xs:element ref="docbook:note"/>
+              <xs:element ref="docbook:tip"/>
+              <xs:element ref="docbook:warning"/>
+              <xs:element ref="docbook:anchor"/>
+              <xs:element ref="docbook:para"/>
+              <xs:element ref="docbook:formalpara"/>
+              <xs:element ref="docbook:simpara"/>
+              <xs:element ref="docbook:annotation"/>
+            </xs:choice>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:refsect2"/>
+          </xs:sequence>
+          <xs:element maxOccurs="unbounded" ref="docbook:refsect2"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="refsect2">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice>
+          <xs:sequence>
+            <xs:choice maxOccurs="unbounded">
+              <xs:element ref="docbook:itemizedlist"/>
+              <xs:element ref="docbook:orderedlist"/>
+              <xs:element ref="docbook:procedure"/>
+              <xs:element ref="docbook:simplelist"/>
+              <xs:element ref="docbook:variablelist"/>
+              <xs:element ref="docbook:segmentedlist"/>
+              <xs:element ref="docbook:glosslist"/>
+              <xs:element ref="docbook:bibliolist"/>
+              <xs:element ref="docbook:calloutlist"/>
+              <xs:element ref="docbook:qandaset"/>
+              <xs:element ref="docbook:example"/>
+              <xs:element ref="docbook:figure"/>
+              <xs:element ref="docbook:table"/>
+              <xs:element ref="docbook:equation"/>
+              <xs:element ref="docbook:informalexample"/>
+              <xs:element ref="docbook:informalfigure"/>
+              <xs:element ref="docbook:informaltable"/>
+              <xs:element ref="docbook:informalequation"/>
+              <xs:element ref="docbook:sidebar"/>
+              <xs:element ref="docbook:blockquote"/>
+              <xs:element ref="docbook:address"/>
+              <xs:element ref="docbook:epigraph"/>
+              <xs:element ref="docbook:mediaobject"/>
+              <xs:element ref="docbook:screenshot"/>
+              <xs:element ref="docbook:task"/>
+              <xs:element ref="docbook:productionset"/>
+              <xs:element ref="docbook:constraintdef"/>
+              <xs:element ref="docbook:msgset"/>
+              <xs:element ref="docbook:screen"/>
+              <xs:element ref="docbook:literallayout"/>
+              <xs:element ref="docbook:programlistingco"/>
+              <xs:element ref="docbook:screenco"/>
+              <xs:element ref="docbook:programlisting"/>
+              <xs:element ref="docbook:synopsis"/>
+              <xs:element ref="docbook:bridgehead"/>
+              <xs:element ref="docbook:remark"/>
+              <xs:element ref="docbook:revhistory"/>
+              <xs:element ref="docbook:indexterm"/>
+              <xs:element ref="docbook:funcsynopsis"/>
+              <xs:element ref="docbook:classsynopsis"/>
+              <xs:element ref="docbook:methodsynopsis"/>
+              <xs:element ref="docbook:constructorsynopsis"/>
+              <xs:element ref="docbook:destructorsynopsis"/>
+              <xs:element ref="docbook:fieldsynopsis"/>
+              <xs:element ref="docbook:cmdsynopsis"/>
+              <xs:element ref="docbook:caution"/>
+              <xs:element ref="docbook:important"/>
+              <xs:element ref="docbook:note"/>
+              <xs:element ref="docbook:tip"/>
+              <xs:element ref="docbook:warning"/>
+              <xs:element ref="docbook:anchor"/>
+              <xs:element ref="docbook:para"/>
+              <xs:element ref="docbook:formalpara"/>
+              <xs:element ref="docbook:simpara"/>
+              <xs:element ref="docbook:annotation"/>
+            </xs:choice>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:refsect3"/>
+          </xs:sequence>
+          <xs:element maxOccurs="unbounded" ref="docbook:refsect3"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="refsect3">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="glosslist">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence minOccurs="0">
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:element maxOccurs="unbounded" ref="docbook:glossentry"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="glossentry">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element minOccurs="0" ref="docbook:acronym"/>
+        <xs:element minOccurs="0" ref="docbook:abbrev"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:indexterm"/>
+        <xs:choice>
+          <xs:element ref="docbook:glosssee"/>
+          <xs:element maxOccurs="unbounded" ref="docbook:glossdef"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="sortas"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="glossdef">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:glossseealso"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="subject"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="glosssee">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="otherterm" type="xs:IDREF"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="glossseealso">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="otherterm" type="xs:IDREF"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="firstterm">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="baseform"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="glossterm">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="baseform"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="glossary">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:choice>
+          <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:glossdiv"/>
+          <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:glossentry"/>
+        </xs:choice>
+        <xs:element minOccurs="0" ref="docbook:bibliography"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="glossdiv">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:element maxOccurs="unbounded" ref="docbook:glossentry"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="termdef">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attribute name="sortas"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="baseform"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="biblioentry">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:abstract"/>
+        <xs:element ref="docbook:address"/>
+        <xs:element ref="docbook:artpagenums"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:authorgroup"/>
+        <xs:element ref="docbook:authorinitials"/>
+        <xs:element ref="docbook:bibliocoverage"/>
+        <xs:element ref="docbook:biblioid"/>
+        <xs:element ref="docbook:bibliosource"/>
+        <xs:element ref="docbook:collab"/>
+        <xs:element ref="docbook:confgroup"/>
+        <xs:element ref="docbook:contractsponsor"/>
+        <xs:element ref="docbook:contractnum"/>
+        <xs:element ref="docbook:copyright"/>
+        <xs:element ref="docbook:cover"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:edition"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:issuenum"/>
+        <xs:element ref="docbook:keywordset"/>
+        <xs:element ref="docbook:legalnotice"/>
+        <xs:element ref="docbook:mediaobject"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:othercredit"/>
+        <xs:element ref="docbook:pagenums"/>
+        <xs:element ref="docbook:printhistory"/>
+        <xs:element ref="docbook:pubdate"/>
+        <xs:element ref="docbook:publisher"/>
+        <xs:element ref="docbook:publishername"/>
+        <xs:element ref="docbook:releaseinfo"/>
+        <xs:element ref="docbook:revhistory"/>
+        <xs:element ref="docbook:seriesvolnums"/>
+        <xs:element ref="docbook:subjectset"/>
+        <xs:element ref="docbook:volumenum"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:extendedlink"/>
+        <xs:element ref="docbook:bibliomisc"/>
+        <xs:element ref="docbook:bibliomset"/>
+        <xs:element ref="docbook:bibliorelation"/>
+        <xs:element ref="docbook:biblioset"/>
+        <xs:element ref="docbook:itermset"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personblurb"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:subtitle"/>
+        <xs:element ref="docbook:title"/>
+        <xs:element ref="docbook:titleabbrev"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="bibliomixed">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:abstract"/>
+        <xs:element ref="docbook:address"/>
+        <xs:element ref="docbook:artpagenums"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:authorgroup"/>
+        <xs:element ref="docbook:authorinitials"/>
+        <xs:element ref="docbook:bibliocoverage"/>
+        <xs:element ref="docbook:biblioid"/>
+        <xs:element ref="docbook:bibliosource"/>
+        <xs:element ref="docbook:collab"/>
+        <xs:element ref="docbook:confgroup"/>
+        <xs:element ref="docbook:contractsponsor"/>
+        <xs:element ref="docbook:contractnum"/>
+        <xs:element ref="docbook:copyright"/>
+        <xs:element ref="docbook:cover"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:edition"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:issuenum"/>
+        <xs:element ref="docbook:keywordset"/>
+        <xs:element ref="docbook:legalnotice"/>
+        <xs:element ref="docbook:mediaobject"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:othercredit"/>
+        <xs:element ref="docbook:pagenums"/>
+        <xs:element ref="docbook:printhistory"/>
+        <xs:element ref="docbook:pubdate"/>
+        <xs:element ref="docbook:publisher"/>
+        <xs:element ref="docbook:publishername"/>
+        <xs:element ref="docbook:releaseinfo"/>
+        <xs:element ref="docbook:revhistory"/>
+        <xs:element ref="docbook:seriesvolnums"/>
+        <xs:element ref="docbook:subjectset"/>
+        <xs:element ref="docbook:volumenum"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:extendedlink"/>
+        <xs:element ref="docbook:bibliomisc"/>
+        <xs:element ref="docbook:bibliomset"/>
+        <xs:element ref="docbook:bibliorelation"/>
+        <xs:element ref="docbook:biblioset"/>
+        <xs:element ref="docbook:itermset"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personblurb"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:subtitle"/>
+        <xs:element ref="docbook:title"/>
+        <xs:element ref="docbook:titleabbrev"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="biblioset">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:abstract"/>
+        <xs:element ref="docbook:address"/>
+        <xs:element ref="docbook:artpagenums"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:authorgroup"/>
+        <xs:element ref="docbook:authorinitials"/>
+        <xs:element ref="docbook:bibliocoverage"/>
+        <xs:element ref="docbook:biblioid"/>
+        <xs:element ref="docbook:bibliosource"/>
+        <xs:element ref="docbook:collab"/>
+        <xs:element ref="docbook:confgroup"/>
+        <xs:element ref="docbook:contractsponsor"/>
+        <xs:element ref="docbook:contractnum"/>
+        <xs:element ref="docbook:copyright"/>
+        <xs:element ref="docbook:cover"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:edition"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:issuenum"/>
+        <xs:element ref="docbook:keywordset"/>
+        <xs:element ref="docbook:legalnotice"/>
+        <xs:element ref="docbook:mediaobject"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:othercredit"/>
+        <xs:element ref="docbook:pagenums"/>
+        <xs:element ref="docbook:printhistory"/>
+        <xs:element ref="docbook:pubdate"/>
+        <xs:element ref="docbook:publisher"/>
+        <xs:element ref="docbook:publishername"/>
+        <xs:element ref="docbook:releaseinfo"/>
+        <xs:element ref="docbook:revhistory"/>
+        <xs:element ref="docbook:seriesvolnums"/>
+        <xs:element ref="docbook:subjectset"/>
+        <xs:element ref="docbook:volumenum"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:extendedlink"/>
+        <xs:element ref="docbook:bibliomisc"/>
+        <xs:element ref="docbook:bibliomset"/>
+        <xs:element ref="docbook:bibliorelation"/>
+        <xs:element ref="docbook:biblioset"/>
+        <xs:element ref="docbook:itermset"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personblurb"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:subtitle"/>
+        <xs:element ref="docbook:title"/>
+        <xs:element ref="docbook:titleabbrev"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="relation"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="bibliomset">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:abstract"/>
+        <xs:element ref="docbook:address"/>
+        <xs:element ref="docbook:artpagenums"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:authorgroup"/>
+        <xs:element ref="docbook:authorinitials"/>
+        <xs:element ref="docbook:bibliocoverage"/>
+        <xs:element ref="docbook:biblioid"/>
+        <xs:element ref="docbook:bibliosource"/>
+        <xs:element ref="docbook:collab"/>
+        <xs:element ref="docbook:confgroup"/>
+        <xs:element ref="docbook:contractsponsor"/>
+        <xs:element ref="docbook:contractnum"/>
+        <xs:element ref="docbook:copyright"/>
+        <xs:element ref="docbook:cover"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:edition"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:issuenum"/>
+        <xs:element ref="docbook:keywordset"/>
+        <xs:element ref="docbook:legalnotice"/>
+        <xs:element ref="docbook:mediaobject"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:othercredit"/>
+        <xs:element ref="docbook:pagenums"/>
+        <xs:element ref="docbook:printhistory"/>
+        <xs:element ref="docbook:pubdate"/>
+        <xs:element ref="docbook:publisher"/>
+        <xs:element ref="docbook:publishername"/>
+        <xs:element ref="docbook:releaseinfo"/>
+        <xs:element ref="docbook:revhistory"/>
+        <xs:element ref="docbook:seriesvolnums"/>
+        <xs:element ref="docbook:subjectset"/>
+        <xs:element ref="docbook:volumenum"/>
+        <xs:element ref="docbook:extendedlink"/>
+        <xs:element ref="docbook:bibliomisc"/>
+        <xs:element ref="docbook:bibliomset"/>
+        <xs:element ref="docbook:bibliorelation"/>
+        <xs:element ref="docbook:biblioset"/>
+        <xs:element ref="docbook:itermset"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personblurb"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:subtitle"/>
+        <xs:element ref="docbook:title"/>
+        <xs:element ref="docbook:titleabbrev"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="relation"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="bibliomisc">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="bibliography">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="docbook:bibliodiv"/>
+          <xs:choice maxOccurs="unbounded">
+            <xs:element ref="docbook:biblioentry"/>
+            <xs:element ref="docbook:bibliomixed"/>
+          </xs:choice>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="bibliodiv">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:biblioentry"/>
+          <xs:element ref="docbook:bibliomixed"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="bibliolist">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence minOccurs="0">
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:biblioentry"/>
+          <xs:element ref="docbook:bibliomixed"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="biblioref">
+    <xs:complexType>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="xrefstyle"/>
+      <xs:attribute name="endterm" type="xs:IDREF"/>
+      <xs:attribute name="units" type="xs:NMTOKEN"/>
+      <xs:attribute name="begin" type="xs:NMTOKEN"/>
+      <xs:attribute name="end" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="itermset">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="docbook:indexterm"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="indexterm">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:primary"/>
+        <xs:choice minOccurs="0">
+          <xs:sequence>
+            <xs:element ref="docbook:secondary"/>
+            <xs:choice minOccurs="0">
+              <xs:sequence>
+                <xs:element ref="docbook:tertiary"/>
+                <xs:choice minOccurs="0">
+                  <xs:element ref="docbook:see"/>
+                  <xs:element maxOccurs="unbounded" ref="docbook:seealso"/>
+                </xs:choice>
+              </xs:sequence>
+              <xs:element ref="docbook:see"/>
+              <xs:element maxOccurs="unbounded" ref="docbook:seealso"/>
+            </xs:choice>
+          </xs:sequence>
+          <xs:element ref="docbook:see"/>
+          <xs:element maxOccurs="unbounded" ref="docbook:seealso"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="significance">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="normal"/>
+            <xs:enumeration value="preferred"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="startref" type="xs:IDREF"/>
+      <xs:attribute name="zone" type="xs:IDREFS"/>
+      <xs:attribute name="pagenum"/>
+      <xs:attribute name="scope">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="all"/>
+            <xs:enumeration value="global"/>
+            <xs:enumeration value="local"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="type"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="singular"/>
+            <xs:enumeration value="startofrange"/>
+            <xs:enumeration value="endofrange"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="primary">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="sortas"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="secondary">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="sortas"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="tertiary">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="sortas"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="see">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="seealso">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="index">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:choice>
+          <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:indexdiv"/>
+          <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:indexentry"/>
+          <xs:element ref="docbook:segmentedlist"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+      <xs:attribute name="type"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="setindex">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:choice>
+          <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:indexdiv"/>
+          <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:indexentry"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+      <xs:attribute name="type"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="indexdiv">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="docbook:indexentry"/>
+          <xs:element ref="docbook:segmentedlist"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="status"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="indexentry">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="docbook:primaryie"/>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:seeie"/>
+          <xs:element ref="docbook:seealsoie"/>
+        </xs:choice>
+        <xs:sequence minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:secondaryie"/>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:seeie"/>
+            <xs:element ref="docbook:seealsoie"/>
+            <xs:element ref="docbook:tertiaryie"/>
+          </xs:choice>
+        </xs:sequence>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="primaryie">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="linkends" type="xs:IDREFS"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="secondaryie">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="linkends" type="xs:IDREFS"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="tertiaryie">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="linkends" type="xs:IDREFS"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="seeie">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="seealsoie">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="linkends" type="xs:IDREFS"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="toc">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:tocdiv"/>
+          <xs:element ref="docbook:tocentry"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="tocdiv">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:tocdiv"/>
+          <xs:element ref="docbook:tocentry"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="pagenum"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="tocentry">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="pagenum"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="task">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+            <xs:element ref="docbook:subtitle"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:tasksummary"/>
+        <xs:element minOccurs="0" ref="docbook:taskprerequisites"/>
+        <xs:element ref="docbook:procedure"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:example"/>
+        <xs:element minOccurs="0" ref="docbook:taskrelated"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="tasksummary">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="taskprerequisites">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="taskrelated">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="calloutlist">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:element maxOccurs="unbounded" ref="docbook:callout"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="callout">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:itemizedlist"/>
+        <xs:element ref="docbook:orderedlist"/>
+        <xs:element ref="docbook:procedure"/>
+        <xs:element ref="docbook:simplelist"/>
+        <xs:element ref="docbook:variablelist"/>
+        <xs:element ref="docbook:segmentedlist"/>
+        <xs:element ref="docbook:glosslist"/>
+        <xs:element ref="docbook:bibliolist"/>
+        <xs:element ref="docbook:calloutlist"/>
+        <xs:element ref="docbook:qandaset"/>
+        <xs:element ref="docbook:example"/>
+        <xs:element ref="docbook:figure"/>
+        <xs:element ref="docbook:table"/>
+        <xs:element ref="docbook:equation"/>
+        <xs:element ref="docbook:informalexample"/>
+        <xs:element ref="docbook:informalfigure"/>
+        <xs:element ref="docbook:informaltable"/>
+        <xs:element ref="docbook:informalequation"/>
+        <xs:element ref="docbook:sidebar"/>
+        <xs:element ref="docbook:blockquote"/>
+        <xs:element ref="docbook:address"/>
+        <xs:element ref="docbook:epigraph"/>
+        <xs:element ref="docbook:mediaobject"/>
+        <xs:element ref="docbook:screenshot"/>
+        <xs:element ref="docbook:task"/>
+        <xs:element ref="docbook:productionset"/>
+        <xs:element ref="docbook:constraintdef"/>
+        <xs:element ref="docbook:msgset"/>
+        <xs:element ref="docbook:screen"/>
+        <xs:element ref="docbook:literallayout"/>
+        <xs:element ref="docbook:programlistingco"/>
+        <xs:element ref="docbook:screenco"/>
+        <xs:element ref="docbook:programlisting"/>
+        <xs:element ref="docbook:synopsis"/>
+        <xs:element ref="docbook:bridgehead"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:revhistory"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:funcsynopsis"/>
+        <xs:element ref="docbook:classsynopsis"/>
+        <xs:element ref="docbook:methodsynopsis"/>
+        <xs:element ref="docbook:constructorsynopsis"/>
+        <xs:element ref="docbook:destructorsynopsis"/>
+        <xs:element ref="docbook:fieldsynopsis"/>
+        <xs:element ref="docbook:cmdsynopsis"/>
+        <xs:element ref="docbook:caution"/>
+        <xs:element ref="docbook:important"/>
+        <xs:element ref="docbook:note"/>
+        <xs:element ref="docbook:tip"/>
+        <xs:element ref="docbook:warning"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:para"/>
+        <xs:element ref="docbook:formalpara"/>
+        <xs:element ref="docbook:simpara"/>
+        <xs:element ref="docbook:annotation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="arearefs" use="required" type="xs:IDREFS"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="programlistingco">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:element ref="docbook:areaspec"/>
+        <xs:element ref="docbook:programlisting"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:calloutlist"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="areaspec">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:area"/>
+        <xs:element ref="docbook:areaset"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="units">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="calspair"/>
+            <xs:enumeration value="linecolumn"/>
+            <xs:enumeration value="linecolumnpair"/>
+            <xs:enumeration value="linerange"/>
+            <xs:enumeration value="other"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="otherunits" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="area">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:alt"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="units">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="calspair"/>
+            <xs:enumeration value="linecolumn"/>
+            <xs:enumeration value="linecolumnpair"/>
+            <xs:enumeration value="linerange"/>
+            <xs:enumeration value="other"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="otherunits" type="xs:NMTOKEN"/>
+      <xs:attribute name="linkends" type="xs:IDREFS"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="coords" use="required"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="areaset">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="docbook:area"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="units">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="calspair"/>
+            <xs:enumeration value="linecolumn"/>
+            <xs:enumeration value="linecolumnpair"/>
+            <xs:enumeration value="linerange"/>
+            <xs:enumeration value="other"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="otherunits" type="xs:NMTOKEN"/>
+      <xs:attribute name="linkends" type="xs:IDREFS"/>
+      <xs:attribute name="label"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="screenco">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:element ref="docbook:areaspec"/>
+        <xs:element ref="docbook:screen"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:calloutlist"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="imageobjectco">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:element ref="docbook:areaspec"/>
+        <xs:element maxOccurs="unbounded" ref="docbook:imageobject"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:calloutlist"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="co">
+    <xs:complexType>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="linkends" type="xs:IDREFS"/>
+      <xs:attribute name="label"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="coref">
+    <xs:complexType>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="productionset">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:production"/>
+          <xs:element ref="docbook:productionrecap"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="production">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="docbook:lhs"/>
+        <xs:element ref="docbook:rhs"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:constraint"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="lhs">
+    <xs:complexType mixed="true">
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="rhs">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:lineannotation"/>
+        <xs:element ref="docbook:sbr"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="nonterminal">
+    <xs:complexType mixed="true">
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="def" use="required"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="constraint">
+    <xs:complexType>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="productionrecap">
+    <xs:complexType>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="constraintdef">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="tgroup">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:colspec"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:spanspec"/>
+        <xs:element minOccurs="0" ref="docbook:thead"/>
+        <xs:element minOccurs="0" ref="docbook:tfoot"/>
+        <xs:element ref="docbook:tbody"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="char"/>
+      <xs:attribute name="charoff"/>
+      <xs:attribute name="tgroupstyle"/>
+      <xs:attribute name="cols" use="required" type="xs:NMTOKEN"/>
+      <xs:attribute name="colsep">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="rowsep">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="char"/>
+            <xs:enumeration value="justify"/>
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="right"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="colspec">
+    <xs:complexType>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="colnum" type="xs:NMTOKEN"/>
+      <xs:attribute name="char"/>
+      <xs:attribute name="colsep">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="colwidth"/>
+      <xs:attribute name="charoff"/>
+      <xs:attribute name="colname"/>
+      <xs:attribute name="rowsep">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="char"/>
+            <xs:enumeration value="justify"/>
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="right"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="spanspec">
+    <xs:complexType>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="spanname" use="required"/>
+      <xs:attribute name="namest" use="required"/>
+      <xs:attribute name="nameend" use="required"/>
+      <xs:attribute name="char"/>
+      <xs:attribute name="colsep">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="charoff"/>
+      <xs:attribute name="rowsep">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="char"/>
+            <xs:enumeration value="justify"/>
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="right"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="thead">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:colspec"/>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="docbook:row"/>
+          <xs:element maxOccurs="unbounded" ref="docbook:tr"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="valign">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="bottom"/>
+            <xs:enumeration value="middle"/>
+            <xs:enumeration value="top"/>
+            <xs:enumeration value="baseline"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="class"/>
+      <xs:attribute name="style"/>
+      <xs:attribute name="title"/>
+      <xs:attribute name="lang"/>
+      <xs:attribute name="onclick"/>
+      <xs:attribute name="ondblclick"/>
+      <xs:attribute name="onmousedown"/>
+      <xs:attribute name="onmouseup"/>
+      <xs:attribute name="onmouseover"/>
+      <xs:attribute name="onmousemove"/>
+      <xs:attribute name="onmouseout"/>
+      <xs:attribute name="onkeypress"/>
+      <xs:attribute name="onkeydown"/>
+      <xs:attribute name="onkeyup"/>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="right"/>
+            <xs:enumeration value="justify"/>
+            <xs:enumeration value="char"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="char"/>
+      <xs:attribute name="charoff"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="tfoot">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:colspec"/>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="docbook:row"/>
+          <xs:element maxOccurs="unbounded" ref="docbook:tr"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="valign">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="bottom"/>
+            <xs:enumeration value="middle"/>
+            <xs:enumeration value="top"/>
+            <xs:enumeration value="baseline"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="class"/>
+      <xs:attribute name="style"/>
+      <xs:attribute name="title"/>
+      <xs:attribute name="lang"/>
+      <xs:attribute name="onclick"/>
+      <xs:attribute name="ondblclick"/>
+      <xs:attribute name="onmousedown"/>
+      <xs:attribute name="onmouseup"/>
+      <xs:attribute name="onmouseover"/>
+      <xs:attribute name="onmousemove"/>
+      <xs:attribute name="onmouseout"/>
+      <xs:attribute name="onkeypress"/>
+      <xs:attribute name="onkeydown"/>
+      <xs:attribute name="onkeyup"/>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="right"/>
+            <xs:enumeration value="justify"/>
+            <xs:enumeration value="char"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="char"/>
+      <xs:attribute name="charoff"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="tbody">
+    <xs:complexType>
+      <xs:choice>
+        <xs:element maxOccurs="unbounded" ref="docbook:row"/>
+        <xs:element maxOccurs="unbounded" ref="docbook:tr"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="valign">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="bottom"/>
+            <xs:enumeration value="middle"/>
+            <xs:enumeration value="top"/>
+            <xs:enumeration value="baseline"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="class"/>
+      <xs:attribute name="style"/>
+      <xs:attribute name="title"/>
+      <xs:attribute name="lang"/>
+      <xs:attribute name="onclick"/>
+      <xs:attribute name="ondblclick"/>
+      <xs:attribute name="onmousedown"/>
+      <xs:attribute name="onmouseup"/>
+      <xs:attribute name="onmouseover"/>
+      <xs:attribute name="onmousemove"/>
+      <xs:attribute name="onmouseout"/>
+      <xs:attribute name="onkeypress"/>
+      <xs:attribute name="onkeydown"/>
+      <xs:attribute name="onkeyup"/>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="right"/>
+            <xs:enumeration value="justify"/>
+            <xs:enumeration value="char"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="char"/>
+      <xs:attribute name="charoff"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="row">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:entry"/>
+        <xs:element ref="docbook:entrytbl"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="rowsep">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="valign">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="bottom"/>
+            <xs:enumeration value="middle"/>
+            <xs:enumeration value="top"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="entry">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:itemizedlist"/>
+        <xs:element ref="docbook:orderedlist"/>
+        <xs:element ref="docbook:procedure"/>
+        <xs:element ref="docbook:simplelist"/>
+        <xs:element ref="docbook:variablelist"/>
+        <xs:element ref="docbook:segmentedlist"/>
+        <xs:element ref="docbook:glosslist"/>
+        <xs:element ref="docbook:bibliolist"/>
+        <xs:element ref="docbook:calloutlist"/>
+        <xs:element ref="docbook:qandaset"/>
+        <xs:element ref="docbook:example"/>
+        <xs:element ref="docbook:figure"/>
+        <xs:element ref="docbook:table"/>
+        <xs:element ref="docbook:equation"/>
+        <xs:element ref="docbook:informalexample"/>
+        <xs:element ref="docbook:informalfigure"/>
+        <xs:element ref="docbook:informaltable"/>
+        <xs:element ref="docbook:informalequation"/>
+        <xs:element ref="docbook:sidebar"/>
+        <xs:element ref="docbook:blockquote"/>
+        <xs:element ref="docbook:address"/>
+        <xs:element ref="docbook:epigraph"/>
+        <xs:element ref="docbook:mediaobject"/>
+        <xs:element ref="docbook:screenshot"/>
+        <xs:element ref="docbook:task"/>
+        <xs:element ref="docbook:productionset"/>
+        <xs:element ref="docbook:constraintdef"/>
+        <xs:element ref="docbook:msgset"/>
+        <xs:element ref="docbook:screen"/>
+        <xs:element ref="docbook:literallayout"/>
+        <xs:element ref="docbook:programlistingco"/>
+        <xs:element ref="docbook:screenco"/>
+        <xs:element ref="docbook:programlisting"/>
+        <xs:element ref="docbook:synopsis"/>
+        <xs:element ref="docbook:bridgehead"/>
+        <xs:element ref="docbook:revhistory"/>
+        <xs:element ref="docbook:funcsynopsis"/>
+        <xs:element ref="docbook:classsynopsis"/>
+        <xs:element ref="docbook:methodsynopsis"/>
+        <xs:element ref="docbook:constructorsynopsis"/>
+        <xs:element ref="docbook:destructorsynopsis"/>
+        <xs:element ref="docbook:fieldsynopsis"/>
+        <xs:element ref="docbook:cmdsynopsis"/>
+        <xs:element ref="docbook:caution"/>
+        <xs:element ref="docbook:important"/>
+        <xs:element ref="docbook:note"/>
+        <xs:element ref="docbook:tip"/>
+        <xs:element ref="docbook:warning"/>
+        <xs:element ref="docbook:para"/>
+        <xs:element ref="docbook:formalpara"/>
+        <xs:element ref="docbook:simpara"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="valign">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="bottom"/>
+            <xs:enumeration value="middle"/>
+            <xs:enumeration value="top"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="char"/>
+      <xs:attribute name="colsep">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="charoff"/>
+      <xs:attribute name="morerows" type="xs:NMTOKEN"/>
+      <xs:attribute name="colname"/>
+      <xs:attribute name="namest"/>
+      <xs:attribute name="spanname"/>
+      <xs:attribute name="nameend"/>
+      <xs:attribute name="rowsep">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="rotate">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="char"/>
+            <xs:enumeration value="justify"/>
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="right"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="entrytbl">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:colspec"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:spanspec"/>
+        <xs:element minOccurs="0" ref="docbook:thead"/>
+        <xs:element ref="docbook:tbody"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="char"/>
+      <xs:attribute name="charoff"/>
+      <xs:attribute name="colname"/>
+      <xs:attribute name="namest"/>
+      <xs:attribute name="spanname"/>
+      <xs:attribute name="nameend"/>
+      <xs:attribute name="tgroupstyle"/>
+      <xs:attribute name="cols" type="xs:NMTOKEN"/>
+      <xs:attribute name="colsep">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="rowsep">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="char"/>
+            <xs:enumeration value="justify"/>
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="right"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="table">
+    <xs:complexType>
+      <xs:choice>
+        <xs:sequence>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+          <xs:sequence>
+            <xs:element ref="docbook:title"/>
+            <xs:element minOccurs="0" ref="docbook:titleabbrev"/>
+          </xs:sequence>
+          <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:indexterm"/>
+          <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:textobject"/>
+          <xs:choice>
+            <xs:element maxOccurs="unbounded" ref="docbook:mediaobject"/>
+            <xs:element maxOccurs="unbounded" ref="docbook:tgroup"/>
+          </xs:choice>
+        </xs:sequence>
+        <xs:sequence>
+          <xs:element ref="docbook:caption"/>
+          <xs:choice>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:col"/>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:colgroup"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:thead"/>
+          <xs:element minOccurs="0" ref="docbook:tfoot"/>
+          <xs:choice>
+            <xs:element maxOccurs="unbounded" ref="docbook:tbody"/>
+            <xs:element maxOccurs="unbounded" ref="docbook:tr"/>
+          </xs:choice>
+        </xs:sequence>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attribute name="label"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="tabstyle"/>
+      <xs:attribute name="floatstyle"/>
+      <xs:attribute name="orient">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="land"/>
+            <xs:enumeration value="port"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="colsep">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="rowsep">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="frame">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="all"/>
+            <xs:enumeration value="bottom"/>
+            <xs:enumeration value="none"/>
+            <xs:enumeration value="sides"/>
+            <xs:enumeration value="top"/>
+            <xs:enumeration value="topbot"/>
+            <xs:enumeration value="void"/>
+            <xs:enumeration value="above"/>
+            <xs:enumeration value="below"/>
+            <xs:enumeration value="hsides"/>
+            <xs:enumeration value="lhs"/>
+            <xs:enumeration value="rhs"/>
+            <xs:enumeration value="vsides"/>
+            <xs:enumeration value="box"/>
+            <xs:enumeration value="border"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="pgwide">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="shortentry">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="tocentry">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="rowheader">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="firstcol"/>
+            <xs:enumeration value="norowheader"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="class"/>
+      <xs:attribute name="style"/>
+      <xs:attribute name="title"/>
+      <xs:attribute name="lang"/>
+      <xs:attribute name="onclick"/>
+      <xs:attribute name="ondblclick"/>
+      <xs:attribute name="onmousedown"/>
+      <xs:attribute name="onmouseup"/>
+      <xs:attribute name="onmouseover"/>
+      <xs:attribute name="onmousemove"/>
+      <xs:attribute name="onmouseout"/>
+      <xs:attribute name="onkeypress"/>
+      <xs:attribute name="onkeydown"/>
+      <xs:attribute name="onkeyup"/>
+      <xs:attribute name="summary"/>
+      <xs:attribute name="width"/>
+      <xs:attribute name="border" type="xs:NMTOKEN"/>
+      <xs:attribute name="rules">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="none"/>
+            <xs:enumeration value="groups"/>
+            <xs:enumeration value="rows"/>
+            <xs:enumeration value="cols"/>
+            <xs:enumeration value="all"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="cellspacing"/>
+      <xs:attribute name="cellpadding"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="informaltable">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:choice>
+          <xs:sequence>
+            <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:textobject"/>
+            <xs:choice>
+              <xs:element maxOccurs="unbounded" ref="docbook:mediaobject"/>
+              <xs:element maxOccurs="unbounded" ref="docbook:tgroup"/>
+            </xs:choice>
+          </xs:sequence>
+          <xs:sequence>
+            <xs:choice>
+              <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:col"/>
+              <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:colgroup"/>
+            </xs:choice>
+            <xs:element minOccurs="0" ref="docbook:thead"/>
+            <xs:element minOccurs="0" ref="docbook:tfoot"/>
+            <xs:choice>
+              <xs:element maxOccurs="unbounded" ref="docbook:tbody"/>
+              <xs:element maxOccurs="unbounded" ref="docbook:tr"/>
+            </xs:choice>
+          </xs:sequence>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="tabstyle"/>
+      <xs:attribute name="floatstyle"/>
+      <xs:attribute name="orient">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="land"/>
+            <xs:enumeration value="port"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="colsep">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="rowsep">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="frame">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="all"/>
+            <xs:enumeration value="bottom"/>
+            <xs:enumeration value="none"/>
+            <xs:enumeration value="sides"/>
+            <xs:enumeration value="top"/>
+            <xs:enumeration value="topbot"/>
+            <xs:enumeration value="void"/>
+            <xs:enumeration value="above"/>
+            <xs:enumeration value="below"/>
+            <xs:enumeration value="hsides"/>
+            <xs:enumeration value="lhs"/>
+            <xs:enumeration value="rhs"/>
+            <xs:enumeration value="vsides"/>
+            <xs:enumeration value="box"/>
+            <xs:enumeration value="border"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="pgwide">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="rowheader">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="firstcol"/>
+            <xs:enumeration value="norowheader"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="class"/>
+      <xs:attribute name="style"/>
+      <xs:attribute name="title"/>
+      <xs:attribute name="lang"/>
+      <xs:attribute name="onclick"/>
+      <xs:attribute name="ondblclick"/>
+      <xs:attribute name="onmousedown"/>
+      <xs:attribute name="onmouseup"/>
+      <xs:attribute name="onmouseover"/>
+      <xs:attribute name="onmousemove"/>
+      <xs:attribute name="onmouseout"/>
+      <xs:attribute name="onkeypress"/>
+      <xs:attribute name="onkeydown"/>
+      <xs:attribute name="onkeyup"/>
+      <xs:attribute name="summary"/>
+      <xs:attribute name="width"/>
+      <xs:attribute name="border" type="xs:NMTOKEN"/>
+      <xs:attribute name="rules">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="none"/>
+            <xs:enumeration value="groups"/>
+            <xs:enumeration value="rows"/>
+            <xs:enumeration value="cols"/>
+            <xs:enumeration value="all"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="cellspacing"/>
+      <xs:attribute name="cellpadding"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="col">
+    <xs:complexType>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="class"/>
+      <xs:attribute name="style"/>
+      <xs:attribute name="title"/>
+      <xs:attribute name="lang"/>
+      <xs:attribute name="onclick"/>
+      <xs:attribute name="ondblclick"/>
+      <xs:attribute name="onmousedown"/>
+      <xs:attribute name="onmouseup"/>
+      <xs:attribute name="onmouseover"/>
+      <xs:attribute name="onmousemove"/>
+      <xs:attribute name="onmouseout"/>
+      <xs:attribute name="onkeypress"/>
+      <xs:attribute name="onkeydown"/>
+      <xs:attribute name="onkeyup"/>
+      <xs:attribute name="span" type="xs:NMTOKEN"/>
+      <xs:attribute name="width"/>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="right"/>
+            <xs:enumeration value="justify"/>
+            <xs:enumeration value="char"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="char"/>
+      <xs:attribute name="charoff"/>
+      <xs:attribute name="valign">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="top"/>
+            <xs:enumeration value="middle"/>
+            <xs:enumeration value="bottom"/>
+            <xs:enumeration value="baseline"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="colgroup">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:col"/>
+      </xs:sequence>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="class"/>
+      <xs:attribute name="style"/>
+      <xs:attribute name="title"/>
+      <xs:attribute name="lang"/>
+      <xs:attribute name="onclick"/>
+      <xs:attribute name="ondblclick"/>
+      <xs:attribute name="onmousedown"/>
+      <xs:attribute name="onmouseup"/>
+      <xs:attribute name="onmouseover"/>
+      <xs:attribute name="onmousemove"/>
+      <xs:attribute name="onmouseout"/>
+      <xs:attribute name="onkeypress"/>
+      <xs:attribute name="onkeydown"/>
+      <xs:attribute name="onkeyup"/>
+      <xs:attribute name="span" type="xs:NMTOKEN"/>
+      <xs:attribute name="width"/>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="right"/>
+            <xs:enumeration value="justify"/>
+            <xs:enumeration value="char"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="char"/>
+      <xs:attribute name="charoff"/>
+      <xs:attribute name="valign">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="top"/>
+            <xs:enumeration value="middle"/>
+            <xs:enumeration value="bottom"/>
+            <xs:enumeration value="baseline"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="tr">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:th"/>
+        <xs:element ref="docbook:td"/>
+      </xs:choice>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="class"/>
+      <xs:attribute name="style"/>
+      <xs:attribute name="title"/>
+      <xs:attribute name="lang"/>
+      <xs:attribute name="onclick"/>
+      <xs:attribute name="ondblclick"/>
+      <xs:attribute name="onmousedown"/>
+      <xs:attribute name="onmouseup"/>
+      <xs:attribute name="onmouseover"/>
+      <xs:attribute name="onmousemove"/>
+      <xs:attribute name="onmouseout"/>
+      <xs:attribute name="onkeypress"/>
+      <xs:attribute name="onkeydown"/>
+      <xs:attribute name="onkeyup"/>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="right"/>
+            <xs:enumeration value="justify"/>
+            <xs:enumeration value="char"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="char"/>
+      <xs:attribute name="charoff"/>
+      <xs:attribute name="valign">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="top"/>
+            <xs:enumeration value="middle"/>
+            <xs:enumeration value="bottom"/>
+            <xs:enumeration value="baseline"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="th">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:itemizedlist"/>
+        <xs:element ref="docbook:orderedlist"/>
+        <xs:element ref="docbook:procedure"/>
+        <xs:element ref="docbook:simplelist"/>
+        <xs:element ref="docbook:variablelist"/>
+        <xs:element ref="docbook:segmentedlist"/>
+        <xs:element ref="docbook:glosslist"/>
+        <xs:element ref="docbook:bibliolist"/>
+        <xs:element ref="docbook:calloutlist"/>
+        <xs:element ref="docbook:qandaset"/>
+        <xs:element ref="docbook:example"/>
+        <xs:element ref="docbook:figure"/>
+        <xs:element ref="docbook:table"/>
+        <xs:element ref="docbook:equation"/>
+        <xs:element ref="docbook:informalexample"/>
+        <xs:element ref="docbook:informalfigure"/>
+        <xs:element ref="docbook:informaltable"/>
+        <xs:element ref="docbook:informalequation"/>
+        <xs:element ref="docbook:sidebar"/>
+        <xs:element ref="docbook:blockquote"/>
+        <xs:element ref="docbook:address"/>
+        <xs:element ref="docbook:epigraph"/>
+        <xs:element ref="docbook:mediaobject"/>
+        <xs:element ref="docbook:screenshot"/>
+        <xs:element ref="docbook:task"/>
+        <xs:element ref="docbook:productionset"/>
+        <xs:element ref="docbook:constraintdef"/>
+        <xs:element ref="docbook:msgset"/>
+        <xs:element ref="docbook:screen"/>
+        <xs:element ref="docbook:literallayout"/>
+        <xs:element ref="docbook:programlistingco"/>
+        <xs:element ref="docbook:screenco"/>
+        <xs:element ref="docbook:programlisting"/>
+        <xs:element ref="docbook:synopsis"/>
+        <xs:element ref="docbook:bridgehead"/>
+        <xs:element ref="docbook:revhistory"/>
+        <xs:element ref="docbook:funcsynopsis"/>
+        <xs:element ref="docbook:classsynopsis"/>
+        <xs:element ref="docbook:methodsynopsis"/>
+        <xs:element ref="docbook:constructorsynopsis"/>
+        <xs:element ref="docbook:destructorsynopsis"/>
+        <xs:element ref="docbook:fieldsynopsis"/>
+        <xs:element ref="docbook:cmdsynopsis"/>
+        <xs:element ref="docbook:caution"/>
+        <xs:element ref="docbook:important"/>
+        <xs:element ref="docbook:note"/>
+        <xs:element ref="docbook:tip"/>
+        <xs:element ref="docbook:warning"/>
+        <xs:element ref="docbook:para"/>
+        <xs:element ref="docbook:formalpara"/>
+        <xs:element ref="docbook:simpara"/>
+      </xs:choice>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="class"/>
+      <xs:attribute name="style"/>
+      <xs:attribute name="title"/>
+      <xs:attribute name="lang"/>
+      <xs:attribute name="onclick"/>
+      <xs:attribute name="ondblclick"/>
+      <xs:attribute name="onmousedown"/>
+      <xs:attribute name="onmouseup"/>
+      <xs:attribute name="onmouseover"/>
+      <xs:attribute name="onmousemove"/>
+      <xs:attribute name="onmouseout"/>
+      <xs:attribute name="onkeypress"/>
+      <xs:attribute name="onkeydown"/>
+      <xs:attribute name="onkeyup"/>
+      <xs:attribute name="abbr"/>
+      <xs:attribute name="axis"/>
+      <xs:attribute name="headers"/>
+      <xs:attribute name="scope">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="row"/>
+            <xs:enumeration value="col"/>
+            <xs:enumeration value="rowgroup"/>
+            <xs:enumeration value="colgroup"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="rowspan" type="xs:NMTOKEN"/>
+      <xs:attribute name="colspan" type="xs:NMTOKEN"/>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="right"/>
+            <xs:enumeration value="justify"/>
+            <xs:enumeration value="char"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="char"/>
+      <xs:attribute name="charoff"/>
+      <xs:attribute name="valign">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="top"/>
+            <xs:enumeration value="middle"/>
+            <xs:enumeration value="bottom"/>
+            <xs:enumeration value="baseline"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="td">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:itemizedlist"/>
+        <xs:element ref="docbook:orderedlist"/>
+        <xs:element ref="docbook:procedure"/>
+        <xs:element ref="docbook:simplelist"/>
+        <xs:element ref="docbook:variablelist"/>
+        <xs:element ref="docbook:segmentedlist"/>
+        <xs:element ref="docbook:glosslist"/>
+        <xs:element ref="docbook:bibliolist"/>
+        <xs:element ref="docbook:calloutlist"/>
+        <xs:element ref="docbook:qandaset"/>
+        <xs:element ref="docbook:example"/>
+        <xs:element ref="docbook:figure"/>
+        <xs:element ref="docbook:table"/>
+        <xs:element ref="docbook:equation"/>
+        <xs:element ref="docbook:informalexample"/>
+        <xs:element ref="docbook:informalfigure"/>
+        <xs:element ref="docbook:informaltable"/>
+        <xs:element ref="docbook:informalequation"/>
+        <xs:element ref="docbook:sidebar"/>
+        <xs:element ref="docbook:blockquote"/>
+        <xs:element ref="docbook:address"/>
+        <xs:element ref="docbook:epigraph"/>
+        <xs:element ref="docbook:mediaobject"/>
+        <xs:element ref="docbook:screenshot"/>
+        <xs:element ref="docbook:task"/>
+        <xs:element ref="docbook:productionset"/>
+        <xs:element ref="docbook:constraintdef"/>
+        <xs:element ref="docbook:msgset"/>
+        <xs:element ref="docbook:screen"/>
+        <xs:element ref="docbook:literallayout"/>
+        <xs:element ref="docbook:programlistingco"/>
+        <xs:element ref="docbook:screenco"/>
+        <xs:element ref="docbook:programlisting"/>
+        <xs:element ref="docbook:synopsis"/>
+        <xs:element ref="docbook:bridgehead"/>
+        <xs:element ref="docbook:revhistory"/>
+        <xs:element ref="docbook:funcsynopsis"/>
+        <xs:element ref="docbook:classsynopsis"/>
+        <xs:element ref="docbook:methodsynopsis"/>
+        <xs:element ref="docbook:constructorsynopsis"/>
+        <xs:element ref="docbook:destructorsynopsis"/>
+        <xs:element ref="docbook:fieldsynopsis"/>
+        <xs:element ref="docbook:cmdsynopsis"/>
+        <xs:element ref="docbook:caution"/>
+        <xs:element ref="docbook:important"/>
+        <xs:element ref="docbook:note"/>
+        <xs:element ref="docbook:tip"/>
+        <xs:element ref="docbook:warning"/>
+        <xs:element ref="docbook:para"/>
+        <xs:element ref="docbook:formalpara"/>
+        <xs:element ref="docbook:simpara"/>
+      </xs:choice>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attribute name="class"/>
+      <xs:attribute name="style"/>
+      <xs:attribute name="title"/>
+      <xs:attribute name="lang"/>
+      <xs:attribute name="onclick"/>
+      <xs:attribute name="ondblclick"/>
+      <xs:attribute name="onmousedown"/>
+      <xs:attribute name="onmouseup"/>
+      <xs:attribute name="onmouseover"/>
+      <xs:attribute name="onmousemove"/>
+      <xs:attribute name="onmouseout"/>
+      <xs:attribute name="onkeypress"/>
+      <xs:attribute name="onkeydown"/>
+      <xs:attribute name="onkeyup"/>
+      <xs:attribute name="abbr"/>
+      <xs:attribute name="axis"/>
+      <xs:attribute name="headers"/>
+      <xs:attribute name="scope">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="row"/>
+            <xs:enumeration value="col"/>
+            <xs:enumeration value="rowgroup"/>
+            <xs:enumeration value="colgroup"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="rowspan" type="xs:NMTOKEN"/>
+      <xs:attribute name="colspan" type="xs:NMTOKEN"/>
+      <xs:attribute name="align">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="center"/>
+            <xs:enumeration value="right"/>
+            <xs:enumeration value="justify"/>
+            <xs:enumeration value="char"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="char"/>
+      <xs:attribute name="charoff"/>
+      <xs:attribute name="valign">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="top"/>
+            <xs:enumeration value="middle"/>
+            <xs:enumeration value="bottom"/>
+            <xs:enumeration value="baseline"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="msgset">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="docbook:msgentry"/>
+          <xs:element maxOccurs="unbounded" ref="docbook:simplemsgentry"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="msgentry">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="docbook:msg"/>
+        <xs:element minOccurs="0" ref="docbook:msginfo"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:msgexplan"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="simplemsgentry">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="docbook:msgtext"/>
+        <xs:element maxOccurs="unbounded" ref="docbook:msgexplan"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="msgaud"/>
+      <xs:attribute name="msgorig"/>
+      <xs:attribute name="msglevel"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="msg">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:element ref="docbook:msgmain"/>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:msgsub"/>
+          <xs:element ref="docbook:msgrel"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="msgmain">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:element ref="docbook:msgtext"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="msgsub">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:element ref="docbook:msgtext"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="msgrel">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:element ref="docbook:msgtext"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="msgtext">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:itemizedlist"/>
+        <xs:element ref="docbook:orderedlist"/>
+        <xs:element ref="docbook:procedure"/>
+        <xs:element ref="docbook:simplelist"/>
+        <xs:element ref="docbook:variablelist"/>
+        <xs:element ref="docbook:segmentedlist"/>
+        <xs:element ref="docbook:glosslist"/>
+        <xs:element ref="docbook:bibliolist"/>
+        <xs:element ref="docbook:calloutlist"/>
+        <xs:element ref="docbook:qandaset"/>
+        <xs:element ref="docbook:example"/>
+        <xs:element ref="docbook:figure"/>
+        <xs:element ref="docbook:table"/>
+        <xs:element ref="docbook:equation"/>
+        <xs:element ref="docbook:informalexample"/>
+        <xs:element ref="docbook:informalfigure"/>
+        <xs:element ref="docbook:informaltable"/>
+        <xs:element ref="docbook:informalequation"/>
+        <xs:element ref="docbook:sidebar"/>
+        <xs:element ref="docbook:blockquote"/>
+        <xs:element ref="docbook:address"/>
+        <xs:element ref="docbook:epigraph"/>
+        <xs:element ref="docbook:mediaobject"/>
+        <xs:element ref="docbook:screenshot"/>
+        <xs:element ref="docbook:task"/>
+        <xs:element ref="docbook:productionset"/>
+        <xs:element ref="docbook:constraintdef"/>
+        <xs:element ref="docbook:msgset"/>
+        <xs:element ref="docbook:screen"/>
+        <xs:element ref="docbook:literallayout"/>
+        <xs:element ref="docbook:programlistingco"/>
+        <xs:element ref="docbook:screenco"/>
+        <xs:element ref="docbook:programlisting"/>
+        <xs:element ref="docbook:synopsis"/>
+        <xs:element ref="docbook:bridgehead"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:revhistory"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:funcsynopsis"/>
+        <xs:element ref="docbook:classsynopsis"/>
+        <xs:element ref="docbook:methodsynopsis"/>
+        <xs:element ref="docbook:constructorsynopsis"/>
+        <xs:element ref="docbook:destructorsynopsis"/>
+        <xs:element ref="docbook:fieldsynopsis"/>
+        <xs:element ref="docbook:cmdsynopsis"/>
+        <xs:element ref="docbook:caution"/>
+        <xs:element ref="docbook:important"/>
+        <xs:element ref="docbook:note"/>
+        <xs:element ref="docbook:tip"/>
+        <xs:element ref="docbook:warning"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:para"/>
+        <xs:element ref="docbook:formalpara"/>
+        <xs:element ref="docbook:simpara"/>
+        <xs:element ref="docbook:annotation"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="msginfo">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:msglevel"/>
+        <xs:element ref="docbook:msgorig"/>
+        <xs:element ref="docbook:msgaud"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="msglevel">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="msgorig">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="msgaud">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="msgexplan">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="qandaset">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="docbook:qandadiv"/>
+          <xs:element maxOccurs="unbounded" ref="docbook:qandaentry"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="defaultlabel">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="none"/>
+            <xs:enumeration value="number"/>
+            <xs:enumeration value="qanda"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="qandadiv">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="docbook:qandadiv"/>
+          <xs:element maxOccurs="unbounded" ref="docbook:qandaentry"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="qandaentry">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:element ref="docbook:question"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:answer"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="question">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:label"/>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="answer">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:label"/>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="label">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="equation">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:alt"/>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="docbook:mediaobject"/>
+          <xs:element maxOccurs="unbounded" ref="docbook:mathphrase"/>
+        </xs:choice>
+        <xs:element minOccurs="0" ref="docbook:caption"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="label"/>
+      <xs:attribute name="pgwide">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="0"/>
+            <xs:enumeration value="1"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="floatstyle"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="informalequation">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:element minOccurs="0" ref="docbook:alt"/>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="docbook:mediaobject"/>
+          <xs:element maxOccurs="unbounded" ref="docbook:mathphrase"/>
+        </xs:choice>
+        <xs:element minOccurs="0" ref="docbook:caption"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="inlineequation">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:alt"/>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="docbook:inlinemediaobject"/>
+          <xs:element maxOccurs="unbounded" ref="docbook:mathphrase"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="mathphrase">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:emphasis"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="markup">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="tag">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="attribute"/>
+            <xs:enumeration value="attvalue"/>
+            <xs:enumeration value="element"/>
+            <xs:enumeration value="emptytag"/>
+            <xs:enumeration value="endtag"/>
+            <xs:enumeration value="genentity"/>
+            <xs:enumeration value="localname"/>
+            <xs:enumeration value="namespace"/>
+            <xs:enumeration value="numcharref"/>
+            <xs:enumeration value="paramentity"/>
+            <xs:enumeration value="pi"/>
+            <xs:enumeration value="prefix"/>
+            <xs:enumeration value="comment"/>
+            <xs:enumeration value="starttag"/>
+            <xs:enumeration value="xmlpi"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="namespace"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="symbol">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="limit"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="token">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="literal">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="code">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="language"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="constant">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="limit"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="productname">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="copyright"/>
+            <xs:enumeration value="registered"/>
+            <xs:enumeration value="service"/>
+            <xs:enumeration value="trade"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="productnumber">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="database">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="altkey"/>
+            <xs:enumeration value="constraint"/>
+            <xs:enumeration value="datatype"/>
+            <xs:enumeration value="field"/>
+            <xs:enumeration value="foreignkey"/>
+            <xs:enumeration value="group"/>
+            <xs:enumeration value="index"/>
+            <xs:enumeration value="key1"/>
+            <xs:enumeration value="key2"/>
+            <xs:enumeration value="name"/>
+            <xs:enumeration value="primarykey"/>
+            <xs:enumeration value="procedure"/>
+            <xs:enumeration value="record"/>
+            <xs:enumeration value="rule"/>
+            <xs:enumeration value="secondarykey"/>
+            <xs:enumeration value="table"/>
+            <xs:enumeration value="user"/>
+            <xs:enumeration value="view"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="application">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="hardware"/>
+            <xs:enumeration value="software"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="hardware">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="guibutton">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:accel"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="guiicon">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:accel"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="guilabel">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:accel"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="guimenu">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:accel"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="guimenuitem">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:accel"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="guisubmenu">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:accel"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="menuchoice">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:shortcut"/>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:guibutton"/>
+          <xs:element ref="docbook:guiicon"/>
+          <xs:element ref="docbook:guilabel"/>
+          <xs:element ref="docbook:guimenu"/>
+          <xs:element ref="docbook:guimenuitem"/>
+          <xs:element ref="docbook:guisubmenu"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="mousebutton">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="keycap">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="function">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="alt"/>
+            <xs:enumeration value="backspace"/>
+            <xs:enumeration value="command"/>
+            <xs:enumeration value="control"/>
+            <xs:enumeration value="delete"/>
+            <xs:enumeration value="down"/>
+            <xs:enumeration value="end"/>
+            <xs:enumeration value="enter"/>
+            <xs:enumeration value="escape"/>
+            <xs:enumeration value="home"/>
+            <xs:enumeration value="insert"/>
+            <xs:enumeration value="left"/>
+            <xs:enumeration value="meta"/>
+            <xs:enumeration value="option"/>
+            <xs:enumeration value="pagedown"/>
+            <xs:enumeration value="pageup"/>
+            <xs:enumeration value="right"/>
+            <xs:enumeration value="shift"/>
+            <xs:enumeration value="space"/>
+            <xs:enumeration value="tab"/>
+            <xs:enumeration value="up"/>
+            <xs:enumeration value="other"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="otherfunction"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="keycode">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="keycombo">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:mousebutton"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="action">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="click"/>
+            <xs:enumeration value="double-click"/>
+            <xs:enumeration value="press"/>
+            <xs:enumeration value="seq"/>
+            <xs:enumeration value="simul"/>
+            <xs:enumeration value="other"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="otheraction"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="keysym">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="accel">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="shortcut">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:mousebutton"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="action">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="click"/>
+            <xs:enumeration value="double-click"/>
+            <xs:enumeration value="press"/>
+            <xs:enumeration value="seq"/>
+            <xs:enumeration value="simul"/>
+            <xs:enumeration value="other"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="otheraction"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="prompt">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:co"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="envar">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="filename">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="path"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="devicefile"/>
+            <xs:enumeration value="directory"/>
+            <xs:enumeration value="extension"/>
+            <xs:enumeration value="headerfile"/>
+            <xs:enumeration value="libraryfile"/>
+            <xs:enumeration value="partition"/>
+            <xs:enumeration value="symlink"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="command">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="computeroutput">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:co"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="userinput">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:co"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="cmdsynopsis">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:command"/>
+          <xs:element ref="docbook:arg"/>
+          <xs:element ref="docbook:group"/>
+          <xs:element ref="docbook:sbr"/>
+        </xs:choice>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:synopfragment"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="sepchar"/>
+      <xs:attribute name="cmdlength"/>
+      <xs:attribute name="label"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="arg">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:arg"/>
+        <xs:element ref="docbook:group"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:synopfragmentref"/>
+        <xs:element ref="docbook:sbr"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="rep" default="norepeat">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="norepeat"/>
+            <xs:enumeration value="repeat"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="choice" default="opt">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="opt"/>
+            <xs:enumeration value="plain"/>
+            <xs:enumeration value="req"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="group">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:arg"/>
+        <xs:element ref="docbook:group"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:synopfragmentref"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:sbr"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="rep" default="norepeat">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="norepeat"/>
+            <xs:enumeration value="repeat"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="choice" default="opt">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="opt"/>
+            <xs:enumeration value="plain"/>
+            <xs:enumeration value="req"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="sbr">
+    <xs:complexType>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="synopfragment">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:element ref="docbook:arg"/>
+        <xs:element ref="docbook:group"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="synopfragmentref">
+    <xs:complexType mixed="true">
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="synopsis">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:info"/>
+        <xs:element ref="docbook:textobject"/>
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:lineannotation"/>
+        <xs:element ref="docbook:co"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="continuation">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="continues"/>
+            <xs:enumeration value="restarts"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="linenumbering">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="numbered"/>
+            <xs:enumeration value="unnumbered"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="startinglinenumber" type="xs:NMTOKEN"/>
+      <xs:attribute name="language"/>
+      <xs:attribute ref="xml:space"/>
+      <xs:attribute name="label"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="funcsynopsis">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" ref="docbook:info"/>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:funcsynopsisinfo"/>
+          <xs:element ref="docbook:funcprototype"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="language"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="funcsynopsisinfo">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:info"/>
+        <xs:element ref="docbook:textobject"/>
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:lineannotation"/>
+        <xs:element ref="docbook:co"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="continuation">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="continues"/>
+            <xs:enumeration value="restarts"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="linenumbering">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="numbered"/>
+            <xs:enumeration value="unnumbered"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="startinglinenumber" type="xs:NMTOKEN"/>
+      <xs:attribute name="language"/>
+      <xs:attribute ref="xml:space"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="funcprototype">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:modifier"/>
+        <xs:element ref="docbook:funcdef"/>
+        <xs:choice>
+          <xs:element ref="docbook:void"/>
+          <xs:element ref="docbook:varargs"/>
+          <xs:sequence>
+            <xs:element maxOccurs="unbounded" ref="docbook:paramdef"/>
+            <xs:element minOccurs="0" ref="docbook:varargs"/>
+          </xs:sequence>
+        </xs:choice>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:modifier"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="funcdef">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:function"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="function">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="void">
+    <xs:complexType>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="varargs">
+    <xs:complexType>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="paramdef">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:funcparams"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="choice" default="opt">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="opt"/>
+            <xs:enumeration value="req"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="funcparams">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="classsynopsis">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:ooclass"/>
+          <xs:element ref="docbook:ooexception"/>
+          <xs:element ref="docbook:oointerface"/>
+        </xs:choice>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:classsynopsisinfo"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="language"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="class"/>
+            <xs:enumeration value="interface"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="classsynopsisinfo">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:info"/>
+        <xs:element ref="docbook:textobject"/>
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:lineannotation"/>
+        <xs:element ref="docbook:co"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="continuation">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="continues"/>
+            <xs:enumeration value="restarts"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="linenumbering">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="numbered"/>
+            <xs:enumeration value="unnumbered"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="startinglinenumber" type="xs:NMTOKEN"/>
+      <xs:attribute name="language"/>
+      <xs:attribute ref="xml:space"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="ooclass">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:package"/>
+          <xs:element ref="docbook:modifier"/>
+        </xs:choice>
+        <xs:element ref="docbook:classname"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="oointerface">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:package"/>
+          <xs:element ref="docbook:modifier"/>
+        </xs:choice>
+        <xs:element ref="docbook:interfacename"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="ooexception">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:package"/>
+          <xs:element ref="docbook:modifier"/>
+        </xs:choice>
+        <xs:element ref="docbook:exceptionname"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="modifier">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute ref="xml:space"/>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="interfacename">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="exceptionname">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="fieldsynopsis">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:modifier"/>
+        <xs:element minOccurs="0" ref="docbook:type"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element minOccurs="0" ref="docbook:initializer"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="language"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="initializer">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="constructorsynopsis">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:modifier"/>
+        <xs:element minOccurs="0" ref="docbook:methodname"/>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="docbook:methodparam"/>
+          <xs:element minOccurs="0" ref="docbook:void"/>
+        </xs:choice>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:exceptionname"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="language"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="destructorsynopsis">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:modifier"/>
+        <xs:element minOccurs="0" ref="docbook:methodname"/>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="docbook:methodparam"/>
+          <xs:element minOccurs="0" ref="docbook:void"/>
+        </xs:choice>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:exceptionname"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="language"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="methodsynopsis">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:modifier"/>
+        <xs:choice minOccurs="0">
+          <xs:element ref="docbook:type"/>
+          <xs:element ref="docbook:void"/>
+        </xs:choice>
+        <xs:element ref="docbook:methodname"/>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="docbook:methodparam"/>
+          <xs:element ref="docbook:void"/>
+        </xs:choice>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:exceptionname"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:modifier"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="language"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="methodname">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="methodparam">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:choice minOccurs="0" maxOccurs="unbounded">
+          <xs:element ref="docbook:modifier"/>
+          <xs:element ref="docbook:type"/>
+        </xs:choice>
+        <xs:choice>
+          <xs:sequence>
+            <xs:element ref="docbook:parameter"/>
+            <xs:element minOccurs="0" ref="docbook:initializer"/>
+          </xs:sequence>
+          <xs:element ref="docbook:funcparams"/>
+        </xs:choice>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="docbook:modifier"/>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="rep" default="norepeat">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="norepeat"/>
+            <xs:enumeration value="repeat"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="choice" default="req">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="opt"/>
+            <xs:enumeration value="plain"/>
+            <xs:enumeration value="req"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="varname">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="returnvalue">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="type">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="classname">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="programlisting">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:info"/>
+        <xs:element ref="docbook:textobject"/>
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:abbrev"/>
+        <xs:element ref="docbook:acronym"/>
+        <xs:element ref="docbook:date"/>
+        <xs:element ref="docbook:emphasis"/>
+        <xs:element ref="docbook:footnote"/>
+        <xs:element ref="docbook:footnoteref"/>
+        <xs:element ref="docbook:foreignphrase"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:quote"/>
+        <xs:element ref="docbook:wordasword"/>
+        <xs:element ref="docbook:firstterm"/>
+        <xs:element ref="docbook:glossterm"/>
+        <xs:element ref="docbook:coref"/>
+        <xs:element ref="docbook:trademark"/>
+        <xs:element ref="docbook:productnumber"/>
+        <xs:element ref="docbook:productname"/>
+        <xs:element ref="docbook:database"/>
+        <xs:element ref="docbook:application"/>
+        <xs:element ref="docbook:hardware"/>
+        <xs:element ref="docbook:citation"/>
+        <xs:element ref="docbook:citerefentry"/>
+        <xs:element ref="docbook:citetitle"/>
+        <xs:element ref="docbook:citebiblioid"/>
+        <xs:element ref="docbook:author"/>
+        <xs:element ref="docbook:person"/>
+        <xs:element ref="docbook:personname"/>
+        <xs:element ref="docbook:org"/>
+        <xs:element ref="docbook:orgname"/>
+        <xs:element ref="docbook:editor"/>
+        <xs:element ref="docbook:jobtitle"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:package"/>
+        <xs:element ref="docbook:parameter"/>
+        <xs:element ref="docbook:termdef"/>
+        <xs:element ref="docbook:nonterminal"/>
+        <xs:element ref="docbook:systemitem"/>
+        <xs:element ref="docbook:option"/>
+        <xs:element ref="docbook:optional"/>
+        <xs:element ref="docbook:property"/>
+        <xs:element ref="docbook:inlineequation"/>
+        <xs:element ref="docbook:tag"/>
+        <xs:element ref="docbook:markup"/>
+        <xs:element ref="docbook:token"/>
+        <xs:element ref="docbook:symbol"/>
+        <xs:element ref="docbook:literal"/>
+        <xs:element ref="docbook:code"/>
+        <xs:element ref="docbook:constant"/>
+        <xs:element ref="docbook:email"/>
+        <xs:element ref="docbook:uri"/>
+        <xs:element ref="docbook:guiicon"/>
+        <xs:element ref="docbook:guibutton"/>
+        <xs:element ref="docbook:guimenuitem"/>
+        <xs:element ref="docbook:guimenu"/>
+        <xs:element ref="docbook:guisubmenu"/>
+        <xs:element ref="docbook:guilabel"/>
+        <xs:element ref="docbook:menuchoice"/>
+        <xs:element ref="docbook:mousebutton"/>
+        <xs:element ref="docbook:keycombo"/>
+        <xs:element ref="docbook:keycap"/>
+        <xs:element ref="docbook:keycode"/>
+        <xs:element ref="docbook:keysym"/>
+        <xs:element ref="docbook:shortcut"/>
+        <xs:element ref="docbook:accel"/>
+        <xs:element ref="docbook:prompt"/>
+        <xs:element ref="docbook:envar"/>
+        <xs:element ref="docbook:filename"/>
+        <xs:element ref="docbook:command"/>
+        <xs:element ref="docbook:computeroutput"/>
+        <xs:element ref="docbook:userinput"/>
+        <xs:element ref="docbook:function"/>
+        <xs:element ref="docbook:varname"/>
+        <xs:element ref="docbook:returnvalue"/>
+        <xs:element ref="docbook:type"/>
+        <xs:element ref="docbook:classname"/>
+        <xs:element ref="docbook:exceptionname"/>
+        <xs:element ref="docbook:interfacename"/>
+        <xs:element ref="docbook:methodname"/>
+        <xs:element ref="docbook:modifier"/>
+        <xs:element ref="docbook:initializer"/>
+        <xs:element ref="docbook:ooclass"/>
+        <xs:element ref="docbook:ooexception"/>
+        <xs:element ref="docbook:oointerface"/>
+        <xs:element ref="docbook:errorcode"/>
+        <xs:element ref="docbook:errortext"/>
+        <xs:element ref="docbook:errorname"/>
+        <xs:element ref="docbook:errortype"/>
+        <xs:element ref="docbook:lineannotation"/>
+        <xs:element ref="docbook:co"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="continuation">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="continues"/>
+            <xs:enumeration value="restarts"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="linenumbering">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="numbered"/>
+            <xs:enumeration value="unnumbered"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+      <xs:attribute name="startinglinenumber" type="xs:NMTOKEN"/>
+      <xs:attribute name="language"/>
+      <xs:attribute ref="xml:space"/>
+      <xs:attribute name="width" type="xs:NMTOKEN"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="caution">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="important">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="note">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="tip">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="warning">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:sequence>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="docbook:title"/>
+            <xs:element ref="docbook:titleabbrev"/>
+          </xs:choice>
+          <xs:element minOccurs="0" ref="docbook:info"/>
+        </xs:sequence>
+        <xs:choice maxOccurs="unbounded">
+          <xs:element ref="docbook:itemizedlist"/>
+          <xs:element ref="docbook:orderedlist"/>
+          <xs:element ref="docbook:procedure"/>
+          <xs:element ref="docbook:simplelist"/>
+          <xs:element ref="docbook:variablelist"/>
+          <xs:element ref="docbook:segmentedlist"/>
+          <xs:element ref="docbook:glosslist"/>
+          <xs:element ref="docbook:bibliolist"/>
+          <xs:element ref="docbook:calloutlist"/>
+          <xs:element ref="docbook:qandaset"/>
+          <xs:element ref="docbook:example"/>
+          <xs:element ref="docbook:figure"/>
+          <xs:element ref="docbook:table"/>
+          <xs:element ref="docbook:equation"/>
+          <xs:element ref="docbook:informalexample"/>
+          <xs:element ref="docbook:informalfigure"/>
+          <xs:element ref="docbook:informaltable"/>
+          <xs:element ref="docbook:informalequation"/>
+          <xs:element ref="docbook:sidebar"/>
+          <xs:element ref="docbook:blockquote"/>
+          <xs:element ref="docbook:address"/>
+          <xs:element ref="docbook:epigraph"/>
+          <xs:element ref="docbook:mediaobject"/>
+          <xs:element ref="docbook:screenshot"/>
+          <xs:element ref="docbook:task"/>
+          <xs:element ref="docbook:productionset"/>
+          <xs:element ref="docbook:constraintdef"/>
+          <xs:element ref="docbook:msgset"/>
+          <xs:element ref="docbook:screen"/>
+          <xs:element ref="docbook:literallayout"/>
+          <xs:element ref="docbook:programlistingco"/>
+          <xs:element ref="docbook:screenco"/>
+          <xs:element ref="docbook:programlisting"/>
+          <xs:element ref="docbook:synopsis"/>
+          <xs:element ref="docbook:bridgehead"/>
+          <xs:element ref="docbook:remark"/>
+          <xs:element ref="docbook:revhistory"/>
+          <xs:element ref="docbook:indexterm"/>
+          <xs:element ref="docbook:funcsynopsis"/>
+          <xs:element ref="docbook:classsynopsis"/>
+          <xs:element ref="docbook:methodsynopsis"/>
+          <xs:element ref="docbook:constructorsynopsis"/>
+          <xs:element ref="docbook:destructorsynopsis"/>
+          <xs:element ref="docbook:fieldsynopsis"/>
+          <xs:element ref="docbook:cmdsynopsis"/>
+          <xs:element ref="docbook:caution"/>
+          <xs:element ref="docbook:important"/>
+          <xs:element ref="docbook:note"/>
+          <xs:element ref="docbook:tip"/>
+          <xs:element ref="docbook:warning"/>
+          <xs:element ref="docbook:anchor"/>
+          <xs:element ref="docbook:para"/>
+          <xs:element ref="docbook:formalpara"/>
+          <xs:element ref="docbook:simpara"/>
+          <xs:element ref="docbook:annotation"/>
+        </xs:choice>
+      </xs:sequence>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="errorcode">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="errorname">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="errortext">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="errortype">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="systemitem">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+        <xs:element ref="docbook:co"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+      <xs:attribute name="class">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="daemon"/>
+            <xs:enumeration value="domainname"/>
+            <xs:enumeration value="etheraddress"/>
+            <xs:enumeration value="event"/>
+            <xs:enumeration value="eventhandler"/>
+            <xs:enumeration value="filesystem"/>
+            <xs:enumeration value="fqdomainname"/>
+            <xs:enumeration value="groupname"/>
+            <xs:enumeration value="ipaddress"/>
+            <xs:enumeration value="library"/>
+            <xs:enumeration value="macro"/>
+            <xs:enumeration value="netmask"/>
+            <xs:enumeration value="newsgroup"/>
+            <xs:enumeration value="osname"/>
+            <xs:enumeration value="process"/>
+            <xs:enumeration value="protocol"/>
+            <xs:enumeration value="resource"/>
+            <xs:enumeration value="server"/>
+            <xs:enumeration value="service"/>
+            <xs:enumeration value="systemname"/>
+            <xs:enumeration value="username"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:attribute>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="option">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="optional">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="property">
+    <xs:complexType mixed="true">
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="docbook:inlinemediaobject"/>
+        <xs:element ref="docbook:remark"/>
+        <xs:element ref="docbook:superscript"/>
+        <xs:element ref="docbook:subscript"/>
+        <xs:element ref="docbook:xref"/>
+        <xs:element ref="docbook:link"/>
+        <xs:element ref="docbook:olink"/>
+        <xs:element ref="docbook:anchor"/>
+        <xs:element ref="docbook:biblioref"/>
+        <xs:element ref="docbook:alt"/>
+        <xs:element ref="docbook:annotation"/>
+        <xs:element ref="docbook:indexterm"/>
+        <xs:element ref="docbook:phrase"/>
+        <xs:element ref="docbook:replaceable"/>
+      </xs:choice>
+      <xs:attribute name="role"/>
+      <xs:attributeGroup ref="docbook:db.common.attributes"/>
+      <xs:attributeGroup ref="docbook:db.common.linking.attributes"/>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>
diff --git a/org.argeo.app.core/src/org/argeo/app/core/schemas/entity.xsd b/org.argeo.app.core/src/org/argeo/app/core/schemas/entity.xsd
new file mode 100644 (file)
index 0000000..a2fbfcd
--- /dev/null
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
+       elementFormDefault="qualified" attributeFormDefault="unqualified"
+       targetNamespace="http://www.argeo.org/ns/entity"
+       xmlns:entity="http://www.argeo.org/ns/entity">
+
+       <xs:attribute name="date" type="xs:date" />
+
+       <xs:element name="local">
+               <xs:complexType>
+                       <xs:sequence>
+                               <xs:any minOccurs="0" maxOccurs="unbounded"
+                                       namespace="##local" processContents="lax" />
+                       </xs:sequence>
+                       <xs:anyAttribute namespace="##any"
+                               processContents="lax" />
+               </xs:complexType>
+       </xs:element>
+
+       <xs:element name="terms">
+               <xs:complexType>
+                       <xs:sequence minOccurs="0" maxOccurs="unbounded">
+                               <xs:element ref="entity:term"></xs:element>
+                       </xs:sequence>
+               </xs:complexType>
+       </xs:element>
+
+       <xs:element name="term">
+               <xs:complexType>
+                       <xs:sequence minOccurs="0" maxOccurs="unbounded">
+                               <xs:element ref="entity:term"></xs:element>
+                       </xs:sequence>
+                       <xs:anyAttribute namespace="##any"
+                               processContents="lax" />
+               </xs:complexType>
+       </xs:element>
+</xs:schema>
\ No newline at end of file
diff --git a/org.argeo.app.core/src/org/argeo/app/core/schemas/fop.xsd b/org.argeo.app.core/src/org/argeo/app/core/schemas/fop.xsd
new file mode 100644 (file)
index 0000000..a787bf3
--- /dev/null
@@ -0,0 +1,4313 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!-- $Id$ -->
+<schema xmlns = "http://www.w3.org/2001/XMLSchema" targetNamespace = "http://www.w3.org/1999/XSL/Format"  xmlns:fo = "http://www.w3.org/1999/XSL/Format" xmlns:xs = "http://www.w3.org/2001/XMLSchema" elementFormDefault = "qualified">
+
+  <annotation>
+    <documentation> 
+
+      I'm not sure where to place this.
+      It applies to the page context (NOT implemented)
+      <attribute name = "size"  type = "size_Type"/>
+      
+      I have not coded for the functions described in 5.10 Core Function Library
+      They need to be segregated into groups and then inserted in the types
+      
+      common_functions
+      object  inherited-property-value(NCName) 
+      object  from-parent( NCName) 
+      object  from-nearest-specified-value( NCName) 
+      object  merge-property-values( NCName) 
+      
+      font_functions
+      object  system-font( NCName , NCName) 
+      
+      length_functions
+      numeric floor( numeric) 
+      numeric ceiling(numeric) 
+      numeric round(numeric) 
+      numeric min( numeric , numeric) 
+      numeric max(numeric , numeric) 
+      numeric abs( numeric)
+      
+      table_cell_or_descendants_functions
+      object  from-table-column( NCName) 
+
+      color_functions
+      color rgb(numeric , numeric , numeric) 
+      color rgb-icc(numeric , numeric , numeric , NCName , numeric , numeric) 
+      color system-color( NCName) 
+
+      label_functions
+      numeric body-start() 
+      numeric label-end() 
+      
+      (defined)
+      table-column_functions
+      numeric proportional-column-width( numeric) 
+      
+      This schema has been developed in order to validate XSL FO documents for FOP
+      All of the elements need to be prefixed with fo:
+      The namespace prefix is xmlns:fo = "http://www.w3.org/1999/XSL/Format".
+
+      This schema, as delivered, may either validate the full spec, or, just the FOP portion. 
+      (What it validates depends upon what I was doing with it when released.)
+      
+      If you want to restrict it to just those elements and attributes implemented by FOP, 
+      you need to edit the <group xmlns=""/> and <attributeGroup xmlns=""/> tags to exclude the groups ending with _Not
+
+      Some schema tools complain about the placement of comments in this schema and will remove or reorder them
+      There are fop_result and fop_fail comments on specific features not implemented by FOP
+
+      FOP does not enforce the following schema requirements
+
+      fo:simple-page-master model = "(region-body,region-before?,region-after?,region-start?,region-end?)"
+      elements can be in any order
+
+      fo:table-cell model = "(%block;)+"
+      Can be empty
+
+      fo:flow model = "(%block;)+"
+      Can be empty
+
+      This schema allows the length attribute to be negative for some elements like margins.
+      There may be instances where I've entered %integer_Type; and it should be positive-integer or number
+      The schema trys to handle the text based rules re: fo:markers, fo:float, footer and fo:initial-property-set
+      But, allows you to do illegal things if you want because I couldn't figure out how to constrain against the illegal actions.
+
+      Please e-mail your comments to cpaussa@myrealbox.com
+
+      Contribution by Oleg Tkachenko 
+      (Declarations able to include non-xsl children)
+      <xs:any minOccurs = "0" maxOccurs = "unbounded" namespace = "##other" processContents = "skip"/>
+      This declaration assumes that all <fo:color-profile/> elements must come before other stuff, 
+      which is not required by spec, but I cannot see any way to express such constraints in schema, 
+      one could use <xs:choice/> instead of <xs:sequence/>, but this way we lose control over (color-profile)+ constraint.
+      
+      VCP 21-Oct-2002 
+        Updated all (px|pt|mm|cm|in|em) to (px|pt|mm|cm|in|em|%) to allow percentage types.
+        Updated the restriction base of those types from NMTOKEN to string
+
+    </documentation>
+  </annotation>
+
+  <group name = "initial_property_set_List_Not">
+    <choice>
+      <element ref = "fo:initial-property-set"/>
+    </choice>
+  </group>
+  
+  <annotation>
+    <documentation>
+      empty group so cannot be defined
+      <group name = "initial_property_set_List_FOP">
+        <choice/>
+      </group>
+    </documentation>
+  </annotation>
+  
+  <group name = "initial_property_set_List">
+    <annotation>
+      <documentation>
+        <choice>
+          <group ref = "fo:initial_property_set_List_FOP"/>
+        </choice>
+      </documentation>
+    </annotation>
+    <choice>
+      <group ref = "fo:initial_property_set_List_Not"/>
+    </choice>
+  </group>
+  <group name = "marker_List">
+    <choice>
+      <element ref = "fo:marker"/>
+    </choice>
+  </group>
+  <group name = "inline_List_FOP">
+    <choice>
+      <element ref = "fo:character"/>
+      <element ref = "fo:external-graphic"/>
+      <element ref = "fo:instream-foreign-object"/>
+      <element ref = "fo:inline"/>
+      <element ref = "fo:leader"/>
+      <element ref = "fo:page-number"/>
+      <element ref = "fo:page-number-citation"/>
+      <element ref = "fo:basic-link"/>
+    </choice>
+  </group>
+  <group name = "inline_List_Not">
+    <choice>
+      <element ref = "fo:bidi-override"/>
+      <element ref = "fo:inline-container"/>
+      <element ref = "fo:multi-toggle"/>
+    </choice>
+  </group>
+  <group name = "inline_List">
+    <choice>
+      <group ref = "fo:inline_List_FOP"/>
+      <group ref = "fo:inline_List_Not"/>
+    </choice>
+  </group>
+  <group name = "block_List_FOP">
+    <choice>
+      <element ref = "fo:block"/>
+      <element ref = "fo:block-container"/>
+      <element ref = "fo:table"/>
+      <element ref = "fo:list-block"/>
+    </choice>
+  </group>
+  <group name = "block_List_Not">
+    <choice>
+      <element ref = "fo:table-and-caption"/>
+    </choice>
+  </group>
+  <group name = "block_List">
+    <choice>
+      <group ref = "fo:block_List_FOP"/>
+      <group ref = "fo:block_List_Not"/>
+    </choice>
+  </group>
+  <group name = "neutral_List_FOP">
+    <choice>
+      <element ref = "fo:wrapper"/>
+      <element ref = "fo:retrieve-marker"/>
+    </choice>
+  </group>
+  <group name = "neutral_List_Not">
+    <choice>
+      <element ref = "fo:multi-switch"/>
+      <element ref = "fo:multi-properties"/>
+    </choice>
+  </group>
+  <group name = "neutral_List">
+    <choice>
+      <group ref = "fo:neutral_List_FOP"/>
+      <group ref = "fo:neutral_List_Not"/>
+    </choice>
+  </group>
+  <annotation>
+    <documentation>
+      empty group so cannot be defined
+      <group name = "float_List_FOP">
+        <choice/>
+      </group>
+    </documentation>
+  </annotation>
+  <group name = "float_List_Not">
+    <choice>
+      <element ref = "fo:float"/>
+    </choice>
+  </group>
+  <group name = "float_List">
+    <annotation>
+      <documentation>
+        empty group
+        <choice>
+          <group ref = "fo:float_List_FOP"/>
+        </choice>
+      </documentation>
+    </annotation>
+    <choice>
+      <group ref = "fo:float_List_Not"/>
+    </choice>
+  </group>
+  <group name = "footnote_List">
+    <choice>
+      <element ref = "fo:footnote"/>
+    </choice>
+  </group>
+
+  <attributeGroup name = "block_properties_Not">
+    <attribute name = "page-break-after"  type = "fo:page_break_after_Type"/>
+    <attribute name = "page-break-before" type = "fo:page_break_after_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "block_properties_FOP">
+  </attributeGroup>
+  <attributeGroup name = "block_properties">
+    <attributeGroup ref = "fo:block_properties_FOP"/>
+    <attributeGroup ref = "fo:block_properties_Not"/>
+  </attributeGroup>
+
+  <attributeGroup name = "list_properties_Not">
+    <attribute name = "page-break-after"  type = "fo:page_break_after_Type"/>
+    <attribute name = "page-break-before" type = "fo:page_break_after_Type"/>
+    <attribute name = "background-position" type = "fo:background_position_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "list_properties_FOP">
+  </attributeGroup>
+  <attributeGroup name = "list_properties">
+    <attributeGroup ref = "fo:list_properties_FOP"/>
+    <attributeGroup ref = "fo:list_properties_Not"/>
+  </attributeGroup>
+
+  <attributeGroup name = "inheritable_properties_List_Not">
+    <attribute name = "auto-restore" type = "fo:auto_restore_Type"/>
+    <attribute name = "background"    type = "fo:background_Type"   /> 
+    <attribute name = "border-spacing" type = "fo:length_Type"/>
+    <attribute name = "caption-side" type = "fo:caption_side_Type"/>
+    <attribute name = "direction" type = "fo:direction_Type"/>
+    <attribute name = "empty-cells" type = "fo:empty_cells_Type"/>
+    <attribute name = "font" type = "xs:string"/>
+    <attribute name = "font-selection-strategy" type = "fo:font_selection_strategy_Type"/>
+    <attribute name = "font-size-adjust" type = "fo:font_size_adjust_Type"/>
+    <attribute name = "font-stretch" type = "xs:string"/>
+    <attribute name = "font-variant" type = "fo:font_variant_Type"/>
+    <attribute name = "glyph-orientation-vertical" type = "fo:orientation_Type"/>
+    <attribute name = "glyph-orientation-horizontal" type = "fo:orientation_Type"/>
+    <attribute name = "hyphenation-keep" type = "fo:hyphenation_keep_Type"/>
+    <attribute name = "hyphenation-ladder-count" type = "fo:hyphenation_ladder_count_Type"/>
+    <attribute name = "intrusion-displace" type = "fo:displace_Type"/>
+    <attribute name = "last-line-end-indent" type = "fo:last_line_end_indent_Type"/>
+    <attribute name = "line-height-shift-adjustment" type = "fo:line_height_shift_adjustment_Type"/>
+    <attribute name = "line-stacking-strategy" type = "fo:line_stacking_strategy_Type"/>
+    <attribute name = "linefeed-treatment" type = "fo:linefeed_treatment_Type"/>
+    <attribute name = "margin"        type = "fo:border_margin_width_Type"       /> 
+    <attribute name = "max-width"     type = "fo:max_width_Type"/>
+    <attribute name = "min-height"    type = "fo:start_indent_Type"/>
+    <attribute name = "min-width"     type = "fo:start_indent_Type"/>
+    <attribute name = "page-break-inside" type = "fo:page_break_inside_Type"/>
+    <attribute name = "reference-orientation" type = "fo:orientation_Type"/>
+    <attribute name = "score-spaces" type = "fo:score_spaces_Type"/>
+    <attribute name = "script" type = "xs:string"/>
+    <attribute name = "text-transform" type = "fo:text_transform_Type"/>
+    <attribute name = "visibility" type = "fo:visibility_Type"/>
+    <attribute name = "white-space" type = "fo:white_space_Type"/>
+    <attribute name = "white-space-treatment" type = "fo:white_space_treatment_Type"/>
+    <attribute name = "word-spacing" type = "fo:letter_spacing_Type"/>
+    <attribute name = "writing-mode" type = "fo:writing_mode_Type"/>
+  </attributeGroup>
+
+
+  <attributeGroup name = "inheritable_properties_List_FOP">
+    <annotation>
+      <documentation>
+        Removed because I'm not sure how to handle this<attribute xmlns="" name = "xml:lang" type = "xs:string"/> 
+      </documentation>
+    </annotation>
+    <attribute name = "border-bottom" type = "fo:border_side_Type"/> 
+    <attribute name = "border-collapse" type = "fo:border_collapse_Type"/>
+    <attribute name = "border-color"  type = "fo:border_color_Type" /> 
+    <attribute name = "border-left"   type = "fo:border_side_Type"  /> 
+    <attribute name = "border-right"  type = "fo:border_side_Type" /> 
+    <attribute name = "border-separation" type = "fo:length_bp_ip_direction_Type"/>
+    <attribute name = "border-style"  type = "fo:border_multi_style_Type" /> 
+    <attribute name = "border-top"    type = "fo:border_side_Type"   /> 
+    <attribute name = "border-width"  type = "fo:border_margin_width_Type" /> 
+    <attribute name = "color" type = "fo:color_Type"/>
+    <attribute name = "country" type = "fo:country_Type"/>
+    <attribute name = "display-align" type = "fo:display_align_Type"/>
+    <attribute name = "end-indent" type = "fo:end_indent_Type"/>
+    <attribute name = "font-family" type = "fo:family_name_Type"/>
+    <attribute name = "font-size" type = "fo:font_size_Type"/>
+    <attribute name = "font-style" type = "fo:font_style_Type"/>
+    <attribute name = "font-weight" type = "fo:font_weight_Type"/>
+    <attribute name = "hyphenate" type = "fo:hyphenate_Type"/>
+    <attribute name = "hyphenation-character" type = "fo:hyphenation_character_Type"/>
+    <attribute name = "hyphenation-push-character-count" type = "fo:integer_Type"/>
+    <attribute name = "hyphenation-remain-character-count" type = "fo:integer_Type"/>
+    <attribute name = "keep-together" type = "fo:keep_compound_Type"/>
+    <attribute name = "keep-together.within-column" type = "fo:keep_integer_Type"/>
+    <attribute name = "keep-together.within-line" type = "fo:keep_integer_Type"/>
+    <attribute name = "keep-together.within-page" type = "fo:keep_integer_Type"/>
+    <attribute name = "language" type = "fo:language_Type"/>
+    <attribute name = "leader-alignment" type = "fo:leader_alignment_Type"/>
+    <attribute name = "leader-length" type = "fo:leader_length_Type"/>
+    <attribute name = "leader-length.maximum" type = "fo:length_Type"/>
+    <attribute name = "leader-length.minimum" type = "fo:length_Type"/>
+    <attribute name = "leader-length.optimum" type = "fo:length_Type"/>
+    <attribute name = "leader-pattern" type = "fo:leader_pattern_Type"/>
+    <attribute name = "leader-pattern-width" type = "fo:leader_pattern_width_Type"/>
+    <attribute name = "letter-spacing" type = "fo:letter_spacing_Type"/>
+    <attribute name = "line-height" type = "fo:line_height_Type"/>
+    <attribute name = "orphans" type = "fo:orphans_Type"/>
+    <attribute name = "position" type = "fo:position_Type"/>
+    <attribute name = "provisional-distance-between-starts" type = "fo:provisional_distance_between_starts_Type"/>
+    <attribute name = "provisional-label-separation" type = "fo:provisional_label_separation_Type"/>
+    <attribute name = "relative-align" type = "fo:relative_align_Type"/>
+    <attribute name = "rule-style" type = "fo:rule_style_Type"/>
+    <attribute name = "rule-thickness" type = "fo:length_Type"/>
+    <attribute name = "start-indent" type = "fo:start_indent_Type"/>
+    <attribute name = "text-align" type = "fo:text_align_Type"/>
+    <attribute name = "text-align-last" type = "fo:text_align_last_Type"/>
+    <attribute name = "text-indent" type = "fo:length_percentage_Type"/>
+    <attribute name = "white-space-collapse" type = "fo:white_space_collapse_Type"/>
+    <attribute name = "widows" type = "fo:widows_Type"/>
+    <attribute name = "wrap-option" type = "fo:wrap_option_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "inheritable_properties_List">
+    <attributeGroup ref = "fo:inheritable_properties_List_FOP"/>
+    <attributeGroup ref = "fo:inheritable_properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "break_Properties_List_Not">
+    <annotation>
+      <documentation>
+        Inheritable
+        <attribute name = "page-break-inside" type = "fo:breaks_Type"/>
+      </documentation>
+    </annotation>
+  </attributeGroup>
+  <attributeGroup name = "break_Properties_List_FOP">
+    <attribute name = "break-after" type = "fo:breaks_Type"/>
+    <attribute name = "break-before" type = "fo:breaks_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "break_Properties_List">
+    <attributeGroup ref = "fo:break_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:break_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "text_one_Properties_List_FOP"/>
+  <attributeGroup name = "text_one_Properties_List_Not">
+    <attribute name = "text-depth" type = "fo:text_depth_Type"/>
+    <attribute name = "text-altitude" type = "fo:text_altitude_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "text_one_Properties_List">
+    <attributeGroup ref = "fo:text_one_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:text_one_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "line_height_Properties_List_FOP"/>
+  <attributeGroup name = "line_height_Properties_List_Not">
+    <annotation>
+      <documentation>
+        Inheritable
+        <attribute name = "line-height-shift-adjustment" type = "fo:line_height_shift_adjustment_Type"/>
+        <attribute name = "line-stacking-strategy" type = "fo:line_stacking_strategy_Type"/>
+      </documentation>
+    </annotation>
+  </attributeGroup>
+  <attributeGroup name = "line_height_Properties_List">
+    <attributeGroup ref = "fo:line_height_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:line_height_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "keep_Properties_List_FOP">
+    <attribute name = "keep-with-next" type = "fo:keep_integer_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "keep_Properties_List_Not">
+    <annotation>
+      <documentation>
+        Inheritable
+        <attribute name = "keep-together" type = "fo:keep_compound_Type"/>
+        <attribute name = "keep-together.within-line" type = "fo:keep_integer_Type"/>
+        <attribute name = "keep-together.within-column" type = "fo:keep_integer_Type"/>
+        <attribute name = "keep-together.within-page" type = "fo:keep_integer_Type"/>
+      </documentation>
+    </annotation>
+    <attribute name = "keep-with-previous" type = "fo:keep_integer_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "keep_Properties_List">
+    <attributeGroup ref = "fo:keep_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:keep_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "block_hyphenation_Properties_List_FOP"/>
+  <attributeGroup name = "block_hyphenation_Properties_List_Not">
+    <annotation>
+      <documentation>
+        Inheritable
+        <attribute name = "hyphenation-keep" type = "fo:hyphenation_keep_Type"/>
+        <attribute name = "hyphenation-ladder-count" type = "fo:hyphenation_ladder_count_Type"/>
+      </documentation>
+    </annotation>
+    </attributeGroup>
+  <attributeGroup name = "block_hyphenation_Properties_List">
+    <attributeGroup ref = "fo:block_hyphenation_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:block_hyphenation_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "intrusion_displace_Properties_List_FOP"/>
+  <attributeGroup name = "intrusion_displace_Properties_List_Not">
+    <annotation>
+      <documentation>
+        Inheritable attributes
+        <attribute name = "intrusion-displace" type = "fo:displace_Type"/>
+      </documentation>
+    </annotation>
+    </attributeGroup>
+  <attributeGroup name = "intrusion_displace_Properties_List">
+    <attributeGroup ref = "fo:intrusion_displace_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:intrusion_displace_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "progression_Properties_List_FOP"/>
+  <attributeGroup name = "progression_Properties_List_Not">
+    <attribute name = "block-progression-dimension" type = "fo:margin_width_Type"/>
+    <attribute name = "block-progression-dimension.minimum" type = "fo:length_Type"/>
+    <attribute name = "block-progression-dimension.optimum" type = "fo:block_progression_dimension_optimum_Type"/>
+    <attribute name = "block-progression-dimension.maximum" type = "fo:block_progression_dimension_maximum_Type"/>
+    <attribute name = "inline-progression-dimension" type = "fo:margin_width_Type"/>
+    <attribute name = "inline-progression-dimension.minimum" type = "fo:length_Type"/>
+    <attribute name = "inline-progression-dimension.optimum" type = "fo:block_progression_dimension_optimum_Type"/>
+    <attribute name = "inline-progression-dimension.maximum" type = "fo:block_progression_dimension_maximum_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "progression_Properties_List">
+    <attributeGroup ref = "fo:progression_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:progression_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "clip_Properties_List_FOP"/>
+  <attributeGroup name = "clip_Properties_List_Not">
+    <attribute name = "clip" type = "fo:clip_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "clip_Properties_List">
+    <attributeGroup ref = "fo:clip_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:clip_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "reference_Properties_List_FOP"/>
+  <attributeGroup name = "reference_Properties_List_Not">
+    <annotation>
+      <documentation>
+        Inherited
+        <attribute name = "reference-orientation" type = "fo:orientation_Type"/>
+        <attribute name = "writing-mode" type = "fo:writing_mode_Type"/>
+      </documentation>
+    </annotation>
+    </attributeGroup>
+  <attributeGroup name = "reference_Properties_List">
+    <attributeGroup ref = "fo:reference_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:reference_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "Accessibility_Properties_List_FOP"/>
+  <attributeGroup name = "Accessibility_Properties_List_Not">
+    <attribute name = "source-document" type = "xs:string"/>
+    <attribute name = "role" type = "xs:string"/>
+  </attributeGroup>
+  <attributeGroup name = "Accessibility_Properties_List">
+    <attributeGroup ref = "fo:Accessibility_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:Accessibility_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "Relative_Position_Properties_List_FOP">
+    <annotation>
+      <documentation>
+        Inherited
+        <attribute name = "position" type = "fo:position_Type"/>
+      </documentation>
+    </annotation>
+    <attribute name = "top" type = "fo:top_Type"/>
+    <attribute name = "right" type = "fo:right_Type"/>
+    <attribute name = "bottom" type = "fo:bottom_Type"/>
+    <attribute name = "left" type = "fo:left_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "Relative_Position_Properties_List_Not">
+    <attribute name = "relative-position" type = "fo:relative_position_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "Relative_Position_Properties_List">
+    <attributeGroup ref = "fo:Relative_Position_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:Relative_Position_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "absolute_or_Relative_Position_Properties_List_FOP">
+    <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+  </attributeGroup>
+  <attributeGroup name = "absolute_or_Relative_Position_Properties_List_Not">
+    <attribute name = "absolute-position" type = "fo:absolute_position_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "absolute_or_Relative_Position_Properties_List">
+    <attributeGroup ref = "fo:absolute_or_Relative_Position_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:absolute_or_Relative_Position_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "Aural_Properties_List_FOP"/>
+  <attributeGroup name = "Aural_Properties_List_Not">
+    <attribute name = "azimuth" type = "fo:azimuth_Type"/>
+    <attribute name = "cue" type = "xs:string"/>
+    <attribute name = "cue-after" type = "xs:string"/>
+    <attribute name = "cue-before" type = "xs:string"/>
+    <attribute name = "elevation" type = "fo:elevation_Type"/>
+    <attribute name = "pause" type = "xs:string"/>
+    <attribute name = "pause-after" type = "xs:string"/>
+    <attribute name = "pause-before" type = "xs:string"/>
+    <attribute name = "pitch" type = "xs:string"/>
+    <attribute name = "pitch-range" type = "xs:string"/>
+    <attribute name = "play-during" type = "xs:string"/>
+    <attribute name = "richness" type = "xs:string"/>
+    <attribute name = "speak" type = "xs:string"/>
+    <attribute name = "speak-header" type = "xs:string"/>
+    <attribute name = "speak-numeral" type = "fo:speak_numeral_Type"/>
+    <attribute name = "speak-punctuation" type = "xs:string"/>
+    <attribute name = "speech-rate" type = "fo:speech_rate_Type"/>
+    <attribute name = "stress" type = "xs:string"/>
+    <attribute name = "voice-family" type = "xs:string"/>
+    <attribute name = "volume" type = "xs:string"/>
+  </attributeGroup>
+  <attributeGroup name = "Aural_Properties_List">
+    <attributeGroup ref = "fo:Aural_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:Aural_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "Border_Padding_and_Background_Properties_List">
+    <attributeGroup ref = "fo:Border_Properties_List"/>
+    <attributeGroup ref = "fo:Padding_Properties_List"/>
+    <attributeGroup ref = "fo:Background_Properties_List"/>
+  </attributeGroup>
+  <attributeGroup name = "Absolute_Position_Properties_List_FOP">
+    <annotation>
+      <documentation>
+        Inherited
+        <attribute name = "position" type = "fo:position_Type"/>
+      </documentation>
+    </annotation>
+    <attribute name = "top" type = "fo:top_Type"/>
+    <attribute name = "right" type = "fo:right_Type"/>
+    <attribute name = "bottom" type = "fo:bottom_Type"/>
+    <attribute name = "left" type = "fo:left_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "Absolute_Position_Properties_List_Not">
+    <attribute name = "absolute-position" type = "fo:absolute_position_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "Absolute_Position_Properties_List">
+    <attributeGroup ref = "fo:Absolute_Position_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:Absolute_Position_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "Background_Properties_List_FOP">
+    <attribute name = "background-color" type = "fo:background_color_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "Background_Properties_List_Not">
+    <attribute name = "background-attachment" type = "fo:background_attachment_Type"/>
+    <attribute name = "background-image" type = "xs:string"/>
+    <attribute name = "background-repeat" type = "fo:background_repeat_Type"/>
+    <attribute name = "background-position-horizontal" type = "fo:background_position_horizontal_Type"/>
+    <attribute name = "background-position-vertical" type = "fo:background_position_vertical_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "Background_Properties_List">
+    <attributeGroup ref = "fo:Background_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:Background_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "Border_Properties_List">
+    <attribute name = "border" type = "fo:border_Type"/>
+    <attribute name = "border-before-color" type = "fo:color_Type"/>
+    <attribute name = "border-before-style" type = "fo:border_style_Type"/>
+    <attribute name = "border-before-width" type = "fo:border_before_width_Type"/>
+    <attribute name = "border-before-width.length" type = "fo:length_Type"/>
+    <attribute name = "border-before-width.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "border-after-color" type = "fo:color_Type"/>
+    <attribute name = "border-after-style" type = "fo:border_style_Type"/>
+    <attribute name = "border-after-width" type = "fo:border_before_width_Type"/>
+    <attribute name = "border-after-width.length" type = "fo:length_Type"/>
+    <attribute name = "border-after-width.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "border-start-color" type = "fo:color_Type"/>
+    <attribute name = "border-start-style" type = "fo:border_style_Type"/>
+    <attribute name = "border-start-width" type = "fo:border_before_width_Type"/>
+    <attribute name = "border-start-width.length" type = "fo:length_Type"/>
+    <attribute name = "border-start-width.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "border-end-color" type = "fo:color_Type"/>
+    <attribute name = "border-end-style" type = "fo:border_style_Type"/>
+    <attribute name = "border-end-width" type = "fo:border_before_width_Type"/>
+    <attribute name = "border-end-width.length" type = "fo:length_Type"/>
+    <attribute name = "border-end-width.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "border-top-color" type = "fo:color_Type"/>
+    <attribute name = "border-top-style" type = "fo:border_style_Type"/>
+    <attribute name = "border-top-width" type = "fo:border_top_width_Type"/>
+    <attribute name = "border-top-width.length" type = "fo:length_Type"/>
+    <attribute name = "border-top-width.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "border-bottom-color" type = "fo:color_Type"/>
+    <attribute name = "border-bottom-style" type = "fo:border_style_Type"/>
+    <attribute name = "border-bottom-width" type = "fo:border_top_width_Type"/>
+    <attribute name = "border-bottom-width.length" type = "fo:length_Type"/>
+    <attribute name = "border-bottom-width.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "border-left-color" type = "fo:color_Type"/>
+    <attribute name = "border-left-style" type = "fo:border_style_Type"/>
+    <attribute name = "border-left-width" type = "fo:border_top_width_Type"/>
+    <attribute name = "border-left-width.length" type = "fo:length_Type"/>
+    <attribute name = "border-left-width.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "border-right-color" type = "fo:color_Type"/>
+    <attribute name = "border-right-style" type = "fo:border_style_Type"/>
+    <attribute name = "border-right-width" type = "fo:border_top_width_Type"/>
+    <attribute name = "border-right-width.length" type = "fo:length_Type"/>
+    <attribute name = "border-right-width.conditionality" type = "fo:conditionality_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "Padding_Properties_List">
+    <attribute name = "padding" type = "fo:padding_before_Type"/>
+    <attribute name = "padding-before" type = "fo:padding_before_Type"/>
+    <attribute name = "padding-before.length" type = "fo:length_Type"/>
+    <attribute name = "padding-before.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "padding-after" type = "fo:padding_before_Type"/>
+    <attribute name = "padding-after.length" type = "fo:length_Type"/>
+    <attribute name = "padding-after.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "padding-start" type = "fo:padding_before_Type"/>
+    <attribute name = "padding-start.length" type = "fo:length_Type"/>
+    <attribute name = "padding-start.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "padding-end" type = "fo:padding_before_Type"/>
+    <attribute name = "padding-end.length" type = "fo:length_Type"/>
+    <attribute name = "padding-end.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "padding-top" type = "fo:padding_top_Type"/>
+    <attribute name = "padding-top.length" type = "fo:length_Type"/>
+    <attribute name = "padding-top.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "padding-bottom" type = "fo:padding_top_Type"/>
+    <attribute name = "padding-bottom.length" type = "fo:length_Type"/>
+    <attribute name = "padding-bottom.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "padding-left" type = "fo:padding_top_Type"/>
+    <attribute name = "padding-left.length" type = "fo:length_Type"/>
+    <attribute name = "padding-left.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "padding-right" type = "fo:padding_top_Type"/>
+    <attribute name = "padding-right.length" type = "fo:length_Type"/>
+    <attribute name = "padding-right.conditionality" type = "fo:conditionality_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "Font_Properties_List_FOP">
+    <annotation>
+      <documentation>
+        Font properties are all inheritable
+        <attribute name = "font-family" type = "fo:family_name_Type"/>
+        <attribute name = "font-size" type = "fo:font_size_Type"/>
+        <attribute name = "font-style" type = "fo:font_style_Type"/>
+        <attribute name = "font-weight" type = "fo:font_weight_Type"/>
+      </documentation>
+    </annotation>
+    </attributeGroup>
+  <attributeGroup name = "Font_Properties_List_Not">
+    <annotation>
+      <documentation>
+        Font properties are all inheritable
+        <attribute name = "font" type = "xs:string"/>
+        <attribute name = "font-selection-strategy" type = "fo:font_selection_strategy_Type"/>
+        <attribute name = "font-size-adjust" type = "xs:string"/>
+        <attribute name = "font-stretch" type = "xs:string"/>
+        <attribute name = "font-variant" type = "fo:font_variant_Type"/>
+      </documentation>
+    </annotation>
+    </attributeGroup>
+  <attributeGroup name = "Font_Properties_List">
+    <attributeGroup ref = "fo:Font_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:Font_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "Hyphenation_Properties_List_FOP">
+    <annotation>
+      <documentation>
+        The hyphenation properties are all inheritable and so superceeded by that list 
+        <attribute name = "country" type = "fo:country_Type"/>
+        <attribute name = "language" type = "fo:language_Type"/>
+        <attribute name = "hyphenate" type = "fo:hyphenate_Type"/>
+        <attribute name = "hyphenation-character" type = "fo:hyphenation_character_Type"/>
+        <attribute name = "hyphenation-push-character-count" type = "fo:integer_Type"/>
+        <attribute name = "hyphenation-remain-character-count" type = "fo:integer_Type"/>
+      </documentation>
+    </annotation>
+    </attributeGroup>
+  <attributeGroup name = "Hyphenation_Properties_List_Not">
+    <annotation>
+      <documentation>
+        The hyphenation properties are all inheritable and so superceeded by that list 
+        <attribute name = "script" type = "xs:string"/>
+      </documentation>
+    </annotation>
+    </attributeGroup>
+  <attributeGroup name = "Hyphenation_Properties_List">
+    <attributeGroup ref = "fo:Hyphenation_Properties_List_FOP"/>
+    <attributeGroup ref = "fo:Hyphenation_Properties_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "Margin_Properties_Basic_List">
+    <attribute name = "margin-top" type = "fo:margin_width_Type"/>
+    <attribute name = "margin-bottom" type = "fo:margin_width_Type"/>
+    <attribute name = "margin-left" type = "fo:margin_width_Type"/>
+    <attribute name = "margin-right" type = "fo:margin_width_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "Margin_Properties_vertical_Space_List_FOP">
+    <annotation>
+      <documentation>
+        Indent properties are inheritable
+        <attribute name = "start-indent" type = "fo:start_indent_Type"/>
+        <attribute name = "end-indent" type = "fo:end_indent_Type"/>
+      </documentation>
+    </annotation>
+    <attribute name = "space-before.optimum" type = "fo:space_before_optimum_Type"/>
+    <attribute name = "space-after.optimum" type = "fo:space_after_optimum_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "Margin_Properties_vertical_Space_List_Not">
+    <attribute name = "space-before" type = "fo:space_Type"/>
+    <attribute name = "space-before.minimum" type = "fo:length_Type"/>
+    <attribute name = "space-before.maximum" type = "fo:length_Type"/>
+    <attribute name = "space-before.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "space-before.precedence" type = "fo:integer_Force_Type"/>
+    <attribute name = "space-after" type = "fo:space_Type"/>
+    <attribute name = "space-after.minimum" type = "fo:length_Type"/>
+    <attribute name = "space-after.maximum" type = "fo:length_Type"/>
+    <attribute name = "space-after.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "space-after.precedence" type = "fo:integer_Force_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "Margin_Properties_vertical_Space_List">
+    <attributeGroup ref = "fo:Margin_Properties_vertical_Space_List_FOP"/>
+    <attributeGroup ref = "fo:Margin_Properties_vertical_Space_List_Not"/>
+  </attributeGroup>
+  <attributeGroup name = "Margin_Properties_Block_List">
+    <attributeGroup ref = "fo:Margin_Properties_Basic_List"/>
+    <attributeGroup ref = "fo:Margin_Properties_vertical_Space_List"/>
+  </attributeGroup>
+  <attributeGroup name = "Margin_Properties_Inline_List">
+    <attributeGroup ref = "fo:Margin_Properties_Basic_List"/>
+    <attributeGroup ref = "fo:Margin_Properties_Horizontal_Space_List"/>
+  </attributeGroup>
+  <attributeGroup name = "Margin_Properties_Horizontal_Space_List_FOP"/>
+  <attributeGroup name = "Margin_Properties_Horizontal_Space_List_Not">
+    <attribute name = "space-start" type = "fo:space_start_Type"/>
+    <attribute name = "space-start.minimum" type = "fo:length_Type"/>
+    <attribute name = "space-start.optimum" type = "fo:length_Type"/>
+    <attribute name = "space-start.maximum" type = "fo:length_Type"/>
+    <attribute name = "space-start.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "space-start.precedence" type = "fo:integer_Force_Type"/>
+    <attribute name = "space-end" type = "fo:space_start_Type"/>
+    <attribute name = "space-end.minimum" type = "fo:length_Type"/>
+    <attribute name = "space-end.optimum" type = "fo:length_Type"/>
+    <attribute name = "space-end.maximum" type = "fo:length_Type"/>
+    <attribute name = "space-end.conditionality" type = "fo:conditionality_Type"/>
+    <attribute name = "space-end.precedence" type = "fo:integer_Force_Type"/>
+  </attributeGroup>
+  <attributeGroup name = "Margin_Properties_Horizontal_Space_List">
+    <attributeGroup ref = "fo:Margin_Properties_Horizontal_Space_List_FOP"/>
+    <attributeGroup ref = "fo:Margin_Properties_Horizontal_Space_List_Not"/>
+  </attributeGroup>
+
+  <annotation>
+    <documentation>
+      Simple Types definitions
+    </documentation>
+  </annotation>
+  <simpleType name = "integer_Type">
+    <annotation>
+      <documentation>
+        A signed integer value which consists of an optional '+' or '-' character followed by a sequence of digits. A property may define additional constraints on the value.
+        <enumeration value = "-3"/>
+        <enumeration value = "0"/>
+        <enumeration value = "1"/>
+        <enumeration value = "+3"/>
+        <enumeration value = "5"/>
+      </documentation>
+    </annotation>
+    <restriction base = "NMTOKEN">
+      <pattern value = "[\+\-]?\d+"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "number_Type">
+    <annotation>
+      <documentation>
+        A signed real number which consists of an optional '+' or '-' character followed by a sequence of digits followed by an optional '.' character and sequence of digits. A property may define additional constraints on the value. 
+        <enumeration value = "-2.4"/>
+        <enumeration value = "2"/>
+        <enumeration value = "4"/>
+      </documentation>
+    </annotation>
+    <restriction base = "string">
+      <pattern value = "[\+\-]?\d+\.\d*"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "length_Type">
+    <annotation>
+      <documentation>
+        A signed length value where a 'length' is a real number plus a unit qualification. A property may define additional constraints on the value.
+        <enumeration value = "1px"/>
+        <enumeration value = "1pt"/>
+        <enumeration value = "1mm"/>
+        <enumeration value = "1cm"/>
+        <enumeration value = "1in"/>
+        <enumeration value = "1em"/>
+      </documentation>
+    </annotation>
+    <restriction base = "string">
+      <pattern value = "[\+\-]?\d+\.?\d*(px|pt|mm|cm|in|em|%)"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "length_range_Type">
+    <annotation>
+      <documentation>
+        A compound datatype, with components: minimum, optimum, maximum. Each component is a <length xmlns=""/>. If "minimum" is greater than optimum, it will be treated as if it had been set to "optimum". If "maximum" is less than optimum, it will be treated as if it had been set to "optimum". A property may define additional constraints on the values.
+        <enumeration value = "1mm 2mm 3mm"/>
+        <enumeration value = "2mm 2mm 1mm"/>
+        <enumeration value = "3mm 2mm 1mm"/>
+      </documentation>
+    </annotation>
+    <xs:restriction>
+      <xs:simpleType>
+        <xs:list>
+          <xs:simpleType>
+            <xs:restriction base = "fo:length_Type"/>
+          </xs:simpleType>
+        </xs:list>
+      </xs:simpleType>
+      <xs:minLength value = "3" />
+      <xs:maxLength value = "3" />
+    </xs:restriction>
+  </simpleType>
+  <simpleType name = "length_conditional_Type">
+    <annotation>
+      <documentation>
+        A compound datatype, with components: length, conditionality. The length component is a <length xmlns=""/>. The conditionality component is either "discard" or "retain". A property may define additional constraints on the values.
+        <enumeration value = "1mm retain"/>
+        <enumeration value = "1mm discard"/>
+        <enumeration value = "1px retain"/>
+        <enumeration value = "1px discard"/>
+        <enumeration value = "1pt retain"/>
+        <enumeration value = "1pt discard"/>
+        <enumeration value = "1mm retain"/>
+        <enumeration value = "1mm discard"/>
+        <enumeration value = "1cm retain"/>
+        <enumeration value = "1cm discard"/>
+        <enumeration value = "1in retain"/>
+        <enumeration value = "1in discard"/>
+        <enumeration value = "1em retain"/>
+        <enumeration value = "1em discard"/>
+      </documentation>
+    </annotation>
+    <restriction base = "string">
+      <pattern value = "\+?\d+\.?\d*(px|pt|mm|cm|in|em|%) (retain|discard)"/>
+    </restriction>
+  </simpleType>
+  <xs:simpleType name = "length_bp_ip_direction_Type">
+    <annotation>
+      <documentation>
+        A compound datatype, with components: block-progression-direction, and inline-progression-direction. Each component is a <length xmlns=""/>. A property may define additional constraints on the values.
+        <enumeration value = "1mm 2mm"/>
+        <enumeration value = "2mm"/>
+        <enumeration value = "3mm 2mm"/>
+      </documentation>
+    </annotation>
+    <xs:restriction>
+      <xs:simpleType>
+        <xs:list>
+          <xs:simpleType>
+            <xs:restriction base = "fo:length_Type"/>
+          </xs:simpleType>
+        </xs:list>
+      </xs:simpleType>
+      <xs:minLength value = "1" />
+      <xs:maxLength value = "2" />
+    </xs:restriction>
+  </xs:simpleType>
+  <simpleType name = "space_Type">
+    <annotation>
+      <documentation>
+        A compound datatype, with components: minimum, optimum, maximum, precedence, and conditionality. The minimum, optimum, and maximum components are <length xmlns=""/>s. The precedence component is either "force" or an <integer/>. The conditionality component is either "discard" or "retain". If "minimum" is greater than optimum, it will be treated as if it had been set to "optimum". If "maximum" is less than optimum, it will be treated as if it had been set to "optimum".
+        <enumeration value = "1mm 2mm 3mm force retain"/>
+        <enumeration value = "1mm 2mm 3mm force discard"/>
+        <enumeration value = "1mm 2mm 3mm 3 retain"/>
+      </documentation>
+    </annotation>
+    <restriction base = "string">
+      <pattern value = "([ ]?\+?\d+\.?\d*(px|pt|mm|cm|in|em|%)){1,3}( \+?\d+| force)?( retain| discard)?"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "angle_Type">
+    <annotation>
+      <documentation>
+        A representation of an angle consisting of an optional '+' or  '-' character immediately followed by a <number/> immediately followed by an angle unit identifier. Angle unit identifiers are: 'deg' (for degrees), 'grad' (for grads), and 'rad' (for radians). The specified values are normalized to the range 0deg to 360deg. A property may define additional constraints on the value.
+        <enumeration value = "3deg"/>
+        <enumeration value = "45deg"/>
+        <enumeration value = "-12deg"/>
+      </documentation>
+    </annotation>
+    <restriction base = "string">
+      <pattern value = "[\+\-]?[1-3]?\d?\d?\.?\d*(deg|grad|rad)"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "percentage_Type">
+    <annotation>
+      <documentation>
+        A signed real percentage which consists of an optional '+' or '-' character followed by a sequence of digits followed by an optional '.' character and sequence of digits followed by '%'. A property may define additional constraints on the value.
+        <enumeration value = "10%"/>
+        <enumeration value = "30%"/>
+        <enumeration value = "100%"/>
+      </documentation>
+    </annotation>
+    <restriction base = "string">
+      <pattern value = "[\+\-]?\d+\.?\d*%"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "character_Type">
+    <annotation>
+      <documentation>
+        <enumeration value = "-"/>
+        <enumeration value = "h"/>
+        <enumeration value = "e"/>
+        <enumeration value = "l"/>
+        <enumeration value = "p"/>
+        <enumeration value = "o"/>
+      </documentation>
+    </annotation>
+    <restriction base = "string">
+      <pattern value = "."/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "name_Type">
+    <annotation>
+      <documentation>
+        A string of characters representing a name. It must conform to the definition of an NCName in
+      </documentation>
+    </annotation>
+    <restriction base = "string">
+      <pattern value = ".*"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "family_name_Type">
+    <annotation>
+      <documentation>
+        A string of characters identifying a font.
+        <enumeration value = "serif"/>
+        <enumeration value = "sans-serif"/>
+        <enumeration value = "Arial"/>
+        <enumeration value = "Times"/>
+        <enumeration value = "Courier"/>
+        <enumeration value = "Zapf Dingbats"/>
+        <enumeration value = "code39"/>
+        <enumeration value = "cyberbit"/>
+        <enumeration value = "Edwardian Script ITC"/>
+        <enumeration value = "Viner Hand ITC"/>
+        <enumeration value = "Georgia"/>
+        <enumeration value = "Bookman Old Style"/>
+        <enumeration value = "Book Antiqua"/>
+      </documentation>
+    </annotation>
+    <restriction base = "string">
+      <pattern value = ".*"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "color_Type">
+    <annotation>
+      <documentation>
+        Either a string of characters representing a keyword or a color function defined in . The list of keyword color names is: aqua, black, blue, fuchsia, gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, and yellow.
+        <enumeration value = "red"/>
+        <enumeration value = "blue"/>
+        <enumeration value = "yellow"/>
+        <enumeration value = "green"/>
+      </documentation>
+    </annotation>
+    <union memberTypes = "fo:color_Hex_Type fo:color_Name_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "proportional_column_width_Type">
+    <annotation>
+      <documentation>
+        The function proportional-column-width(N[0])
+        This returns a width as a fraction of the available width as ( N[0] / sum1 ) * available space
+        The parent table must have width="x" and table-layout="fixed"
+        <enumeration value = "proportional-column-width(Number)"/>
+      </documentation>
+    </annotation>
+    <restriction base = "string">
+      <pattern value = "proportional-column-width\(\d+\)"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "column_width_Type">
+    <annotation>
+      <documentation>
+        <length xmlns=""/>, <percentage/>, <function>proportional-column-width</function>, or <function>common-functions</function>
+        <enumeration value = "20mm"/>
+        <enumeration value = "15%"/>
+      </documentation>
+    </annotation>
+    <union memberTypes = "fo:length_percentage_Type fo:proportional_column_width_Type"/>
+  </simpleType>
+  <annotation>
+    <documentation>
+      <script/> A string of characters conforming to an ISO 15924 script code.
+    </documentation>
+  </annotation>
+  <annotation>
+    <documentation>
+      <id/>     A string of characters conforming to the definition of an NCName in and is unique within the stylesheet.
+    </documentation>
+  </annotation>
+  <annotation>
+    <documentation>
+      <idRef/>  A string of characters conforming to the definition of an NCName in and that matches an ID property value used within the stylesheet.
+    </documentation>
+  </annotation>
+  <annotation>
+    <documentation>
+      <uri-specification/> A sequence of characters that is "url(", followed by optional white space, followed by an optional single quote (') or double quote (") character, followed by a URI reference as defined in , followed by an optional single quote (') or double quote (") character, followed by optional white space, followed by ")". The two quote characters must be the same and must both be present or absent. If the URI reference contains a single quote, the two quote characters must be present and be double quotes.
+    </documentation>
+  </annotation>
+  <annotation>
+    <documentation>
+      <time/>   A <number/> immediately followed by a time unit identifier. Time unit identifiers are: 'ms' (for milliseconds) and 's' (for seconds).
+    </documentation>
+  </annotation>
+  <annotation>
+    <documentation>
+      <frequency/> A <number/> immediately followed by a frequency unit identifier. Frequency unit identifiers are: 'Hz' (for Hertz) and 'kHz' (for kilo Hertz).
+    </documentation>
+  </annotation>
+  <annotation>
+    <documentation>
+      <generic-family/> The following generic families are defined: "serif", "sans-serif", "cursive", "fantasy", and "monospace". Please see the section on generic font families for descriptions of these families. Generic font family names are keywords, and therefore must not be quoted.
+    </documentation>
+  </annotation>
+  <simpleType name = "absolute_size_Type">
+    <annotation>
+      <documentation>
+        An <absolute-size/> keyword refers to an entry in a table of font sizes computed and kept by the user agent. Possible values are: [ xx-small | x-small | small | medium | large | x-large | xx-large ] On a computer screen a scaling factor of 1.2 is suggested between adjacent indexes; if the "medium" font is 12pt, the "large" font could be 14.4pt. Different media may need different scaling factors. Also, the user agent should take the quality and availability of fonts into account when computing the table. The table may be different from one font family to another. Note. In CSS1, the suggested scaling factor between adjacent indexes was 1.5 which user experience proved to be too large.
+      </documentation>
+    </annotation>
+    <restriction base = "NMTOKEN">
+      <enumeration value = "xx-small"/>
+      <enumeration value = "x-small"/>
+      <enumeration value = "small"/>
+      <enumeration value = "medium"/>
+      <enumeration value = "large"/>
+      <enumeration value = "x-large"/>
+      <enumeration value = "xx-large"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "relative_size_Type">
+    <annotation>
+      <documentation>
+        A <relative-size/> keyword is interpreted relative to the table of font sizes and the font size of the parent element. Possible values are: [ larger | smaller ] For example, if the parent element has a font size of "medium", a value of "larger" will make the font size of the current element be "large". If the parent element's size is not close to a table entry, the user agent is free to interpolate between table entries or round off to the closest one. The user agent may have to extrapolate table values if the numerical value goes beyond the keywords.
+      </documentation>
+    </annotation>
+    <restriction base = "NMTOKEN">
+      <enumeration value = "larger"/>
+      <enumeration value = "smaller"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "clip_Type">
+    <annotation>
+      <documentation>
+        shape_Type In CSS2, the only valid <shape/> value is: rect (<top/>, <right/>, <bottom/>, <left/>) where <top/>, <bottom/> <right/>, and <left/> specify offsets from the respective sides of the box. <top/>, <right/>, <bottom/>, and <left/> may either have a <length xmlns=""/> value or "auto". Negative lengths are permitted. The value "auto" means that a given edge of the clipping region will be the same as the edge of the element's generated box (i.e., "auto" means the same as "0".) When coordinates are rounded to pixel coordinates, care should be taken that no pixels remain visible when <left/> + <right/> is equal to the element's width (or <top/> + <bottom/> equals the element's height), and conversely that no pixels remain hidden when these values are 0.
+      </documentation>
+    </annotation>
+    <restriction base = "string">
+      <annotation>
+        <documentation>
+          length_Type{1,2}
+        </documentation>
+      </annotation>
+      <pattern value = "(rect\((\+?\d+\.?\d*(px|pt|mm|cm|in|em|%)|auto),(\+?\d+\.?\d*(px|pt|mm|cm|in|em|%)|auto),(\+?\d+\.?\d*(px|pt|mm|cm|in|em|%)|auto),(\+?\d+\.?\d*(px|pt|mm|cm|in|em|%)|auto)\)|auto|inherit)"/>
+    </restriction>
+  </simpleType>
+  
+  <simpleType name = "border_side_Type">
+    <annotation>
+      <documentation>
+        "fo:width_Type fo:border_style_Type fo:color_Type"
+        <enumeration value="thin solid red"/>
+        <enumeration value="medium solid black"/>
+        <enumeration value="thick solid blue"/>
+      </documentation>
+    </annotation>
+    <restriction base = "string">
+      <pattern value = "(thin|medium|thick) (none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset) ([a-z]{3,16}|#[0-9A-F]{6})"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "border_margin_width_Type">
+    <annotation>
+      <documentation>
+        "fo:width_Type{1,4} fo:inherit_Type"
+        <enumeration value = "none"/>
+        <enumeration value = "thin"/>
+        <enumeration value = "medium"/>
+        <enumeration value = "thick"/>
+        <enumeration value = "thick thin medium none"/>
+      </documentation>
+    </annotation>
+    <xs:restriction>
+      <xs:simpleType>
+        <xs:list>
+          <xs:simpleType>
+            <union memberTypes = "fo:width_Type fo:positive_length_Type"/>
+          </xs:simpleType>
+        </xs:list>
+      </xs:simpleType>
+      <xs:minLength value = "1" />
+      <xs:maxLength value = "4" />
+    </xs:restriction>
+  </simpleType>
+  <simpleType name = "border_multi_style_Type" >
+    <annotation>
+      <documentation>
+        "fo:border_style_Type{1,4} fo:inherit_Type"
+        <enumeration value = "none"/>
+        <enumeration value = "hidden"/>
+        <enumeration value = "dotted"/>
+        <enumeration value = "dashed"/>
+        <enumeration value = "solid"/>
+        <enumeration value = "double"/>
+        <enumeration value = "groove"/>
+        <enumeration value = "ridge"/>
+        <enumeration value = "inset"/>
+        <enumeration value = "outset"/>
+        <enumeration value = "solid dashed ridge groove"/>
+      </documentation>
+    </annotation>
+    <xs:restriction>
+      <xs:simpleType>
+        <xs:list>
+          <xs:simpleType>
+            <xs:restriction base = "fo:border_style_Type"/>
+          </xs:simpleType>
+        </xs:list>
+      </xs:simpleType>
+      <xs:minLength value = "1" />
+      <xs:maxLength value = "4" />
+    </xs:restriction>
+  </simpleType>
+  <simpleType name = "border_color_Type" >
+    <annotation>
+      <documentation>
+        "fo:background_color_Type{1,4}"
+        <enumeration value="red"/>
+        <enumeration value="green"/>
+        <enumeration value="blue red yellow"/>
+        <enumeration value="black"/>
+        <enumeration value="black red yellow green"/>
+        <enumeration value="silver black"/>
+      </documentation>
+    </annotation>
+    <xs:restriction>
+      <xs:simpleType>
+        <xs:list>
+          <xs:simpleType>
+            <xs:restriction base = "fo:color_Type"/>
+          </xs:simpleType>
+        </xs:list>
+      </xs:simpleType>
+      <xs:minLength value = "1" />
+      <xs:maxLength value = "4" />
+    </xs:restriction>
+  </simpleType>
+  <simpleType name = "max_width_Type">
+    <annotation>
+      <documentation>
+        <enumeration value="100%"/>
+        <enumeration value="160mm"/>
+      </documentation>
+    </annotation>
+    <union memberTypes = "fo:length_Type fo:percentage_Type fo:none_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "background_Type">
+    <union memberTypes = "fo:background_color_Type fo:background_image_Type fo:background_repeat_Type fo:background_attachment_Type fo:background_position_Type"/>
+  </simpleType>
+  <simpleType name = "background_position_Type">
+    <union memberTypes = "fo:background_position_percentage_Type fo:background_position_length_Type fo:background_position_base_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "background_position_percentage_Type">
+    <xs:restriction>
+      <xs:simpleType>
+        <xs:list>
+          <xs:simpleType>
+            <xs:restriction base = "fo:percentage_Type"/>
+          </xs:simpleType>
+        </xs:list>
+      </xs:simpleType>
+      <xs:minLength value = "1" />
+      <xs:maxLength value = "2" />
+    </xs:restriction>
+  </simpleType>
+  <simpleType name = "background_position_length_Type">
+    <xs:restriction>
+      <xs:simpleType>
+        <xs:list>
+          <xs:simpleType>
+            <xs:restriction base = "fo:length_Type"/>
+          </xs:simpleType>
+        </xs:list>
+      </xs:simpleType>
+      <xs:minLength value = "1" />
+      <xs:maxLength value = "2" />
+    </xs:restriction>
+  </simpleType>
+  <simpleType name = "background_position_base_Type">
+    <restriction base = "string">
+      <enumeration value = "top left"/>
+      <enumeration value = "top center"/>
+      <enumeration value = "top right"/>
+      <enumeration value = "center left"/>
+      <enumeration value = "center center"/>
+      <enumeration value = "center right"/>
+      <enumeration value = "bottom left"/>
+      <enumeration value = "bottom center"/>
+      <enumeration value = "bottom right"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "size_Type">
+    <union memberTypes = "fo:background_position_length_Type fo:size_base_Type"/>
+  </simpleType>
+  <simpleType name = "size_base_Type">
+    <restriction base = "string">
+      <enumeration value = "auto"/>
+      <enumeration value = "landscape"/>
+      <enumeration value = "portrait"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "vertical_align_base_Type">
+    <restriction base = "string">
+      <enumeration value = "baseline"/>
+      <enumeration value = "middle"/>
+      <enumeration value = "sub"/>
+      <enumeration value = "super"/>
+      <enumeration value = "text-top"/>
+      <enumeration value = "text-bottom"/>
+      <enumeration value = "top"/>
+      <enumeration value = "bottom"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "vertical_align_Type">
+    <union memberTypes = "fo:vertical_align_base_Type fo:percentage_Type fo:length_Type"/>
+  </simpleType>
+  <simpleType name = "leader_length_Type">
+    <annotation>
+      <documentation>
+        <enumeration value = "50% 100% 100%"/>
+      </documentation>
+    </annotation>
+    <union memberTypes = "fo:length_range_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "letter_spacing_Type">
+    <union memberTypes = "fo:normal_Type fo:length_Type fo:space_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "font_size_adjust_Type">
+    <union memberTypes = "fo:number_Type fo:none_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "space_start_Type">
+    <union memberTypes = "fo:space_Type fo:percentage_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "normal_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "normal"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "background_attachment_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "scroll"/>
+      <enumeration value = "fixed"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "background_repeat_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "repeat"/>
+      <enumeration value = "repeat-x"/>
+      <enumeration value = "repeat-y"/>
+      <enumeration value = "no-repeat"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "speech_rate_base_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "x-slow"/>
+      <enumeration value = "slow"/>
+      <enumeration value = "medium"/>
+      <enumeration value = "fast"/>
+      <enumeration value = "x-fast"/>
+      <enumeration value = "faster"/>
+      <enumeration value = "slower"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "speech_rate_Type">
+    <union memberTypes = "fo:speech_rate_base_Type fo:integer_Type"/>
+  </simpleType>
+  <simpleType name = "speak_numeral_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "digits"/>
+      <enumeration value = "continuous"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "font_variant_Type">
+    <restriction base = "string">
+      <enumeration value = "normal"/>
+      <enumeration value = "small-caps"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "line_height_Type">
+    <union memberTypes = "fo:normal_Type fo:length_Type fo:integer_Type fo:percentage_Type fo:space_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "text_shadow_Type">
+    <union memberTypes = "fo:none_Type fo:color_Type fo:length_range_Type"/>
+  </simpleType>
+  <simpleType name = "height_Type">
+    <union memberTypes = "fo:length_Type fo:percentage_Type fo:auto_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "hyphenation_character_Type">
+    <union memberTypes = "fo:character_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "content_height_Type">
+    <union memberTypes = "fo:auto_Type fo:scale_to_fit_Type fo:length_Type fo:percentage_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "scale_to_fit_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "scale-to-fit"/>
+    </restriction>
+  </simpleType>
+
+  <simpleType name = "font_weight_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "normal"/>
+      <enumeration value = "bold">
+        <annotation>
+          <documentation>
+            <fop_result>heavier than no value</fop_result>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "bolder">
+        <annotation>
+          <documentation>
+            <fop_result>lighter than normal</fop_result> <fop_fail>unknown font</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "lighter">
+        <annotation>
+          <documentation>
+            <fop_result>lighter than normal</fop_result> <fop_fail>unknown font</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "100">
+        <annotation>
+          <documentation>
+            <fop_result>same as normal</fop_result>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "200">
+        <annotation>
+          <documentation>
+            <fop_result>same as normal</fop_result>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "300">
+        <annotation>
+          <documentation>
+            <fop_result>same as normal</fop_result>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "400">
+        <annotation>
+          <documentation>
+            <fop_result>same as normal</fop_result>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "500">
+        <annotation>
+          <documentation>
+            <fop_result>same as normal</fop_result>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "600">
+        <annotation>
+          <documentation>
+            <fop_result>same as normal</fop_result>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "700">
+        <annotation>
+          <documentation>
+            <fop_result>same as bold</fop_result>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "800">
+        <annotation>
+          <documentation>
+            <fop_result>same as bold</fop_result>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "900">
+        <annotation>
+          <documentation>
+            <fop_result>same as bold</fop_result>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "inherit">
+        <annotation>
+          <documentation>
+            <fop_result>lighter than normal</fop_result> <fop_fail>unknown font</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+  <simpleType name = "font_style_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "normal"/>
+      <enumeration value = "italic"/>
+      <enumeration value = "oblique"/>
+      <enumeration value = "backslant">
+        <annotation>
+          <documentation>
+            <fop_fail>unknown font</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "inherit">
+        <annotation>
+          <documentation>
+            <fop_fail>unknown font</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+  <simpleType name = "page_break_inside_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "avoid"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "page_break_after_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "always"/>
+      <enumeration value = "avoid"/>
+      <enumeration value = "left"/>
+      <enumeration value = "right"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "white_space_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "normal"/>
+      <enumeration value = "pre"/>
+      <enumeration value = "nowrap"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "show_destination_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "replace"/>
+      <enumeration value = "new"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "indicate_destination_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "true"/>
+      <enumeration value = "false"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "speak_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "normal"/>
+      <enumeration value = "none"/>
+      <enumeration value = "spell-out"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "relative_align_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "before"/>
+      <enumeration value = "baseline"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "empty_cells_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "show"/>
+      <enumeration value = "hide"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "ends_row_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "true"/>
+      <enumeration value = "false"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "starts_row_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "true"/>
+      <enumeration value = "false"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "position_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "static"/>
+      <enumeration value = "relative"/>
+      <enumeration value = "absolute"/>
+      <enumeration value = "fixed"/>
+      <enumeration value = "inherit">
+        <annotation>
+          <documentation>
+            <fop_fail>Unknown enumerated value</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+  <simpleType name = "conditionality_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "retain"/>
+      <enumeration value = "discard"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "keep_compound_Type">
+    <annotation>
+      <documentation>
+        A compound datatype, with components: within-line, within-column, within-page. Each component is a <keep/>. 
+        <enumeration value = "2 auto always"/>
+        <enumeration value = "auto"/>
+        <enumeration value = "always"/>
+      </documentation>
+    </annotation>
+    <xs:restriction>
+      <xs:simpleType>
+        <xs:list>
+          <xs:simpleType>
+            <xs:restriction base = "fo:keep_integer_Type"/>
+          </xs:simpleType>
+        </xs:list>
+      </xs:simpleType>
+      <xs:minLength value = "1" />
+      <xs:maxLength value = "3" />
+    </xs:restriction>
+  </simpleType>
+  <simpleType name = "keep_integer_Type">
+    <annotation>
+      <documentation>
+        <enumeration value = "2"/>
+        <enumeration value = "5"/>
+        <enumeration value = "10"/>
+        <enumeration value = "auto"/>
+        <enumeration value = "always"/>
+      </documentation>
+    </annotation>
+    <restriction base = "NMTOKEN">
+      <pattern value = "(\+?\d+|auto|always)"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "letter_value_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "alphabetic"/>
+      <enumeration value = "traditional"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "alignment_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "baseline"/>
+      <enumeration value = "before-edge"/>
+      <enumeration value = "text-before-edge"/>
+      <enumeration value = "middle"/>
+      <enumeration value = "central"/>
+      <enumeration value = "after-edge"/>
+      <enumeration value = "text-after-edge"/>
+      <enumeration value = "ideographic"/>
+      <enumeration value = "alphabetic"/>
+      <enumeration value = "hanging"/>
+      <enumeration value = "mathematical"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "box_alignment_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "top"/>
+      <enumeration value = "text-top"/>
+      <enumeration value = "bottom"/>
+      <enumeration value = "text-bottom"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "breaks_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "inherit">
+        <annotation>
+          <documentation>
+            <fop_fail>Unknown enumerated value</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "auto"/>
+      <enumeration value = "column"/>
+      <enumeration value = "page"/>
+      <enumeration value = "even-page"/>
+      <enumeration value = "odd-page"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "force_page_count_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "even"/>
+      <enumeration value = "odd"/>
+      <enumeration value = "end-on-even"/>
+      <enumeration value = "end-on-odd"/>
+      <enumeration value = "no-force"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "table_layout_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "fixed"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "scaling_method_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "integer-pixels"/>
+      <enumeration value = "resample-any-method"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "displace_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "inherit"/>
+      <enumeration value = "auto"/>
+      <enumeration value = "none"/>
+      <enumeration value = "line"/>
+      <enumeration value = "indent"/>
+      <enumeration value = "block"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "media_usage_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "paginate"/>
+      <enumeration value = "bounded-in-one-dimension"/>
+      <enumeration value = "unbounded"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "rendering_intent_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "perceptual"/>
+      <enumeration value = "relative-colorimetric"/>
+      <enumeration value = "saturation"/>
+      <enumeration value = "absolute-colorimetric"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "hyphenate_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "false"/>
+      <enumeration value = "true"/>
+      <enumeration value = "inherit">
+        <annotation>
+          <documentation>
+            <fop_fail>Unknown enumerated value</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+  <simpleType name = "suppress_at_line_break_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "suppress"/>
+      <enumeration value = "retain"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "treat_as_word_space_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "true"/>
+      <enumeration value = "false"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "dominant_baseline_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "use-script"/>
+      <enumeration value = "no-change"/>
+      <enumeration value = "reset-size"/>
+      <enumeration value = "ideographic"/>
+      <enumeration value = "alphabetic"/>
+      <enumeration value = "hanging"/>
+      <enumeration value = "mathematical"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "orientation_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "inherit"/>
+      <enumeration value = "0"/>
+      <enumeration value = "90"/>
+      <enumeration value = "180"/>
+      <enumeration value = "270"/>
+      <enumeration value = "-90"/>
+      <enumeration value = "-180"/>
+      <enumeration value = "-270"/>
+      <enumeration value = "0deg"/>
+      <enumeration value = "90deg"/>
+      <enumeration value = "180deg"/>
+      <enumeration value = "270deg"/>
+      <enumeration value = "-90deg"/>
+      <enumeration value = "-180deg"/>
+      <enumeration value = "-270deg"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "measurement_Type">
+    <annotation>
+      <documentation>
+        Here to document the acceptable measurements 
+      </documentation>
+    </annotation>
+    <restriction base = "string">
+      <enumeration value = "px"/>
+      <enumeration value = "pt"/>
+      <enumeration value = "mm"/>
+      <enumeration value = "in"/>
+      <enumeration value = "cm"/>
+      <enumeration value = "em"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "positive_length_Type">
+    <restriction base = "string">
+      <pattern value = "\+?\d+\.?\d*(px|pt|mm|cm|in|em|%)"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "negative_length_Type">
+    <restriction base = "string">
+      <pattern value = "-\d+\.?\d*(px|pt|mm|cm|in|em|%)"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "integer_Force_Type">
+    <restriction base = "string">
+      <pattern value = "([0-9]+|force)"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "padding_top_Type">
+    <union memberTypes = "fo:width_Type fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "padding_before_Type">
+    <union memberTypes = "fo:width_Type fo:length_Type fo:length_conditional_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "country_Type">
+    <annotation>
+      <documentation>
+        A string of characters conforming to an ISO 3166 country code. 
+      </documentation>
+    </annotation>
+    <restriction base = "NMTOKEN">
+      <enumeration value = "none"/>
+      <enumeration value = "inherit"/>
+      <enumeration value = "AF"><annotation><documentation> country-name = "AFGHANISTAN"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "AL"><annotation><documentation> country-name = "ALBANIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "DZ"><annotation><documentation> country-name = "ALGERIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "AS"><annotation><documentation> country-name = "AMERICANSAMOA"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "AD"><annotation><documentation> country-name = "ANDORRA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "AO"><annotation><documentation> country-name = "ANGOLA"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "AI"><annotation><documentation> country-name = "ANGUILLA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "AQ"><annotation><documentation> country-name = "ANTARCTICA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "AG"><annotation><documentation> country-name = "ANTIGUAANDBARBUDA"/ </documentation></annotation>             </enumeration>
+      <enumeration value = "AR"><annotation><documentation> country-name = "ARGENTINA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "AM"><annotation><documentation> country-name = "ARMENIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "AW"><annotation><documentation> country-name = "ARUBA"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "AU"><annotation><documentation> country-name = "AUSTRALIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "AT"><annotation><documentation> country-name = "AUSTRIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "AZ"><annotation><documentation> country-name = "AZERBAIJAN"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "BS"><annotation><documentation> country-name = "BAHAMAS"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "BH"><annotation><documentation> country-name = "BAHRAIN"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "BD"><annotation><documentation> country-name = "BANGLADESH"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "BB"><annotation><documentation> country-name = "BARBADOS"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "BY"><annotation><documentation> country-name = "BELARUS"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "BE"><annotation><documentation> country-name = "BELGIUM"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "BZ"><annotation><documentation> country-name = "BELIZE"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "BJ"><annotation><documentation> country-name = "BENIN"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "BM"><annotation><documentation> country-name = "BERMUDA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "BT"><annotation><documentation> country-name = "BHUTAN"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "BO"><annotation><documentation> country-name = "BOLIVIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "BA"><annotation><documentation> country-name = "BOSNIAANDHERZEGOVINA"/ </documentation></annotation>            </enumeration>
+      <enumeration value = "BW"><annotation><documentation> country-name = "BOTSWANA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "BV"><annotation><documentation> country-name = "BOUVETISLAND"/ </documentation></annotation>                </enumeration>
+      <enumeration value = "BR"><annotation><documentation> country-name = "BRAZIL"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "IO"><annotation><documentation> country-name = "BRITISHINDIANOCEANTERRITORY"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "BN"><annotation><documentation> country-name = "BRUNEIDARUSSALAM"/ </documentation></annotation>              </enumeration>
+      <enumeration value = "BG"><annotation><documentation> country-name = "BULGARIA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "BF"><annotation><documentation> country-name = "BURKINAFASO"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "BI"><annotation><documentation> country-name = "BURUNDI"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "KH"><annotation><documentation> country-name = "CAMBODIA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "CM"><annotation><documentation> country-name = "CAMEROON"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "CA"><annotation><documentation> country-name = "CANADA"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "CV"><annotation><documentation> country-name = "CAPEVERDE"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "KY"><annotation><documentation> country-name = "CAYMANISLANDS"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "CF"><annotation><documentation> country-name = "CENTRALAFRICANREPUBLIC"/ </documentation></annotation>            </enumeration>
+      <enumeration value = "TD"><annotation><documentation> country-name = "CHAD"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "CL"><annotation><documentation> country-name = "CHILE"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "CN"><annotation><documentation> country-name = "CHINA"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "CX"><annotation><documentation> country-name = "CHRISTMASISLAND"/ </documentation></annotation>             </enumeration>
+      <enumeration value = "CC"><annotation><documentation> country-name = "COCOS(KEELING)ISLANDS"/ </documentation></annotation>           </enumeration>
+      <enumeration value = "CO"><annotation><documentation> country-name = "COLOMBIA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "KM"><annotation><documentation> country-name = "COMOROS"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "CG"><annotation><documentation> country-name = "CONGO"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "CD"><annotation><documentation> country-name = "CONGO,THEDEMOCRATICREPUBLICOFTHE"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "CK"><annotation><documentation> country-name = "COOKISLANDS"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "CR"><annotation><documentation> country-name = "COSTARICA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "CI"><annotation><documentation> country-name = "COTED'IVOIRE"/ </documentation></annotation>                </enumeration>
+      <enumeration value = "HR"><annotation><documentation> country-name = "CROATIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "CU"><annotation><documentation> country-name = "CUBA"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "CY"><annotation><documentation> country-name = "CYPRUS"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "CZ"><annotation><documentation> country-name = "CZECHREPUBLIC"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "DK"><annotation><documentation> country-name = "DENMARK"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "DJ"><annotation><documentation> country-name = "DJIBOUTI"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "DM"><annotation><documentation> country-name = "DOMINICA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "DO"><annotation><documentation> country-name = "DOMINICANREPUBLIC"/ </documentation></annotation>             </enumeration>
+      <enumeration value = "TP"><annotation><documentation> country-name = "EASTTIMOR"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "EC"><annotation><documentation> country-name = "ECUADOR"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "EG"><annotation><documentation> country-name = "EGYPT"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "SV"><annotation><documentation> country-name = "ELSALVADOR"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "GQ"><annotation><documentation> country-name = "EQUATORIALGUINEA"/ </documentation></annotation>              </enumeration>
+      <enumeration value = "ER"><annotation><documentation> country-name = "ERITREA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "EE"><annotation><documentation> country-name = "ESTONIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "ET"><annotation><documentation> country-name = "ETHIOPIA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "FK"><annotation><documentation> country-name = "FALKLANDISLANDS(MALVINAS)"/ </documentation></annotation>         </enumeration>
+      <enumeration value = "FO"><annotation><documentation> country-name = "FAROEISLANDS"/ </documentation></annotation>                </enumeration>
+      <enumeration value = "FJ"><annotation><documentation> country-name = "FIJI"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "FI"><annotation><documentation> country-name = "FINLAND"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "FR"><annotation><documentation> country-name = "FRANCE"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "GF"><annotation><documentation> country-name = "FRENCHGUIANA"/ </documentation></annotation>                </enumeration>
+      <enumeration value = "PF"><annotation><documentation> country-name = "FRENCHPOLYNESIA"/ </documentation></annotation>             </enumeration>
+      <enumeration value = "TF"><annotation><documentation> country-name = "FRENCHSOUTHERNTERRITORIES"/ </documentation></annotation>         </enumeration>
+      <enumeration value = "GA"><annotation><documentation> country-name = "GABON"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "GM"><annotation><documentation> country-name = "GAMBIA"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "GE"><annotation><documentation> country-name = "GEORGIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "DE"><annotation><documentation> country-name = "GERMANY"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "GH"><annotation><documentation> country-name = "GHANA"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "GI"><annotation><documentation> country-name = "GIBRALTAR"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "GR"><annotation><documentation> country-name = "GREECE"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "GL"><annotation><documentation> country-name = "GREENLAND"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "GD"><annotation><documentation> country-name = "GRENADA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "GP"><annotation><documentation> country-name = "GUADELOUPE"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "GU"><annotation><documentation> country-name = "GUAM"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "GT"><annotation><documentation> country-name = "GUATEMALA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "GN"><annotation><documentation> country-name = "GUINEA"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "GW"><annotation><documentation> country-name = "GUINEA-BISSAU"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "GY"><annotation><documentation> country-name = "GUYANA"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "HT"><annotation><documentation> country-name = "HAITI"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "HM"><annotation><documentation> country-name = "HEARDISLANDANDMCDONALDISLANDS"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "VA"><annotation><documentation> country-name = "HOLYSEE(VATICANCITYSTATE)"/ </documentation></annotation>         </enumeration>
+      <enumeration value = "HN"><annotation><documentation> country-name = "HONDURAS"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "HK"><annotation><documentation> country-name = "HONGKONG"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "HU"><annotation><documentation> country-name = "HUNGARY"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "IS"><annotation><documentation> country-name = "ICELAND"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "IN"><annotation><documentation> country-name = "INDIA"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "ID"><annotation><documentation> country-name = "INDONESIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "IR"><annotation><documentation> country-name = "IRAN,ISLAMICREPUBLICOF"/ </documentation></annotation>            </enumeration>
+      <enumeration value = "IQ"><annotation><documentation> country-name = "IRAQ"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "IE"><annotation><documentation> country-name = "IRELAND"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "IL"><annotation><documentation> country-name = "ISRAEL"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "IT"><annotation><documentation> country-name = "ITALY"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "JM"><annotation><documentation> country-name = "JAMAICA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "JP"><annotation><documentation> country-name = "JAPAN"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "JO"><annotation><documentation> country-name = "JORDAN"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "KZ"><annotation><documentation> country-name = "KAZAKSTAN"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "KE"><annotation><documentation> country-name = "KENYA"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "KI"><annotation><documentation> country-name = "KIRIBATI"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "KP"><annotation><documentation> country-name = "KOREA,DEMOCRATICPEOPLE'SREPUBLICOF"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "KR"><annotation><documentation> country-name = "KOREA,REPUBLICOF"/ </documentation></annotation>              </enumeration>
+      <enumeration value = "KW"><annotation><documentation> country-name = "KUWAIT"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "KG"><annotation><documentation> country-name = "KYRGYZSTAN"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "LA"><annotation><documentation> country-name = "LAOPEOPLE'SDEMOCRATICREPUBLIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "LV"><annotation><documentation> country-name = "LATVIA"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "LB"><annotation><documentation> country-name = "LEBANON"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "LS"><annotation><documentation> country-name = "LESOTHO"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "LR"><annotation><documentation> country-name = "LIBERIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "LY"><annotation><documentation> country-name = "LIBYANARABJAMAHIRIYA"/ </documentation></annotation>            </enumeration>
+      <enumeration value = "LI"><annotation><documentation> country-name = "LIECHTENSTEIN"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "LT"><annotation><documentation> country-name = "LITHUANIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "LU"><annotation><documentation> country-name = "LUXEMBOURG"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "MO"><annotation><documentation> country-name = "MACAU"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "MK"><annotation><documentation> country-name = "MACEDONIA,THEFORMERYUGOSLAVREPUBLICOF"/ </documentation></annotation>   </enumeration>
+      <enumeration value = "MG"><annotation><documentation> country-name = "MADAGASCAR"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "MW"><annotation><documentation> country-name = "MALAWI"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "MY"><annotation><documentation> country-name = "MALAYSIA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "MV"><annotation><documentation> country-name = "MALDIVES"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "ML"><annotation><documentation> country-name = "MALI"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "MT"><annotation><documentation> country-name = "MALTA"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "MH"><annotation><documentation> country-name = "MARSHALLISLANDS"/ </documentation></annotation>             </enumeration>
+      <enumeration value = "MQ"><annotation><documentation> country-name = "MARTINIQUE"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "MR"><annotation><documentation> country-name = "MAURITANIA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "MU"><annotation><documentation> country-name = "MAURITIUS"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "YT"><annotation><documentation> country-name = "MAYOTTE"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "MX"><annotation><documentation> country-name = "MEXICO"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "FM"><annotation><documentation> country-name = "MICRONESIA,FEDERATEDSTATESOF"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "MD"><annotation><documentation> country-name = "MOLDOVA,REPUBLICOF"/ </documentation></annotation>              </enumeration>
+      <enumeration value = "MC"><annotation><documentation> country-name = "MONACO"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "MN"><annotation><documentation> country-name = "MONGOLIA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "MS"><annotation><documentation> country-name = "MONTSERRAT"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "MA"><annotation><documentation> country-name = "MOROCCO"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "MZ"><annotation><documentation> country-name = "MOZAMBIQUE"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "MM"><annotation><documentation> country-name = "MYANMAR"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "NA"><annotation><documentation> country-name = "NAMIBIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "NR"><annotation><documentation> country-name = "NAURU"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "NP"><annotation><documentation> country-name = "NEPAL"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "NL"><annotation><documentation> country-name = "NETHERLANDS"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "AN"><annotation><documentation> country-name = "NETHERLANDSANTILLES"/ </documentation></annotation>           </enumeration>
+      <enumeration value = "NC"><annotation><documentation> country-name = "NEWCALEDONIA"/ </documentation></annotation>                </enumeration>
+      <enumeration value = "NZ"><annotation><documentation> country-name = "NEWZEALAND"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "NI"><annotation><documentation> country-name = "NICARAGUA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "NE"><annotation><documentation> country-name = "NIGER"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "NG"><annotation><documentation> country-name = "NIGERIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "NU"><annotation><documentation> country-name = "NIUE"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "NF"><annotation><documentation> country-name = "NORFOLKISLAND"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "MP"><annotation><documentation> country-name = "NORTHERNMARIANAISLANDS"/ </documentation></annotation>            </enumeration>
+      <enumeration value = "NO"><annotation><documentation> country-name = "NORWAY"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "OM"><annotation><documentation> country-name = "OMAN"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "PK"><annotation><documentation> country-name = "PAKISTAN"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "PW"><annotation><documentation> country-name = "PALAU"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "PS"><annotation><documentation> country-name = "PALESTINIANTERRITORY,OCCUPIED"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "PA"><annotation><documentation> country-name = "PANAMA"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "PG"><annotation><documentation> country-name = "PAPUANEWGUINEA"/ </documentation></annotation>                </enumeration>
+      <enumeration value = "PY"><annotation><documentation> country-name = "PARAGUAY"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "PE"><annotation><documentation> country-name = "PERU"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "PH"><annotation><documentation> country-name = "PHILIPPINES"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "PN"><annotation><documentation> country-name = "PITCAIRN"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "PL"><annotation><documentation> country-name = "POLAND"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "PT"><annotation><documentation> country-name = "PORTUGAL"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "PR"><annotation><documentation> country-name = "PUERTORICO"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "QA"><annotation><documentation> country-name = "QATAR"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "RE"><annotation><documentation> country-name = "R+UNION"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "RO"><annotation><documentation> country-name = "ROMANIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "RU"><annotation><documentation> country-name = "RUSSIANFEDERATION"/ </documentation></annotation>             </enumeration>
+      <enumeration value = "RW"><annotation><documentation> country-name = "RWANDA"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "SH"><annotation><documentation> country-name = "SAINTHELENA"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "KN"><annotation><documentation> country-name = "SAINTKITTSANDNEVIS"/ </documentation></annotation>              </enumeration>
+      <enumeration value = "LC"><annotation><documentation> country-name = "SAINTLUCIA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "PM"><annotation><documentation> country-name = "SAINTPIERREANDMIQUELON"/ </documentation></annotation>            </enumeration>
+      <enumeration value = "VC"><annotation><documentation> country-name = "SAINTVINCENTANDTHEGRENADINES"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "WS"><annotation><documentation> country-name = "SAMOA"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "SM"><annotation><documentation> country-name = "SANMARINO"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "ST"><annotation><documentation> country-name = "SAOTOMEANDPRINCIPE"/ </documentation></annotation>              </enumeration>
+      <enumeration value = "SA"><annotation><documentation> country-name = "SAUDIARABIA"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "SN"><annotation><documentation> country-name = "SENEGAL"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "SC"><annotation><documentation> country-name = "SEYCHELLES"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "SL"><annotation><documentation> country-name = "SIERRALEONE"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "SG"><annotation><documentation> country-name = "SINGAPORE"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "SK"><annotation><documentation> country-name = "SLOVAKIA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "SI"><annotation><documentation> country-name = "SLOVENIA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "SB"><annotation><documentation> country-name = "SOLOMONISLANDS"/ </documentation></annotation>                </enumeration>
+      <enumeration value = "SO"><annotation><documentation> country-name = "SOMALIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "ZA"><annotation><documentation> country-name = "SOUTHAFRICA"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "GS"><annotation><documentation> country-name = "SOUTHGEORGIAANDTHESOUTHSANDWICHISLANDS"/ </documentation></annotation>    </enumeration>
+      <enumeration value = "ES"><annotation><documentation> country-name = "SPAIN"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "LK"><annotation><documentation> country-name = "SRILANKA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "SD"><annotation><documentation> country-name = "SUDAN"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "SR"><annotation><documentation> country-name = "SURINAME"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "SJ"><annotation><documentation> country-name = "SVALBARDANDJANMAYEN"/ </documentation></annotation>           </enumeration>
+      <enumeration value = "SZ"><annotation><documentation> country-name = "SWAZILAND"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "SE"><annotation><documentation> country-name = "SWEDEN"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "CH"><annotation><documentation> country-name = "SWITZERLAND"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "SY"><annotation><documentation> country-name = "SYRIANARABREPUBLIC"/ </documentation></annotation>              </enumeration>
+      <enumeration value = "TW"><annotation><documentation> country-name = "TAIWAN,PROVINCEOFCHINA"/ </documentation></annotation>            </enumeration>
+      <enumeration value = "TJ"><annotation><documentation> country-name = "TAJIKISTAN"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "TZ"><annotation><documentation> country-name = "TANZANIA,UNITEDREPUBLICOF"/ </documentation></annotation>         </enumeration>
+      <enumeration value = "TH"><annotation><documentation> country-name = "THAILAND"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "TG"><annotation><documentation> country-name = "TOGO"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "TK"><annotation><documentation> country-name = "TOKELAU"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "TO"><annotation><documentation> country-name = "TONGA"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "TT"><annotation><documentation> country-name = "TRINIDADANDTOBAGO"/ </documentation></annotation>             </enumeration>
+      <enumeration value = "TN"><annotation><documentation> country-name = "TUNISIA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "TR"><annotation><documentation> country-name = "TURKEY"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "TM"><annotation><documentation> country-name = "TURKMENISTAN"/ </documentation></annotation>                </enumeration>
+      <enumeration value = "TC"><annotation><documentation> country-name = "TURKSANDCAICOSISLANDS"/ </documentation></annotation>           </enumeration>
+      <enumeration value = "TV"><annotation><documentation> country-name = "TUVALU"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "UG"><annotation><documentation> country-name = "UGANDA"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "UA"><annotation><documentation> country-name = "UKRAINE"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "AE"><annotation><documentation> country-name = "UNITEDARABEMIRATES"/ </documentation></annotation>              </enumeration>
+      <enumeration value = "GB"><annotation><documentation> country-name = "UNITEDKINGDOM"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "US"><annotation><documentation> country-name = "UNITEDSTATES"/ </documentation></annotation>                </enumeration>
+      <enumeration value = "UM"><annotation><documentation> country-name = "UNITEDSTATESMINOROUTLYINGISLANDS"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "UY"><annotation><documentation> country-name = "URUGUAY"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "UZ"><annotation><documentation> country-name = "UZBEKISTAN"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "VU"><annotation><documentation> country-name = "VANUATU"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "VE"><annotation><documentation> country-name = "VENEZUELA"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "VN"><annotation><documentation> country-name = "VIETNAM"/ </documentation></annotation>                 </enumeration>
+      <enumeration value = "VG"><annotation><documentation> country-name = "VIRGINISLANDS,BRITISH"/ </documentation></annotation>           </enumeration>
+      <enumeration value = "VI"><annotation><documentation> country-name = "VIRGINISLANDS,U.S."/ </documentation></annotation>              </enumeration>
+      <enumeration value = "WF"><annotation><documentation> country-name = "WALLISANDFUTUNA"/ </documentation></annotation>             </enumeration>
+      <enumeration value = "EH"><annotation><documentation> country-name = "WESTERNSAHARA"/ </documentation></annotation>               </enumeration>
+      <enumeration value = "YE"><annotation><documentation> country-name = "YEMEN"/ </documentation></annotation>                   </enumeration>
+      <enumeration value = "YU"><annotation><documentation> country-name = "YUGOSLAVIA"/ </documentation></annotation>                  </enumeration>
+      <enumeration value = "ZM"><annotation><documentation> country-name = "ZAMBIA"/ </documentation></annotation>                    </enumeration>
+      <enumeration value = "ZW"><annotation><documentation> country-name = "ZIMBABWE"/ </documentation></annotation>                  </enumeration>
+    </restriction>
+  </simpleType>
+  <simpleType name = "language_Type">
+  <annotation><documentation> A string of characters conforming to the ISO 639 3-letter code. (Rather odd since all of them have 2 letters)</documentation></annotation>
+    <restriction base = "NMTOKEN">
+      <enumeration value = "none"/>
+      <enumeration value = "inherit"/>
+      <enumeration value = "AY"><annotation><documentation> language-name = "AYMARA" language-family = "AMERINDIAN"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "GN"><annotation><documentation> language-name = "GUARANI" language-family = "AMERINDIAN"/ </documentation></annotation>     </enumeration>
+      <enumeration value = "QU"><annotation><documentation> language-name = "QUECHUA" language-family = "AMERINDIAN"/ </documentation></annotation>     </enumeration>
+      <enumeration value = "DZ"><annotation><documentation> language-name = "BHUTANI" language-family = "ASIAN"/ </documentation></annotation>          </enumeration>
+      <enumeration value = "MY"><annotation><documentation> language-name = "BURMESE" language-family = "ASIAN"/ </documentation></annotation>          </enumeration>
+      <enumeration value = "KM"><annotation><documentation> language-name = "CAMBODIAN" language-family = "ASIAN"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "ZH"><annotation><documentation> language-name = "CHINESE" language-family = "ASIAN"/ </documentation></annotation>          </enumeration>
+      <enumeration value = "JA"><annotation><documentation> language-name = "JAPANESE" language-family = "ASIAN"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "KO"><annotation><documentation> language-name = "KOREAN" language-family = "ASIAN"/ </documentation></annotation>         </enumeration>
+      <enumeration value = "LO"><annotation><documentation> language-name = "LAOTHIAN" language-family = "ASIAN"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "TH"><annotation><documentation> language-name = "THAI" language-family = "ASIAN"/ </documentation></annotation>         </enumeration>
+      <enumeration value = "BO"><annotation><documentation> language-name = "TIBETAN" language-family = "ASIAN"/ </documentation></annotation>          </enumeration>
+      <enumeration value = "VI"><annotation><documentation> language-name = "VIETNAMESE" language-family = "ASIAN"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "LV"><annotation><documentation> language-name = "LATVIAN;LETTISH" language-family = "BALTIC"/ </documentation></annotation>   </enumeration>
+      <enumeration value = "LT"><annotation><documentation> language-name = "LITHUANIAN" language-family = "BALTIC"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "EU"><annotation><documentation> language-name = "BASQUE" language-family = "BASQUE"/ </documentation></annotation>          </enumeration>
+      <enumeration value = "BR"><annotation><documentation> language-name = "BRETON" language-family = "CELTIC"/ </documentation></annotation>          </enumeration>
+      <enumeration value = "GA"><annotation><documentation> language-name = "IRISH" language-family = "CELTIC"/ </documentation></annotation>         </enumeration>
+      <enumeration value = "GD"><annotation><documentation> language-name = "SCOTS-GAELIC" language-family = "CELTIC"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "CY"><annotation><documentation> language-name = "WELSH" language-family = "CELTIC"/ </documentation></annotation>         </enumeration>
+      <enumeration value = "KN"><annotation><documentation> language-name = "KANNADA" language-family = "DRAVIDIAN"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "ML"><annotation><documentation> language-name = "MALAYALAM" language-family = "DRAVIDIAN"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "TA"><annotation><documentation> language-name = "TAMIL" language-family = "DRAVIDIAN"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "TE"><annotation><documentation> language-name = "TELUGU" language-family = "DRAVIDIAN"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "KL"><annotation><documentation> language-name = "GREENLANDIC" language-family = "ESKIMO"/ </documentation></annotation>     </enumeration>
+      <enumeration value = "IK"><annotation><documentation> language-name = "INUPIAK" language-family = "ESKIMO"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "ET"><annotation><documentation> language-name = "ESTONIAN" language-family = "FINNO-UGRIC"/ </documentation></annotation>     </enumeration>
+      <enumeration value = "FI"><annotation><documentation> language-name = "FINNISH" language-family = "FINNO-UGRIC"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "HU"><annotation><documentation> language-name = "HUNGARIAN" language-family = "FINNO-UGRIC"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "AF"><annotation><documentation> language-name = "AFRIKAANS" language-family = "GERMANIC"/ </documentation></annotation>     </enumeration>
+      <enumeration value = "DA"><annotation><documentation> language-name = "DANISH" language-family = "GERMANIC"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "NL"><annotation><documentation> language-name = "DUTCH" language-family = "GERMANIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "EN"><annotation><documentation> language-name = "ENGLISH" language-family = "GERMANIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "FO"><annotation><documentation> language-name = "FAROESE" language-family = "GERMANIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "FY"><annotation><documentation> language-name = "FRISIAN" language-family = "GERMANIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "DE"><annotation><documentation> language-name = "GERMAN" language-family = "GERMANIC"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "IS"><annotation><documentation> language-name = "ICELANDIC" language-family = "GERMANIC"/ </documentation></annotation>     </enumeration>
+      <enumeration value = "NO"><annotation><documentation> language-name = "NORWEGIAN" language-family = "GERMANIC"/ </documentation></annotation>     </enumeration>
+      <enumeration value = "SV"><annotation><documentation> language-name = "SWEDISH" language-family = "GERMANIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "YI"><annotation><documentation> language-name = "YIDDISH" language-family = "GERMANIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "OM"><annotation><documentation> language-name = "AFAN-(OROMO)" language-family = "HAMITIC"/ </documentation></annotation>     </enumeration>
+      <enumeration value = "AA"><annotation><documentation> language-name = "AFAR" language-family = "HAMITIC"/ </documentation></annotation>         </enumeration>
+      <enumeration value = "SO"><annotation><documentation> language-name = "SOMALI" language-family = "HAMITIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "AB"><annotation><documentation> language-name = "ABKHAZIAN" language-family = "IBERO-CAUCASIAN"/ </documentation></annotation>    </enumeration>
+      <enumeration value = "KA"><annotation><documentation> language-name = "GEORGIAN" language-family = "IBERO-CAUCASIAN"/ </documentation></annotation>   </enumeration>
+      <enumeration value = "AS"><annotation><documentation> language-name = "ASSAMESE" language-family = "INDIAN"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "BN"><annotation><documentation> language-name = "BENGALI;BANGLA" language-family = "INDIAN"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "BH"><annotation><documentation> language-name = "BIHARI" language-family = "INDIAN"/ </documentation></annotation>          </enumeration>
+      <enumeration value = "GU"><annotation><documentation> language-name = "GUJARATI" language-family = "INDIAN"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "HI"><annotation><documentation> language-name = "HINDI" language-family = "INDIAN"/ </documentation></annotation>         </enumeration>
+      <enumeration value = "KS"><annotation><documentation> language-name = "KASHMIRI" language-family = "INDIAN"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "MR"><annotation><documentation> language-name = "MARATHI" language-family = "INDIAN"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "NE"><annotation><documentation> language-name = "NEPALI" language-family = "INDIAN"/ </documentation></annotation>          </enumeration>
+      <enumeration value = "OR"><annotation><documentation> language-name = "ORIYA" language-family = "INDIAN"/ </documentation></annotation>         </enumeration>
+      <enumeration value = "PA"><annotation><documentation> language-name = "PUNJABI" language-family = "INDIAN"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "SA"><annotation><documentation> language-name = "SANSKRIT" language-family = "INDIAN"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "SD"><annotation><documentation> language-name = "SINDHI" language-family = "INDIAN"/ </documentation></annotation>          </enumeration>
+      <enumeration value = "SI"><annotation><documentation> language-name = "SINGHALESE" language-family = "INDIAN"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "UR"><annotation><documentation> language-name = "URDU" language-family = "INDIAN"/ </documentation></annotation>          </enumeration>
+      <enumeration value = "SQ"><annotation><documentation> language-name = "ALBANIAN" language-family = "INDO-EUROPEAN(OTHER)"/ </documentation></annotation>  </enumeration>
+      <enumeration value = "HY"><annotation><documentation> language-name = "ARMENIAN" language-family = "INDO-EUROPEAN(OTHER)"/ </documentation></annotation>  </enumeration>
+      <enumeration value = "EO"><annotation><documentation> language-name = "ESPERANTO" language-family = "INTERNATIONAL-AUX."/ </documentation></annotation> </enumeration>
+      <enumeration value = "IA"><annotation><documentation> language-name = "INTERLINGUA" language-family = "INTERNATIONAL-AUX."/ </documentation></annotation> </enumeration>
+      <enumeration value = "IE"><annotation><documentation> language-name = "INTERLINGUE" language-family = "INTERNATIONAL-AUX."/ </documentation></annotation> </enumeration>
+      <enumeration value = "VO"><annotation><documentation> language-name = "VOLAPUK" language-family = "INTERNATIONAL-AUX."/ </documentation></annotation> </enumeration>
+      <enumeration value = "KU"><annotation><documentation> language-name = "KURDISH" language-family = "IRANIAN"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "PS"><annotation><documentation> language-name = "PASHTO;PUSHTO" language-family = "IRANIAN"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "FA"><annotation><documentation> language-name = "PERSIAN-(farsi)" language-family = "IRANIAN"/ </documentation></annotation>    </enumeration>
+      <enumeration value = "TG"><annotation><documentation> language-name = "TAJIK" language-family = "IRANIAN"/ </documentation></annotation>          </enumeration>
+      <enumeration value = "EL"><annotation><documentation> language-name = "GREEK" language-family = "LATIN/GREEK"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "LA"><annotation><documentation> language-name = "LATIN" language-family = "LATIN/GREEK"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "HA"><annotation><documentation> language-name = "HAUSA" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "RW"><annotation><documentation> language-name = "KINYARWANDA" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>    </enumeration>
+      <enumeration value = "RN"><annotation><documentation> language-name = "KURUNDI" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "LN"><annotation><documentation> language-name = "LINGALA" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "SG"><annotation><documentation> language-name = "SANGHO" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>     </enumeration>
+      <enumeration value = "ST"><annotation><documentation> language-name = "SESOTHO" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "TN"><annotation><documentation> language-name = "SETSWANA" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>   </enumeration>
+      <enumeration value = "SN"><annotation><documentation> language-name = "SHONA" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "SS"><annotation><documentation> language-name = "SISWATI" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "SW"><annotation><documentation> language-name = "SWAHILI" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "TS"><annotation><documentation> language-name = "TSONGA" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>     </enumeration>
+      <enumeration value = "TW"><annotation><documentation> language-name = "TWI" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "WO"><annotation><documentation> language-name = "WOLOF" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "XH"><annotation><documentation> language-name = "XHOSA" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "YO"><annotation><documentation> language-name = "YORUBA" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>     </enumeration>
+      <enumeration value = "ZU"><annotation><documentation> language-name = "ZULU" language-family = "NEGRO-AFRICAN"/ </documentation></annotation>     </enumeration>
+      <enumeration value = "FJ"><annotation><documentation> language-name = "FIJI" language-family = "OCEANIC/INDONESIAN"/ </documentation></annotation>    </enumeration>
+      <enumeration value = "ID"><annotation><documentation> language-name = "INDONESIAN" language-family = "OCEANIC/INDONESIAN"/ </documentation></annotation>  </enumeration>
+      <enumeration value = "JV"><annotation><documentation> language-name = "JAVANESE" language-family = "OCEANIC/INDONESIAN"/ </documentation></annotation>  </enumeration>
+      <enumeration value = "MG"><annotation><documentation> language-name = "MALAGASY" language-family = "OCEANIC/INDONESIAN"/ </documentation></annotation>  </enumeration>
+      <enumeration value = "MS"><annotation><documentation> language-name = "MALAY" language-family = "OCEANIC/INDONESIAN"/ </documentation></annotation>   </enumeration>
+      <enumeration value = "MI"><annotation><documentation> language-name = "MAORI" language-family = "OCEANIC/INDONESIAN"/ </documentation></annotation>   </enumeration>
+      <enumeration value = "SM"><annotation><documentation> language-name = "SAMOAN" language-family = "OCEANIC/INDONESIAN"/ </documentation></annotation>    </enumeration>
+      <enumeration value = "SU"><annotation><documentation> language-name = "SUNDANESE" language-family = "OCEANIC/INDONESIAN"/ </documentation></annotation> </enumeration>
+      <enumeration value = "TL"><annotation><documentation> language-name = "TAGALOG" language-family = "OCEANIC/INDONESIAN"/ </documentation></annotation> </enumeration>
+      <enumeration value = "TO"><annotation><documentation> language-name = "TONGA" language-family = "OCEANIC/INDONESIAN"/ </documentation></annotation>   </enumeration>
+      <enumeration value = "CA"><annotation><documentation> language-name = "CATALAN" language-family = "ROMANCE"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "CO"><annotation><documentation> language-name = "CORSICAN" language-family = "ROMANCE"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "FR"><annotation><documentation> language-name = "FRENCH" language-family = "ROMANCE"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "GL"><annotation><documentation> language-name = "GALICIAN" language-family = "ROMANCE"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "IT"><annotation><documentation> language-name = "ITALIAN" language-family = "ROMANCE"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "MO"><annotation><documentation> language-name = "MOLDAVIAN" language-family = "ROMANCE"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "OC"><annotation><documentation> language-name = "OCCITAN" language-family = "ROMANCE"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "PT"><annotation><documentation> language-name = "PORTUGUESE" language-family = "ROMANCE"/ </documentation></annotation>     </enumeration>
+      <enumeration value = "RM"><annotation><documentation> language-name = "RHAETO-ROMANCE" language-family = "ROMANCE"/ </documentation></annotation>   </enumeration>
+      <enumeration value = "RO"><annotation><documentation> language-name = "ROMANIAN" language-family = "ROMANCE"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "ES"><annotation><documentation> language-name = "SPANISH" language-family = "ROMANCE"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "AM"><annotation><documentation> language-name = "AMHARIC" language-family = "SEMITIC"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "AR"><annotation><documentation> language-name = "ARABIC" language-family = "SEMITIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "HE"><annotation><documentation> language-name = "HEBREW" language-family = "SEMITIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "MT"><annotation><documentation> language-name = "MALTESE" language-family = "SEMITIC"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "TI"><annotation><documentation> language-name = "TIGRINYA" language-family = "SEMITIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "BG"><annotation><documentation> language-name = "BULGARIAN" language-family = "SLAVIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "BE"><annotation><documentation> language-name = "BYELORUSSIAN" language-family = "SLAVIC"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "HR"><annotation><documentation> language-name = "CROATIAN" language-family = "SLAVIC"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "CS"><annotation><documentation> language-name = "CZECH" language-family = "SLAVIC"/ </documentation></annotation>         </enumeration>
+      <enumeration value = "MK"><annotation><documentation> language-name = "MACEDONIAN" language-family = "SLAVIC"/ </documentation></annotation>        </enumeration>
+      <enumeration value = "PL"><annotation><documentation> language-name = "POLISH" language-family = "SLAVIC"/ </documentation></annotation>          </enumeration>
+      <enumeration value = "RU"><annotation><documentation> language-name = "RUSSIAN" language-family = "SLAVIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "SR"><annotation><documentation> language-name = "SERBIAN" language-family = "SLAVIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "SH"><annotation><documentation> language-name = "SERBO-CROATIAN" language-family = "SLAVIC"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "SK"><annotation><documentation> language-name = "SLOVAK" language-family = "SLAVIC"/ </documentation></annotation>          </enumeration>
+      <enumeration value = "SL"><annotation><documentation> language-name = "SLOVENIAN" language-family = "SLAVIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "UK"><annotation><documentation> language-name = "UKRAINIAN" language-family = "SLAVIC"/ </documentation></annotation>       </enumeration>
+      <enumeration value = "AZ"><annotation><documentation> language-name = "AZERBAIJANI" language-family = "TURKIC/ALTAIC"/ </documentation></annotation>    </enumeration>
+      <enumeration value = "BA"><annotation><documentation> language-name = "BASHKIR" language-family = "TURKIC/ALTAIC"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "KK"><annotation><documentation> language-name = "KAZAKH" language-family = "TURKIC/ALTAIC"/ </documentation></annotation>     </enumeration>
+      <enumeration value = "KY"><annotation><documentation> language-name = "KIRGHIZ" language-family = "TURKIC/ALTAIC"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "TT"><annotation><documentation> language-name = "TATAR" language-family = "TURKIC/ALTAIC"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "TR"><annotation><documentation> language-name = "TURKISH" language-family = "TURKIC/ALTAIC"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "TK"><annotation><documentation> language-name = "TURKMEN" language-family = "TURKIC/ALTAIC"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "UZ"><annotation><documentation> language-name = "UZBEK" language-family = "TURKIC/ALTAIC"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "BI"><annotation><documentation> language-name = "BISLAMA" language-family = "[not-given]"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "MN"><annotation><documentation> language-name = "MONGOLIAN" language-family = "[not-given]"/ </documentation></annotation>      </enumeration>
+      <enumeration value = "NA"><annotation><documentation> language-name = "NAURU" language-family = "[not-given]"/ </documentation></annotation>        </enumeration>
+    </restriction>
+  </simpleType>
+  <simpleType name = "always_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "always"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "auto_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "baseline_base_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "baseline"/>
+      <enumeration value = "sub"/>
+      <enumeration value = "super"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "caption_side_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "before"/>
+      <enumeration value = "after"/>
+      <enumeration value = "start"/>
+      <enumeration value = "end"/>
+      <enumeration value = "top"/>
+      <enumeration value = "bottom"/>
+      <enumeration value = "left"/>
+      <enumeration value = "right"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "display_align_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "before"/>
+      <enumeration value = "center"/>
+      <enumeration value = "after"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "float_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "inherit"/>
+      <enumeration value = "before"/>
+      <enumeration value = "start"/>
+      <enumeration value = "end"/>
+      <enumeration value = "left"/>
+      <enumeration value = "right"/>
+      <enumeration value = "none"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "blank_or_not_blank_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "blank"/>
+      <enumeration value = "not-blank"/>
+      <enumeration value = "any"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "text_transform_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "capitalize"/>
+      <enumeration value = "uppercase"/>
+      <enumeration value = "lowercase"/>
+      <enumeration value = "none"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "border_collapse_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "collapse"/>
+      <enumeration value = "separate"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "line_height_shift_adjustment_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "consider-shifts"/>
+      <enumeration value = "disregard-shifts"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "white_space_collapse_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "false"/>
+      <enumeration value = "true"/>
+      <enumeration value = "inherit">
+        <annotation>
+          <documentation>
+            <fop_fail>Unknown enumerated value</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+  <simpleType name = "retrieve_position_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "first-starting-within-page"/>
+      <enumeration value = "first-including-carryover"/>
+      <enumeration value = "last-starting-within-page"/>
+      <enumeration value = "last-ending-within-page"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "page_position_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "first"/>
+      <enumeration value = "last"/>
+      <enumeration value = "rest"/>
+      <enumeration value = "any"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "force_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "force"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "white_space_treatment_Type">
+    <annotation>
+      <documentation>
+        <fop_fail>property ignored</fop_fail>
+      </documentation>
+    </annotation>
+    <restriction base = "NMTOKEN">
+      <enumeration value = "ignore"/>
+      <enumeration value = "preserve"/>
+      <enumeration value = "ignore-if-before-linefeed"/>
+      <enumeration value = "ignore-if-after-linefeed"/>
+      <enumeration value = "ignore-if-surrounding-linefeed"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "linefeed_treatment_Type">
+    <annotation>
+      <documentation>
+        <fop_fail>property is not implemented yet</fop_fail>
+      </documentation>
+    </annotation>
+    <restriction base = "NMTOKEN">
+      <enumeration value = "ignore"/>
+      <enumeration value = "preserve"/>
+      <enumeration value = "treat-as-space"/>
+      <enumeration value = "treat-as-zero-width-space"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "inherit_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "horizontal_position_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "left"/>
+      <enumeration value = "center"/>
+      <enumeration value = "right"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "line_stacking_strategy_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "line-height"/>
+      <enumeration value = "font-height"/>
+      <enumeration value = "max-height"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "active_state_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "link"/>
+      <enumeration value = "visited"/>
+      <enumeration value = "active"/>
+      <enumeration value = "hover"/>
+      <enumeration value = "focus"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "writing_mode_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "lr-tb"/>
+      <enumeration value = "rl-tb"/>
+      <enumeration value = "tb-rl"/>
+      <enumeration value = "lr"/>
+      <enumeration value = "rl"/>
+      <enumeration value = "tb"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "direction_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "ltr"/>
+      <enumeration value = "rtl"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "wrap_option_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "no-wrap"/>
+      <enumeration value = "wrap"/>
+      <enumeration value = "inherit">
+        <annotation>
+          <documentation>
+            <fop_fail>Unknown enumerated value</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+  <simpleType name = "span_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "none"/>
+      <enumeration value = "all"/>
+      <enumeration value = "inherit">
+        <annotation>
+          <documentation>
+            <fop_fail>Unknown enumerated value</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+  <simpleType name = "rule_style_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "none"/>
+      <enumeration value = "dotted"/>
+      <enumeration value = "dashed"/>
+      <enumeration value = "solid"/>
+      <enumeration value = "double"/>
+      <enumeration value = "groove"/>
+      <enumeration value = "ridge"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "border_style_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "inherit">
+        <annotation>
+          <documentation>
+            <fop_fail>Unknown enumerated value</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "none"/>
+      <enumeration value = "hidden"/>
+      <enumeration value = "dotted"/>
+      <enumeration value = "dashed"/>
+      <enumeration value = "solid"/>
+      <enumeration value = "double"/>
+      <enumeration value = "groove"/>
+      <enumeration value = "ridge"/>
+      <enumeration value = "inset"/>
+      <enumeration value = "outset"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "leader_alignment_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "none"/>
+      <enumeration value = "reference-area"/>
+      <enumeration value = "page"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "text_decoration_Type">
+    <annotation>
+      <documentation>
+        <fop_result>not implemented</fop_result>
+      </documentation>
+    </annotation>
+    <restriction base = "NMTOKEN">
+      <enumeration value = "none"/>
+      <enumeration value = "underline"/>
+      <enumeration value = "no-underline"/>
+      <enumeration value = "overline"/>
+      <enumeration value = "no-overline"/>
+      <enumeration value = "line-through"/>
+      <enumeration value = "no-line-through"/>
+      <enumeration value = "blink"/>
+      <enumeration value = "no-blink"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "unicode_bidi_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "normal"/>
+      <enumeration value = "embed"/>
+      <enumeration value = "bidi-override"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "odd_or_even_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "odd"/>
+      <enumeration value = "even"/>
+      <enumeration value = "any"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "once_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "once"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "retrieve_boundary_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "page"/>
+      <enumeration value = "page-sequence"/>
+      <enumeration value = "document"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "starting_state_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "show"/>
+      <enumeration value = "hide"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "leader_pattern_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "space"/>
+      <enumeration value = "rule"/>
+      <enumeration value = "dots"/>
+      <enumeration value = "use-content"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "text_align_last_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "start"/>
+      <enumeration value = "center"/>
+      <enumeration value = "end"/>
+      <enumeration value = "justify"/>
+      <enumeration value = "inside">
+        <annotation>
+          <documentation>
+            <fop_fail>Unknown enumerated value</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "outside">
+        <annotation>
+          <documentation>
+            <fop_fail>Unknown enumerated value</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "left">
+        <annotation>
+          <documentation>
+            <fop_fail>Unknown enumerated value</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "right">
+        <annotation>
+          <documentation>
+            <fop_fail>Unknown enumerated value</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "inherit">
+        <annotation>
+          <documentation>
+            <fop_fail>Unknown enumerated value</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+  <simpleType name = "text_align_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "start"/>
+      <enumeration value = "center"/>
+      <enumeration value = "end"/>
+      <enumeration value = "justify"/>
+      <enumeration value = "inside">
+        <annotation>
+          <documentation>
+            <fop_fail>Unknown enumerated value</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "outside">
+        <annotation>
+          <documentation>
+            <fop_fail>Unknown enumerated value</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+      <enumeration value = "left"/>
+      <enumeration value = "right"/>
+      <enumeration value = "inherit">
+        <annotation>
+          <documentation>
+            <fop_fail>Unknown enumerated value</fop_fail>
+          </documentation>
+        </annotation>
+      </enumeration>
+    </restriction>
+  </simpleType>
+  <simpleType name = "width_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "thin"/>
+      <enumeration value = "medium"/>
+      <enumeration value = "thick"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "vertical_position_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "top"/>
+      <enumeration value = "center"/>
+      <enumeration value = "bottom"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "auto_restore_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "true"/>
+      <enumeration value = "false"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "table_omit_footer_at_break_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "true"/>
+      <enumeration value = "false"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "table_omit_header_at_break_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "true"/>
+      <enumeration value = "false"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "precedence_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "true"/>
+      <enumeration value = "false"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "score_spaces_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "true"/>
+      <enumeration value = "false"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "scaling_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "uniform"/>
+      <enumeration value = "non-uniform"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "use_font_metrics_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "use-font-metrics"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "background_image_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "uri-specification"/>
+      <enumeration value = "none"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "hyphenation_keep_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "column"/>
+      <enumeration value = "page"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "no_limit_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "no-limit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "visibility_Type">
+    <annotation>
+      <documentation>
+        <fop_fail>property is not implemented yet</fop_fail>
+      </documentation>
+    </annotation>
+    <restriction base = "NMTOKEN">
+      <enumeration value = "visible"/>
+      <enumeration value = "hidden"/>
+      <enumeration value = "collapse"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "overflow_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "visible"/>
+      <enumeration value = "hidden"/>
+      <enumeration value = "scroll"/>
+      <enumeration value = "error-if-overflow"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "transparent_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "transparent"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "none_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "none"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "absolute_position_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "absolute"/>
+      <enumeration value = "fixed"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "azimuth_base_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "left-side"/>
+      <enumeration value = "far-left"/>
+      <enumeration value = "left"/>
+      <enumeration value = "center-left"/>
+      <enumeration value = "center"/>
+      <enumeration value = "center-right"/>
+      <enumeration value = "right"/>
+      <enumeration value = "far-right"/>
+      <enumeration value = "right-side"/>
+      <enumeration value = "behind"/>
+      <enumeration value = "leftwards"/>
+      <enumeration value = "rightwards"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "azimuth_Type">
+    <union memberTypes = "fo:angle_Type fo:azimuth_base_Type"/>
+  </simpleType>
+  <simpleType name = "elevation_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "below"/>
+      <enumeration value = "level"/>
+      <enumeration value = "above"/>
+      <enumeration value = "higher"/>
+      <enumeration value = "lower"/>
+      <enumeration value = "0"/>
+      <enumeration value = "90"/>
+      <enumeration value = "180"/>
+      <enumeration value = "270"/>
+      <enumeration value = "0deg"/>
+      <enumeration value = "90deg"/>
+      <enumeration value = "180deg"/>
+      <enumeration value = "270deg"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "font_selection_strategy_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "auto"/>
+      <enumeration value = "character-by-character"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "font_stretch_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "normal"/>
+      <enumeration value = "wider"/>
+      <enumeration value = "narrower"/>
+      <enumeration value = "ultra-condensed"/>
+      <enumeration value = "extra-condensed"/>
+      <enumeration value = "condensed"/>
+      <enumeration value = "semi-condensed"/>
+      <enumeration value = "semi-expanded"/>
+      <enumeration value = "expanded"/>
+      <enumeration value = "extra-expanded"/>
+      <enumeration value = "ultra-expanded"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "clear_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "start"/>
+      <enumeration value = "end"/>
+      <enumeration value = "left"/>
+      <enumeration value = "right"/>
+      <enumeration value = "both"/>
+      <enumeration value = "none"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "color_Name_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "aliceblue"/>
+      <enumeration value = "antiquewhite"/>
+      <enumeration value = "aqua"/>
+      <enumeration value = "aquamarine"/>
+      <enumeration value = "azure"/>
+      <enumeration value = "beige"/>
+      <enumeration value = "bisque"/>
+      <enumeration value = "black"/>
+      <enumeration value = "blanchedalmond"/>
+      <enumeration value = "blue"/>
+      <enumeration value = "blueviolet"/>
+      <enumeration value = "brown"/>
+      <enumeration value = "burlywood"/>
+      <enumeration value = "cadetblue"/>
+      <enumeration value = "chartreuse"/>
+      <enumeration value = "chocolate"/>
+      <enumeration value = "coral"/>
+      <enumeration value = "cornflowerblue"/>
+      <enumeration value = "cornsilk"/>
+      <enumeration value = "crimson"/>
+      <enumeration value = "cyan"/>
+      <enumeration value = "darkblue"/>
+      <enumeration value = "darkcyan"/>
+      <enumeration value = "darkgoldenrod"/>
+      <enumeration value = "darkgray"/>
+      <enumeration value = "darkgreen"/>
+      <enumeration value = "darkgrey"/>
+      <enumeration value = "darkkhaki"/>
+      <enumeration value = "darkmagenta"/>
+      <enumeration value = "darkolivegreen"/>
+      <enumeration value = "darkorange"/>
+      <enumeration value = "darkorchid"/>
+      <enumeration value = "darkred"/>
+      <enumeration value = "darksalmon"/>
+      <enumeration value = "darkseagreen"/>
+      <enumeration value = "darkslateblue"/>
+      <enumeration value = "darkslategray"/>
+      <enumeration value = "darkslategrey"/>
+      <enumeration value = "darkturquoise"/>
+      <enumeration value = "darkviolet"/>
+      <enumeration value = "deeppink"/>
+      <enumeration value = "deepskyblue"/>
+      <enumeration value = "dimgray"/>
+      <enumeration value = "dimgrey"/>
+      <enumeration value = "dodgerblue"/>
+      <enumeration value = "firebrick"/>
+      <enumeration value = "floralwhite"/>
+      <enumeration value = "forestgreen"/>
+      <enumeration value = "fuchsia"/>
+      <enumeration value = "gainsboro"/>
+      <enumeration value = "lightpink"/>
+      <enumeration value = "lightsalmon"/>
+      <enumeration value = "lightseagreen"/>
+      <enumeration value = "lightskyblue"/>
+      <enumeration value = "lightslategray"/>
+      <enumeration value = "lightslategrey"/>
+      <enumeration value = "lightsteelblue"/>
+      <enumeration value = "lightyellow"/>
+      <enumeration value = "lime"/>
+      <enumeration value = "limegreen"/>
+      <enumeration value = "linen"/>
+      <enumeration value = "magenta"/>
+      <enumeration value = "maroon"/>
+      <enumeration value = "mediumaquamarine"/>
+      <enumeration value = "mediumblue"/>
+      <enumeration value = "mediumorchid"/>
+      <enumeration value = "mediumpurple"/>
+      <enumeration value = "mediumseagreen"/>
+      <enumeration value = "mediumslateblue"/>
+      <enumeration value = "mediumspringgreen"/>
+      <enumeration value = "mediumturquoise"/>
+      <enumeration value = "mediumvioletred"/>
+      <enumeration value = "midnightblue"/>
+      <enumeration value = "mintcream"/>
+      <enumeration value = "mistyrose"/>
+      <enumeration value = "moccasin"/>
+      <enumeration value = "navajowhite"/>
+      <enumeration value = "navy"/>
+      <enumeration value = "oldlace"/>
+      <enumeration value = "olive"/>
+      <enumeration value = "olivedrab"/>
+      <enumeration value = "orange"/>
+      <enumeration value = "orangered"/>
+      <enumeration value = "orchid"/>
+      <enumeration value = "palegoldenrod"/>
+      <enumeration value = "palegreen"/>
+      <enumeration value = "paleturquoise"/>
+      <enumeration value = "palevioletred"/>
+      <enumeration value = "papayawhip"/>
+      <enumeration value = "peachpuff"/>
+      <enumeration value = "peru"/>
+      <enumeration value = "pink"/>
+      <enumeration value = "plum"/>
+      <enumeration value = "powderblue"/>
+      <enumeration value = "purple"/>
+      <enumeration value = "red"/>
+      <enumeration value = "rosybrown"/>
+      <enumeration value = "royalblue"/>
+      <enumeration value = "saddlebrown"/>
+      <enumeration value = "salmon"/>
+      <enumeration value = "ghostwhite"/>
+      <enumeration value = "gold"/>
+      <enumeration value = "goldenrod"/>
+      <enumeration value = "gray"/>
+      <enumeration value = "grey"/>
+      <enumeration value = "green"/>
+      <enumeration value = "greenyellow"/>
+      <enumeration value = "honeydew"/>
+      <enumeration value = "hotpink"/>
+      <enumeration value = "indianred"/>
+      <enumeration value = "indigo"/>
+      <enumeration value = "ivory"/>
+      <enumeration value = "khaki"/>
+      <enumeration value = "lavender"/>
+      <enumeration value = "lavenderblush"/>
+      <enumeration value = "lawngreen"/>
+      <enumeration value = "lemonchiffon"/>
+      <enumeration value = "lightblue"/>
+      <enumeration value = "lightcoral"/>
+      <enumeration value = "lightcyan"/>
+      <enumeration value = "lightgoldenrodyellow"/>
+      <enumeration value = "lightgray"/>
+      <enumeration value = "lightgreen"/>
+      <enumeration value = "lightgrey"/>
+      <enumeration value = "sandybrown"/>
+      <enumeration value = "seagreen"/>
+      <enumeration value = "seashell"/>
+      <enumeration value = "sienna"/>
+      <enumeration value = "silver"/>
+      <enumeration value = "skyblue"/>
+      <enumeration value = "slateblue"/>
+      <enumeration value = "slategray"/>
+      <enumeration value = "slategrey"/>
+      <enumeration value = "snow"/>
+      <enumeration value = "springgreen"/>
+      <enumeration value = "steelblue"/>
+      <enumeration value = "tan"/>
+      <enumeration value = "teal"/>
+      <enumeration value = "thistle"/>
+      <enumeration value = "tomato"/>
+      <enumeration value = "turquoise"/>
+      <enumeration value = "violet"/>
+      <enumeration value = "wheat"/>
+      <enumeration value = "white"/>
+      <enumeration value = "whitesmoke"/>
+      <enumeration value = "yellow"/>
+      <enumeration value = "yellowgreen"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "color_Hex_Type">
+    <restriction base = "string">
+      <pattern value = "#[0-9A-F]{6}"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "background_color_Type">
+    <union memberTypes = "fo:color_Hex_Type fo:color_Name_Type fo:inherit_Type fo:transparent_Type"/>
+  </simpleType>
+  <simpleType name = "relative_position_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "static"/>
+      <enumeration value = "relative"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "speak_header_Type">
+    <restriction base = "NMTOKEN">
+      <enumeration value = "once"/>
+      <enumeration value = "always"/>
+      <enumeration value = "inherit"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "border_Type">
+    <annotation>
+      <documentation>
+        "fo:width_Type fo:border_style_Type fo:color_Type"
+        <enumeration value="solid 4px yellow"/>
+        <enumeration value="solid 2px green"/>
+        <enumeration value="solid 1px blue"/>
+        <enumeration value="solid 1px silver"/>
+      </documentation>
+    </annotation>
+    <restriction base = "string">
+      <pattern value = "(none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset) \+?\d+\.?\d*(px|pt|mm|cm|in|em|%) (#[0-9A-F]{6}|[a-z]{3,16})"/>
+    </restriction>
+  </simpleType>
+  <simpleType name = "font_size_Type">
+    <union memberTypes = "fo:absolute_size_Type fo:relative_size_Type fo:length_Type fo:percentage_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "alignment_baseline_Type">
+    <union memberTypes = "fo:auto_Type fo:alignment_Type fo:box_alignment_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "alignment_adjust_Type">
+    <union memberTypes = "fo:auto_Type fo:alignment_Type fo:percentage_Type fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "z_index_Type">
+    <union memberTypes = "fo:auto_Type fo:integer_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "margin_width_Type">
+    <union memberTypes = "fo:auto_Type fo:length_Type fo:percentage_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "block_progression_dimension_optimum_Type">
+    <union memberTypes = "fo:auto_Type fo:length_Type"/>
+  </simpleType>
+  <simpleType name = "block_progression_dimension_maximum_Type">
+    <union memberTypes = "fo:auto_Type fo:length_Type"/>
+  </simpleType>
+  <simpleType name = "inline_progression_dimension_maximum_Type">
+    <union memberTypes = "fo:auto_Type fo:length_Type"/>
+  </simpleType>
+  <simpleType name = "inline_progression_dimension_optimum_Type">
+    <union memberTypes = "fo:auto_Type fo:length_Type"/>
+  </simpleType>
+  <simpleType name = "baseline_shift_Type">
+    <union memberTypes = "fo:baseline_base_Type fo:percentage_Type fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "space_start_precedence_Type">
+    <union memberTypes = "fo:integer_Type fo:force_Type"/>
+  </simpleType>
+  <simpleType name = "space_end_precedence_Type">
+    <union memberTypes = "fo:integer_Type fo:force_Type"/>
+  </simpleType>
+  <simpleType name = "space_after_precedence_Type">
+    <union memberTypes = "fo:integer_Type fo:force_Type"/>
+  </simpleType>
+  <simpleType name = "space_before_precedence_Type">
+    <union memberTypes = "fo:integer_Type fo:force_Type"/>
+  </simpleType>
+  <simpleType name = "widows_Type">
+    <union memberTypes = "fo:integer_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "orphans_Type">
+    <union memberTypes = "fo:integer_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "space_start_maximum_Type">
+    <union memberTypes = "fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "space_start_minimum_Type">
+    <union memberTypes = "fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "space_end_minimum_Type">
+    <union memberTypes = "fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "space_end_optimum_Type">
+    <union memberTypes = "fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "space_before_minimum_Type">
+    <union memberTypes = "fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "space_after_maximum_Type">
+    <union memberTypes = "fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "space_start_optimum_Type">
+    <union memberTypes = "fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "space_end_maximum_Type">
+    <union memberTypes = "fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "space_before_optimum_Type">
+    <union memberTypes = "fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "space_before_maximum_Type">
+    <union memberTypes = "fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "space_after_optimum_Type">
+    <union memberTypes = "fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "space_after_minimum_Type">
+    <union memberTypes = "fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "left_Type">
+    <union memberTypes = "fo:length_Type fo:percentage_Type fo:auto_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "bottom_Type">
+    <union memberTypes = "fo:length_Type fo:percentage_Type fo:auto_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "right_Type">
+    <union memberTypes = "fo:length_Type fo:percentage_Type fo:auto_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "top_Type">
+    <union memberTypes = "fo:length_Type fo:percentage_Type fo:auto_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "start_indent_Type">
+    <union memberTypes = "fo:length_Type fo:percentage_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "last_line_end_indent_Type">
+    <union memberTypes = "fo:length_Type fo:percentage_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "provisional_distance_between_starts_Type">
+    <union memberTypes = "fo:length_Type fo:percentage_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "end_indent_Type">
+    <union memberTypes = "fo:length_Type fo:percentage_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "extent_Type">
+    <union memberTypes = "fo:length_Type fo:percentage_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "provisional_label_separation_Type">
+    <union memberTypes = "fo:length_Type fo:percentage_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "length_percentage_Type">
+    <union memberTypes = "fo:length_Type fo:percentage_Type"/>
+  </simpleType>
+  <simpleType name = "hyphenation_ladder_count_Type">
+    <union memberTypes = "fo:no_limit_Type fo:integer_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "background_position_horizontal_Type">
+    <union memberTypes = "fo:percentage_Type fo:length_Type fo:horizontal_position_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "background_position_vertical_Type">
+    <union memberTypes = "fo:percentage_Type fo:length_Type fo:vertical_position_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "leader_pattern_width_Type">
+    <union memberTypes = "fo:use_font_metrics_Type fo:length_Type fo:percentage_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "text_altitude_Type">
+    <union memberTypes = "fo:use_font_metrics_Type fo:length_Type fo:percentage_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "text_depth_Type">
+    <union memberTypes = "fo:use_font_metrics_Type fo:length_Type fo:percentage_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "border_before_width_Type">
+    <union memberTypes = "fo:width_Type fo:length_Type fo:length_conditional_Type fo:inherit_Type"/>
+  </simpleType>
+  <simpleType name = "border_top_width_Type">
+    <union memberTypes = "fo:width_Type fo:length_Type fo:inherit_Type"/>
+  </simpleType>
+  
+  <annotation>
+    <documentation>
+      Element definitions 
+    </documentation>
+  </annotation>
+  
+  <element name = "root">
+    <complexType>
+      <sequence>
+        <element ref = "fo:layout-master-set"/>
+        <element ref = "fo:declarations" minOccurs = "0"/>
+        <element ref = "fo:page-sequence" maxOccurs = "unbounded"/>
+      </sequence>
+      <attribute name = "media-usage" type = "fo:media_usage_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "declarations">
+    <complexType>
+      <sequence>
+        <element ref = "fo:color-profile" maxOccurs = "unbounded"/>
+        <any minOccurs = "0" maxOccurs = "unbounded" namespace = "##other" processContents = "skip"/>
+      </sequence>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "color-profile">
+    <complexType>
+      <attribute name = "src" type = "xs:string" use = "required"/>
+      <attribute name = "color-profile-name" type = "xs:string" use = "required"/>
+      <attribute name = "rendering-intent" type = "fo:rendering_intent_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "layout-master-set">
+    <complexType>
+      <choice maxOccurs = "unbounded">
+        <element ref = "fo:simple-page-master"/>
+        <element ref = "fo:page-sequence-master"/>
+      </choice>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "page-sequence-master">
+    <complexType>
+      <choice maxOccurs = "unbounded">
+        <element ref = "fo:single-page-master-reference"/>
+        <element ref = "fo:repeatable-page-master-reference"/>
+        <element ref = "fo:repeatable-page-master-alternatives"/>
+      </choice>
+      <attribute name = "master-name" type = "xs:string" use = "required"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "single-page-master-reference">
+    <complexType>
+      <attribute name = "master-reference" type = "xs:string" use = "required"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "repeatable-page-master-reference">
+    <complexType>
+      <attribute name = "master-reference" type = "xs:string" use = "required"/>
+      <attribute name = "maximum-repeats" type = "fo:integer_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "repeatable-page-master-alternatives">
+    <complexType>
+      <sequence>
+        <element ref = "fo:conditional-page-master-reference" maxOccurs = "unbounded"/>
+      </sequence>
+      <attribute name = "maximum-repeats" type = "fo:integer_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "conditional-page-master-reference">
+    <complexType>
+      <attribute name = "master-reference" type = "xs:string" use = "required"/>
+      <attribute name = "page-position" type = "fo:page_position_Type"/>
+      <attribute name = "odd-or-even" type = "fo:odd_or_even_Type"/>
+      <attribute name = "blank-or-not-blank" type = "fo:blank_or_not_blank_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "simple-page-master">
+    <complexType>
+      <sequence>
+        <element ref = "fo:region-body"/>
+        <element ref = "fo:region-before" minOccurs = "0"/>
+        <element ref = "fo:region-after" minOccurs = "0"/>
+        <element ref = "fo:region-start" minOccurs = "0"/>
+        <element ref = "fo:region-end" minOccurs = "0"/>
+      </sequence>
+      <attributeGroup ref = "fo:Margin_Properties_Block_List"/>
+      <attribute name = "master-name" type = "xs:string" use = "required"/>
+      <attribute name = "page-height" type = "fo:length_Type"/>
+      <attribute name = "page-width" type = "fo:length_Type"/>
+      <attributeGroup ref = "fo:reference_Properties_List"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "region-body">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable <attribute name = "display-align" type = "fo:display_align_Type"/> 
+        </documentation>
+      </annotation>
+      <attributeGroup ref = "fo:Margin_Properties_Block_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:clip_Properties_List"/>
+      <attribute name = "column-count" type = "fo:integer_Type"/>
+      <attribute name = "column-gap" type = "fo:length_Type"/>
+      <attribute name = "overflow" type = "fo:overflow_Type"/>
+      <attribute name = "region-name" type = "xs:string"/>
+      <attributeGroup ref = "fo:reference_Properties_List"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "region-before">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable <attribute name = "display-align" type = "fo:display_align_Type"/> 
+        </documentation>
+      </annotation>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:clip_Properties_List"/>
+      <attribute name = "extent" type = "fo:extent_Type"/>
+      <attribute name = "overflow" type = "fo:overflow_Type"/>
+      <attribute name = "precedence" type = "fo:precedence_Type"/>
+      <attribute name = "region-name" type = "xs:string"/>
+      <attributeGroup ref = "fo:reference_Properties_List"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "region-after">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable <attribute name = "display-align" type = "fo:display_align_Type"/> 
+        </documentation>
+      </annotation>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:clip_Properties_List"/>
+      <attribute name = "extent" type = "fo:extent_Type"/>
+      <attribute name = "overflow" type = "fo:overflow_Type"/>
+      <attribute name = "precedence" type = "fo:precedence_Type"/>
+      <attribute name = "region-name" type = "xs:string"/>
+      <attributeGroup ref = "fo:reference_Properties_List"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "region-start">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable <attribute name = "display-align" type = "fo:display_align_Type"/> 
+        </documentation>
+      </annotation>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:clip_Properties_List"/>
+      <attribute name = "extent" type = "fo:extent_Type"/>
+      <attribute name = "overflow" type = "fo:overflow_Type"/>
+      <attribute name = "precedence" type = "fo:precedence_Type"/>
+      <attribute name = "region-name" type = "xs:string"/>
+      <attributeGroup ref = "fo:reference_Properties_List"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "region-end">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable <attribute name = "display-align" type = "fo:display_align_Type"/> 
+        </documentation>
+      </annotation>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:clip_Properties_List"/>
+      <attribute name = "extent" type = "fo:extent_Type"/>
+      <attribute name = "overflow" type = "fo:overflow_Type"/>
+      <attribute name = "precedence" type = "fo:precedence_Type"/>
+      <attribute name = "region-name" type = "xs:string"/>
+      <attributeGroup ref = "fo:reference_Properties_List"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "page-sequence">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable 
+          <attribute name = "country" type = "fo:country_Type"/> 
+          <attribute name = "language" type = "fo:language_Type"/>
+        </documentation>
+      </annotation>
+      <sequence>
+        <element ref = "fo:title" minOccurs = "0"/>
+        <element ref = "fo:static-content" minOccurs = "0" maxOccurs = "unbounded"/>
+        <element ref = "fo:flow"/>
+      </sequence>
+      <attribute name = "id" type = "xs:string"/>
+      <attribute name = "master-reference" type = "xs:string" use = "required"/>
+      <attribute name = "initial-page-number" type = "fo:integer_Type"/>
+      <attribute name = "force-page-count" type = "fo:force_page_count_Type"/>
+      <attribute name = "format" type = "xs:string"/>
+      <attribute name = "letter-value" type = "fo:letter_value_Type"/>
+      <attribute name = "grouping-separator" type = "fo:character_Type"/>
+      <attribute name = "grouping-size" type = "fo:integer_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "title">
+    <complexType mixed = "true">
+      <annotation>
+        <documentation>
+          Inheritable 
+          <attribute name = "color" type = "fo:color_Type"/>
+          <attribute name = "line-height" type = "fo:line_height_Type"/>
+          <attribute name = "visibility" type = "fo:visibility_Type"/>
+        </documentation>
+      </annotation>
+      <choice minOccurs = "0" maxOccurs = "unbounded">
+        <group ref = "fo:inline_List"/>
+        <group ref = "fo:neutral_List"/>
+      </choice>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Font_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Inline_List"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "static-content">
+    <complexType>
+      <choice maxOccurs = "unbounded">
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attribute name = "flow-name" type = "xs:string" use = "required"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "flow">
+    <complexType>
+      <choice maxOccurs = "unbounded">
+        <group ref = "fo:marker_List"/>
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attribute name = "flow-name" type = "xs:string" use = "required"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "block">
+    <complexType mixed = "true">
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "color" type = "fo:color_Type"/>
+          <attribute name = "last-line-end-indent" type = "fo:last_line_end_indent_Type"/>
+          <attribute name = "linefeed-treatment" type = "fo:linefeed_treatment_Type"/>
+          <attribute name = "line-height" type = "fo:line_height_Type"/>
+          <attribute name = "orphans" type = "fo:orphans_Type"/>
+          <attribute name = "white-space-treatment" type = "fo:white_space_treatment_Type"/>
+          <attribute name = "text-align" type = "fo:text_align_Type"/>
+          <attribute name = "text-align-last" type = "fo:text_align_last_Type"/>
+          <attribute name = "text-indent" type = "fo:length_percentage_Type"/>
+          <attribute name = "visibility" type = "fo:visibility_Type"/>
+          <attribute name = "white-space-collapse" type = "fo:white_space_collapse_Type"/>
+          <attribute name = "widows" type = "fo:widows_Type"/>
+          <attribute name = "wrap-option" type = "fo:wrap_option_Type"/>
+        </documentation>
+      </annotation>
+      <choice minOccurs = "0" maxOccurs = "unbounded">
+        <group ref = "fo:marker_List"/>
+        <group ref = "fo:initial_property_set_List"/>
+        <group ref = "fo:inline_List"/>
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attributeGroup ref = "fo:block_properties"/>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Font_Properties_List"/>
+      <attributeGroup ref = "fo:Hyphenation_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Block_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attributeGroup ref = "fo:break_Properties_List"/>
+      <attributeGroup ref = "fo:text_one_Properties_List"/>
+      <attributeGroup ref = "fo:block_hyphenation_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:intrusion_displace_Properties_List"/>
+      <attributeGroup ref = "fo:keep_Properties_List"/>
+      <attributeGroup ref = "fo:line_height_Properties_List"/>
+      <attribute name = "span" type = "fo:span_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "block-container">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable <attribute name = "display-align" type = "fo:display_align_Type"/> 
+        </documentation>
+      </annotation>
+      <choice maxOccurs = "unbounded">
+        <group ref = "fo:marker_List"/>
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attributeGroup ref = "fo:block_properties"/>
+      <attributeGroup ref = "fo:Absolute_Position_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Block_List"/>
+      <attributeGroup ref = "fo:progression_Properties_List"/>
+      <attributeGroup ref = "fo:break_Properties_List"/>
+      <attributeGroup ref = "fo:clip_Properties_List"/>
+      <attribute name = "height" type = "fo:height_Type"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:intrusion_displace_Properties_List"/>
+      <attributeGroup ref = "fo:keep_Properties_List"/>
+      <attribute name = "overflow" type = "fo:overflow_Type"/>
+      <attributeGroup ref = "fo:reference_Properties_List"/>
+      <attribute name = "span" type = "fo:span_Type"/>
+      <attribute name = "width" type = "fo:height_Type"/>
+      <attribute name = "z-index" type = "fo:z_index_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "bidi-override">
+    <complexType mixed = "true">
+      <annotation>
+        <documentation>
+          Inheritable 
+          <attribute name = "color" type = "fo:color_Type"/> 
+          <attribute name = "direction" type = "fo:direction_Type"/> 
+          <attribute name = "letter-spacing" type = "fo:letter_spacing_Type"/>
+          <attribute name = "line-height" type = "fo:line_height_Type"/> 
+          <attribute name = "score-spaces" type = "fo:score_spaces_Type"/> 
+          <attribute name = "word-spacing" type = "fo:letter_spacing_Type"/> 
+        </documentation>
+      </annotation>
+      <choice minOccurs = "0" maxOccurs = "unbounded">
+        <group ref = "fo:marker_List"/>
+        <group ref = "fo:inline_List"/>
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Font_Properties_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attribute name = "unicode-bidi" type = "fo:unicode_bidi_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attribute name = "vertical-align" type = "fo:vertical_align_Type"/>
+    </complexType>
+  </element>
+  <element name = "character">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "color" type = "fo:color_Type"/> 
+          <attribute name = "glyph-orientation-horizontal" type = "fo:orientation_Type"/> 
+          <attribute name = "glyph-orientation-vertical" type = "fo:orientation_Type"/> 
+          <attribute name = "letter-spacing" type = "fo:letter_spacing_Type"/> 
+          <attribute name = "line-height" type = "fo:line_height_Type"/> 
+          <attribute name = "score-spaces" type = "fo:score_spaces_Type"/> 
+          <attribute name = "text-transform" type = "fo:text_transform_Type"/> 
+          <attribute name = "visibility" type = "fo:visibility_Type"/> 
+          <attribute name = "word-spacing" type = "fo:letter_spacing_Type"/>
+        </documentation>
+      </annotation>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Font_Properties_List"/>
+      <attributeGroup ref = "fo:Hyphenation_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Inline_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "alignment-adjust" type = "fo:alignment_adjust_Type"/>
+      <attribute name = "treat-as-word-space" type = "fo:treat_as_word_space_Type"/>
+      <attribute name = "alignment-baseline" type = "fo:alignment_baseline_Type"/>
+      <attribute name = "baseline-shift" type = "fo:baseline_shift_Type"/>
+      <attribute name = "character" type = "fo:character_Type"/>
+      <attribute name = "dominant-baseline" type = "fo:dominant_baseline_Type"/>
+      <attributeGroup ref = "fo:text_one_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attribute name = "keep-with-next" type = "fo:keep_integer_Type"/>
+      <attribute name = "keep-with-previous" type = "fo:keep_integer_Type"/>
+      <attribute name = "suppress-at-line-break" type = "fo:suppress_at_line_break_Type"/>
+      <attribute name = "text-decoration" type = "fo:text_decoration_Type"/>
+      <attribute name = "text-shadow" type = "fo:text_shadow_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attribute name = "vertical-align" type = "fo:vertical_align_Type"/>
+    </complexType>
+  </element>
+  <element name = "initial-property-set">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "color" type = "fo:color_Type"/> 
+          <attribute name = "letter-spacing" type = "fo:letter_spacing_Type"/> 
+          <attribute name = "line-height" type = "fo:line_height_Type"/> 
+          <attribute name = "score-spaces" type = "fo:score_spaces_Type"/> 
+          <attribute name = "text-transform" type = "fo:text_transform_Type"/> 
+          <attribute name = "word-spacing" type = "fo:letter_spacing_Type"/>
+        </documentation>
+      </annotation>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Font_Properties_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attribute name = "text-decoration" type = "fo:text_decoration_Type"/>
+      <attribute name = "text-shadow" type = "fo:text_shadow_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "external-graphic">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "display-align" type = "fo:display_align_Type"/> 
+          <attribute name = "line-height" type = "fo:line_height_Type"/> 
+          <attribute name = "text-align" type = "fo:text_align_Type"/>
+        </documentation>
+      </annotation>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Inline_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "alignment-adjust" type = "fo:alignment_adjust_Type"/>
+      <attribute name = "alignment-baseline" type = "fo:alignment_baseline_Type"/>
+      <attribute name = "baseline-shift" type = "fo:baseline_shift_Type"/>
+      <attributeGroup ref = "fo:progression_Properties_List"/>
+      <attributeGroup ref = "fo:clip_Properties_List"/>
+      <attribute name = "content-height" type = "fo:content_height_Type"/>
+      <attribute name = "content-type" type = "xs:string"/>
+      <attribute name = "content-width" type = "fo:content_height_Type"/>
+      <attribute name = "dominant-baseline" type = "fo:dominant_baseline_Type"/>
+      <attribute name = "height" type = "fo:height_Type"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attribute name = "keep-with-next" type = "fo:keep_integer_Type"/>
+      <attribute name = "keep-with-previous" type = "fo:keep_integer_Type"/>
+      <attribute name = "overflow" type = "fo:overflow_Type"/>
+      <attribute name = "scaling" type = "fo:scaling_Type"/>
+      <attribute name = "scaling-method" type = "fo:scaling_method_Type"/>
+      <attribute name = "src" type = "xs:string" use = "required"/>
+      <attribute name = "width" type = "fo:height_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attribute name = "vertical-align" type = "fo:vertical_align_Type"/>
+    </complexType>
+  </element>
+  <element name = "instream-foreign-object">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "display-align" type = "fo:display_align_Type"/> 
+          <attribute name = "line-height" type = "fo:line_height_Type"/> 
+          <attribute name = "text-align" type = "fo:text_align_Type"/>
+        </documentation>
+      </annotation>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Inline_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "alignment-adjust" type = "fo:alignment_adjust_Type"/>
+      <attribute name = "alignment-baseline" type = "fo:alignment_baseline_Type"/>
+      <attribute name = "baseline-shift" type = "fo:baseline_shift_Type"/>
+      <attributeGroup ref = "fo:progression_Properties_List"/>
+      <attributeGroup ref = "fo:clip_Properties_List"/>
+      <attribute name = "content-height" type = "fo:content_height_Type"/>
+      <attribute name = "content-type" type = "xs:string"/>
+      <attribute name = "content-width" type = "fo:content_height_Type"/>
+      <attribute name = "dominant-baseline" type = "fo:dominant_baseline_Type"/>
+      <attribute name = "height" type = "fo:height_Type"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attribute name = "keep-with-next" type = "fo:keep_integer_Type"/>
+      <attribute name = "keep-with-previous" type = "fo:keep_integer_Type"/>
+      <attribute name = "overflow" type = "fo:overflow_Type"/>
+      <attribute name = "scaling" type = "fo:scaling_Type"/>
+      <attribute name = "scaling-method" type = "fo:scaling_method_Type"/>
+      <attribute name = "width" type = "fo:height_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attribute name = "vertical-align" type = "fo:vertical_align_Type"/>
+    </complexType>
+  </element>
+  <element name = "inline">
+    <complexType mixed = "true">
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "color" type = "fo:color_Type"/> 
+          <attribute name = "line-height" type = "fo:line_height_Type"/> 
+          <attribute name = "visibility" type = "fo:visibility_Type"/> 
+          <attribute name = "wrap-option" type = "fo:wrap_option_Type"/>
+        </documentation>
+      </annotation>
+      <choice minOccurs = "0" maxOccurs = "unbounded">
+        <group ref = "fo:marker_List"/>
+        <group ref = "fo:inline_List"/>
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List">
+        <annotation>
+          <documentation>
+            <fop_result>Border and background properties not implemented</fop_result>
+          </documentation>
+        </annotation>
+      </attributeGroup>
+      <attributeGroup ref = "fo:Font_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Inline_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "alignment-adjust" type = "fo:alignment_adjust_Type"/>
+      <attribute name = "alignment-baseline" type = "fo:alignment_baseline_Type"/>
+      <attribute name = "baseline-shift" type = "fo:baseline_shift_Type"/>
+      <attributeGroup ref = "fo:progression_Properties_List"/>
+      <attribute name = "dominant-baseline" type = "fo:dominant_baseline_Type"/>
+      <attribute name = "height" type = "fo:height_Type"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:keep_Properties_List"/>
+      <attribute name = "text-decoration" type = "fo:text_decoration_Type"/>
+      <attribute name = "width" type = "fo:height_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attribute name = "vertical-align" type = "fo:vertical_align_Type"/>
+    </complexType>
+  </element>
+  <element name = "inline-container">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable 
+          <attribute name = "display-align" type = "fo:display_align_Type"/>
+          <attribute name = "line-height" type = "fo:line_height_Type"/>
+        </documentation>
+      </annotation>
+      <choice maxOccurs = "unbounded">
+        <group ref = "fo:marker_List"/>
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Inline_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "alignment-adjust" type = "fo:alignment_adjust_Type"/>
+      <attribute name = "alignment-baseline" type = "fo:alignment_baseline_Type"/>
+      <attribute name = "baseline-shift" type = "fo:baseline_shift_Type"/>
+      <attributeGroup ref = "fo:progression_Properties_List"/>
+      <attributeGroup ref = "fo:clip_Properties_List"/>
+      <attribute name = "dominant-baseline" type = "fo:dominant_baseline_Type"/>
+      <attribute name = "height" type = "fo:height_Type"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:keep_Properties_List"/>
+      <attribute name = "overflow" type = "fo:overflow_Type"/>
+      <attributeGroup ref = "fo:reference_Properties_List"/>
+      <attribute name = "width" type = "fo:height_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attribute name = "vertical-align" type = "fo:vertical_align_Type"/>
+    </complexType>
+  </element>
+  <element name = "leader">
+    <complexType mixed = "true">
+      <annotation>
+        <documentation>
+          Inheritable 
+          <attribute name = "color" type = "fo:color_Type"/> 
+          <attribute name = "leader-alignment" type = "fo:leader_alignment_Type"/> 
+          <attribute name = "leader-length" type = "fo:leader_length_Type"/> 
+          <attribute name = "leader-length.minimum" type = "fo:length_Type"/>
+          <attribute name = "leader-length.optimum" type = "fo:length_Type"/>
+          <attribute name = "leader-length.maximum" type = "fo:length_Type"/>
+          <attribute name = "leader-pattern" type = "fo:leader_pattern_Type"/> 
+          <attribute name = "leader-pattern-width" type = "fo:leader_pattern_width_Type"/> 
+          <attribute name = "rule-style" type = "fo:rule_style_Type"/> 
+          <attribute name = "rule-thickness" type = "fo:length_Type"/> 
+          <attribute name = "letter-spacing" type = "fo:letter_spacing_Type"/> 
+          <attribute name = "line-height" type = "fo:line_height_Type"/> 
+          <attribute name = "visibility" type = "fo:visibility_Type"/> 
+          <attribute name = "word-spacing" type = "fo:letter_spacing_Type"/>
+        </documentation>
+      </annotation>
+      <choice minOccurs = "0" maxOccurs = "unbounded">
+        <group ref = "fo:inline_List"/>
+        <group ref = "fo:neutral_List"/>
+      </choice>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Font_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Inline_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "alignment-adjust" type = "fo:alignment_adjust_Type"/>
+      <attribute name = "alignment-baseline" type = "fo:alignment_baseline_Type"/>
+      <attribute name = "baseline-shift" type = "fo:baseline_shift_Type"/>
+      <attribute name = "dominant-baseline" type = "fo:dominant_baseline_Type"/>
+      <attributeGroup ref = "fo:text_one_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attribute name = "keep-with-next" type = "fo:keep_integer_Type"/>
+      <attribute name = "keep-with-previous" type = "fo:keep_integer_Type"/>
+      <attribute name = "text-shadow" type = "fo:text_shadow_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attribute name = "vertical-align" type = "fo:vertical_align_Type"/>
+    </complexType>
+  </element>
+  <element name = "page-number">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable 
+          <attribute name = "letter-spacing" type = "fo:letter_spacing_Type"/>
+          <attribute name = "line-height" type = "fo:line_height_Type"/>
+          <attribute name = "score-spaces" type = "fo:score_spaces_Type"/>
+          <attribute name = "text-transform" type = "fo:text_transform_Type"/>
+          <attribute name = "visibility" type = "fo:visibility_Type"/>
+          <attribute name = "word-spacing" type = "fo:letter_spacing_Type"/>
+          <attribute name = "wrap-option" type = "fo:wrap_option_Type"/>
+        </documentation>
+      </annotation>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Font_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Inline_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "alignment-adjust" type = "fo:alignment_adjust_Type"/>
+      <attribute name = "alignment-baseline" type = "fo:alignment_baseline_Type"/>
+      <attribute name = "baseline-shift" type = "fo:baseline_shift_Type"/>
+      <attribute name = "dominant-baseline" type = "fo:dominant_baseline_Type"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attribute name = "keep-with-next" type = "fo:keep_integer_Type"/>
+      <attribute name = "keep-with-previous" type = "fo:keep_integer_Type"/>
+      <attributeGroup ref = "fo:text_one_Properties_List"/>
+      <attribute name = "text-decoration" type = "fo:text_decoration_Type"/>
+      <attribute name = "text-shadow" type = "fo:text_shadow_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attribute name = "vertical-align" type = "fo:vertical_align_Type"/>
+    </complexType>
+  </element>
+  <element name = "page-number-citation">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable 
+          <attribute name = "letter-spacing" type = "fo:letter_spacing_Type"/>
+          <attribute name = "line-height" type = "fo:line_height_Type"/>
+          <attribute name = "score-spaces" type = "fo:score_spaces_Type"/>
+          <attribute name = "text-transform" type = "fo:text_transform_Type"/>
+          <attribute name = "visibility" type = "fo:visibility_Type"/>
+          <attribute name = "word-spacing" type = "fo:letter_spacing_Type"/>
+          <attribute name = "wrap-option" type = "fo:wrap_option_Type"/>
+        </documentation>
+      </annotation>
+      <attribute name = "ref-id" type = "xs:string" use = "required"/>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Font_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Inline_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "alignment-adjust" type = "fo:alignment_adjust_Type"/>
+      <attribute name = "alignment-baseline" type = "fo:alignment_baseline_Type"/>
+      <attribute name = "baseline-shift" type = "fo:baseline_shift_Type"/>
+      <attribute name = "dominant-baseline" type = "fo:dominant_baseline_Type"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attribute name = "keep-with-next" type = "fo:keep_integer_Type"/>
+      <attribute name = "keep-with-previous" type = "fo:keep_integer_Type"/>
+      <attributeGroup ref = "fo:text_one_Properties_List"/>
+      <attribute name = "text-decoration" type = "fo:text_decoration_Type"/>
+      <attribute name = "text-shadow" type = "fo:text_shadow_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attribute name = "vertical-align" type = "fo:vertical_align_Type"/>
+    </complexType>
+  </element>
+  <element name = "table-and-caption">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "caption-side" type = "fo:caption_side_Type"/>
+          <attribute name = "text-align" type = "fo:text_align_Type"/>
+        </documentation>
+      </annotation>
+      <sequence>
+        <element ref = "fo:table-caption" minOccurs = "0"/>
+        <element ref = "fo:table"/>
+      </sequence>
+      <attributeGroup ref = "fo:block_properties"/>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Block_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attributeGroup ref = "fo:break_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:intrusion_displace_Properties_List"/>
+      <attributeGroup ref = "fo:keep_Properties_List"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "table-caption">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable 
+          <attribute name = "keep-together" type = "fo:keep_compound_Type"/>
+          <attribute name = "keep-together.within-line" type = "fo:keep_integer_Type"/>
+          <attribute name = "keep-together.within-column" type = "fo:keep_integer_Type"/>
+          <attribute name = "keep-together.within-page" type = "fo:keep_integer_Type"/>
+        </documentation>
+      </annotation>
+      <choice maxOccurs = "unbounded">
+        <group ref = "fo:marker_List"/>
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attributeGroup ref = "fo:progression_Properties_List"/>
+      <attribute name = "height" type = "fo:height_Type"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:intrusion_displace_Properties_List"/>
+      <attribute name = "width" type = "fo:height_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "table">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "border-collapse" type = "fo:border_collapse_Type"/>
+          <attribute name = "border-separation" type = "fo:length_bp_ip_direction_Type"/>
+          <attribute name = "border-spacing" type = "fo:length_Type"/>
+          <attribute name = "writing-mode" type = "fo:writing_mode_Type"/>
+        </documentation>
+      </annotation>
+      <sequence>
+        <element ref = "fo:table-column" minOccurs = "0" maxOccurs = "unbounded"/>
+        <element ref = "fo:table-header" minOccurs = "0"/>
+        <element ref = "fo:table-footer" minOccurs = "0"/>
+        <element ref = "fo:table-body" maxOccurs = "unbounded"/>
+      </sequence>
+      <attributeGroup ref = "fo:block_properties"/>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Block_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attributeGroup ref = "fo:progression_Properties_List"/>
+      <attribute name = "border-after-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-before-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-end-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-start-precedence" type = "fo:precedence_Type"/>
+      <attributeGroup ref = "fo:break_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:intrusion_displace_Properties_List"/>
+      <attribute name = "height" type = "fo:height_Type"/>
+      <attributeGroup ref = "fo:keep_Properties_List"/>
+      <attribute name = "table-layout" type = "fo:table_layout_Type"/>
+      <attribute name = "table-omit-footer-at-break" type = "fo:table_omit_footer_at_break_Type"/>
+      <attribute name = "table-omit-header-at-break" type = "fo:table_omit_header_at_break_Type"/>
+      <attribute name = "width" type = "fo:height_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "table-column">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable 
+          <attribute name = "visibility" type = "fo:visibility_Type"/> 
+        </documentation>
+      </annotation>
+      <attributeGroup ref = "fo:Border_Properties_List"/>
+      <attributeGroup ref = "fo:Background_Properties_List"/>
+      <attribute name = "border-after-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-before-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-end-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-start-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "column-number" type = "fo:integer_Type"/>
+      <attribute name = "column-width" type = "fo:column_width_Type"/>
+      <attribute name = "number-columns-repeated" type = "fo:integer_Type"/>
+      <attribute name = "number-columns-spanned" type = "fo:integer_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "table-header">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable <attribute name = "visibility" type = "fo:visibility_Type"/> 
+        </documentation>
+      </annotation>
+      <choice>
+        <element ref = "fo:table-row" maxOccurs = "unbounded"/>
+        <element ref = "fo:table-cell" maxOccurs = "unbounded"/>
+      </choice>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Properties_List"/>
+      <attributeGroup ref = "fo:Background_Properties_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "border-after-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-before-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-end-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-start-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "table-footer">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable <attribute name = "visibility" type = "fo:visibility_Type"/> 
+        </documentation>
+      </annotation>
+      <choice>
+        <element ref = "fo:table-row" maxOccurs = "unbounded"/>
+        <element ref = "fo:table-cell" maxOccurs = "unbounded"/>
+      </choice>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Properties_List"/>
+      <attributeGroup ref = "fo:Background_Properties_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "border-after-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-before-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-end-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-start-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "table-body">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable <attribute name = "visibility" type = "fo:visibility_Type"/> 
+        </documentation>
+      </annotation>
+      <choice>
+        <element ref = "fo:table-row" maxOccurs = "unbounded"/>
+        <element ref = "fo:table-cell" maxOccurs = "unbounded"/>
+      </choice>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Properties_List"/>
+      <attributeGroup ref = "fo:Background_Properties_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "border-after-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-before-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-end-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-start-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "table-row">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable <attribute name = "visibility" type = "fo:visibility_Type"/> 
+        </documentation>
+      </annotation>
+      <sequence>
+        <element ref = "fo:table-cell" maxOccurs = "unbounded"/>
+      </sequence>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Properties_List"/>
+      <attributeGroup ref = "fo:Background_Properties_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "block-progression-dimension" type = "fo:margin_width_Type"/>
+      <attribute name = "block-progression-dimension.minimum" type = "fo:length_Type"/>
+      <attribute name = "block-progression-dimension.optimum" type = "fo:block_progression_dimension_optimum_Type"/>
+      <attribute name = "block-progression-dimension.maximum" type = "fo:block_progression_dimension_maximum_Type"/>
+      <attribute name = "border-after-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-before-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-end-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-start-precedence" type = "fo:precedence_Type"/>
+      <attributeGroup ref = "fo:break_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attribute name = "height" type = "fo:height_Type"/>
+      <attributeGroup ref = "fo:keep_Properties_List"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attribute name = "page-break-after"  type = "fo:page_break_after_Type"/>
+      <attribute name = "page-break-before" type = "fo:page_break_after_Type"/>
+    </complexType>
+  </element>
+  <element name = "table-cell">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "display-align" type = "fo:display_align_Type"/>
+          <attribute name = "relative-align" type = "fo:relative_align_Type"/>
+          <attribute name = "empty-cells" type = "fo:empty_cells_Type"/>
+        </documentation>
+      </annotation>
+      <choice maxOccurs = "unbounded">
+        <group ref = "fo:marker_List"/>
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "border-after-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-before-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-end-precedence" type = "fo:precedence_Type"/>
+      <attribute name = "border-start-precedence" type = "fo:precedence_Type"/>
+      <attributeGroup ref = "fo:progression_Properties_List"/>
+      <attribute name = "column-number" type = "fo:integer_Type"/>
+      <attribute name = "ends-row" type = "fo:ends_row_Type"/>
+      <attribute name = "height" type = "fo:height_Type"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attribute name = "number-columns-spanned" type = "fo:integer_Type"/>
+      <attribute name = "number-rows-spanned" type = "fo:integer_Type"/>
+      <attribute name = "starts-row" type = "fo:starts_row_Type"/>
+      <attribute name = "width" type = "fo:height_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attribute name = "vertical-align" type = "fo:vertical_align_Type"/>
+    </complexType>
+  </element>
+  <element name = "list-block">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable
+          <attribute name = "provisional-distance-between-starts" type = "fo:provisional_distance_between_starts_Type"/>
+          <attribute name = "provisional-label-separation" type = "fo:provisional_label_separation_Type"/>
+        </documentation>
+      </annotation>
+      <sequence>
+        <element ref = "fo:list-item" maxOccurs = "unbounded"/>
+      </sequence>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Block_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attributeGroup ref = "fo:break_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:intrusion_displace_Properties_List"/>
+      <attributeGroup ref = "fo:keep_Properties_List"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attributeGroup ref = "fo:list_properties"/>
+    </complexType>
+  </element>
+  <element name = "list-item">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable <attribute name = "relative-align" type = "fo:relative_align_Type"/> 
+        </documentation>
+      </annotation>
+      <sequence>
+        <element ref = "fo:list-item-label"/>
+        <element ref = "fo:list-item-body"/>
+      </sequence>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Block_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attributeGroup ref = "fo:break_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:intrusion_displace_Properties_List"/>
+      <attributeGroup ref = "fo:keep_Properties_List"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attributeGroup ref = "fo:list_properties"/>
+    </complexType>
+  </element>
+  <element name = "list-item-body">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable 
+          <attribute name = "keep-together" type = "fo:keep_compound_Type"/>
+          <attribute name = "keep-together.within-line" type = "fo:keep_integer_Type"/>
+          <attribute name = "keep-together.within-column" type = "fo:keep_integer_Type"/>
+          <attribute name = "keep-together.within-page" type = "fo:keep_integer_Type"/>
+        </documentation>
+      </annotation>
+      <choice maxOccurs = "unbounded">
+        <group ref = "fo:marker_List"/>
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attributeGroup ref = "fo:list_properties"/>
+    </complexType>
+  </element>
+  <element name = "list-item-label">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable 
+          <attribute name = "keep-together" type = "fo:keep_compound_Type"/>
+          <attribute name = "keep-together.within-line" type = "fo:keep_integer_Type"/>
+          <attribute name = "keep-together.within-column" type = "fo:keep_integer_Type"/>
+          <attribute name = "keep-together.within-page" type = "fo:keep_integer_Type"/>
+        </documentation>
+      </annotation>
+      <choice maxOccurs = "unbounded">
+        <group ref = "fo:marker_List"/>
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attributeGroup ref = "fo:list_properties"/>
+    </complexType>
+  </element>
+  <element name = "float">
+    <complexType>
+      <choice maxOccurs = "unbounded">
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attribute name = "float" type = "fo:float_Type"/>
+      <attribute name = "clear" type = "fo:clear_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "footnote">
+    <complexType>
+      <sequence>
+        <element ref = "fo:inline"/>
+        <element ref = "fo:footnote-body"/>
+      </sequence>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "footnote-body">
+    <complexType>
+      <choice maxOccurs = "unbounded">
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "basic-link">
+    <complexType mixed = "true">
+      <annotation>
+        <documentation>
+          Inheritable <attribute name = "line-height" type = "fo:line_height_Type"/> 
+        </documentation>
+      </annotation>
+      <choice minOccurs = "0" maxOccurs = "unbounded">
+        <group ref = "fo:marker_List"/>
+        <group ref = "fo:inline_List"/>
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attributeGroup ref = "fo:Aural_Properties_List"/>
+      <attributeGroup ref = "fo:Border_Padding_and_Background_Properties_List"/>
+      <attributeGroup ref = "fo:Margin_Properties_Inline_List"/>
+      <attributeGroup ref = "fo:Relative_Position_Properties_List"/>
+      <attribute name = "alignment-adjust" type = "fo:alignment_adjust_Type"/>
+      <attribute name = "alignment-baseline" type = "fo:alignment_baseline_Type"/>
+      <attribute name = "baseline-shift" type = "fo:baseline_shift_Type"/>
+      <attribute name = "destination-placement-offset" type = "fo:length_Type"/>
+      <attribute name = "dominant-baseline" type = "fo:dominant_baseline_Type"/>
+      <attribute name = "external-destination" type = "xs:string"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attribute name = "indicate-destination" type = "fo:indicate_destination_Type"/>
+      <attribute name = "internal-destination" type = "xs:string"/>
+      <attributeGroup ref = "fo:keep_Properties_List"/>
+      <attribute name = "show-destination" type = "fo:show_destination_Type"/>
+      <attribute name = "target-processing-context" type = "xs:string"/>
+      <attribute name = "target-presentation-context" type = "xs:string"/>
+      <attribute name = "target-stylesheet" type = "xs:string"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attribute name = "vertical-align" type = "fo:vertical_align_Type"/>
+    </complexType>
+  </element>
+  <element name = "wrapper">
+    <complexType mixed = "true">
+      <choice minOccurs = "0" maxOccurs = "unbounded">
+        <group ref = "fo:marker_List"/>
+        <group ref = "fo:inline_List"/>
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "marker">
+    <complexType mixed = "true">
+      <choice minOccurs = "0" maxOccurs = "unbounded">
+        <group ref = "fo:inline_List"/>
+        <group ref = "fo:block_List"/>
+      </choice>
+      <attribute name = "marker-class-name" type = "xs:string"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "retrieve-marker">
+    <complexType>
+      <attribute name = "retrieve-class-name" type = "xs:string"/>
+      <attribute name = "retrieve-position" type = "fo:retrieve_position_Type"/>
+      <attribute name = "retrieve-boundary" type = "fo:retrieve_boundary_Type"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "multi-switch">
+    <complexType>
+      <annotation>
+        <documentation>
+          Inheritable <attribute name = "auto-restore" type = "fo:auto_restore_Type"/> 
+        </documentation>
+      </annotation>
+      <sequence>
+        <element ref = "fo:multi-case"/>
+      </sequence>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "multi-case">
+    <complexType mixed = "true">
+      <choice minOccurs = "0" maxOccurs = "unbounded">
+        <group ref = "fo:inline_List"/>
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attribute name = "starting-state" type = "fo:starting_state_Type"/>
+      <attribute name = "case-name" type = "xs:string"/>
+      <attribute name = "case-title" type = "xs:string"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "multi-toggle">
+    <complexType mixed = "true">
+      <choice minOccurs = "0" maxOccurs = "unbounded">
+        <group ref = "fo:inline_List"/>
+        <group ref = "fo:block_List"/>
+        <group ref = "fo:neutral_List"/>
+        <group ref = "fo:float_List"/>
+        <group ref = "fo:footnote_List"/>
+      </choice>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attribute name = "switch-to" type = "xs:string"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+      <attribute name = "vertical-align" type = "fo:vertical_align_Type"/>
+    </complexType>
+  </element>
+  <element name = "multi-properties">
+    <complexType>
+      <sequence>
+        <element ref = "fo:multi-property-set" maxOccurs = "unbounded"/>
+        <element ref = "fo:wrapper"/>
+      </sequence>
+      <attributeGroup ref = "fo:Accessibility_Properties_List"/>
+      <attribute name = "id" type = "xs:string"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+  <element name = "multi-property-set">
+    <complexType>
+      <attribute name = "id" type = "xs:string"/>
+      <attribute name = "active-state" type = "fo:active_state_Type" use = "required"/>
+      <attributeGroup ref = "fo:inheritable_properties_List"/>
+    </complexType>
+  </element>
+</schema>
diff --git a/org.argeo.app.core/src/org/argeo/app/core/schemas/xCal-2.0-RFC6321.rnc b/org.argeo.app.core/src/org/argeo/app/core/schemas/xCal-2.0-RFC6321.rnc
new file mode 100644 (file)
index 0000000..d18211d
--- /dev/null
@@ -0,0 +1,1192 @@
+   default namespace = "urn:ietf:params:xml:ns:icalendar-2.0"
+
+   # 3.2 Property Parameters
+
+   # 3.2.1 Alternate Text Representation
+
+   altrepparam = element altrep {
+       value-uri
+   }
+
+   # 3.2.2 Common Name
+
+   cnparam = element cn {
+       value-text
+   }
+
+   # 3.2.3 Calendar User Type
+
+   cutypeparam = element cutype {
+       element text {
+           "INDIVIDUAL" |
+           "GROUP" |
+           "RESOURCE" |
+           "ROOM" |
+           "UNKNOWN"
+       }
+   }
+
+   # 3.2.4 Delegators
+
+   delfromparam = element delegated-from {
+       value-cal-address+
+   }
+
+   # 3.2.5 Delegatees
+
+   deltoparam = element delegated-to {
+       value-cal-address+
+   }
+
+   # 3.2.6 Directory Entry Reference
+
+   dirparam = element dir {
+       value-uri
+   }
+
+   # 3.2.7 Inline Encoding
+
+   encodingparam = element encoding {
+       element text {
+           "8BIT" |
+           "BASE64"
+       }
+   }
+
+   # 3.2.8 Format Type
+
+   fmttypeparam = element fmttype {
+       value-text
+   }
+
+   # 3.2.9 Free/Busy Time Type
+
+   fbtypeparam = element fbtype {
+       element text {
+           "FREE" |
+           "BUSY" |
+           "BUSY-UNAVAILABLE" |
+           "BUSY-TENTATIVE"
+       }
+   }
+
+   # 3.2.10 Language
+
+   languageparam = element language {
+       value-text
+   }
+
+   # 3.2.11 Group or List Membership
+
+   memberparam = element member {
+       value-cal-address+
+   }
+
+   # 3.2.12 Participation Status
+
+   partstatparam = element partstat {
+       type-partstat-event |
+       type-partstat-todo |
+       type-partstat-jour
+   }
+
+   type-partstat-event = (
+       element text {
+           "NEEDS-ACTION" |
+           "ACCEPTED" |
+           "DECLINED" |
+           "TENTATIVE" |
+           "DELEGATED"
+       }
+   )
+
+   type-partstat-todo = (
+       element text {
+           "NEEDS-ACTION" |
+           "ACCEPTED" |
+           "DECLINED" |
+           "TENTATIVE" |
+           "DELEGATED" |
+           "COMPLETED" |
+           "IN-PROCESS"
+       }
+   )
+
+   type-partstat-jour = (
+       element text {
+           "NEEDS-ACTION" |
+           "ACCEPTED" |
+           "DECLINED"
+       }
+   )
+
+   # 3.2.13 Recurrence Identifier Range
+
+   rangeparam = element range {
+       element text {
+           "THISANDFUTURE"
+       }
+   }
+
+   # 3.2.14 Alarm Trigger Relationship
+
+   trigrelparam = element related {
+       element text {
+           "START" |
+           "END"
+       }
+   }
+
+   # 3.2.15 Relationship Type
+
+   reltypeparam = element reltype {
+       element text {
+           "PARENT" |
+           "CHILD" |
+           "SIBLING"
+       }
+   }
+
+   # 3.2.16 Participation Role
+
+   roleparam = element role {
+       element text {
+           "CHAIR" |
+           "REQ-PARTICIPANT" |
+           "OPT-PARTICIPANT" |
+           "NON-PARTICIPANT"
+       }
+   }
+
+   # 3.2.17 RSVP Expectation
+
+   rsvpparam = element rsvp {
+       value-boolean
+   }
+
+   # 3.2.18 Sent By
+
+   sentbyparam = element sent-by {
+       value-cal-address
+   }
+
+   # 3.2.19 Time Zone Identifier
+
+   tzidparam = element tzid {
+       value-text
+   }
+
+   # 3.3 Property Value Data Types
+
+   # 3.3.1 BINARY
+
+   value-binary =  element binary {
+       xsd:string
+   }
+
+   # 3.3.2 BOOLEAN
+
+   value-boolean = element boolean {
+       xsd:boolean
+   }
+
+   # 3.3.3 CAL-ADDRESS
+
+   value-cal-address = element cal-address {
+       xsd:anyURI
+   }
+
+   # 3.3.4 DATE
+
+   pattern-date = xsd:string {
+       pattern = "\d\d\d\d-\d\d-\d\d"
+   }
+
+   value-date = element date {
+       pattern-date
+   }
+
+   # 3.3.5 DATE-TIME
+
+   pattern-date-time = xsd:string {
+       pattern = "\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\dZ?"
+   }
+
+   value-date-time = element date-time {
+       pattern-date-time
+   }
+
+   # 3.3.6 DURATION
+
+   pattern-duration = xsd:string {
+       pattern = "(+|-)?P(\d+W)|(\d+D)?"
+               ~ "(T(\d+H(\d+M)?(\d+S)?)|"
+               ~   "(\d+M(\d+S)?)|"
+               ~   "(\d+S))?"
+   }
+
+   value-duration = element duration {
+       pattern-duration
+   }
+
+   # 3.3.7 FLOAT
+
+   value-float = element float {
+       xsd:float
+   }
+
+   # 3.3.8 INTEGER
+
+   value-integer = element integer {
+       xsd:integer
+   }
+
+   # 3.3.9 PERIOD
+
+   value-period = element period {
+       element start {
+           pattern-date-time
+       },
+       (
+           element end {
+               pattern-date-time
+           } |
+           element duration {
+               pattern-duration
+           }
+       )
+   }
+
+   # 3.3.10 RECUR
+
+   value-recur = element recur {
+       type-freq,
+       (type-until | type-count)?,
+       element interval {
+           xsd:positiveInteger
+       }?,
+       type-bysecond*,
+       type-byminute*,
+       type-byhour*,
+       type-byday*,
+       type-bymonthday*,
+       type-byyearday*,
+       type-byweekno*,
+       type-bymonth*,
+       type-bysetpos*,
+       element wkst { type-weekday }?
+   }
+
+   type-freq = element freq {
+       "SECONDLY" |
+       "MINUTELY" |
+       "HOURLY"   |
+       "DAILY"    |
+       "WEEKLY"   |
+       "MONTHLY"  |
+       "YEARLY"
+   }
+
+   type-until = element until {
+       type-date |
+       type-date-time
+   }
+
+   type-count = element count {
+       xsd:positiveInteger
+   }
+
+   type-bysecond = element bysecond {
+       xsd:positiveInteger
+   }
+
+   type-byminute = element byminute {
+       xsd:positiveInteger
+   }
+
+   type-byhour = element byhour {
+       xsd:positiveInteger
+   }
+
+   type-weekday = (
+       "SU" |
+       "MO" |
+       "TU" |
+       "WE" |
+       "TH" |
+       "FR" |
+       "SA"
+   )
+
+   type-byday = element byday {
+       xsd:integer?,
+       type-weekday
+   }
+
+   type-bymonthday = element bymonthday {
+       xsd:integer
+   }
+
+   type-byyearday = element byyearday {
+       xsd:integer
+   }
+
+   type-byweekno = element byweekno {
+       xsd:integer
+   }
+
+   type-bymonth = element bymonth {
+       xsd:positiveInteger
+   }
+
+   type-bysetpos = element bysetpos {
+       xsd:integer
+   }
+
+   # 3.3.11 TEXT
+
+   value-text = element text {
+       xsd:string
+   }
+
+   # 3.3.12 TIME
+
+   pattern-time = xsd:string {
+       pattern = "\d\d:\d\d:\d\dZ?"
+   }
+
+   value-time = element time {
+       pattern-time
+   }
+
+   # 3.3.13 URI
+
+   value-uri = element uri {
+       xsd:anyURI
+   }
+
+   # 3.3.14 UTC-OFFSET
+
+   value-utc-offset = element utc-offset {
+       xsd:string { pattern = "(+|-)\d\d:\d\d(:\d\d)?" }
+   }
+
+   # UNKNOWN
+
+   value-unknown = element unknown {
+       xsd:string
+   }
+
+   # 3.4 iCalendar Stream
+
+   start = element icalendar {
+       vcalendar+
+   }
+
+   # 3.6 Calendar Components
+
+   vcalendar = element vcalendar {
+       type-calprops,
+       type-component
+   }
+
+   type-calprops = element properties {
+       property-prodid &
+       property-version &
+       property-calscale? &
+       property-method?
+   }
+
+   type-component = element components {
+       (
+           component-vevent |
+           component-vtodo |
+           component-vjournal |
+           component-vfreebusy |
+           component-vtimezone
+       )*
+   }
+
+   # 3.6.1 Event Component
+
+   component-vevent = element vevent {
+       type-eventprop,
+       element components {
+           component-valarm+
+       }?
+   }
+
+   type-eventprop = element properties {
+       property-dtstamp &
+       property-dtstart &
+       property-uid &
+
+       property-class? &
+       property-created? &
+       property-description? &
+       property-geo? &
+       property-last-mod? &
+       property-location? &
+       property-organizer? &
+       property-priority? &
+       property-seq? &
+       property-status-event? &
+
+       property-summary? &
+       property-transp? &
+       property-url? &
+       property-recurid? &
+
+       property-rrule? &
+
+       (property-dtend | property-duration)? &
+
+       property-attach* &
+       property-attendee* &
+       property-categories* &
+       property-comment* &
+       property-contact* &
+       property-exdate* &
+       property-rstatus* &
+       property-related* &
+       property-resources* &
+       property-rdate*
+   }
+
+   # 3.6.2 To-do Component
+
+   component-vtodo = element vtodo {
+       type-todoprop,
+       element components {
+           component-valarm+
+       }?
+   }
+
+   type-todoprop = element properties {
+       property-dtstamp &
+       property-uid &
+
+       property-class? &
+       property-completed? &
+       property-created? &
+       property-description? &
+       property-geo? &
+       property-last-mod? &
+       property-location? &
+       property-organizer? &
+       property-percent? &
+       property-priority? &
+       property-recurid? &
+       property-seq? &
+       property-status-todo? &
+       property-summary? &
+
+       property-url? &
+
+       property-rrule? &
+
+       (
+           (property-dtstart?, property-dtend? ) |
+           (property-dtstart, property-duration)?
+       ) &
+
+       property-attach* &
+       property-attendee* &
+       property-categories* &
+       property-comment* &
+       property-contact* &
+       property-exdate* &
+       property-rstatus* &
+       property-related* &
+       property-resources* &
+       property-rdate*
+   }
+
+   # 3.6.3 Journal Component
+
+   component-vjournal = element vjournal {
+       type-jourprop
+   }
+
+   type-jourprop = element properties {
+       property-dtstamp &
+       property-uid &
+
+       property-class? &
+       property-created? &
+       property-dtstart? &
+       property-last-mod? &
+       property-organizer? &
+       property-recurid? &
+       property-seq? &
+       property-status-jour? &
+       property-summary? &
+       property-url? &
+
+       property-rrule? &
+
+       property-attach* &
+       property-attendee* &
+       property-categories* &
+       property-comment* &
+       property-contact* &
+       property-description? &
+       property-exdate* &
+       property-related* &
+       property-rdate* &
+       property-rstatus*
+   }
+
+   # 3.6.4 Free/Busy Component
+
+   component-vfreebusy = element vfreebusy {
+       type-fbprop
+   }
+
+   type-fbprop = element properties {
+       property-dtstamp &
+       property-uid &
+
+       property-contact? &
+       property-dtstart? &
+       property-dtend? &
+       property-duration? &
+       property-organizer? &
+       property-url? &
+
+       property-attendee* &
+       property-comment* &
+       property-freebusy* &
+       property-rstatus*
+   }
+
+   # 3.6.5 Time Zone Component
+
+   component-vtimezone = element vtimezone {
+       element properties {
+           property-tzid &
+
+           property-last-mod? &
+           property-tzuurl?
+       },
+       element components {
+           (component-standard | component-daylight) &
+           component-standard* &
+           component-daylight*
+       }
+   }
+
+   component-standard = element standard {
+       type-tzprop
+   }
+
+   component-daylight = element daylight {
+       type-tzprop
+   }
+
+   type-tzprop = element properties {
+       property-dtstart &
+       property-tzoffsetto &
+       property-tzoffsetfrom &
+
+       property-rrule? &
+
+       property-comment* &
+       property-rdate* &
+       property-tzname*
+   }
+
+   # 3.6.6 Alarm Component
+
+   component-valarm = element valarm {
+       audioprop | dispprop | emailprop
+   }
+
+   type-audioprop = element properties {
+       property-action &
+
+       property-trigger &
+
+       (property-duration, property-repeat)? &
+
+       property-attach?
+   }
+
+   type-dispprop = element properties {
+       property-action &
+       property-description &
+       property-trigger &
+       property-summary &
+
+       property-attendee+ &
+
+       (property-duration, property-repeat)? &
+
+       property-attach*
+   }
+
+   type-emailprop = element properties {
+       property-action &
+       property-description &
+       property-trigger &
+
+       (property-duration, property-repeat)?
+   }
+
+   # 3.7 Calendar Properties
+
+   # 3.7.1 Calendar Scale
+
+   property-calscale = element calscale {
+
+       element parameters { empty }?,
+
+       element text { "GREGORIAN" }
+   }
+
+   # 3.7.2 Method
+
+   property-method = element method {
+
+       element parameters { empty }?,
+
+       value-text
+   }
+
+   # 3.7.3 Product Identifier
+
+   property-prodid = element prodid {
+
+       element parameters { empty }?,
+
+       value-text
+   }
+
+   # 3.7.4 Version
+
+   property-version = element version {
+
+       element parameters { empty }?,
+
+       element text { "2.0" }
+   }
+
+   # 3.8 Component Properties
+
+   # 3.8.1 Descriptive Component Properties
+
+   # 3.8.1.1 Attachment
+
+   property-attach = element attach {
+
+       element parameters {
+           fmttypeparam? &
+           encodingparam?
+       }?,
+
+       value-uri | value-binary
+   }
+
+   # 3.8.1.2 Categories
+
+   property-categories = element categories {
+
+       element parameters {
+           languageparam? &
+       }?,
+
+       value-text+
+   }
+
+   # 3.8.1.3 Classification
+
+   property-class = element class {
+
+       element parameters { empty }?,
+
+       element text {
+           "PUBLIC" |
+           "PRIVATE" |
+           "CONFIDENTIAL"
+       }
+   }
+
+   # 3.8.1.4 Comment
+
+   property-comment = element comment {
+
+       element parameters {
+           altrepparam? &
+           languageparam?
+       }?,
+
+       value-text
+   }
+
+   # 3.8.1.5 Description
+
+   property-description = element description {
+
+       element parameters {
+           altrepparam? &
+           languageparam?
+       }?,
+
+       value-text
+   }
+
+   # 3.8.1.6 Geographic Position
+
+   property-geo = element geo {
+
+       element parameters { empty }?,
+
+       element latitude  { xsd:float },
+       element longitude { xsd:float }
+   }
+
+   # 3.8.1.7 Location
+
+   property-location = element location {
+
+       element parameters {
+
+           altrepparam? &
+           languageparam?
+       }?,
+
+       value-text
+   }
+
+   # 3.8.1.8 Percent Complete
+
+   property-percent = element percent-complete {
+
+       element parameters { empty }?,
+
+       value-integer
+   }
+
+
+   # 3.8.1.9 Priority
+
+   property-priority = element priority {
+
+       element parameters { empty }?,
+
+       value-integer
+   }
+
+   # 3.8.1.10 Resources
+
+   property-resources = element resources {
+
+       element parameters {
+           altrepparam? &
+           languageparam?
+       }?,
+
+       value-text+
+   }
+
+   # 3.8.1.11 Status
+
+   property-status-event = element status {
+
+       element parameters { empty }?,
+
+       element text {
+           "TENTATIVE" |
+           "CONFIRMED" |
+           "CANCELLED"
+       }
+   }
+
+   property-status-todo = element status {
+
+       element parameters { empty }?,
+
+       element text {
+           "NEEDS-ACTION" |
+           "COMPLETED" |
+           "IN-PROCESS" |
+           "CANCELLED"
+       }
+   }
+
+   property-status-jour = element status {
+
+       element parameters { empty }?,
+
+       element text {
+           "DRAFT" |
+           "FINAL" |
+           "CANCELLED"
+       }
+   }
+
+   # 3.8.1.12 Summary
+
+   property-summary = element summary {
+
+       element parameters {
+           altrepparam? &
+           languageparam?
+       }?,
+
+       value-text
+   }
+
+   # 3.8.2 Date and Time Component Properties
+
+   # 3.8.2.1 Date/Time Completed
+
+   property-completed = element completed {
+
+       element parameters { empty }?,
+
+       value-date-time
+   }
+
+   # 3.8.2.2 Date/Time End
+
+   property-dtend = element dtend {
+
+       element parameters {
+           tzidparam?
+       }?,
+
+       value-date-time |
+       value-date
+   }
+
+   # 3.8.2.3 Date/Time Due
+
+   property-due = element due {
+
+       element parameters {
+           tzidparam?
+       }?,
+
+       value-date-time |
+       value-date
+   }
+
+   # 3.8.2.4 Date/Time Start
+
+   property-dtstart = element dtstart {
+
+       element parameters {
+           tzidparam?
+       }?,
+
+       value-date-time |
+       value-date
+   }
+
+   # 3.8.2.5 Duration
+
+   property-duration = element duration {
+
+       element parameters { empty }?,
+
+       value-duration
+   }
+
+   # 3.8.2.6 Free/Busy Time
+
+   property-freebusy = element freebusy {
+
+       element parameters {
+           fbtypeparam?
+       }?,
+
+
+       value-period+
+   }
+
+   # 3.8.2.7 Time Transparency
+
+   property-transp = element transp {
+
+
+       element parameters { empty }?,
+
+       element text {
+           "OPAQUE" |
+           "TRANSPARENT"
+       }
+   }
+
+   # 3.8.3 Time Zone Component Properties
+
+   # 3.8.3.1 Time Zone Identifier
+
+   property-tzid = element tzid {
+
+       element parameters { empty }?,
+
+       value-text
+   }
+
+   # 3.8.3.2 Time Zone Name
+
+   property-tzname = element tzname {
+
+       element parameters {
+           languageparam?
+       }?,
+
+       value-text
+   }
+
+   # 3.8.3.3 Time Zone Offset From
+
+   property-tzoffsetfrom = element tzoffsetfrom {
+
+       element parameters { empty }?,
+
+       value-utc-offset
+   }
+
+   # 3.8.3.4 Time Zone Offset To
+
+   property-tzoffsetto = element tzoffsetto {
+
+       element parameters { empty }?,
+
+       value-utc-offset
+   }
+
+   # 3.8.3.5 Time Zone URL
+
+   property-tzurl = element tzurl {
+
+       element parameters { empty }?,
+
+       value-uri
+   }
+
+   # 3.8.4 Relationship Component Properties
+
+   # 3.8.4.1 Attendee
+
+   property-attendee = element attendee {
+
+       element parameters {
+           cutypeparam? &
+           memberparam? &
+           roleparam? &
+           partstatparam? &
+           rsvpparam? &
+           deltoparam? &
+           delfromparam? &
+           sentbyparam? &
+           cnparam? &
+           dirparam? &
+           languageparam?
+       }?,
+
+       value-cal-address
+   }
+
+   # 3.8.4.2 Contact
+
+   property-contact = element contact {
+
+       element parameters {
+           altrepparam? &
+           languageparam?
+       }?,
+
+       value-text
+   }
+
+   # 3.8.4.3 Organizer
+
+   property-organizer = element organizer {
+
+       element parameters {
+           cnparam? &
+           dirparam? &
+           sentbyparam? &
+           languageparam?
+       }?,
+
+       value-cal-address
+   }
+
+   # 3.8.4.4 Recurrence ID
+
+   property-recurid = element recurrence-id {
+
+       element parameters {
+           tzidparam? &
+           rangeparam?
+       }?,
+
+       value-date-time |
+       value-date
+   }
+
+   # 3.8.4.5 Related-To
+
+   property-related = element related-to {
+
+       element parameters {
+           reltypeparam?
+       }?,
+
+       value-text
+   }
+
+   # 3.8.4.6 Uniform Resource Locator
+
+   property-url = element url {
+
+       element parameters { empty }?,
+
+       value-uri
+   }
+
+   # 3.8.4.7 Unique Identifier
+
+   property-uid = element uid {
+
+       element parameters { empty }?,
+       value-text
+   }
+
+   # 3.8.5 Recurrence Component Properties
+
+   # 3.8.5.1 Exception Date/Times
+
+   property-exdate = element exdate {
+
+       element parameters {
+           tzidparam?
+       }?,
+
+       value-date-time+ |
+       value-date+
+   }
+
+   # 3.8.5.2 Recurrence Date/Times
+
+   property-rdate = element rdate {
+
+       element parameters {
+           tzidparam?
+       }?,
+
+       value-date-time+ |
+       value-date+ |
+       value-period+
+   }
+
+   # 3.8.5.3 Recurrence Rule
+
+   property-rrule = element rrule {
+
+       element parameters { empty }?,
+
+       value-recur
+   }
+
+   # 3.8.6 Alarm Component Properties
+
+   # 3.8.6.1 Action
+
+   property-action = element action {
+
+       element parameters { empty }?,
+       element text {
+           "AUDIO" |
+           "DISPLAY" |
+           "EMAIL"
+       }
+   }
+
+   # 3.8.6.2 Repeat Count
+
+   property-repeat = element repeat {
+
+       element parameters { empty }?,
+
+       value-integer
+   }
+
+   # 3.8.6.3 Trigger
+
+   property-trigger = element trigger {
+
+       (
+           element parameters {
+               trigrelparam?
+           }?,
+
+           value-duration
+       ) |
+       (
+           element parameters { empty }?,
+
+           value-date-time
+       )
+   }
+
+   # 3.8.7 Change Management Component Properties
+
+   # 3.8.7.1 Date/Time Created
+
+   property-created = element created {
+
+       element parameters { empty }?,
+
+       value-date-time
+   }
+
+   # 3.8.7.2 Date/Time Stamp
+
+   property-dtstamp = element dtstamp {
+       element parameters { empty }?,
+
+       value-date-time
+   }
+
+   # 3.8.7.3 Last Modified
+
+   property-last-mod = element last-modified {
+
+       element parameters { empty }?,
+
+       value-date-time
+   }
+
+   # 3.8.7.4 Sequence Number
+
+   property-seq = element sequence {
+
+       element parameters { empty }?,
+
+       value-integer
+   }
+
+   # 3.8.8 Miscellaneous Component Properties
+
+   # 3.8.8.3 Request Status
+
+   property-rstatus = element request-status {
+
+       element parameters {
+           languageparam?
+       }?,
+
+       element code { xsd:string },
+       element description { xsd:string },
+       element data { xsd:string }?
+   }
+
+
+
+
+
diff --git a/org.argeo.app.core/src/org/argeo/app/core/schemas/xCal-2.0.rnc b/org.argeo.app.core/src/org/argeo/app/core/schemas/xCal-2.0.rnc
new file mode 100644 (file)
index 0000000..4c863be
--- /dev/null
@@ -0,0 +1,1207 @@
+   default namespace = "urn:ietf:params:xml:ns:icalendar-2.0"
+
+   # 3.2 Property Parameters
+
+   # 3.2.1 Alternate Text Representation
+
+   altrepparam = element altrep {
+       value-uri
+   }
+
+   # 3.2.2 Common Name
+
+   cnparam = element cn {
+       value-text
+   }
+
+   # 3.2.3 Calendar User Type
+
+   cutypeparam = element cutype {
+       element text {
+           "INDIVIDUAL" |
+           "GROUP" |
+           "RESOURCE" |
+           "ROOM" |
+           "UNKNOWN"
+       }
+   }
+
+   # 3.2.4 Delegators
+
+   delfromparam = element delegated-from {
+       value-cal-address+
+   }
+
+   # 3.2.5 Delegatees
+
+   deltoparam = element delegated-to {
+       value-cal-address+
+   }
+
+   # 3.2.6 Directory Entry Reference
+
+   dirparam = element dir {
+       value-uri
+   }
+
+   # 3.2.7 Inline Encoding
+
+   encodingparam = element encoding {
+       element text {
+           "8BIT" |
+           "BASE64"
+       }
+   }
+
+   # 3.2.8 Format Type
+
+   fmttypeparam = element fmttype {
+       value-text
+   }
+
+   # 3.2.9 Free/Busy Time Type
+
+   fbtypeparam = element fbtype {
+       element text {
+           "FREE" |
+           "BUSY" |
+           "BUSY-UNAVAILABLE" |
+           "BUSY-TENTATIVE"
+       }
+   }
+
+   # 3.2.10 Language
+
+   languageparam = element language {
+       value-text
+   }
+
+   # 3.2.11 Group or List Membership
+
+   memberparam = element member {
+       value-cal-address+
+   }
+
+   # 3.2.12 Participation Status
+
+   partstatparam = element partstat {
+       type-partstat-event |
+       type-partstat-todo |
+       type-partstat-jour
+   }
+
+   type-partstat-event = (
+       element text {
+           "NEEDS-ACTION" |
+           "ACCEPTED" |
+           "DECLINED" |
+           "TENTATIVE" |
+           "DELEGATED"
+       }
+   )
+
+   type-partstat-todo = (
+       element text {
+           "NEEDS-ACTION" |
+           "ACCEPTED" |
+           "DECLINED" |
+           "TENTATIVE" |
+           "DELEGATED" |
+           "COMPLETED" |
+           "IN-PROCESS"
+       }
+   )
+
+   type-partstat-jour = (
+       element text {
+           "NEEDS-ACTION" |
+           "ACCEPTED" |
+           "DECLINED"
+       }
+   )
+
+   # 3.2.13 Recurrence Identifier Range
+
+   rangeparam = element range {
+       element text {
+           "THISANDFUTURE"
+       }
+   }
+
+   # 3.2.14 Alarm Trigger Relationship
+
+   trigrelparam = element related {
+       element text {
+           "START" |
+           "END"
+       }
+   }
+
+   # 3.2.15 Relationship Type
+
+   reltypeparam = element reltype {
+       element text {
+           "PARENT" |
+           "CHILD" |
+           "SIBLING"
+       }
+   }
+
+   # 3.2.16 Participation Role
+
+   roleparam = element role {
+       element text {
+           "CHAIR" |
+           "REQ-PARTICIPANT" |
+           "OPT-PARTICIPANT" |
+           "NON-PARTICIPANT"
+       }
+   }
+
+   # 3.2.17 RSVP Expectation
+
+   rsvpparam = element rsvp {
+       value-boolean
+   }
+
+   # 3.2.18 Sent By
+
+   sentbyparam = element sent-by {
+       value-cal-address
+   }
+
+   # 3.2.19 Time Zone Identifier
+
+   tzidparam = element tzid {
+       value-text
+   }
+
+   # 3.3 Property Value Data Types
+
+   # 3.3.1 BINARY
+
+   value-binary =  element binary {
+       xsd:string
+   }
+
+   # 3.3.2 BOOLEAN
+
+   value-boolean = element boolean {
+       xsd:boolean
+   }
+
+   # 3.3.3 CAL-ADDRESS
+
+   value-cal-address = element cal-address {
+       xsd:anyURI
+   }
+
+   # 3.3.4 DATE
+
+   pattern-date = xsd:string {
+       pattern = "\d\d\d\d-\d\d-\d\d"
+   }
+
+   value-date = element date {
+       pattern-date
+   }
+
+   # 3.3.5 DATE-TIME
+
+   pattern-date-time = xsd:string {
+       pattern = "\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\dZ?"
+   }
+
+   value-date-time = element date-time {
+       pattern-date-time
+   }
+
+   # 3.3.6 DURATION
+
+   pattern-duration = xsd:string {
+       # mbaudier - 2022-05-31 : corrected regexp from RFC 6321
+       pattern = "(\+|-)?P(\d+W)|(\d+D)?"
+               ~ "(T(\d+H(\d+M)?(\d+S)?)|"
+               ~   "(\d+M(\d+S)?)|"
+               ~   "(\d+S))?"
+   }
+
+   value-duration = element duration {
+       pattern-duration
+   }
+
+   # 3.3.7 FLOAT
+
+   value-float = element float {
+       xsd:float
+   }
+
+   # 3.3.8 INTEGER
+
+   value-integer = element integer {
+       xsd:integer
+   }
+
+   # 3.3.9 PERIOD
+
+   value-period = element period {
+       element start {
+           pattern-date-time
+       },
+       (
+           element end {
+               pattern-date-time
+           } |
+           element duration {
+               pattern-duration
+           }
+       )
+   }
+
+   # 3.3.10 RECUR
+
+   value-recur = element recur {
+       type-freq,
+       (type-until | type-count)?,
+       element interval {
+           xsd:positiveInteger
+       }?,
+       type-bysecond*,
+       type-byminute*,
+       type-byhour*,
+       type-byday*,
+       type-bymonthday*,
+       type-byyearday*,
+       type-byweekno*,
+       type-bymonth*,
+       type-bysetpos*,
+       element wkst { type-weekday }?
+   }
+
+   type-freq = element freq {
+       "SECONDLY" |
+       "MINUTELY" |
+       "HOURLY"   |
+       "DAILY"    |
+       "WEEKLY"   |
+       "MONTHLY"  |
+       "YEARLY"
+   }
+
+   type-until = element until {
+       # mbaudier - 2022-05-31 : corrected undefined pattern from RFC 6321
+       value-date |
+       value-date-time
+   }
+
+   type-count = element count {
+       xsd:positiveInteger
+   }
+
+   type-bysecond = element bysecond {
+       xsd:positiveInteger
+   }
+
+   type-byminute = element byminute {
+       xsd:positiveInteger
+   }
+
+   type-byhour = element byhour {
+       xsd:positiveInteger
+   }
+
+   type-weekday = (
+       "SU" |
+       "MO" |
+       "TU" |
+       "WE" |
+       "TH" |
+       "FR" |
+       "SA"
+   )
+
+   type-byday = element byday {
+       # mbaudier - 2022-05-31 : corrected (?) grouping data is only allowed inside list from RFC 6321
+       xsd:integer? |
+       type-weekday
+   }
+
+   type-bymonthday = element bymonthday {
+       xsd:integer
+   }
+
+   type-byyearday = element byyearday {
+       xsd:integer
+   }
+
+   type-byweekno = element byweekno {
+       xsd:integer
+   }
+
+   type-bymonth = element bymonth {
+       xsd:positiveInteger
+   }
+
+   type-bysetpos = element bysetpos {
+       xsd:integer
+   }
+
+   # 3.3.11 TEXT
+
+   value-text = element text {
+       xsd:string
+   }
+
+   # 3.3.12 TIME
+
+   pattern-time = xsd:string {
+       pattern = "\d\d:\d\d:\d\dZ?"
+   }
+
+   value-time = element time {
+       pattern-time
+   }
+
+   # 3.3.13 URI
+
+   value-uri = element uri {
+       xsd:anyURI
+   }
+
+   # 3.3.14 UTC-OFFSET
+
+   value-utc-offset = element utc-offset {
+       # mbaudier - 2022-05-31 : corrected regexp from RFC 6321
+       xsd:string { pattern = "(\+|-)\d\d:\d\d(:\d\d)?" }
+   }
+
+   # UNKNOWN
+
+   value-unknown = element unknown {
+       xsd:string
+   }
+
+   # 3.4 iCalendar Stream
+
+   start = element icalendar {
+       vcalendar+
+   }
+
+   # 3.6 Calendar Components
+
+   vcalendar = element vcalendar {
+       type-calprops,
+       type-component
+   }
+
+   type-calprops = element properties {
+       property-prodid &
+       property-version &
+       property-calscale? &
+       property-method?
+   }
+
+   type-component = element components {
+       (
+           component-vevent |
+           component-vtodo |
+           component-vjournal |
+           component-vfreebusy |
+           component-vtimezone
+       )*
+   }
+
+   # 3.6.1 Event Component
+
+   component-vevent = element vevent {
+       type-eventprop,
+       element components {
+           component-valarm+
+       }?
+   }
+
+   type-eventprop = element properties {
+       property-dtstamp &
+       property-dtstart &
+       property-uid &
+
+       property-class? &
+       property-created? &
+       property-description? &
+       property-geo? &
+       property-last-mod? &
+       property-location? &
+       property-organizer? &
+       property-priority? &
+       property-seq? &
+       property-status-event? &
+
+       property-summary? &
+       property-transp? &
+       property-url? &
+       property-recurid? &
+
+       property-rrule? &
+
+       (property-dtend | property-duration)? &
+
+       property-attach* &
+       property-attendee* &
+       property-categories* &
+       property-comment* &
+       property-contact* &
+       property-exdate* &
+       property-rstatus* &
+       property-related* &
+       property-resources* &
+       property-rdate*
+   }
+
+   # 3.6.2 To-do Component
+
+   component-vtodo = element vtodo {
+       type-todoprop,
+       element components {
+           component-valarm+
+       }?
+   }
+
+   type-todoprop = element properties {
+       property-dtstamp &
+       property-uid &
+
+       property-class? &
+       property-completed? &
+       property-created? &
+       property-description? &
+       property-geo? &
+       property-last-mod? &
+       property-location? &
+       property-organizer? &
+       property-percent? &
+       property-priority? &
+       property-recurid? &
+       property-seq? &
+       property-status-todo? &
+       property-summary? &
+
+       property-url? &
+
+       property-rrule? &
+
+       (
+           (property-dtstart?, property-dtend? ) |
+           (property-dtstart, property-duration)?
+       ) &
+
+       property-attach* &
+       property-attendee* &
+       property-categories* &
+       property-comment* &
+       property-contact* &
+       property-exdate* &
+       property-rstatus* &
+       property-related* &
+       property-resources* &
+       property-rdate*
+   }
+
+   # 3.6.3 Journal Component
+
+   component-vjournal = element vjournal {
+       type-jourprop
+   }
+
+   type-jourprop = element properties {
+       property-dtstamp &
+       property-uid &
+
+       property-class? &
+       property-created? &
+       property-dtstart? &
+       property-last-mod? &
+       property-organizer? &
+       property-recurid? &
+       property-seq? &
+       property-status-jour? &
+       property-summary? &
+       property-url? &
+
+       property-rrule? &
+
+       property-attach* &
+       property-attendee* &
+       property-categories* &
+       property-comment* &
+       property-contact* &
+       property-description? &
+       property-exdate* &
+       property-related* &
+       property-rdate* &
+       property-rstatus*
+   }
+
+   # 3.6.4 Free/Busy Component
+
+   component-vfreebusy = element vfreebusy {
+       type-fbprop
+   }
+
+   type-fbprop = element properties {
+       property-dtstamp &
+       property-uid &
+
+       property-contact? &
+       property-dtstart? &
+       property-dtend? &
+       property-duration? &
+       property-organizer? &
+       property-url? &
+
+       property-attendee* &
+       property-comment* &
+       property-freebusy* &
+       property-rstatus*
+   }
+
+   # 3.6.5 Time Zone Component
+
+   component-vtimezone = element vtimezone {
+       element properties {
+           property-tzid &
+
+           property-last-mod? &
+       # mbaudier - 2022-05-31 : corrected undefined reference from RFC 6321
+           property-tzurl?
+       },
+       element components {
+           (component-standard | component-daylight) &
+           component-standard* &
+           component-daylight*
+       }
+   }
+
+   component-standard = element standard {
+       type-tzprop
+   }
+
+   component-daylight = element daylight {
+       type-tzprop
+   }
+
+   type-tzprop = element properties {
+       property-dtstart &
+       property-tzoffsetto &
+       property-tzoffsetfrom &
+
+       property-rrule? &
+
+       property-comment* &
+       property-rdate* &
+       property-tzname*
+   }
+
+   # 3.6.6 Alarm Component
+
+   component-valarm = element valarm {
+       # mbaudier - 2022-05-31 : corrected undefined reference from RFC 6321
+       type-audioprop | type-dispprop | type-emailprop
+   }
+
+   type-audioprop = element properties {
+       property-action &
+
+       property-trigger &
+
+       (property-duration, property-repeat)? &
+
+       property-attach?
+   }
+
+   type-dispprop = element properties {
+       property-action &
+       property-description &
+       property-trigger &
+       property-summary &
+
+       property-attendee+ &
+
+       (property-duration, property-repeat)? &
+
+       property-attach*
+   }
+
+   type-emailprop = element properties {
+       property-action &
+       property-description &
+       property-trigger &
+
+       (property-duration, property-repeat)?
+   }
+
+   # 3.7 Calendar Properties
+
+   # 3.7.1 Calendar Scale
+
+   property-calscale = element calscale {
+
+       element parameters { empty }?,
+
+       element text { "GREGORIAN" }
+   }
+
+   # 3.7.2 Method
+
+   property-method = element method {
+
+       element parameters { empty }?,
+
+       value-text
+   }
+
+   # 3.7.3 Product Identifier
+
+   property-prodid = element prodid {
+
+       element parameters { empty }?,
+
+       value-text
+   }
+
+   # 3.7.4 Version
+
+   property-version = element version {
+
+       element parameters { empty }?,
+
+       element text { "2.0" }
+   }
+
+   # 3.8 Component Properties
+
+   # 3.8.1 Descriptive Component Properties
+
+   # 3.8.1.1 Attachment
+
+   property-attach = element attach {
+
+       element parameters {
+           fmttypeparam? &
+           encodingparam?
+       }?,
+
+       # mbaudier - 2022-05-31 : corrected syntax error from RFC 6321
+       (value-uri |
+       value-binary)
+   }
+
+   # 3.8.1.2 Categories
+
+   property-categories = element categories {
+
+       element parameters {
+       # mbaudier - 2022-05-31 : corrected syntax error from RFC 6321
+           languageparam? 
+       }?,
+
+       value-text+
+   }
+
+   # 3.8.1.3 Classification
+
+   property-class = element class {
+
+       element parameters { empty }?,
+
+       element text {
+           "PUBLIC" |
+           "PRIVATE" |
+           "CONFIDENTIAL"
+       }
+   }
+
+   # 3.8.1.4 Comment
+
+   property-comment = element comment {
+
+       element parameters {
+           altrepparam? &
+           languageparam?
+       }?,
+
+       value-text
+   }
+
+   # 3.8.1.5 Description
+
+   property-description = element description {
+
+       element parameters {
+           altrepparam? &
+           languageparam?
+       }?,
+
+       value-text
+   }
+
+   # 3.8.1.6 Geographic Position
+
+   property-geo = element geo {
+
+       element parameters { empty }?,
+
+       element latitude  { xsd:float },
+       element longitude { xsd:float }
+   }
+
+   # 3.8.1.7 Location
+
+   property-location = element location {
+
+       element parameters {
+
+           altrepparam? &
+           languageparam?
+       }?,
+
+       value-text
+   }
+
+   # 3.8.1.8 Percent Complete
+
+   property-percent = element percent-complete {
+
+       element parameters { empty }?,
+
+       value-integer
+   }
+
+
+   # 3.8.1.9 Priority
+
+   property-priority = element priority {
+
+       element parameters { empty }?,
+
+       value-integer
+   }
+
+   # 3.8.1.10 Resources
+
+   property-resources = element resources {
+
+       element parameters {
+           altrepparam? &
+           languageparam?
+       }?,
+
+       value-text+
+   }
+
+   # 3.8.1.11 Status
+
+   property-status-event = element status {
+
+       element parameters { empty }?,
+
+       element text {
+           "TENTATIVE" |
+           "CONFIRMED" |
+           "CANCELLED"
+       }
+   }
+
+   property-status-todo = element status {
+
+       element parameters { empty }?,
+
+       element text {
+           "NEEDS-ACTION" |
+           "COMPLETED" |
+           "IN-PROCESS" |
+           "CANCELLED"
+       }
+   }
+
+   property-status-jour = element status {
+
+       element parameters { empty }?,
+
+       element text {
+           "DRAFT" |
+           "FINAL" |
+           "CANCELLED"
+       }
+   }
+
+   # 3.8.1.12 Summary
+
+   property-summary = element summary {
+
+       element parameters {
+           altrepparam? &
+           languageparam?
+       }?,
+
+       value-text
+   }
+
+   # 3.8.2 Date and Time Component Properties
+
+   # 3.8.2.1 Date/Time Completed
+
+   property-completed = element completed {
+
+       element parameters { empty }?,
+
+       value-date-time
+   }
+
+   # 3.8.2.2 Date/Time End
+
+   property-dtend = element dtend {
+
+       element parameters {
+           tzidparam?
+       }?,
+
+       # mbaudier - 2022-05-31 : corrected syntax error from RFC 6321
+       (value-date-time |
+       value-date)
+   }
+
+   # 3.8.2.3 Date/Time Due
+
+   property-due = element due {
+
+       element parameters {
+           tzidparam?
+       }?,
+
+       # mbaudier - 2022-05-31 : corrected syntax error from RFC 6321
+       (value-date-time |
+       value-date)
+   }
+
+   # 3.8.2.4 Date/Time Start
+
+   property-dtstart = element dtstart {
+
+       element parameters {
+           tzidparam?
+       }?,
+
+       # mbaudier - 2022-05-31 : corrected syntax error from RFC 6321
+       (value-date-time |
+       value-date)
+   }
+
+   # 3.8.2.5 Duration
+
+   property-duration = element duration {
+
+       element parameters { empty }?,
+
+       value-duration
+   }
+
+   # 3.8.2.6 Free/Busy Time
+
+   property-freebusy = element freebusy {
+
+       element parameters {
+           fbtypeparam?
+       }?,
+
+
+       value-period+
+   }
+
+   # 3.8.2.7 Time Transparency
+
+   property-transp = element transp {
+
+
+       element parameters { empty }?,
+
+       element text {
+           "OPAQUE" |
+           "TRANSPARENT"
+       }
+   }
+
+   # 3.8.3 Time Zone Component Properties
+
+   # 3.8.3.1 Time Zone Identifier
+
+   property-tzid = element tzid {
+
+       element parameters { empty }?,
+
+       value-text
+   }
+
+   # 3.8.3.2 Time Zone Name
+
+   property-tzname = element tzname {
+
+       element parameters {
+           languageparam?
+       }?,
+
+       value-text
+   }
+
+   # 3.8.3.3 Time Zone Offset From
+
+   property-tzoffsetfrom = element tzoffsetfrom {
+
+       element parameters { empty }?,
+
+       value-utc-offset
+   }
+
+   # 3.8.3.4 Time Zone Offset To
+
+   property-tzoffsetto = element tzoffsetto {
+
+       element parameters { empty }?,
+
+       value-utc-offset
+   }
+
+   # 3.8.3.5 Time Zone URL
+
+   property-tzurl = element tzurl {
+
+       element parameters { empty }?,
+
+       value-uri
+   }
+
+   # 3.8.4 Relationship Component Properties
+
+   # 3.8.4.1 Attendee
+
+   property-attendee = element attendee {
+
+       element parameters {
+           cutypeparam? &
+           memberparam? &
+           roleparam? &
+           partstatparam? &
+           rsvpparam? &
+           deltoparam? &
+           delfromparam? &
+           sentbyparam? &
+           cnparam? &
+           dirparam? &
+           languageparam?
+       }?,
+
+       value-cal-address
+   }
+
+   # 3.8.4.2 Contact
+
+   property-contact = element contact {
+
+       element parameters {
+           altrepparam? &
+           languageparam?
+       }?,
+
+       value-text
+   }
+
+   # 3.8.4.3 Organizer
+
+   property-organizer = element organizer {
+
+       element parameters {
+           cnparam? &
+           dirparam? &
+           sentbyparam? &
+           languageparam?
+       }?,
+
+       value-cal-address
+   }
+
+   # 3.8.4.4 Recurrence ID
+
+   property-recurid = element recurrence-id {
+
+       element parameters {
+           tzidparam? &
+           rangeparam?
+       }?,
+
+       # mbaudier - 2022-05-31 : corrected syntax error from RFC 6321
+       (value-date-time |
+       value-date)
+   }
+
+   # 3.8.4.5 Related-To
+
+   property-related = element related-to {
+
+       element parameters {
+           reltypeparam?
+       }?,
+
+       value-text
+   }
+
+   # 3.8.4.6 Uniform Resource Locator
+
+   property-url = element url {
+
+       element parameters { empty }?,
+
+       value-uri
+   }
+
+   # 3.8.4.7 Unique Identifier
+
+   property-uid = element uid {
+
+       element parameters { empty }?,
+       value-text
+   }
+
+   # 3.8.5 Recurrence Component Properties
+
+   # 3.8.5.1 Exception Date/Times
+
+   property-exdate = element exdate {
+
+       element parameters {
+           tzidparam?
+       }?,
+
+       # mbaudier - 2022-05-31 : corrected syntax error from RFC 6321
+       (value-date-time+ |
+       value-date+)
+   }
+
+   # 3.8.5.2 Recurrence Date/Times
+
+   property-rdate = element rdate {
+
+       element parameters {
+           tzidparam?
+       }?,
+
+       # mbaudier - 2022-05-31 : corrected syntax error from RFC 6321
+       (value-date-time+ |
+       value-date+ |
+       value-period+)
+   }
+
+   # 3.8.5.3 Recurrence Rule
+
+   property-rrule = element rrule {
+
+       element parameters { empty }?,
+
+       value-recur
+   }
+
+   # 3.8.6 Alarm Component Properties
+
+   # 3.8.6.1 Action
+
+   property-action = element action {
+
+       element parameters { empty }?,
+       element text {
+           "AUDIO" |
+           "DISPLAY" |
+           "EMAIL"
+       }
+   }
+
+   # 3.8.6.2 Repeat Count
+
+   property-repeat = element repeat {
+
+       element parameters { empty }?,
+
+       value-integer
+   }
+
+   # 3.8.6.3 Trigger
+
+   property-trigger = element trigger {
+
+       (
+           element parameters {
+               trigrelparam?
+           }?,
+
+           value-duration
+       ) |
+       (
+           element parameters { empty }?,
+
+           value-date-time
+       )
+   }
+
+   # 3.8.7 Change Management Component Properties
+
+   # 3.8.7.1 Date/Time Created
+
+   property-created = element created {
+
+       element parameters { empty }?,
+
+       value-date-time
+   }
+
+   # 3.8.7.2 Date/Time Stamp
+
+   property-dtstamp = element dtstamp {
+       element parameters { empty }?,
+
+       value-date-time
+   }
+
+   # 3.8.7.3 Last Modified
+
+   property-last-mod = element last-modified {
+
+       element parameters { empty }?,
+
+       value-date-time
+   }
+
+   # 3.8.7.4 Sequence Number
+
+   property-seq = element sequence {
+
+       element parameters { empty }?,
+
+       value-integer
+   }
+
+   # 3.8.8 Miscellaneous Component Properties
+
+   # 3.8.8.3 Request Status
+
+   property-rstatus = element request-status {
+
+       element parameters {
+           languageparam?
+       }?,
+
+       element code { xsd:string },
+       element description { xsd:string },
+       element data { xsd:string }?
+   }
+
+
+
+
+
diff --git a/org.argeo.app.core/src/org/argeo/app/core/schemas/xCal-2.0.xsd b/org.argeo.app.core/src/org/argeo/app/core/schemas/xCal-2.0.xsd
new file mode 100644 (file)
index 0000000..d0bb31e
--- /dev/null
@@ -0,0 +1,1489 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:ietf:params:xml:ns:icalendar-2.0" xmlns:ns1="urn:ietf:params:xml:ns:icalendar-2.0">
+  <!-- 3.2 Property Parameters -->
+  <!-- 3.2.1 Alternate Text Representation -->
+  <xs:element name="altrep">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="ns1:uri"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.2.2 Common Name -->
+  <xs:element name="cn">
+    <xs:complexType>
+      <xs:group ref="ns1:value-text"/>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.2.3 Calendar User Type -->
+  <xs:element name="cutype">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="text">
+          <xs:simpleType>
+            <xs:restriction base="xs:token">
+              <xs:enumeration value="INDIVIDUAL"/>
+              <xs:enumeration value="GROUP"/>
+              <xs:enumeration value="RESOURCE"/>
+              <xs:enumeration value="ROOM"/>
+              <xs:enumeration value="UNKNOWN"/>
+            </xs:restriction>
+          </xs:simpleType>
+        </xs:element>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.2.4 Delegators -->
+  <xs:element name="delegated-from">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="ns1:cal-address"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.2.5 Delegatees -->
+  <xs:element name="delegated-to">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="ns1:cal-address"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.2.6 Directory Entry Reference -->
+  <xs:element name="dir">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="ns1:uri"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.2.7 Inline Encoding -->
+  <xs:element name="encoding">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="text">
+          <xs:simpleType>
+            <xs:restriction base="xs:token">
+              <xs:enumeration value="8BIT"/>
+              <xs:enumeration value="BASE64"/>
+            </xs:restriction>
+          </xs:simpleType>
+        </xs:element>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.2.8 Format Type -->
+  <xs:element name="fmttype">
+    <xs:complexType>
+      <xs:group ref="ns1:value-text"/>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.2.9 Free/Busy Time Type -->
+  <xs:element name="fbtype">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="text">
+          <xs:simpleType>
+            <xs:restriction base="xs:token">
+              <xs:enumeration value="FREE"/>
+              <xs:enumeration value="BUSY"/>
+              <xs:enumeration value="BUSY-UNAVAILABLE"/>
+              <xs:enumeration value="BUSY-TENTATIVE"/>
+            </xs:restriction>
+          </xs:simpleType>
+        </xs:element>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.2.10 Language -->
+  <xs:element name="language">
+    <xs:complexType>
+      <xs:group ref="ns1:value-text"/>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.2.11 Group or List Membership -->
+  <xs:element name="member">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="ns1:cal-address"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.2.12 Participation Status -->
+  <xs:element name="partstat">
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="ns1:type-partstat-event"/>
+        <xs:group ref="ns1:type-partstat-todo"/>
+        <xs:group ref="ns1:type-partstat-jour"/>
+      </xs:choice>
+    </xs:complexType>
+  </xs:element>
+  <xs:group name="type-partstat-event">
+    <xs:sequence>
+      <xs:element name="text">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="NEEDS-ACTION"/>
+            <xs:enumeration value="ACCEPTED"/>
+            <xs:enumeration value="DECLINED"/>
+            <xs:enumeration value="TENTATIVE"/>
+            <xs:enumeration value="DELEGATED"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:group name="type-partstat-todo">
+    <xs:sequence>
+      <xs:element name="text">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="NEEDS-ACTION"/>
+            <xs:enumeration value="ACCEPTED"/>
+            <xs:enumeration value="DECLINED"/>
+            <xs:enumeration value="TENTATIVE"/>
+            <xs:enumeration value="DELEGATED"/>
+            <xs:enumeration value="COMPLETED"/>
+            <xs:enumeration value="IN-PROCESS"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:group name="type-partstat-jour">
+    <xs:sequence>
+      <xs:element name="text">
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:enumeration value="NEEDS-ACTION"/>
+            <xs:enumeration value="ACCEPTED"/>
+            <xs:enumeration value="DECLINED"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <!-- 3.2.13 Recurrence Identifier Range -->
+  <xs:element name="range">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="text">
+          <xs:simpleType>
+            <xs:restriction base="xs:token">
+              <xs:enumeration value="THISANDFUTURE"/>
+            </xs:restriction>
+          </xs:simpleType>
+        </xs:element>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.2.14 Alarm Trigger Relationship -->
+  <xs:element name="related">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="text">
+          <xs:simpleType>
+            <xs:restriction base="xs:token">
+              <xs:enumeration value="START"/>
+              <xs:enumeration value="END"/>
+            </xs:restriction>
+          </xs:simpleType>
+        </xs:element>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.2.15 Relationship Type -->
+  <xs:element name="reltype">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="text">
+          <xs:simpleType>
+            <xs:restriction base="xs:token">
+              <xs:enumeration value="PARENT"/>
+              <xs:enumeration value="CHILD"/>
+              <xs:enumeration value="SIBLING"/>
+            </xs:restriction>
+          </xs:simpleType>
+        </xs:element>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.2.16 Participation Role -->
+  <xs:element name="role">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="text">
+          <xs:simpleType>
+            <xs:restriction base="xs:token">
+              <xs:enumeration value="CHAIR"/>
+              <xs:enumeration value="REQ-PARTICIPANT"/>
+              <xs:enumeration value="OPT-PARTICIPANT"/>
+              <xs:enumeration value="NON-PARTICIPANT"/>
+            </xs:restriction>
+          </xs:simpleType>
+        </xs:element>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.2.17 RSVP Expectation -->
+  <xs:element name="rsvp" type="ns1:value-boolean"/>
+  <!-- 3.2.18 Sent By -->
+  <xs:element name="sent-by">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="ns1:cal-address"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.2.19 Time Zone Identifier -->
+  <xs:group name="tzidparam">
+    <xs:sequence>
+      <xs:element name="tzid">
+        <xs:complexType>
+          <xs:group ref="ns1:value-text"/>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <!-- 3.3 Property Value Data Types -->
+  <!-- 3.3.1 BINARY -->
+  <xs:element name="binary" type="xs:string"/>
+  <!-- 3.3.2 BOOLEAN -->
+  <xs:complexType name="value-boolean">
+    <xs:sequence>
+      <xs:element ref="ns1:boolean"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:element name="boolean" type="xs:boolean"/>
+  <!-- 3.3.3 CAL-ADDRESS -->
+  <xs:element name="cal-address" type="xs:anyURI"/>
+  <!-- 3.3.4 DATE -->
+  <xs:simpleType name="pattern-date">
+    <xs:restriction base="xs:string">
+      <xs:pattern value="\d\d\d\d-\d\d-\d\d"/>
+    </xs:restriction>
+  </xs:simpleType>
+  <xs:element name="date" type="ns1:pattern-date"/>
+  <!-- 3.3.5 DATE-TIME -->
+  <xs:simpleType name="pattern-date-time">
+    <xs:restriction base="xs:string">
+      <xs:pattern value="\d\d\d\d-\d\d-\d\dT\d\d:\d\d:\d\dZ?"/>
+    </xs:restriction>
+  </xs:simpleType>
+  <xs:element name="date-time" type="ns1:pattern-date-time"/>
+  <!-- 3.3.6 DURATION -->
+  <xs:simpleType name="pattern-duration">
+    <xs:restriction base="xs:string">
+      <xs:pattern value="(\+|-)?P(\d+W)|(\d+D)?(T(\d+H(\d+M)?(\d+S)?)|(\d+M(\d+S)?)|(\d+S))?"/>
+    </xs:restriction>
+  </xs:simpleType>
+  <xs:group name="value-duration">
+    <xs:sequence>
+      <xs:element name="duration" type="ns1:pattern-duration"/>
+    </xs:sequence>
+  </xs:group>
+  <!-- 3.3.7 FLOAT -->
+  <xs:element name="float" type="xs:float"/>
+  <!-- 3.3.8 INTEGER -->
+  <xs:element name="integer" type="xs:integer"/>
+  <!-- 3.3.9 PERIOD -->
+  <xs:element name="period">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="ns1:start"/>
+        <xs:choice>
+          <xs:element ref="ns1:end"/>
+          <xs:element name="duration" type="ns1:pattern-duration"/>
+        </xs:choice>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="start" type="ns1:pattern-date-time"/>
+  <xs:element name="end" type="ns1:pattern-date-time"/>
+  <!-- 3.3.10 RECUR -->
+  <xs:element name="recur">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="ns1:freq"/>
+        <xs:choice minOccurs="0">
+          <xs:element ref="ns1:until"/>
+          <xs:element ref="ns1:count"/>
+        </xs:choice>
+        <xs:element minOccurs="0" ref="ns1:interval"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="ns1:bysecond"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="ns1:byminute"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="ns1:byhour"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="ns1:byday"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="ns1:bymonthday"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="ns1:byyearday"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="ns1:byweekno"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="ns1:bymonth"/>
+        <xs:element minOccurs="0" maxOccurs="unbounded" ref="ns1:bysetpos"/>
+        <xs:element minOccurs="0" ref="ns1:wkst"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="interval" type="xs:positiveInteger"/>
+  <xs:element name="wkst" type="ns1:type-weekday"/>
+  <xs:element name="freq">
+    <xs:simpleType>
+      <xs:restriction base="xs:token">
+        <xs:enumeration value="SECONDLY"/>
+        <xs:enumeration value="MINUTELY"/>
+        <xs:enumeration value="HOURLY"/>
+        <xs:enumeration value="DAILY"/>
+        <xs:enumeration value="WEEKLY"/>
+        <xs:enumeration value="MONTHLY"/>
+        <xs:enumeration value="YEARLY"/>
+      </xs:restriction>
+    </xs:simpleType>
+  </xs:element>
+  <xs:element name="until">
+    <xs:complexType>
+      <xs:choice>
+        <xs:element ref="ns1:date"/>
+        <xs:element ref="ns1:date-time"/>
+      </xs:choice>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="count" type="xs:positiveInteger"/>
+  <xs:element name="bysecond" type="xs:positiveInteger"/>
+  <xs:element name="byminute" type="xs:positiveInteger"/>
+  <xs:element name="byhour" type="xs:positiveInteger"/>
+  <xs:simpleType name="type-weekday">
+    <xs:restriction base="xs:token">
+      <xs:enumeration value="SU"/>
+      <xs:enumeration value="MO"/>
+      <xs:enumeration value="TU"/>
+      <xs:enumeration value="WE"/>
+      <xs:enumeration value="TH"/>
+      <xs:enumeration value="FR"/>
+      <xs:enumeration value="SA"/>
+    </xs:restriction>
+  </xs:simpleType>
+  <xs:element name="byday">
+    <xs:simpleType>
+      <xs:union>
+        <xs:simpleType>
+          <xs:union memberTypes="xs:integer ns1:type-weekday"/>
+        </xs:simpleType>
+        <xs:simpleType>
+          <xs:restriction base="xs:token">
+            <xs:length value="0"/>
+          </xs:restriction>
+        </xs:simpleType>
+      </xs:union>
+    </xs:simpleType>
+  </xs:element>
+  <xs:element name="bymonthday" type="xs:integer"/>
+  <xs:element name="byyearday" type="xs:integer"/>
+  <xs:element name="byweekno" type="xs:integer"/>
+  <xs:element name="bymonth" type="xs:positiveInteger"/>
+  <xs:element name="bysetpos" type="xs:integer"/>
+  <!-- 3.3.11 TEXT -->
+  <xs:group name="value-text">
+    <xs:sequence>
+      <xs:element name="text" type="xs:string"/>
+    </xs:sequence>
+  </xs:group>
+  <!-- 3.3.12 TIME -->
+  <xs:simpleType name="pattern-time">
+    <xs:restriction base="xs:string">
+      <xs:pattern value="\d\d:\d\d:\d\dZ?"/>
+    </xs:restriction>
+  </xs:simpleType>
+  <xs:element name="time" type="ns1:pattern-time"/>
+  <!-- 3.3.13 URI -->
+  <xs:element name="uri" type="xs:anyURI"/>
+  <!-- 3.3.14 UTC-OFFSET -->
+  <xs:element name="utc-offset">
+    <xs:simpleType>
+      <xs:restriction base="xs:string">
+        <xs:pattern value="(\+|-)\d\d:\d\d(:\d\d)?"/>
+      </xs:restriction>
+    </xs:simpleType>
+  </xs:element>
+  <!-- UNKNOWN -->
+  <xs:element name="unknown" type="xs:string"/>
+  <!-- 3.4 iCalendar Stream -->
+  <xs:element name="icalendar">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="ns1:vcalendar"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.6 Calendar Components -->
+  <xs:element name="vcalendar">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:group ref="ns1:type-calprops"/>
+        <xs:element ref="ns1:components"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:group name="type-calprops">
+    <xs:sequence>
+      <xs:element name="properties">
+        <xs:complexType>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="ns1:prodid"/>
+            <xs:element ref="ns1:version"/>
+            <xs:element ref="ns1:calscale"/>
+            <xs:element ref="ns1:method"/>
+          </xs:choice>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:element name="components">
+    <xs:complexType>
+      <xs:choice minOccurs="0" maxOccurs="unbounded">
+        <xs:element ref="ns1:vevent"/>
+        <xs:element ref="ns1:vtodo"/>
+        <xs:element ref="ns1:vjournal"/>
+        <xs:element ref="ns1:vfreebusy"/>
+        <xs:element ref="ns1:vtimezone"/>
+      </xs:choice>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.6.1 Event Component -->
+  <xs:element name="vevent">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:group ref="ns1:type-eventprop"/>
+        <xs:element minOccurs="0" name="components">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="ns1:valarm"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:group name="type-eventprop">
+    <xs:sequence>
+      <xs:element name="properties">
+        <xs:complexType>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="ns1:dtstamp"/>
+            <xs:element ref="ns1:dtstart"/>
+            <xs:element ref="ns1:uid"/>
+            <xs:element ref="ns1:class"/>
+            <xs:element ref="ns1:created"/>
+            <xs:element ref="ns1:description"/>
+            <xs:element ref="ns1:geo"/>
+            <xs:element ref="ns1:last-modified"/>
+            <xs:element ref="ns1:location"/>
+            <xs:element ref="ns1:organizer"/>
+            <xs:element ref="ns1:priority"/>
+            <xs:element ref="ns1:sequence"/>
+            <xs:group ref="ns1:property-status-event"/>
+            <xs:element ref="ns1:summary"/>
+            <xs:element ref="ns1:transp"/>
+            <xs:element ref="ns1:url"/>
+            <xs:element ref="ns1:recurrence-id"/>
+            <xs:element ref="ns1:rrule"/>
+            <xs:choice>
+              <xs:element ref="ns1:dtend"/>
+              <xs:group ref="ns1:property-duration"/>
+            </xs:choice>
+            <xs:element ref="ns1:attach"/>
+            <xs:element ref="ns1:attendee"/>
+            <xs:element ref="ns1:categories"/>
+            <xs:element ref="ns1:comment"/>
+            <xs:element ref="ns1:contact"/>
+            <xs:element ref="ns1:exdate"/>
+            <xs:element ref="ns1:request-status"/>
+            <xs:element ref="ns1:related-to"/>
+            <xs:element ref="ns1:resources"/>
+            <xs:element ref="ns1:rdate"/>
+          </xs:choice>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <!-- 3.6.2 To-do Component -->
+  <xs:element name="vtodo">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:group ref="ns1:type-todoprop"/>
+        <xs:element minOccurs="0" name="components">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element maxOccurs="unbounded" ref="ns1:valarm"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:group name="type-todoprop">
+    <xs:sequence>
+      <xs:element name="properties">
+        <xs:complexType>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="ns1:dtstamp"/>
+            <xs:element ref="ns1:uid"/>
+            <xs:element ref="ns1:class"/>
+            <xs:element ref="ns1:completed"/>
+            <xs:element ref="ns1:created"/>
+            <xs:element ref="ns1:description"/>
+            <xs:element ref="ns1:geo"/>
+            <xs:element ref="ns1:last-modified"/>
+            <xs:element ref="ns1:location"/>
+            <xs:element ref="ns1:organizer"/>
+            <xs:element ref="ns1:percent-complete"/>
+            <xs:element ref="ns1:priority"/>
+            <xs:element ref="ns1:recurrence-id"/>
+            <xs:element ref="ns1:sequence"/>
+            <xs:group ref="ns1:property-status-todo"/>
+            <xs:element ref="ns1:summary"/>
+            <xs:element ref="ns1:url"/>
+            <xs:element ref="ns1:rrule"/>
+            <xs:choice>
+              <xs:choice>
+                <xs:element ref="ns1:dtstart"/>
+                <xs:element ref="ns1:dtend"/>
+              </xs:choice>
+              <xs:choice>
+                <xs:element ref="ns1:dtstart"/>
+                <xs:group ref="ns1:property-duration"/>
+              </xs:choice>
+            </xs:choice>
+            <xs:element ref="ns1:attach"/>
+            <xs:element ref="ns1:attendee"/>
+            <xs:element ref="ns1:categories"/>
+            <xs:element ref="ns1:comment"/>
+            <xs:element ref="ns1:contact"/>
+            <xs:element ref="ns1:exdate"/>
+            <xs:element ref="ns1:request-status"/>
+            <xs:element ref="ns1:related-to"/>
+            <xs:element ref="ns1:resources"/>
+            <xs:element ref="ns1:rdate"/>
+          </xs:choice>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <!-- 3.6.3 Journal Component -->
+  <xs:element name="vjournal" type="ns1:type-jourprop"/>
+  <xs:complexType name="type-jourprop">
+    <xs:sequence>
+      <xs:element name="properties">
+        <xs:complexType>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="ns1:dtstamp"/>
+            <xs:element ref="ns1:uid"/>
+            <xs:element ref="ns1:class"/>
+            <xs:element ref="ns1:created"/>
+            <xs:element ref="ns1:dtstart"/>
+            <xs:element ref="ns1:last-modified"/>
+            <xs:element ref="ns1:organizer"/>
+            <xs:element ref="ns1:recurrence-id"/>
+            <xs:element ref="ns1:sequence"/>
+            <xs:group ref="ns1:property-status-jour"/>
+            <xs:element ref="ns1:summary"/>
+            <xs:element ref="ns1:url"/>
+            <xs:element ref="ns1:rrule"/>
+            <xs:element ref="ns1:attach"/>
+            <xs:element ref="ns1:attendee"/>
+            <xs:element ref="ns1:categories"/>
+            <xs:element ref="ns1:comment"/>
+            <xs:element ref="ns1:contact"/>
+            <xs:element ref="ns1:description"/>
+            <xs:element ref="ns1:exdate"/>
+            <xs:element ref="ns1:related-to"/>
+            <xs:element ref="ns1:rdate"/>
+            <xs:element ref="ns1:request-status"/>
+          </xs:choice>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:complexType>
+  <!-- 3.6.4 Free/Busy Component -->
+  <xs:element name="vfreebusy" type="ns1:type-fbprop"/>
+  <xs:complexType name="type-fbprop">
+    <xs:sequence>
+      <xs:element name="properties">
+        <xs:complexType>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="ns1:dtstamp"/>
+            <xs:element ref="ns1:uid"/>
+            <xs:element ref="ns1:contact"/>
+            <xs:element ref="ns1:dtstart"/>
+            <xs:element ref="ns1:dtend"/>
+            <xs:group ref="ns1:property-duration"/>
+            <xs:element ref="ns1:organizer"/>
+            <xs:element ref="ns1:url"/>
+            <xs:element ref="ns1:attendee"/>
+            <xs:element ref="ns1:comment"/>
+            <xs:element ref="ns1:freebusy"/>
+            <xs:element ref="ns1:request-status"/>
+          </xs:choice>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:complexType>
+  <!-- 3.6.5 Time Zone Component -->
+  <xs:element name="vtimezone">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="properties">
+          <xs:complexType>
+            <xs:choice minOccurs="0" maxOccurs="unbounded">
+              <xs:group ref="ns1:property-tzid"/>
+              <xs:element ref="ns1:last-modified"/>
+              <xs:element ref="ns1:tzurl"/>
+            </xs:choice>
+          </xs:complexType>
+        </xs:element>
+        <xs:element name="components">
+          <xs:complexType>
+            <xs:choice minOccurs="0" maxOccurs="unbounded">
+              <xs:choice>
+                <xs:element ref="ns1:standard"/>
+                <xs:element ref="ns1:daylight"/>
+              </xs:choice>
+              <xs:element ref="ns1:standard"/>
+              <xs:element ref="ns1:daylight"/>
+            </xs:choice>
+          </xs:complexType>
+        </xs:element>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="standard" type="ns1:type-tzprop"/>
+  <xs:element name="daylight" type="ns1:type-tzprop"/>
+  <xs:complexType name="type-tzprop">
+    <xs:sequence>
+      <xs:element name="properties">
+        <xs:complexType>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="ns1:dtstart"/>
+            <xs:element ref="ns1:tzoffsetto"/>
+            <xs:element ref="ns1:tzoffsetfrom"/>
+            <xs:element ref="ns1:rrule"/>
+            <xs:element ref="ns1:comment"/>
+            <xs:element ref="ns1:rdate"/>
+            <xs:element ref="ns1:tzname"/>
+          </xs:choice>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:complexType>
+  <!-- 3.6.6 Alarm Component -->
+  <xs:element name="valarm">
+    <xs:complexType>
+      <xs:choice>
+        <xs:group ref="ns1:type-audioprop"/>
+        <xs:group ref="ns1:type-dispprop"/>
+        <xs:group ref="ns1:type-emailprop"/>
+      </xs:choice>
+    </xs:complexType>
+  </xs:element>
+  <xs:group name="type-audioprop">
+    <xs:sequence>
+      <xs:element name="properties">
+        <xs:complexType>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="ns1:action"/>
+            <xs:element ref="ns1:trigger"/>
+            <xs:choice>
+              <xs:group ref="ns1:property-duration"/>
+              <xs:element ref="ns1:repeat"/>
+            </xs:choice>
+            <xs:element ref="ns1:attach"/>
+          </xs:choice>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:group name="type-dispprop">
+    <xs:sequence>
+      <xs:element name="properties">
+        <xs:complexType>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="ns1:action"/>
+            <xs:element ref="ns1:description"/>
+            <xs:element ref="ns1:trigger"/>
+            <xs:element ref="ns1:summary"/>
+            <xs:element ref="ns1:attendee"/>
+            <xs:choice>
+              <xs:group ref="ns1:property-duration"/>
+              <xs:element ref="ns1:repeat"/>
+            </xs:choice>
+            <xs:element ref="ns1:attach"/>
+          </xs:choice>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:group name="type-emailprop">
+    <xs:sequence>
+      <xs:element name="properties">
+        <xs:complexType>
+          <xs:choice minOccurs="0" maxOccurs="unbounded">
+            <xs:element ref="ns1:action"/>
+            <xs:element ref="ns1:description"/>
+            <xs:element ref="ns1:trigger"/>
+            <xs:choice>
+              <xs:group ref="ns1:property-duration"/>
+              <xs:element ref="ns1:repeat"/>
+            </xs:choice>
+          </xs:choice>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <!-- 3.7 Calendar Properties -->
+  <!-- 3.7.1 Calendar Scale -->
+  <xs:element name="calscale">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType/>
+        </xs:element>
+        <xs:element name="text">
+          <xs:simpleType>
+            <xs:restriction base="xs:token">
+              <xs:enumeration value="GREGORIAN"/>
+            </xs:restriction>
+          </xs:simpleType>
+        </xs:element>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.7.2 Method -->
+  <xs:element name="method">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType/>
+        </xs:element>
+        <xs:group ref="ns1:value-text"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.7.3 Product Identifier -->
+  <xs:element name="prodid">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType/>
+        </xs:element>
+        <xs:group ref="ns1:value-text"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.7.4 Version -->
+  <xs:element name="version">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType/>
+        </xs:element>
+        <xs:element name="text">
+          <xs:simpleType>
+            <xs:restriction base="xs:token">
+              <xs:enumeration value="2.0"/>
+            </xs:restriction>
+          </xs:simpleType>
+        </xs:element>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8 Component Properties -->
+  <!-- 3.8.1 Descriptive Component Properties -->
+  <!-- 3.8.1.1 Attachment -->
+  <xs:element name="attach">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:choice minOccurs="0" maxOccurs="unbounded">
+              <xs:element ref="ns1:fmttype"/>
+              <xs:element ref="ns1:encoding"/>
+            </xs:choice>
+          </xs:complexType>
+        </xs:element>
+        <xs:choice>
+          <xs:element ref="ns1:uri"/>
+          <xs:element ref="ns1:binary"/>
+        </xs:choice>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.1.2 Categories -->
+  <xs:element name="categories">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element minOccurs="0" ref="ns1:language"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:group maxOccurs="unbounded" ref="ns1:value-text"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.1.3 Classification -->
+  <xs:element name="class">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType/>
+        </xs:element>
+        <xs:element name="text">
+          <xs:simpleType>
+            <xs:restriction base="xs:token">
+              <xs:enumeration value="PUBLIC"/>
+              <xs:enumeration value="PRIVATE"/>
+              <xs:enumeration value="CONFIDENTIAL"/>
+            </xs:restriction>
+          </xs:simpleType>
+        </xs:element>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.1.4 Comment -->
+  <xs:element name="comment">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:choice minOccurs="0" maxOccurs="unbounded">
+              <xs:element ref="ns1:altrep"/>
+              <xs:element ref="ns1:language"/>
+            </xs:choice>
+          </xs:complexType>
+        </xs:element>
+        <xs:group ref="ns1:value-text"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.1.5 Description -->
+  <xs:element name="description">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:choice minOccurs="0" maxOccurs="unbounded">
+              <xs:element ref="ns1:altrep"/>
+              <xs:element ref="ns1:language"/>
+            </xs:choice>
+          </xs:complexType>
+        </xs:element>
+        <xs:group ref="ns1:value-text"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.1.6 Geographic Position -->
+  <xs:element name="geo">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType/>
+        </xs:element>
+        <xs:element ref="ns1:latitude"/>
+        <xs:element ref="ns1:longitude"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="latitude" type="xs:float"/>
+  <xs:element name="longitude" type="xs:float"/>
+  <!-- 3.8.1.7 Location -->
+  <xs:element name="location">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:choice minOccurs="0" maxOccurs="unbounded">
+              <xs:element ref="ns1:altrep"/>
+              <xs:element ref="ns1:language"/>
+            </xs:choice>
+          </xs:complexType>
+        </xs:element>
+        <xs:group ref="ns1:value-text"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.1.8 Percent Complete -->
+  <xs:element name="percent-complete">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType/>
+        </xs:element>
+        <xs:element ref="ns1:integer"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.1.9 Priority -->
+  <xs:element name="priority">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType/>
+        </xs:element>
+        <xs:element ref="ns1:integer"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.1.10 Resources -->
+  <xs:element name="resources">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:choice minOccurs="0" maxOccurs="unbounded">
+              <xs:element ref="ns1:altrep"/>
+              <xs:element ref="ns1:language"/>
+            </xs:choice>
+          </xs:complexType>
+        </xs:element>
+        <xs:group maxOccurs="unbounded" ref="ns1:value-text"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.1.11 Status -->
+  <xs:group name="property-status-event">
+    <xs:sequence>
+      <xs:element name="status">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element minOccurs="0" name="parameters">
+              <xs:complexType/>
+            </xs:element>
+            <xs:element name="text">
+              <xs:simpleType>
+                <xs:restriction base="xs:token">
+                  <xs:enumeration value="TENTATIVE"/>
+                  <xs:enumeration value="CONFIRMED"/>
+                  <xs:enumeration value="CANCELLED"/>
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:group name="property-status-todo">
+    <xs:sequence>
+      <xs:element name="status">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element minOccurs="0" name="parameters">
+              <xs:complexType/>
+            </xs:element>
+            <xs:element name="text">
+              <xs:simpleType>
+                <xs:restriction base="xs:token">
+                  <xs:enumeration value="NEEDS-ACTION"/>
+                  <xs:enumeration value="COMPLETED"/>
+                  <xs:enumeration value="IN-PROCESS"/>
+                  <xs:enumeration value="CANCELLED"/>
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <xs:group name="property-status-jour">
+    <xs:sequence>
+      <xs:element name="status">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element minOccurs="0" name="parameters">
+              <xs:complexType/>
+            </xs:element>
+            <xs:element name="text">
+              <xs:simpleType>
+                <xs:restriction base="xs:token">
+                  <xs:enumeration value="DRAFT"/>
+                  <xs:enumeration value="FINAL"/>
+                  <xs:enumeration value="CANCELLED"/>
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <!-- 3.8.1.12 Summary -->
+  <xs:element name="summary">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:choice minOccurs="0" maxOccurs="unbounded">
+              <xs:element ref="ns1:altrep"/>
+              <xs:element ref="ns1:language"/>
+            </xs:choice>
+          </xs:complexType>
+        </xs:element>
+        <xs:group ref="ns1:value-text"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.2 Date and Time Component Properties -->
+  <!-- 3.8.2.1 Date/Time Completed -->
+  <xs:element name="completed">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType/>
+        </xs:element>
+        <xs:element ref="ns1:date-time"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.2.2 Date/Time End -->
+  <xs:element name="dtend">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:group minOccurs="0" ref="ns1:tzidparam"/>
+          </xs:complexType>
+        </xs:element>
+        <xs:choice>
+          <xs:element ref="ns1:date-time"/>
+          <xs:element ref="ns1:date"/>
+        </xs:choice>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.2.3 Date/Time Due -->
+  <xs:element name="due">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:group minOccurs="0" ref="ns1:tzidparam"/>
+          </xs:complexType>
+        </xs:element>
+        <xs:choice>
+          <xs:element ref="ns1:date-time"/>
+          <xs:element ref="ns1:date"/>
+        </xs:choice>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.2.4 Date/Time Start -->
+  <xs:element name="dtstart">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:group minOccurs="0" ref="ns1:tzidparam"/>
+          </xs:complexType>
+        </xs:element>
+        <xs:choice>
+          <xs:element ref="ns1:date-time"/>
+          <xs:element ref="ns1:date"/>
+        </xs:choice>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.2.5 Duration -->
+  <xs:group name="property-duration">
+    <xs:sequence>
+      <xs:element name="duration">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element minOccurs="0" name="parameters">
+              <xs:complexType/>
+            </xs:element>
+            <xs:group ref="ns1:value-duration"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <!-- 3.8.2.6 Free/Busy Time -->
+  <xs:element name="freebusy">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element minOccurs="0" ref="ns1:fbtype"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element maxOccurs="unbounded" ref="ns1:period"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.2.7 Time Transparency -->
+  <xs:element name="transp">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType/>
+        </xs:element>
+        <xs:element name="text">
+          <xs:simpleType>
+            <xs:restriction base="xs:token">
+              <xs:enumeration value="OPAQUE"/>
+              <xs:enumeration value="TRANSPARENT"/>
+            </xs:restriction>
+          </xs:simpleType>
+        </xs:element>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.3 Time Zone Component Properties -->
+  <!-- 3.8.3.1 Time Zone Identifier -->
+  <xs:group name="property-tzid">
+    <xs:sequence>
+      <xs:element name="tzid">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element minOccurs="0" name="parameters">
+              <xs:complexType/>
+            </xs:element>
+            <xs:group ref="ns1:value-text"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <!-- 3.8.3.2 Time Zone Name -->
+  <xs:element name="tzname">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element minOccurs="0" ref="ns1:language"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:group ref="ns1:value-text"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.3.3 Time Zone Offset From -->
+  <xs:element name="tzoffsetfrom">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType/>
+        </xs:element>
+        <xs:element ref="ns1:utc-offset"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.3.4 Time Zone Offset To -->
+  <xs:element name="tzoffsetto">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType/>
+        </xs:element>
+        <xs:element ref="ns1:utc-offset"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.3.5 Time Zone URL -->
+  <xs:element name="tzurl">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType/>
+        </xs:element>
+        <xs:element ref="ns1:uri"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.4 Relationship Component Properties -->
+  <!-- 3.8.4.1 Attendee -->
+  <xs:element name="attendee">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:choice minOccurs="0" maxOccurs="unbounded">
+              <xs:element ref="ns1:cutype"/>
+              <xs:element ref="ns1:member"/>
+              <xs:element ref="ns1:role"/>
+              <xs:element ref="ns1:partstat"/>
+              <xs:element ref="ns1:rsvp"/>
+              <xs:element ref="ns1:delegated-to"/>
+              <xs:element ref="ns1:delegated-from"/>
+              <xs:element ref="ns1:sent-by"/>
+              <xs:element ref="ns1:cn"/>
+              <xs:element ref="ns1:dir"/>
+              <xs:element ref="ns1:language"/>
+            </xs:choice>
+          </xs:complexType>
+        </xs:element>
+        <xs:element ref="ns1:cal-address"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.4.2 Contact -->
+  <xs:element name="contact">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:choice minOccurs="0" maxOccurs="unbounded">
+              <xs:element ref="ns1:altrep"/>
+              <xs:element ref="ns1:language"/>
+            </xs:choice>
+          </xs:complexType>
+        </xs:element>
+        <xs:group ref="ns1:value-text"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.4.3 Organizer -->
+  <xs:element name="organizer">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:choice minOccurs="0" maxOccurs="unbounded">
+              <xs:element ref="ns1:cn"/>
+              <xs:element ref="ns1:dir"/>
+              <xs:element ref="ns1:sent-by"/>
+              <xs:element ref="ns1:language"/>
+            </xs:choice>
+          </xs:complexType>
+        </xs:element>
+        <xs:element ref="ns1:cal-address"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.4.4 Recurrence ID -->
+  <xs:element name="recurrence-id">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:choice minOccurs="0" maxOccurs="unbounded">
+              <xs:group ref="ns1:tzidparam"/>
+              <xs:element ref="ns1:range"/>
+            </xs:choice>
+          </xs:complexType>
+        </xs:element>
+        <xs:choice>
+          <xs:element ref="ns1:date-time"/>
+          <xs:element ref="ns1:date"/>
+        </xs:choice>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.4.5 Related-To -->
+  <xs:element name="related-to">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element minOccurs="0" ref="ns1:reltype"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:group ref="ns1:value-text"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.4.6 Uniform Resource Locator -->
+  <xs:element name="url">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType/>
+        </xs:element>
+        <xs:element ref="ns1:uri"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.4.7 Unique Identifier -->
+  <xs:element name="uid">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType/>
+        </xs:element>
+        <xs:group ref="ns1:value-text"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.5 Recurrence Component Properties -->
+  <!-- 3.8.5.1 Exception Date/Times -->
+  <xs:element name="exdate">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:group minOccurs="0" ref="ns1:tzidparam"/>
+          </xs:complexType>
+        </xs:element>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="ns1:date-time"/>
+          <xs:element maxOccurs="unbounded" ref="ns1:date"/>
+        </xs:choice>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.5.2 Recurrence Date/Times -->
+  <xs:element name="rdate">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:group minOccurs="0" ref="ns1:tzidparam"/>
+          </xs:complexType>
+        </xs:element>
+        <xs:choice>
+          <xs:element maxOccurs="unbounded" ref="ns1:date-time"/>
+          <xs:element maxOccurs="unbounded" ref="ns1:date"/>
+          <xs:element maxOccurs="unbounded" ref="ns1:period"/>
+        </xs:choice>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.5.3 Recurrence Rule -->
+  <xs:element name="rrule">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType/>
+        </xs:element>
+        <xs:element ref="ns1:recur"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.6 Alarm Component Properties -->
+  <!-- 3.8.6.1 Action -->
+  <xs:element name="action">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType/>
+        </xs:element>
+        <xs:element name="text">
+          <xs:simpleType>
+            <xs:restriction base="xs:token">
+              <xs:enumeration value="AUDIO"/>
+              <xs:enumeration value="DISPLAY"/>
+              <xs:enumeration value="EMAIL"/>
+            </xs:restriction>
+          </xs:simpleType>
+        </xs:element>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.6.2 Repeat Count -->
+  <xs:element name="repeat">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType/>
+        </xs:element>
+        <xs:element ref="ns1:integer"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.6.3 Trigger -->
+  <xs:element name="trigger">
+    <xs:complexType>
+      <xs:choice>
+        <xs:sequence>
+          <xs:element minOccurs="0" name="parameters">
+            <xs:complexType>
+              <xs:sequence>
+                <xs:element minOccurs="0" ref="ns1:related"/>
+              </xs:sequence>
+            </xs:complexType>
+          </xs:element>
+          <xs:group ref="ns1:value-duration"/>
+        </xs:sequence>
+        <xs:sequence>
+          <xs:element minOccurs="0" name="parameters">
+            <xs:complexType/>
+          </xs:element>
+          <xs:element ref="ns1:date-time"/>
+        </xs:sequence>
+      </xs:choice>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.7 Change Management Component Properties -->
+  <!-- 3.8.7.1 Date/Time Created -->
+  <xs:element name="created">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType/>
+        </xs:element>
+        <xs:element ref="ns1:date-time"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.7.2 Date/Time Stamp -->
+  <xs:element name="dtstamp">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType/>
+        </xs:element>
+        <xs:element ref="ns1:date-time"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.7.3 Last Modified -->
+  <xs:element name="last-modified">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType/>
+        </xs:element>
+        <xs:element ref="ns1:date-time"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.7.4 Sequence Number -->
+  <xs:element name="sequence">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType/>
+        </xs:element>
+        <xs:element ref="ns1:integer"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 3.8.8 Miscellaneous Component Properties -->
+  <!-- 3.8.8.3 Request Status -->
+  <xs:element name="request-status">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:element minOccurs="0" ref="ns1:language"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element ref="ns1:code"/>
+        <xs:element name="description" type="xs:string"/>
+        <xs:element minOccurs="0" ref="ns1:data"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="code" type="xs:string"/>
+  <xs:element name="data" type="xs:string"/>
+</xs:schema>
diff --git a/org.argeo.app.core/src/org/argeo/app/core/schemas/xCard-4.0-RFC6351.rnc b/org.argeo.app.core/src/org/argeo/app/core/schemas/xCard-4.0-RFC6351.rnc
new file mode 100644 (file)
index 0000000..9f4f163
--- /dev/null
@@ -0,0 +1,382 @@
+default namespace = "urn:ietf:params:xml:ns:vcard-4.0"
+
+### Section 3.3: vCard Format Specification
+#
+# 3.3
+iana-token = xsd:string { pattern = "[a-zA-Z0-9-]+" }
+x-name = xsd:string { pattern = "x-[a-zA-Z0-9-]+" }
+
+### Section 4: Value types
+#
+# 4.1
+value-text = element text { text }
+value-text-list = value-text+
+
+# 4.2
+value-uri = element uri { xsd:anyURI }
+
+# 4.3.1
+value-date = element date {
+    xsd:string { pattern = "\d{8}|\d{4}-\d\d|--\d\d(\d\d)?|---\d\d" }
+  }
+
+# 4.3.2
+value-time = element time {
+    xsd:string { pattern = "(\d\d(\d\d(\d\d)?)?|-\d\d(\d\d?)|--\d\d)"
+                         ~ "(Z|[+\-]\d\d(\d\d)?)?" }
+  }
+
+# 4.3.3
+value-date-time = element date-time {
+    xsd:string { pattern = "(\d{8}|--\d{4}|---\d\d)T\d\d(\d\d(\d\d)?)?"
+                         ~ "(Z|[+\-]\d\d(\d\d)?)?" }
+  }
+
+# 4.3.4
+value-date-and-or-time = value-date | value-date-time | value-time
+
+# 4.3.5
+value-timestamp = element timestamp {
+    xsd:string { pattern = "\d{8}T\d{6}(Z|[+\-]\d\d(\d\d)?)?" }
+  }
+
+# 4.4
+value-boolean = element boolean { xsd:boolean }
+
+# 4.5
+value-integer = element integer { xsd:integer }
+
+# 4.6
+value-float = element float { xsd:float }
+
+# 4.7
+value-utc-offset = element utc-offset {
+    xsd:string { pattern = "[+\-]\d\d(\d\d)?" }
+  }
+
+# 4.8
+value-language-tag = element language-tag {
+    xsd:string { pattern = "([a-z]{2,3}((-[a-z]{3}){0,3})?|[a-z]{4,8})"
+                         ~ "(-[a-z]{4})?(-([a-z]{2}|\d{3}))?"
+                         ~ "(-([0-9a-z]{5,8}|\d[0-9a-z]{3}))*"
+                         ~ "(-[0-9a-wyz](-[0-9a-z]{2,8})+)*"
+                         ~ "(-x(-[0-9a-z]{1,8})+)?|x(-[0-9a-z]{1,8})+|"
+                         ~ "[a-z]{1,3}(-[0-9a-z]{2,8}){1,2}" }
+  }
+
+### Section 5: Parameters
+#
+# 5.1
+param-language = element language { value-language-tag }?
+
+# 5.2
+param-pref = element pref {
+    element integer {
+      xsd:integer { minInclusive = "1" maxInclusive = "100" }
+    }
+  }?
+
+# 5.4
+param-altid = element altid { value-text }?
+
+# 5.5
+param-pid = element pid {
+    element text { xsd:string { pattern = "\d+(\.\d+)?" } }+
+  }?
+
+# 5.6
+param-type = element type { element text { "work" | "home" }+ }?
+
+# 5.7
+param-mediatype = element mediatype { value-text }?
+
+# 5.8
+param-calscale = element calscale { element text { "gregorian" } }?
+
+# 5.9
+param-sort-as = element sort-as { value-text+ }?
+
+# 5.10
+param-geo = element geo { value-uri }?
+
+# 5.11
+param-tz = element tz { value-text | value-uri }?
+
+### Section 6: Properties
+#
+# 6.1.3
+property-source = element source {
+    element parameters { param-altid, param-pid, param-pref,
+                         param-mediatype },
+    value-uri
+  }
+
+# 6.1.4
+property-kind = element kind {
+    element text { "individual" | "group" | "org" | "location" |
+                   x-name | iana-token }*
+  }
+
+# 6.2.1
+property-fn = element fn {
+    element parameters { param-language, param-altid, param-pid,
+                         param-pref, param-type }?,
+    value-text
+  }
+
+# 6.2.2
+property-n = element n {
+    element parameters { param-language, param-sort-as, param-altid }?,
+    element surname { text }+,
+    element given { text }+,
+    element additional { text }+,
+    element prefix { text }+,
+    element suffix { text }+
+  }
+
+# 6.2.3
+property-nickname = element nickname {
+    element parameters { param-language, param-altid, param-pid,
+                         param-pref, param-type }?,
+    value-text-list
+  }
+
+# 6.2.4
+property-photo = element photo {
+    element parameters { param-altid, param-pid, param-pref, param-type,
+                         param-mediatype }?,
+    value-uri
+  }
+
+# 6.2.5
+property-bday = element bday {
+    element parameters { param-altid, param-calscale }?,
+    (value-date-and-or-time | value-text)
+  }
+
+# 6.2.6
+property-anniversary = element anniversary {
+    element parameters { param-altid, param-calscale }?,
+    (value-date-and-or-time | value-text)
+  }
+
+# 6.2.7
+property-gender = element gender {
+    element sex { "" | "M" | "F" | "O" | "N" | "U" },
+    element identity { text }?
+  }
+
+# 6.3.1
+param-label = element label { value-text }?
+property-adr = element adr {
+    element parameters { param-language, param-altid, param-pid,
+                         param-pref, param-type, param-geo, param-tz,
+                         param-label }?,
+    element pobox { text }+,
+    element ext { text }+,
+    element street { text }+,
+    element locality { text }+,
+    element region { text }+,
+    element code { text }+,
+    element country { text }+
+  }
+
+# 6.4.1
+property-tel = element tel {
+    element parameters {
+      param-altid,
+      param-pid,
+      param-pref,
+      element type {
+        element text { "work" | "home" | "text" | "voice"
+                     | "fax" | "cell" | "video" | "pager"
+                     | "textphone" }+
+      }?,
+      param-mediatype
+    }?,
+    (value-text | value-uri)
+  }
+
+# 6.4.2
+property-email = element email {
+    element parameters { param-altid, param-pid, param-pref,
+                         param-type }?,
+    value-text
+  }
+
+# 6.4.3
+property-impp = element impp {
+    element parameters { param-altid, param-pid, param-pref,
+                         param-type, param-mediatype }?,
+    value-uri
+  }
+
+# 6.4.4
+property-lang = element lang {
+    element parameters { param-altid, param-pid, param-pref,
+                         param-type }?,
+    value-language-tag
+  }
+
+# 6.5.1
+property-tz = element tz {
+    element parameters { param-altid, param-pid, param-pref,
+                         param-type, param-mediatype }?,
+    (value-text | value-uri | value-utc-offset)
+  }
+
+# 6.5.2
+property-geo = element geo {
+    element parameters { param-altid, param-pid, param-pref,
+                         param-type, param-mediatype }?,
+    value-uri
+  }
+
+# 6.6.1
+property-title = element title {
+    element parameters { param-language, param-altid, param-pid,
+                         param-pref, param-type }?,
+    value-text
+  }
+
+# 6.6.2
+property-role = element role {
+    element parameters { param-language, param-altid, param-pid,
+                         param-pref, param-type }?,
+    value-text
+  }
+
+# 6.6.3
+property-logo = element logo {
+    element parameters { param-language, param-altid, param-pid,
+                         param-pref, param-type, param-mediatype }?,
+    value-uri
+  }
+
+# 6.6.4
+property-org = element org {
+    element parameters { param-language, param-altid, param-pid,
+                         param-pref, param-type, param-sort-as }?,
+    value-text-list
+  }
+
+# 6.6.5
+property-member = element member {
+    element parameters { param-altid, param-pid, param-pref,
+                         param-mediatype }?,
+    value-uri
+  }
+
+# 6.6.6
+property-related = element related {
+    element parameters {
+      param-altid,
+      param-pid,
+      param-pref,
+      element type {
+        element text {
+          "work" | "home" | "contact" | "acquaintance" |
+          "friend" | "met" | "co-worker" | "colleague" | "co-resident" |
+          "neighbor" | "child" | "parent" | "sibling" | "spouse" |
+          "kin" | "muse" | "crush" | "date" | "sweetheart" | "me" |
+          "agent" | "emergency"
+        }+
+      }?,
+      param-mediatype
+    }?,
+    (value-uri | value-text)
+  }
+
+# 6.7.1
+property-categories = element categories {
+    element parameters { param-altid, param-pid, param-pref,
+                         param-type }?,
+    value-text-list
+  }
+
+# 6.7.2
+property-note = element note {
+    element parameters { param-language, param-altid, param-pid,
+                         param-pref, param-type }?,
+    value-text
+  }
+
+# 6.7.3
+property-prodid = element prodid { value-text }
+
+# 6.7.4
+property-rev = element rev { value-timestamp }
+
+# 6.7.5
+property-sound = element sound {
+    element parameters { param-language, param-altid, param-pid,
+                         param-pref, param-type, param-mediatype }?,
+    value-uri
+  }
+
+# 6.7.6
+property-uid = element uid { value-uri }
+
+# 6.7.7
+property-clientpidmap = element clientpidmap {
+    element sourceid { xsd:positiveInteger },
+    value-uri
+  }
+
+# 6.7.8
+property-url = element url {
+    element parameters { param-altid, param-pid, param-pref,
+                         param-type, param-mediatype }?,
+    value-uri
+  }
+
+# 6.8.1
+property-key = element key {
+    element parameters { param-altid, param-pid, param-pref,
+                         param-type, param-mediatype }?,
+    (value-uri | value-text)
+  }
+
+# 6.9.1
+property-fburl = element fburl {
+    element parameters { param-altid, param-pid, param-pref,
+                         param-type, param-mediatype }?,
+    value-uri
+  }
+
+# 6.9.2
+property-caladruri = element caladruri {
+    element parameters { param-altid, param-pid, param-pref,
+                         param-type, param-mediatype }?,
+    value-uri
+  }
+
+# 6.9.3
+property-caluri = element caluri {
+    element parameters { param-altid, param-pid, param-pref,
+                         param-type, param-mediatype }?,
+    value-uri
+  }
+
+# Top-level grammar
+property = property-adr | property-anniversary | property-bday
+         | property-caladruri | property-caluri | property-categories
+         | property-clientpidmap | property-email | property-fburl
+         | property-fn | property-geo | property-impp | property-key
+         | property-kind | property-lang | property-logo
+         | property-member | property-n | property-nickname
+         | property-note | property-org | property-photo
+         | property-prodid | property-related | property-rev
+         | property-role | property-gender | property-sound
+         | property-source | property-tel | property-title
+         | property-tz | property-uid | property-url
+start = element vcards {
+    element vcard {
+      (property
+       | element group {
+           attribute name { text },
+           property*
+         })+
+    }+
+  }
+
diff --git a/org.argeo.app.core/src/org/argeo/app/core/schemas/xCard-4.0.rnc b/org.argeo.app.core/src/org/argeo/app/core/schemas/xCard-4.0.rnc
new file mode 100644 (file)
index 0000000..5494882
--- /dev/null
@@ -0,0 +1,385 @@
+default namespace = "urn:ietf:params:xml:ns:vcard-4.0"
+
+### Section 3.3: vCard Format Specification
+#
+# 3.3
+
+# mbaudier - 2022-05-31 : corrected regexp from RFC 6351
+iana-token = xsd:string { pattern = "[a-zA-Z0-9]+" }
+# mbaudier - 2022-05-31 : corrected regexp from RFC 6351
+x-name = xsd:string { pattern = "x-[a-zA-Z0-9]+" }
+
+### Section 4: Value types
+#
+# 4.1
+value-text = element text { text }
+value-text-list = value-text+
+
+# 4.2
+value-uri = element uri { xsd:anyURI }
+
+# 4.3.1
+value-date = element date {
+    xsd:string { pattern = "\d{8}|\d{4}-\d\d|--\d\d(\d\d)?|---\d\d" }
+  }
+
+# 4.3.2
+value-time = element time {
+    xsd:string { pattern = "(\d\d(\d\d(\d\d)?)?|-\d\d(\d\d?)|--\d\d)"
+                         ~ "(Z|[+\-]\d\d(\d\d)?)?" }
+  }
+
+# 4.3.3
+value-date-time = element date-time {
+    xsd:string { pattern = "(\d{8}|--\d{4}|---\d\d)T\d\d(\d\d(\d\d)?)?"
+                         ~ "(Z|[+\-]\d\d(\d\d)?)?" }
+  }
+
+# 4.3.4
+value-date-and-or-time = value-date | value-date-time | value-time
+
+# 4.3.5
+value-timestamp = element timestamp {
+    xsd:string { pattern = "\d{8}T\d{6}(Z|[+\-]\d\d(\d\d)?)?" }
+  }
+
+# 4.4
+value-boolean = element boolean { xsd:boolean }
+
+# 4.5
+value-integer = element integer { xsd:integer }
+
+# 4.6
+value-float = element float { xsd:float }
+
+# 4.7
+value-utc-offset = element utc-offset {
+    xsd:string { pattern = "[+\-]\d\d(\d\d)?" }
+  }
+
+# 4.8
+value-language-tag = element language-tag {
+    xsd:string { pattern = "([a-z]{2,3}((-[a-z]{3}){0,3})?|[a-z]{4,8})"
+                         ~ "(-[a-z]{4})?(-([a-z]{2}|\d{3}))?"
+                         ~ "(-([0-9a-z]{5,8}|\d[0-9a-z]{3}))*"
+                         ~ "(-[0-9a-wyz](-[0-9a-z]{2,8})+)*"
+                         ~ "(-x(-[0-9a-z]{1,8})+)?|x(-[0-9a-z]{1,8})+|"
+                         ~ "[a-z]{1,3}(-[0-9a-z]{2,8}){1,2}" }
+  }
+
+### Section 5: Parameters
+#
+# 5.1
+param-language = element language { value-language-tag }?
+
+# 5.2
+param-pref = element pref {
+    element integer {
+      xsd:integer { minInclusive = "1" maxInclusive = "100" }
+    }
+  }?
+
+# 5.4
+param-altid = element altid { value-text }?
+
+# 5.5
+param-pid = element pid {
+    element text { xsd:string { pattern = "\d+(\.\d+)?" } }+
+  }?
+
+# 5.6
+param-type = element type { element text { "work" | "home" }+ }?
+
+# 5.7
+param-mediatype = element mediatype { value-text }?
+
+# 5.8
+param-calscale = element calscale { element text { "gregorian" } }?
+
+# 5.9
+param-sort-as = element sort-as { value-text+ }?
+
+# 5.10
+param-geo = element geo { value-uri }?
+
+# 5.11
+param-tz = element tz { value-text | value-uri }?
+
+### Section 6: Properties
+#
+# 6.1.3
+property-source = element source {
+    element parameters { param-altid, param-pid, param-pref,
+                         param-mediatype },
+    value-uri
+  }
+
+# 6.1.4
+property-kind = element kind {
+    element text { "individual" | "group" | "org" | "location" |
+                   x-name | iana-token }*
+  }
+
+# 6.2.1
+property-fn = element fn {
+    element parameters { param-language, param-altid, param-pid,
+                         param-pref, param-type }?,
+    value-text
+  }
+
+# 6.2.2
+property-n = element n {
+    element parameters { param-language, param-sort-as, param-altid }?,
+    element surname { text }+,
+    element given { text }+,
+    element additional { text }+,
+    element prefix { text }+,
+    element suffix { text }+
+  }
+
+# 6.2.3
+property-nickname = element nickname {
+    element parameters { param-language, param-altid, param-pid,
+                         param-pref, param-type }?,
+    value-text-list
+  }
+
+# 6.2.4
+property-photo = element photo {
+    element parameters { param-altid, param-pid, param-pref, param-type,
+                         param-mediatype }?,
+    value-uri
+  }
+
+# 6.2.5
+property-bday = element bday {
+    element parameters { param-altid, param-calscale }?,
+    (value-date-and-or-time | value-text)
+  }
+
+# 6.2.6
+property-anniversary = element anniversary {
+    element parameters { param-altid, param-calscale }?,
+    (value-date-and-or-time | value-text)
+  }
+
+# 6.2.7
+property-gender = element gender {
+    element sex { "" | "M" | "F" | "O" | "N" | "U" },
+    element identity { text }?
+  }
+
+# 6.3.1
+param-label = element label { value-text }?
+property-adr = element adr {
+    element parameters { param-language, param-altid, param-pid,
+                         param-pref, param-type, param-geo, param-tz,
+                         param-label }?,
+    element pobox { text }+,
+    element ext { text }+,
+    element street { text }+,
+    element locality { text }+,
+    element region { text }+,
+    element code { text }+,
+    element country { text }+
+  }
+
+# 6.4.1
+property-tel = element tel {
+    element parameters {
+      param-altid,
+      param-pid,
+      param-pref,
+      element type {
+        element text { "work" | "home" | "text" | "voice"
+                     | "fax" | "cell" | "video" | "pager"
+                     | "textphone" }+
+      }?,
+      param-mediatype
+    }?,
+    (value-text | value-uri)
+  }
+
+# 6.4.2
+property-email = element email {
+    element parameters { param-altid, param-pid, param-pref,
+                         param-type }?,
+    value-text
+  }
+
+# 6.4.3
+property-impp = element impp {
+    element parameters { param-altid, param-pid, param-pref,
+                         param-type, param-mediatype }?,
+    value-uri
+  }
+
+# 6.4.4
+property-lang = element lang {
+    element parameters { param-altid, param-pid, param-pref,
+                         param-type }?,
+    value-language-tag
+  }
+
+# 6.5.1
+property-tz = element tz {
+    element parameters { param-altid, param-pid, param-pref,
+                         param-type, param-mediatype }?,
+    (value-text | value-uri | value-utc-offset)
+  }
+
+# 6.5.2
+property-geo = element geo {
+    element parameters { param-altid, param-pid, param-pref,
+                         param-type, param-mediatype }?,
+    value-uri
+  }
+
+# 6.6.1
+property-title = element title {
+    element parameters { param-language, param-altid, param-pid,
+                         param-pref, param-type }?,
+    value-text
+  }
+
+# 6.6.2
+property-role = element role {
+    element parameters { param-language, param-altid, param-pid,
+                         param-pref, param-type }?,
+    value-text
+  }
+
+# 6.6.3
+property-logo = element logo {
+    element parameters { param-language, param-altid, param-pid,
+                         param-pref, param-type, param-mediatype }?,
+    value-uri
+  }
+
+# 6.6.4
+property-org = element org {
+    element parameters { param-language, param-altid, param-pid,
+                         param-pref, param-type, param-sort-as }?,
+    value-text-list
+  }
+
+# 6.6.5
+property-member = element member {
+    element parameters { param-altid, param-pid, param-pref,
+                         param-mediatype }?,
+    value-uri
+  }
+
+# 6.6.6
+property-related = element related {
+    element parameters {
+      param-altid,
+      param-pid,
+      param-pref,
+      element type {
+        element text {
+          "work" | "home" | "contact" | "acquaintance" |
+          "friend" | "met" | "co-worker" | "colleague" | "co-resident" |
+          "neighbor" | "child" | "parent" | "sibling" | "spouse" |
+          "kin" | "muse" | "crush" | "date" | "sweetheart" | "me" |
+          "agent" | "emergency"
+        }+
+      }?,
+      param-mediatype
+    }?,
+    (value-uri | value-text)
+  }
+
+# 6.7.1
+property-categories = element categories {
+    element parameters { param-altid, param-pid, param-pref,
+                         param-type }?,
+    value-text-list
+  }
+
+# 6.7.2
+property-note = element note {
+    element parameters { param-language, param-altid, param-pid,
+                         param-pref, param-type }?,
+    value-text
+  }
+
+# 6.7.3
+property-prodid = element prodid { value-text }
+
+# 6.7.4
+property-rev = element rev { value-timestamp }
+
+# 6.7.5
+property-sound = element sound {
+    element parameters { param-language, param-altid, param-pid,
+                         param-pref, param-type, param-mediatype }?,
+    value-uri
+  }
+
+# 6.7.6
+property-uid = element uid { value-uri }
+
+# 6.7.7
+property-clientpidmap = element clientpidmap {
+    element sourceid { xsd:positiveInteger },
+    value-uri
+  }
+
+# 6.7.8
+property-url = element url {
+    element parameters { param-altid, param-pid, param-pref,
+                         param-type, param-mediatype }?,
+    value-uri
+  }
+
+# 6.8.1
+property-key = element key {
+    element parameters { param-altid, param-pid, param-pref,
+                         param-type, param-mediatype }?,
+    (value-uri | value-text)
+  }
+
+# 6.9.1
+property-fburl = element fburl {
+    element parameters { param-altid, param-pid, param-pref,
+                         param-type, param-mediatype }?,
+    value-uri
+  }
+
+# 6.9.2
+property-caladruri = element caladruri {
+    element parameters { param-altid, param-pid, param-pref,
+                         param-type, param-mediatype }?,
+    value-uri
+  }
+
+# 6.9.3
+property-caluri = element caluri {
+    element parameters { param-altid, param-pid, param-pref,
+                         param-type, param-mediatype }?,
+    value-uri
+  }
+
+# Top-level grammar
+property = property-adr | property-anniversary | property-bday
+         | property-caladruri | property-caluri | property-categories
+         | property-clientpidmap | property-email | property-fburl
+         | property-fn | property-geo | property-impp | property-key
+         | property-kind | property-lang | property-logo
+         | property-member | property-n | property-nickname
+         | property-note | property-org | property-photo
+         | property-prodid | property-related | property-rev
+         | property-role | property-gender | property-sound
+         | property-source | property-tel | property-title
+         | property-tz | property-uid | property-url
+start = element vcards {
+    element vcard {
+      (property
+       | element group {
+           attribute name { text },
+           property*
+         })+
+    }+
+  }
+
diff --git a/org.argeo.app.core/src/org/argeo/app/core/schemas/xCard-4.0.xsd b/org.argeo.app.core/src/org/argeo/app/core/schemas/xCard-4.0.xsd
new file mode 100644 (file)
index 0000000..bb1b175
--- /dev/null
@@ -0,0 +1,1041 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:ietf:params:xml:ns:vcard-4.0" xmlns:ns1="urn:ietf:params:xml:ns:vcard-4.0">
+  <!--
+    
+    3.3
+  -->
+  <!-- mbaudier - 2022-05-31 : corrected regexp from RFC 6351 -->
+  <xs:simpleType name="iana-token">
+    <xs:annotation>
+      <xs:documentation>Section 3.3: vCard Format Specification</xs:documentation>
+    </xs:annotation>
+    <xs:restriction base="xs:string">
+      <xs:pattern value="[a-zA-Z0-9]+"/>
+    </xs:restriction>
+  </xs:simpleType>
+  <!-- mbaudier - 2022-05-31 : corrected regexp from RFC 6351 -->
+  <xs:simpleType name="x-name">
+    <xs:restriction base="xs:string">
+      <xs:pattern value="x-[a-zA-Z0-9]+"/>
+    </xs:restriction>
+  </xs:simpleType>
+  <!--
+    
+    4.1
+  -->
+  <xs:element name="text" type="xs:string"/>
+  <xs:group name="value-text-list">
+    <xs:sequence>
+      <xs:element maxOccurs="unbounded" ref="ns1:text"/>
+    </xs:sequence>
+  </xs:group>
+  <!-- 4.2 -->
+  <xs:element name="uri" type="xs:anyURI"/>
+  <!-- 4.3.1 -->
+  <xs:element name="date" substitutionGroup="ns1:value-date-and-or-time">
+    <xs:simpleType>
+      <xs:restriction base="xs:string">
+        <xs:pattern value="\d{8}|\d{4}-\d\d|--\d\d(\d\d)?|---\d\d"/>
+      </xs:restriction>
+    </xs:simpleType>
+  </xs:element>
+  <!-- 4.3.2 -->
+  <xs:element name="time" substitutionGroup="ns1:value-date-and-or-time">
+    <xs:simpleType>
+      <xs:restriction base="xs:string">
+        <xs:pattern value="(\d\d(\d\d(\d\d)?)?|-\d\d(\d\d?)|--\d\d)(Z|[+\-]\d\d(\d\d)?)?"/>
+      </xs:restriction>
+    </xs:simpleType>
+  </xs:element>
+  <!-- 4.3.3 -->
+  <xs:element name="date-time" substitutionGroup="ns1:value-date-and-or-time">
+    <xs:simpleType>
+      <xs:restriction base="xs:string">
+        <xs:pattern value="(\d{8}|--\d{4}|---\d\d)T\d\d(\d\d(\d\d)?)?(Z|[+\-]\d\d(\d\d)?)?"/>
+      </xs:restriction>
+    </xs:simpleType>
+  </xs:element>
+  <!-- 4.3.4 -->
+  <xs:element name="value-date-and-or-time" abstract="true"/>
+  <!-- 4.3.5 -->
+  <xs:complexType name="value-timestamp">
+    <xs:sequence>
+      <xs:element ref="ns1:timestamp"/>
+    </xs:sequence>
+  </xs:complexType>
+  <xs:element name="timestamp">
+    <xs:simpleType>
+      <xs:restriction base="xs:string">
+        <xs:pattern value="\d{8}T\d{6}(Z|[+\-]\d\d(\d\d)?)?"/>
+      </xs:restriction>
+    </xs:simpleType>
+  </xs:element>
+  <!-- 4.4 -->
+  <xs:element name="boolean" type="xs:boolean"/>
+  <!-- 4.5 -->
+  <xs:element name="integer" type="xs:integer"/>
+  <!-- 4.6 -->
+  <xs:element name="float" type="xs:float"/>
+  <!-- 4.7 -->
+  <xs:element name="utc-offset">
+    <xs:simpleType>
+      <xs:restriction base="xs:string">
+        <xs:pattern value="[+\-]\d\d(\d\d)?"/>
+      </xs:restriction>
+    </xs:simpleType>
+  </xs:element>
+  <!-- 4.8 -->
+  <xs:element name="language-tag">
+    <xs:simpleType>
+      <xs:restriction base="xs:string">
+        <xs:pattern value="([a-z]{2,3}((-[a-z]{3}){0,3})?|[a-z]{4,8})(-[a-z]{4})?(-([a-z]{2}|\d{3}))?(-([0-9a-z]{5,8}|\d[0-9a-z]{3}))*(-[0-9a-wyz](-[0-9a-z]{2,8})+)*(-x(-[0-9a-z]{1,8})+)?|x(-[0-9a-z]{1,8})+|[a-z]{1,3}(-[0-9a-z]{2,8}){1,2}"/>
+      </xs:restriction>
+    </xs:simpleType>
+  </xs:element>
+  <!--
+    
+    5.1
+  -->
+  <xs:group name="param-language">
+    <xs:annotation>
+      <xs:documentation>Section 5: Parameters</xs:documentation>
+    </xs:annotation>
+    <xs:sequence>
+      <xs:element minOccurs="0" ref="ns1:language"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:element name="language">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="ns1:language-tag"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 5.2 -->
+  <xs:group name="param-pref">
+    <xs:sequence>
+      <xs:element minOccurs="0" ref="ns1:pref"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:element name="pref">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="integer">
+          <xs:simpleType>
+            <xs:restriction base="xs:integer">
+              <xs:minInclusive value="1"/>
+              <xs:maxInclusive value="100"/>
+            </xs:restriction>
+          </xs:simpleType>
+        </xs:element>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 5.4 -->
+  <xs:group name="param-altid">
+    <xs:sequence>
+      <xs:element minOccurs="0" ref="ns1:altid"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:element name="altid">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="ns1:text"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 5.5 -->
+  <xs:group name="param-pid">
+    <xs:sequence>
+      <xs:element minOccurs="0" ref="ns1:pid"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:element name="pid">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" name="text">
+          <xs:simpleType>
+            <xs:restriction base="xs:string">
+              <xs:pattern value="\d+(\.\d+)?"/>
+            </xs:restriction>
+          </xs:simpleType>
+        </xs:element>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 5.6 -->
+  <xs:group name="param-type">
+    <xs:sequence>
+      <xs:element minOccurs="0" ref="ns1:type"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:element name="type">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" name="text">
+          <xs:simpleType>
+            <xs:restriction base="xs:token">
+              <xs:enumeration value="work"/>
+              <xs:enumeration value="home"/>
+            </xs:restriction>
+          </xs:simpleType>
+        </xs:element>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 5.7 -->
+  <xs:group name="param-mediatype">
+    <xs:sequence>
+      <xs:element minOccurs="0" ref="ns1:mediatype"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:element name="mediatype">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="ns1:text"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 5.8 -->
+  <xs:group name="param-calscale">
+    <xs:sequence>
+      <xs:element minOccurs="0" ref="ns1:calscale"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:element name="calscale">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="text">
+          <xs:simpleType>
+            <xs:restriction base="xs:token">
+              <xs:enumeration value="gregorian"/>
+            </xs:restriction>
+          </xs:simpleType>
+        </xs:element>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 5.9 -->
+  <xs:group name="param-sort-as">
+    <xs:sequence>
+      <xs:element minOccurs="0" ref="ns1:sort-as"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:element name="sort-as">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="ns1:text"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 5.10 -->
+  <xs:group name="param-geo">
+    <xs:sequence>
+      <xs:element minOccurs="0" name="geo">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element ref="ns1:uri"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <!-- 5.11 -->
+  <xs:group name="param-tz">
+    <xs:sequence>
+      <xs:element minOccurs="0" name="tz">
+        <xs:complexType>
+          <xs:choice>
+            <xs:element ref="ns1:text"/>
+            <xs:element ref="ns1:uri"/>
+          </xs:choice>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <!--
+    
+    6.1.3
+  -->
+  <xs:element name="source">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:group ref="ns1:param-altid"/>
+              <xs:group ref="ns1:param-pid"/>
+              <xs:group ref="ns1:param-pref"/>
+              <xs:group ref="ns1:param-mediatype"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element ref="ns1:uri"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 6.1.4 -->
+  <xs:element name="kind">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" maxOccurs="unbounded" name="text">
+          <xs:simpleType>
+            <xs:union memberTypes="ns1:x-name ns1:iana-token">
+              <xs:simpleType>
+                <xs:restriction base="xs:token">
+                  <xs:enumeration value="individual"/>
+                </xs:restriction>
+              </xs:simpleType>
+              <xs:simpleType>
+                <xs:restriction base="xs:token">
+                  <xs:enumeration value="group"/>
+                </xs:restriction>
+              </xs:simpleType>
+              <xs:simpleType>
+                <xs:restriction base="xs:token">
+                  <xs:enumeration value="org"/>
+                </xs:restriction>
+              </xs:simpleType>
+              <xs:simpleType>
+                <xs:restriction base="xs:token">
+                  <xs:enumeration value="location"/>
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:union>
+          </xs:simpleType>
+        </xs:element>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 6.2.1 -->
+  <xs:element name="fn">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:group ref="ns1:param-language"/>
+              <xs:group ref="ns1:param-altid"/>
+              <xs:group ref="ns1:param-pid"/>
+              <xs:group ref="ns1:param-pref"/>
+              <xs:group ref="ns1:param-type"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element ref="ns1:text"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 6.2.2 -->
+  <xs:element name="n">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:group ref="ns1:param-language"/>
+              <xs:group ref="ns1:param-sort-as"/>
+              <xs:group ref="ns1:param-altid"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element maxOccurs="unbounded" ref="ns1:surname"/>
+        <xs:element maxOccurs="unbounded" ref="ns1:given"/>
+        <xs:element maxOccurs="unbounded" ref="ns1:additional"/>
+        <xs:element maxOccurs="unbounded" ref="ns1:prefix"/>
+        <xs:element maxOccurs="unbounded" ref="ns1:suffix"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="surname" type="xs:string"/>
+  <xs:element name="given" type="xs:string"/>
+  <xs:element name="additional" type="xs:string"/>
+  <xs:element name="prefix" type="xs:string"/>
+  <xs:element name="suffix" type="xs:string"/>
+  <!-- 6.2.3 -->
+  <xs:element name="nickname">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:group ref="ns1:param-language"/>
+              <xs:group ref="ns1:param-altid"/>
+              <xs:group ref="ns1:param-pid"/>
+              <xs:group ref="ns1:param-pref"/>
+              <xs:group ref="ns1:param-type"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:group ref="ns1:value-text-list"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 6.2.4 -->
+  <xs:element name="photo">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:group ref="ns1:param-altid"/>
+              <xs:group ref="ns1:param-pid"/>
+              <xs:group ref="ns1:param-pref"/>
+              <xs:group ref="ns1:param-type"/>
+              <xs:group ref="ns1:param-mediatype"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element ref="ns1:uri"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 6.2.5 -->
+  <xs:element name="bday">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:group ref="ns1:param-altid"/>
+              <xs:group ref="ns1:param-calscale"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:choice>
+          <xs:element ref="ns1:value-date-and-or-time"/>
+          <xs:element ref="ns1:text"/>
+        </xs:choice>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 6.2.6 -->
+  <xs:element name="anniversary">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:group ref="ns1:param-altid"/>
+              <xs:group ref="ns1:param-calscale"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:choice>
+          <xs:element ref="ns1:value-date-and-or-time"/>
+          <xs:element ref="ns1:text"/>
+        </xs:choice>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 6.2.7 -->
+  <xs:element name="gender">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="ns1:sex"/>
+        <xs:element minOccurs="0" ref="ns1:identity"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="sex">
+    <xs:simpleType>
+      <xs:restriction base="xs:token">
+        <xs:enumeration value=""/>
+        <xs:enumeration value="M"/>
+        <xs:enumeration value="F"/>
+        <xs:enumeration value="O"/>
+        <xs:enumeration value="N"/>
+        <xs:enumeration value="U"/>
+      </xs:restriction>
+    </xs:simpleType>
+  </xs:element>
+  <xs:element name="identity" type="xs:string"/>
+  <!-- 6.3.1 -->
+  <xs:group name="param-label">
+    <xs:sequence>
+      <xs:element minOccurs="0" ref="ns1:label"/>
+    </xs:sequence>
+  </xs:group>
+  <xs:element name="label">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="ns1:text"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="adr">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:group ref="ns1:param-language"/>
+              <xs:group ref="ns1:param-altid"/>
+              <xs:group ref="ns1:param-pid"/>
+              <xs:group ref="ns1:param-pref"/>
+              <xs:group ref="ns1:param-type"/>
+              <xs:group ref="ns1:param-geo"/>
+              <xs:group ref="ns1:param-tz"/>
+              <xs:group ref="ns1:param-label"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element maxOccurs="unbounded" ref="ns1:pobox"/>
+        <xs:element maxOccurs="unbounded" ref="ns1:ext"/>
+        <xs:element maxOccurs="unbounded" ref="ns1:street"/>
+        <xs:element maxOccurs="unbounded" ref="ns1:locality"/>
+        <xs:element maxOccurs="unbounded" ref="ns1:region"/>
+        <xs:element maxOccurs="unbounded" ref="ns1:code"/>
+        <xs:element maxOccurs="unbounded" ref="ns1:country"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="pobox" type="xs:string"/>
+  <xs:element name="ext" type="xs:string"/>
+  <xs:element name="street" type="xs:string"/>
+  <xs:element name="locality" type="xs:string"/>
+  <xs:element name="region" type="xs:string"/>
+  <xs:element name="code" type="xs:string"/>
+  <xs:element name="country" type="xs:string"/>
+  <!-- 6.4.1 -->
+  <xs:element name="tel">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:group ref="ns1:param-altid"/>
+              <xs:group ref="ns1:param-pid"/>
+              <xs:group ref="ns1:param-pref"/>
+              <xs:element minOccurs="0" name="type">
+                <xs:complexType>
+                  <xs:sequence>
+                    <xs:element maxOccurs="unbounded" name="text">
+                      <xs:simpleType>
+                        <xs:restriction base="xs:token">
+                          <xs:enumeration value="work"/>
+                          <xs:enumeration value="home"/>
+                          <xs:enumeration value="text"/>
+                          <xs:enumeration value="voice"/>
+                          <xs:enumeration value="fax"/>
+                          <xs:enumeration value="cell"/>
+                          <xs:enumeration value="video"/>
+                          <xs:enumeration value="pager"/>
+                          <xs:enumeration value="textphone"/>
+                        </xs:restriction>
+                      </xs:simpleType>
+                    </xs:element>
+                  </xs:sequence>
+                </xs:complexType>
+              </xs:element>
+              <xs:group ref="ns1:param-mediatype"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:choice>
+          <xs:element ref="ns1:text"/>
+          <xs:element ref="ns1:uri"/>
+        </xs:choice>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 6.4.2 -->
+  <xs:element name="email">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:group ref="ns1:param-altid"/>
+              <xs:group ref="ns1:param-pid"/>
+              <xs:group ref="ns1:param-pref"/>
+              <xs:group ref="ns1:param-type"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element ref="ns1:text"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 6.4.3 -->
+  <xs:element name="impp">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:group ref="ns1:param-altid"/>
+              <xs:group ref="ns1:param-pid"/>
+              <xs:group ref="ns1:param-pref"/>
+              <xs:group ref="ns1:param-type"/>
+              <xs:group ref="ns1:param-mediatype"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element ref="ns1:uri"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 6.4.4 -->
+  <xs:element name="lang">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:group ref="ns1:param-altid"/>
+              <xs:group ref="ns1:param-pid"/>
+              <xs:group ref="ns1:param-pref"/>
+              <xs:group ref="ns1:param-type"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element ref="ns1:language-tag"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 6.5.1 -->
+  <xs:group name="property-tz">
+    <xs:sequence>
+      <xs:element name="tz">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element minOccurs="0" name="parameters">
+              <xs:complexType>
+                <xs:sequence>
+                  <xs:group ref="ns1:param-altid"/>
+                  <xs:group ref="ns1:param-pid"/>
+                  <xs:group ref="ns1:param-pref"/>
+                  <xs:group ref="ns1:param-type"/>
+                  <xs:group ref="ns1:param-mediatype"/>
+                </xs:sequence>
+              </xs:complexType>
+            </xs:element>
+            <xs:choice>
+              <xs:element ref="ns1:text"/>
+              <xs:element ref="ns1:uri"/>
+              <xs:element ref="ns1:utc-offset"/>
+            </xs:choice>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <!-- 6.5.2 -->
+  <xs:group name="property-geo">
+    <xs:sequence>
+      <xs:element name="geo">
+        <xs:complexType>
+          <xs:sequence>
+            <xs:element minOccurs="0" name="parameters">
+              <xs:complexType>
+                <xs:sequence>
+                  <xs:group ref="ns1:param-altid"/>
+                  <xs:group ref="ns1:param-pid"/>
+                  <xs:group ref="ns1:param-pref"/>
+                  <xs:group ref="ns1:param-type"/>
+                  <xs:group ref="ns1:param-mediatype"/>
+                </xs:sequence>
+              </xs:complexType>
+            </xs:element>
+            <xs:element ref="ns1:uri"/>
+          </xs:sequence>
+        </xs:complexType>
+      </xs:element>
+    </xs:sequence>
+  </xs:group>
+  <!-- 6.6.1 -->
+  <xs:element name="title">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:group ref="ns1:param-language"/>
+              <xs:group ref="ns1:param-altid"/>
+              <xs:group ref="ns1:param-pid"/>
+              <xs:group ref="ns1:param-pref"/>
+              <xs:group ref="ns1:param-type"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element ref="ns1:text"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 6.6.2 -->
+  <xs:element name="role">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:group ref="ns1:param-language"/>
+              <xs:group ref="ns1:param-altid"/>
+              <xs:group ref="ns1:param-pid"/>
+              <xs:group ref="ns1:param-pref"/>
+              <xs:group ref="ns1:param-type"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element ref="ns1:text"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 6.6.3 -->
+  <xs:element name="logo">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:group ref="ns1:param-language"/>
+              <xs:group ref="ns1:param-altid"/>
+              <xs:group ref="ns1:param-pid"/>
+              <xs:group ref="ns1:param-pref"/>
+              <xs:group ref="ns1:param-type"/>
+              <xs:group ref="ns1:param-mediatype"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element ref="ns1:uri"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 6.6.4 -->
+  <xs:element name="org">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:group ref="ns1:param-language"/>
+              <xs:group ref="ns1:param-altid"/>
+              <xs:group ref="ns1:param-pid"/>
+              <xs:group ref="ns1:param-pref"/>
+              <xs:group ref="ns1:param-type"/>
+              <xs:group ref="ns1:param-sort-as"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:group ref="ns1:value-text-list"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 6.6.5 -->
+  <xs:element name="member">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:group ref="ns1:param-altid"/>
+              <xs:group ref="ns1:param-pid"/>
+              <xs:group ref="ns1:param-pref"/>
+              <xs:group ref="ns1:param-mediatype"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element ref="ns1:uri"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 6.6.6 -->
+  <xs:element name="related">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:group ref="ns1:param-altid"/>
+              <xs:group ref="ns1:param-pid"/>
+              <xs:group ref="ns1:param-pref"/>
+              <xs:element minOccurs="0" name="type">
+                <xs:complexType>
+                  <xs:sequence>
+                    <xs:element maxOccurs="unbounded" name="text">
+                      <xs:simpleType>
+                        <xs:restriction base="xs:token">
+                          <xs:enumeration value="work"/>
+                          <xs:enumeration value="home"/>
+                          <xs:enumeration value="contact"/>
+                          <xs:enumeration value="acquaintance"/>
+                          <xs:enumeration value="friend"/>
+                          <xs:enumeration value="met"/>
+                          <xs:enumeration value="co-worker"/>
+                          <xs:enumeration value="colleague"/>
+                          <xs:enumeration value="co-resident"/>
+                          <xs:enumeration value="neighbor"/>
+                          <xs:enumeration value="child"/>
+                          <xs:enumeration value="parent"/>
+                          <xs:enumeration value="sibling"/>
+                          <xs:enumeration value="spouse"/>
+                          <xs:enumeration value="kin"/>
+                          <xs:enumeration value="muse"/>
+                          <xs:enumeration value="crush"/>
+                          <xs:enumeration value="date"/>
+                          <xs:enumeration value="sweetheart"/>
+                          <xs:enumeration value="me"/>
+                          <xs:enumeration value="agent"/>
+                          <xs:enumeration value="emergency"/>
+                        </xs:restriction>
+                      </xs:simpleType>
+                    </xs:element>
+                  </xs:sequence>
+                </xs:complexType>
+              </xs:element>
+              <xs:group ref="ns1:param-mediatype"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:choice>
+          <xs:element ref="ns1:uri"/>
+          <xs:element ref="ns1:text"/>
+        </xs:choice>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 6.7.1 -->
+  <xs:element name="categories">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:group ref="ns1:param-altid"/>
+              <xs:group ref="ns1:param-pid"/>
+              <xs:group ref="ns1:param-pref"/>
+              <xs:group ref="ns1:param-type"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:group ref="ns1:value-text-list"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 6.7.2 -->
+  <xs:element name="note">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:group ref="ns1:param-language"/>
+              <xs:group ref="ns1:param-altid"/>
+              <xs:group ref="ns1:param-pid"/>
+              <xs:group ref="ns1:param-pref"/>
+              <xs:group ref="ns1:param-type"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element ref="ns1:text"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 6.7.3 -->
+  <xs:element name="prodid">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="ns1:text"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 6.7.4 -->
+  <xs:element name="rev" type="ns1:value-timestamp"/>
+  <!-- 6.7.5 -->
+  <xs:element name="sound">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:group ref="ns1:param-language"/>
+              <xs:group ref="ns1:param-altid"/>
+              <xs:group ref="ns1:param-pid"/>
+              <xs:group ref="ns1:param-pref"/>
+              <xs:group ref="ns1:param-type"/>
+              <xs:group ref="ns1:param-mediatype"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element ref="ns1:uri"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 6.7.6 -->
+  <xs:element name="uid">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="ns1:uri"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 6.7.7 -->
+  <xs:element name="clientpidmap">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element ref="ns1:sourceid"/>
+        <xs:element ref="ns1:uri"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="sourceid" type="xs:positiveInteger"/>
+  <!-- 6.7.8 -->
+  <xs:element name="url">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:group ref="ns1:param-altid"/>
+              <xs:group ref="ns1:param-pid"/>
+              <xs:group ref="ns1:param-pref"/>
+              <xs:group ref="ns1:param-type"/>
+              <xs:group ref="ns1:param-mediatype"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element ref="ns1:uri"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 6.8.1 -->
+  <xs:element name="key">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:group ref="ns1:param-altid"/>
+              <xs:group ref="ns1:param-pid"/>
+              <xs:group ref="ns1:param-pref"/>
+              <xs:group ref="ns1:param-type"/>
+              <xs:group ref="ns1:param-mediatype"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:choice>
+          <xs:element ref="ns1:uri"/>
+          <xs:element ref="ns1:text"/>
+        </xs:choice>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 6.9.1 -->
+  <xs:element name="fburl">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:group ref="ns1:param-altid"/>
+              <xs:group ref="ns1:param-pid"/>
+              <xs:group ref="ns1:param-pref"/>
+              <xs:group ref="ns1:param-type"/>
+              <xs:group ref="ns1:param-mediatype"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element ref="ns1:uri"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 6.9.2 -->
+  <xs:element name="caladruri">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:group ref="ns1:param-altid"/>
+              <xs:group ref="ns1:param-pid"/>
+              <xs:group ref="ns1:param-pref"/>
+              <xs:group ref="ns1:param-type"/>
+              <xs:group ref="ns1:param-mediatype"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element ref="ns1:uri"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- 6.9.3 -->
+  <xs:element name="caluri">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element minOccurs="0" name="parameters">
+          <xs:complexType>
+            <xs:sequence>
+              <xs:group ref="ns1:param-altid"/>
+              <xs:group ref="ns1:param-pid"/>
+              <xs:group ref="ns1:param-pref"/>
+              <xs:group ref="ns1:param-type"/>
+              <xs:group ref="ns1:param-mediatype"/>
+            </xs:sequence>
+          </xs:complexType>
+        </xs:element>
+        <xs:element ref="ns1:uri"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <!-- Top-level grammar -->
+  <xs:group name="property">
+    <xs:choice>
+      <xs:element ref="ns1:adr"/>
+      <xs:element ref="ns1:anniversary"/>
+      <xs:element ref="ns1:bday"/>
+      <xs:element ref="ns1:caladruri"/>
+      <xs:element ref="ns1:caluri"/>
+      <xs:element ref="ns1:categories"/>
+      <xs:element ref="ns1:clientpidmap"/>
+      <xs:element ref="ns1:email"/>
+      <xs:element ref="ns1:fburl"/>
+      <xs:element ref="ns1:fn"/>
+      <xs:group ref="ns1:property-geo"/>
+      <xs:element ref="ns1:impp"/>
+      <xs:element ref="ns1:key"/>
+      <xs:element ref="ns1:kind"/>
+      <xs:element ref="ns1:lang"/>
+      <xs:element ref="ns1:logo"/>
+      <xs:element ref="ns1:member"/>
+      <xs:element ref="ns1:n"/>
+      <xs:element ref="ns1:nickname"/>
+      <xs:element ref="ns1:note"/>
+      <xs:element ref="ns1:org"/>
+      <xs:element ref="ns1:photo"/>
+      <xs:element ref="ns1:prodid"/>
+      <xs:element ref="ns1:related"/>
+      <xs:element ref="ns1:rev"/>
+      <xs:element ref="ns1:role"/>
+      <xs:element ref="ns1:gender"/>
+      <xs:element ref="ns1:sound"/>
+      <xs:element ref="ns1:source"/>
+      <xs:element ref="ns1:tel"/>
+      <xs:element ref="ns1:title"/>
+      <xs:group ref="ns1:property-tz"/>
+      <xs:element ref="ns1:uid"/>
+      <xs:element ref="ns1:url"/>
+    </xs:choice>
+  </xs:group>
+  <xs:element name="vcards">
+    <xs:complexType>
+      <xs:sequence>
+        <xs:element maxOccurs="unbounded" ref="ns1:vcard"/>
+      </xs:sequence>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="vcard">
+    <xs:complexType>
+      <xs:choice maxOccurs="unbounded">
+        <xs:group ref="ns1:property"/>
+        <xs:element ref="ns1:group"/>
+      </xs:choice>
+    </xs:complexType>
+  </xs:element>
+  <xs:element name="group">
+    <xs:complexType>
+      <xs:group minOccurs="0" maxOccurs="unbounded" ref="ns1:property"/>
+      <xs:attribute name="name" use="required"/>
+    </xs:complexType>
+  </xs:element>
+</xs:schema>
diff --git a/org.argeo.app.core/src/org/argeo/app/core/schemas/xlink.xsd b/org.argeo.app.core/src/org/argeo/app/core/schemas/xlink.xsd
new file mode 100644 (file)
index 0000000..e9ce635
--- /dev/null
@@ -0,0 +1,293 @@
+<?xml version='1.0' encoding='UTF-8'?>\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.w3.org/1999/xlink" xmlns:xlink="http://www.w3.org/1999/xlink">\r
\r
+ <xs:annotation>\r
+  <xs:documentation>This schema is not normative, or even definitive.  The\r
+prose copy in the XLink 1.1 recommendation (http://www.w3.org/TR/xlink11/) is\r
+definitive, although it should not differ from this file, except for the\r
+absence of these two initial comments.</xs:documentation>\r
+ </xs:annotation>\r
\r
+ <xs:annotation>\r
+  <xs:documentation>In keeping with the W3C's standard versioning\r
+   policy, this schema document will persist at\r
+   http://www.w3.org/XML/2008/06/xlink.xsd.\r
+   At the date of issue it can also be found at\r
+   http://www.w3.org/1999/xlink.xsd.\r
+   The schema document at that URI may however change in the future,\r
+   in order to remain compatible with the latest version of XML Schema\r
+   itself, or with the XLink namespace itself.  In other words, if the XML\r
+   Schema or XLink namespaces change, the version of this document at\r
+   http://www.w3.org/1999/xlink.xsd will change\r
+   accordingly; the version at\r
+   http://www.w3.org/2008/06/xlink.xsd will not change.\r
+</xs:documentation>\r
+ </xs:annotation>\r
\r
+ <xs:annotation>\r
+  <xs:documentation>This schema document provides attribute declarations and\r
+attribute group, complex type and simple type definitions which can be used in\r
+the construction of user schemas to define the structure of particular linking\r
+constructs, e.g.\r
+<![CDATA[\r
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"\r
+           xmlns:xl="http://www.w3.org/1999/xlink">\r
+\r
+ <xs:import namespace="http://www.w3.org/1999/xlink"\r
+            location="http://www.w3.org/1999/xlink.xsd">\r
+\r
+ <xs:element name="mySimple">\r
+  <xs:complexType>\r
+   ...\r
+   <xs:attributeGroup ref="xl:simpleAttrs"/>\r
+   ...\r
+  </xs:complexType>\r
+ </xs:element>\r
+ ...\r
+</xs:schema>]]></xs:documentation>\r
+ </xs:annotation>\r
+\r
+ <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd"/>\r
+\r
+ <xs:attribute name="type" type="xlink:typeType"/>\r
+\r
+ <xs:simpleType name="typeType">\r
+  <xs:restriction base="xs:token">\r
+   <xs:enumeration value="simple"/>\r
+   <xs:enumeration value="extended"/>\r
+   <xs:enumeration value="title"/>\r
+   <xs:enumeration value="resource"/>\r
+   <xs:enumeration value="locator"/>\r
+   <xs:enumeration value="arc"/>\r
+  </xs:restriction>\r
+ </xs:simpleType>\r
+\r
+ <xs:attribute name="href" type="xlink:hrefType"/>\r
+\r
+ <xs:simpleType name="hrefType">\r
+  <xs:restriction base="xs:anyURI"/>\r
+ </xs:simpleType>\r
+\r
+ <xs:attribute name="role" type="xlink:roleType"/>\r
+\r
+ <xs:simpleType name="roleType">\r
+  <xs:restriction base="xs:anyURI">\r
+   <xs:minLength value="1"/>\r
+  </xs:restriction>\r
+ </xs:simpleType>\r
+\r
+ <xs:attribute name="arcrole" type="xlink:arcroleType"/>\r
+\r
+ <xs:simpleType name="arcroleType">\r
+  <xs:restriction base="xs:anyURI">\r
+   <xs:minLength value="1"/>\r
+  </xs:restriction>\r
+ </xs:simpleType>\r
+\r
+ <xs:attribute name="title" type="xlink:titleAttrType"/>\r
+\r
+ <xs:simpleType name="titleAttrType">\r
+  <xs:restriction base="xs:string"/>\r
+ </xs:simpleType>\r
+\r
+ <xs:attribute name="show" type="xlink:showType"/>\r
+\r
+ <xs:simpleType name="showType">\r
+  <xs:restriction base="xs:token">\r
+   <xs:enumeration value="new"/>\r
+   <xs:enumeration value="replace"/>\r
+   <xs:enumeration value="embed"/>\r
+   <xs:enumeration value="other"/>\r
+   <xs:enumeration value="none"/>\r
+  </xs:restriction>\r
+ </xs:simpleType>\r
+\r
+ <xs:attribute name="actuate" type="xlink:actuateType"/>\r
+\r
+ <xs:simpleType name="actuateType">\r
+  <xs:restriction base="xs:token">\r
+   <xs:enumeration value="onLoad"/>\r
+   <xs:enumeration value="onRequest"/>\r
+   <xs:enumeration value="other"/>\r
+   <xs:enumeration value="none"/>\r
+  </xs:restriction>\r
+ </xs:simpleType>\r
+\r
+ <xs:attribute name="label" type="xlink:labelType"/>\r
+\r
+ <xs:simpleType name="labelType">\r
+  <xs:restriction base="xs:NCName"/>\r
+ </xs:simpleType>\r
+\r
+ <xs:attribute name="from" type="xlink:fromType"/>\r
+\r
+ <xs:simpleType name="fromType">\r
+  <xs:restriction base="xs:NCName"/>\r
+ </xs:simpleType>\r
+\r
+ <xs:attribute name="to" type="xlink:toType"/>\r
+\r
+ <xs:simpleType name="toType">\r
+  <xs:restriction base="xs:NCName"/>\r
+ </xs:simpleType>\r
+\r
+ <xs:attributeGroup name="simpleAttrs">\r
+  <xs:attribute ref="xlink:type" fixed="simple"/>\r
+  <xs:attribute ref="xlink:href"/>\r
+  <xs:attribute ref="xlink:role"/>\r
+  <xs:attribute ref="xlink:arcrole"/>\r
+  <xs:attribute ref="xlink:title"/>\r
+  <xs:attribute ref="xlink:show"/>\r
+  <xs:attribute ref="xlink:actuate"/>\r
+ </xs:attributeGroup>\r
+\r
+ <xs:group name="simpleModel">\r
+  <xs:sequence>\r
+   <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>\r
+  </xs:sequence>\r
+ </xs:group>\r
+\r
+ <xs:complexType mixed="true" name="simple">\r
+  <xs:annotation>\r
+   <xs:documentation>\r
+    Intended for use as the type of user-declared elements to make them\r
+    simple links.\r
+   </xs:documentation>\r
+  </xs:annotation>\r
+  <xs:group ref="xlink:simpleModel"/>\r
+  <xs:attributeGroup ref="xlink:simpleAttrs"/>\r
+ </xs:complexType>\r
+\r
+ <xs:attributeGroup name="extendedAttrs">\r
+  <xs:attribute ref="xlink:type" fixed="extended" use="required"/>\r
+  <xs:attribute ref="xlink:role"/>\r
+  <xs:attribute ref="xlink:title"/>\r
+ </xs:attributeGroup>\r
+\r
+ <xs:group name="extendedModel">\r
+   <xs:choice>\r
+    <xs:element ref="xlink:title"/>\r
+    <xs:element ref="xlink:resource"/>\r
+    <xs:element ref="xlink:locator"/>\r
+    <xs:element ref="xlink:arc"/>\r
+  </xs:choice>\r
+ </xs:group>\r
+\r
+ <xs:complexType name="extended">\r
+  <xs:annotation>\r
+   <xs:documentation>\r
+    Intended for use as the type of user-declared elements to make them\r
+    extended links.\r
+    Note that the elements referenced in the content model are all abstract.\r
+    The intention is that by simply declaring elements with these as their\r
+    substitutionGroup, all the right things will happen.\r
+   </xs:documentation>\r
+  </xs:annotation>\r
+  <xs:group ref="xlink:extendedModel" minOccurs="0" maxOccurs="unbounded"/>\r
+  <xs:attributeGroup ref="xlink:extendedAttrs"/>\r
+ </xs:complexType>\r
+\r
+ <xs:element name="title" type="xlink:titleEltType" abstract="true"/>\r
+\r
+ <xs:attributeGroup name="titleAttrs">\r
+  <xs:attribute ref="xlink:type" fixed="title" use="required"/>\r
+  <xs:attribute ref="xml:lang">\r
+   <xs:annotation>\r
+    <xs:documentation>\r
+     xml:lang is not required, but provides much of the\r
+     motivation for title elements in addition to attributes, and so\r
+     is provided here for convenience.\r
+    </xs:documentation>\r
+   </xs:annotation>\r
+  </xs:attribute>\r
+ </xs:attributeGroup>\r
+\r
+ <xs:group name="titleModel">\r
+  <xs:sequence>\r
+   <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>\r
+  </xs:sequence>\r
+ </xs:group>\r
+\r
+ <xs:complexType mixed="true" name="titleEltType">\r
+  <xs:group ref="xlink:titleModel"/>\r
+  <xs:attributeGroup ref="xlink:titleAttrs"/>\r
+ </xs:complexType>\r
+\r
+ <xs:element name="resource" type="xlink:resourceType" abstract="true"/>\r
+\r
+ <xs:attributeGroup name="resourceAttrs">\r
+  <xs:attribute ref="xlink:type" fixed="resource" use="required"/>\r
+  <xs:attribute ref="xlink:role"/>\r
+  <xs:attribute ref="xlink:title"/>\r
+  <xs:attribute ref="xlink:label"/>\r
+ </xs:attributeGroup>\r
+\r
+ <xs:group name="resourceModel">\r
+  <xs:sequence>\r
+   <xs:any processContents="lax" minOccurs="0" maxOccurs="unbounded"/>\r
+  </xs:sequence>\r
+ </xs:group>\r
+\r
+ <xs:complexType mixed="true" name="resourceType">\r
+  <xs:group ref="xlink:resourceModel"/>\r
+  <xs:attributeGroup ref="xlink:resourceAttrs"/>\r
+ </xs:complexType>\r
+\r
+ <xs:element name="locator" type="xlink:locatorType" abstract="true"/>\r
+\r
+ <xs:attributeGroup name="locatorAttrs">\r
+  <xs:attribute ref="xlink:type" fixed="locator" use="required"/>\r
+  <xs:attribute ref="xlink:href" use="required"/>\r
+  <xs:attribute ref="xlink:role"/>\r
+  <xs:attribute ref="xlink:title"/>\r
+  <xs:attribute ref="xlink:label">\r
+   <xs:annotation>\r
+    <xs:documentation>\r
+     label is not required, but locators have no particular\r
+     XLink function if they are not labeled.\r
+    </xs:documentation>\r
+   </xs:annotation>\r
+  </xs:attribute>\r
+ </xs:attributeGroup>\r
+\r
+ <xs:group name="locatorModel">\r
+  <xs:sequence>\r
+   <xs:element ref="xlink:title" minOccurs="0" maxOccurs="unbounded"/>\r
+  </xs:sequence>\r
+ </xs:group>\r
+\r
+ <xs:complexType name="locatorType">\r
+  <xs:group ref="xlink:locatorModel"/>\r
+  <xs:attributeGroup ref="xlink:locatorAttrs"/>\r
+ </xs:complexType>\r
+\r
+ <xs:element name="arc" type="xlink:arcType" abstract="true"/>\r
+\r
+ <xs:attributeGroup name="arcAttrs">\r
+  <xs:attribute ref="xlink:type" fixed="arc" use="required"/>\r
+  <xs:attribute ref="xlink:arcrole"/>\r
+  <xs:attribute ref="xlink:title"/>\r
+  <xs:attribute ref="xlink:show"/>\r
+  <xs:attribute ref="xlink:actuate"/>\r
+  <xs:attribute ref="xlink:from"/>\r
+  <xs:attribute ref="xlink:to">\r
+   <xs:annotation>\r
+    <xs:documentation>\r
+     from and to have default behavior when values are missing\r
+    </xs:documentation>\r
+   </xs:annotation>\r
+  </xs:attribute>\r
+ </xs:attributeGroup>\r
+\r
+ <xs:group name="arcModel">\r
+  <xs:sequence>\r
+   <xs:element ref="xlink:title" minOccurs="0" maxOccurs="unbounded"/>\r
+  </xs:sequence>\r
+ </xs:group>\r
+\r
+ <xs:complexType name="arcType">\r
+  <xs:group ref="xlink:arcModel"/>\r
+  <xs:attributeGroup ref="xlink:arcAttrs"/>\r
+ </xs:complexType>\r
+\r
+</xs:schema>\r
diff --git a/org.argeo.app.core/src/org/argeo/app/core/schemas/xml-events-attribs-1.xsd b/org.argeo.app.core/src/org/argeo/app/core/schemas/xml-events-attribs-1.xsd
new file mode 100644 (file)
index 0000000..ef99128
--- /dev/null
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema 
+    targetNamespace="http://www.w3.org/2001/xml-events" 
+    xmlns:ev="http://www.w3.org/2001/xml-events" 
+    xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+    xsi:schemaLocation="http://www.w3.org/2001/XMLSchema 
+                        http://www.w3.org/2001/XMLSchema.xsd" 
+    elementFormDefault="unqualified" 
+    blockDefault="#all" 
+    finalDefault="#all" 
+    attributeFormDefault="unqualified">
+
+  <xs:annotation>
+    <xs:documentation>
+      This is the XML Schema for XML Events global attributes
+
+      URI: http://www.w3.org/MarkUp/SCHEMA/xml-events-attribs-1.xsd
+      $Id: xml-events-attribs-1.xsd,v 1.7 2004/11/22 17:09:15 ahby Exp $
+    </xs:documentation>
+    <xs:documentation source="xml-events-copyright-1.xsd"/>
+  </xs:annotation>
+
+  <xs:annotation>
+    <xs:documentation>
+      XML Event Attributes
+               
+        These "global" event attributes are defined in "Attaching
+        Attributes Directly to the Observer Element" of the XML
+        Events specification.
+    </xs:documentation>
+  </xs:annotation>
+
+  <xs:attribute name="event" type="xs:NMTOKEN"/>
+  <xs:attribute name="observer" type="xs:IDREF"/>
+  <xs:attribute name="target" type="xs:IDREF"/>
+  <xs:attribute name="handler" type="xs:anyURI"/>
+  <xs:attribute name="phase" default="default">
+    <xs:simpleType>
+      <xs:restriction base="xs:NMTOKEN">
+        <xs:enumeration value="capture"/>
+        <xs:enumeration value="default"/>
+      </xs:restriction>
+    </xs:simpleType>
+  </xs:attribute>
+  <xs:attribute name="propagate" default="continue">
+    <xs:simpleType>
+      <xs:restriction base="xs:NMTOKEN">
+        <xs:enumeration value="stop"/>
+        <xs:enumeration value="continue"/>
+      </xs:restriction>
+    </xs:simpleType>
+  </xs:attribute>
+  <xs:attribute name="defaultAction" default="perform">
+    <xs:simpleType>
+      <xs:restriction base="xs:NMTOKEN">
+        <xs:enumeration value="cancel"/>
+        <xs:enumeration value="perform"/>
+      </xs:restriction>
+    </xs:simpleType>
+  </xs:attribute>
+
+  <xs:attributeGroup name="XmlEvents.attlist">
+    <xs:attribute ref="ev:event"/>
+    <xs:attribute ref="ev:observer"/>
+    <xs:attribute ref="ev:target"/>
+    <xs:attribute ref="ev:handler"/>
+    <xs:attribute ref="ev:phase"/>
+    <xs:attribute ref="ev:propagate"/>
+    <xs:attribute ref="ev:defaultAction"/>
+  </xs:attributeGroup>
+
+</xs:schema>
diff --git a/org.argeo.app.core/src/org/argeo/app/core/schemas/xml.xsd b/org.argeo.app.core/src/org/argeo/app/core/schemas/xml.xsd
new file mode 100644 (file)
index 0000000..aea7d0d
--- /dev/null
@@ -0,0 +1,287 @@
+<?xml version='1.0'?>
+<?xml-stylesheet href="../2008/09/xsd.xsl" type="text/xsl"?>
+<xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace" 
+  xmlns:xs="http://www.w3.org/2001/XMLSchema" 
+  xmlns   ="http://www.w3.org/1999/xhtml"
+  xml:lang="en">
+
+ <xs:annotation>
+  <xs:documentation>
+   <div>
+    <h1>About the XML namespace</h1>
+
+    <div class="bodytext">
+     <p>
+      This schema document describes the XML namespace, in a form
+      suitable for import by other schema documents.
+     </p>
+     <p>
+      See <a href="http://www.w3.org/XML/1998/namespace.html">
+      http://www.w3.org/XML/1998/namespace.html</a> and
+      <a href="http://www.w3.org/TR/REC-xml">
+      http://www.w3.org/TR/REC-xml</a> for information 
+      about this namespace.
+     </p>
+     <p>
+      Note that local names in this namespace are intended to be
+      defined only by the World Wide Web Consortium or its subgroups.
+      The names currently defined in this namespace are listed below.
+      They should not be used with conflicting semantics by any Working
+      Group, specification, or document instance.
+     </p>
+     <p>   
+      See further below in this document for more information about <a
+      href="#usage">how to refer to this schema document from your own
+      XSD schema documents</a> and about <a href="#nsversioning">the
+      namespace-versioning policy governing this schema document</a>.
+     </p>
+    </div>
+   </div>
+  </xs:documentation>
+ </xs:annotation>
+
+ <xs:attribute name="lang">
+  <xs:annotation>
+   <xs:documentation>
+    <div>
+     
+      <h3>lang (as an attribute name)</h3>
+      <p>
+       denotes an attribute whose value
+       is a language code for the natural language of the content of
+       any element; its value is inherited.  This name is reserved
+       by virtue of its definition in the XML specification.</p>
+     
+    </div>
+    <div>
+     <h4>Notes</h4>
+     <p>
+      Attempting to install the relevant ISO 2- and 3-letter
+      codes as the enumerated possible values is probably never
+      going to be a realistic possibility.  
+     </p>
+     <p>
+      See BCP 47 at <a href="http://www.rfc-editor.org/rfc/bcp/bcp47.txt">
+       http://www.rfc-editor.org/rfc/bcp/bcp47.txt</a>
+      and the IANA language subtag registry at
+      <a href="http://www.iana.org/assignments/language-subtag-registry">
+       http://www.iana.org/assignments/language-subtag-registry</a>
+      for further information.
+     </p>
+     <p>
+      The union allows for the 'un-declaration' of xml:lang with
+      the empty string.
+     </p>
+    </div>
+   </xs:documentation>
+  </xs:annotation>
+  <xs:simpleType>
+   <xs:union memberTypes="xs:language">
+    <xs:simpleType>    
+     <xs:restriction base="xs:string">
+      <xs:enumeration value=""/>
+     </xs:restriction>
+    </xs:simpleType>
+   </xs:union>
+  </xs:simpleType>
+ </xs:attribute>
+
+ <xs:attribute name="space">
+  <xs:annotation>
+   <xs:documentation>
+    <div>
+     
+      <h3>space (as an attribute name)</h3>
+      <p>
+       denotes an attribute whose
+       value is a keyword indicating what whitespace processing
+       discipline is intended for the content of the element; its
+       value is inherited.  This name is reserved by virtue of its
+       definition in the XML specification.</p>
+     
+    </div>
+   </xs:documentation>
+  </xs:annotation>
+  <xs:simpleType>
+   <xs:restriction base="xs:NCName">
+    <xs:enumeration value="default"/>
+    <xs:enumeration value="preserve"/>
+   </xs:restriction>
+  </xs:simpleType>
+ </xs:attribute>
+ <xs:attribute name="base" type="xs:anyURI"> <xs:annotation>
+   <xs:documentation>
+    <div>
+     
+      <h3>base (as an attribute name)</h3>
+      <p>
+       denotes an attribute whose value
+       provides a URI to be used as the base for interpreting any
+       relative URIs in the scope of the element on which it
+       appears; its value is inherited.  This name is reserved
+       by virtue of its definition in the XML Base specification.</p>
+     
+     <p>
+      See <a
+      href="http://www.w3.org/TR/xmlbase/">http://www.w3.org/TR/xmlbase/</a>
+      for information about this attribute.
+     </p>
+    </div>
+   </xs:documentation>
+  </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="id" type="xs:ID">
+  <xs:annotation>
+   <xs:documentation>
+    <div>
+     
+      <h3>id (as an attribute name)</h3> 
+      <p>
+       denotes an attribute whose value
+       should be interpreted as if declared to be of type ID.
+       This name is reserved by virtue of its definition in the
+       xml:id specification.</p>
+     
+     <p>
+      See <a
+      href="http://www.w3.org/TR/xml-id/">http://www.w3.org/TR/xml-id/</a>
+      for information about this attribute.
+     </p>
+    </div>
+   </xs:documentation>
+  </xs:annotation>
+ </xs:attribute>
+
+ <xs:attributeGroup name="specialAttrs">
+  <xs:attribute ref="xml:base"/>
+  <xs:attribute ref="xml:lang"/>
+  <xs:attribute ref="xml:space"/>
+  <xs:attribute ref="xml:id"/>
+ </xs:attributeGroup>
+
+ <xs:annotation>
+  <xs:documentation>
+   <div>
+   
+    <h3>Father (in any context at all)</h3> 
+
+    <div class="bodytext">
+     <p>
+      denotes Jon Bosak, the chair of 
+      the original XML Working Group.  This name is reserved by 
+      the following decision of the W3C XML Plenary and 
+      XML Coordination groups:
+     </p>
+     <blockquote>
+       <p>
+       In appreciation for his vision, leadership and
+       dedication the W3C XML Plenary on this 10th day of
+       February, 2000, reserves for Jon Bosak in perpetuity
+       the XML name "xml:Father".
+       </p>
+     </blockquote>
+    </div>
+   </div>
+  </xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+  <xs:documentation>
+   <div xml:id="usage" id="usage">
+    <h2><a name="usage">About this schema document</a></h2>
+
+    <div class="bodytext">
+     <p>
+      This schema defines attributes and an attribute group suitable
+      for use by schemas wishing to allow <code>xml:base</code>,
+      <code>xml:lang</code>, <code>xml:space</code> or
+      <code>xml:id</code> attributes on elements they define.
+     </p>
+     <p>
+      To enable this, such a schema must import this schema for
+      the XML namespace, e.g. as follows:
+     </p>
+     <pre>
+          &lt;schema . . .>
+           . . .
+           &lt;import namespace="http://www.w3.org/XML/1998/namespace"
+                      schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+     </pre>
+     <p>
+      or
+     </p>
+     <pre>
+           &lt;import namespace="http://www.w3.org/XML/1998/namespace"
+                      schemaLocation="http://www.w3.org/2009/01/xml.xsd"/>
+     </pre>
+     <p>
+      Subsequently, qualified reference to any of the attributes or the
+      group defined below will have the desired effect, e.g.
+     </p>
+     <pre>
+          &lt;type . . .>
+           . . .
+           &lt;attributeGroup ref="xml:specialAttrs"/>
+     </pre>
+     <p>
+      will define a type which will schema-validate an instance element
+      with any of those attributes.
+     </p>
+    </div>
+   </div>
+  </xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+  <xs:documentation>
+   <div id="nsversioning" xml:id="nsversioning">
+    <h2><a name="nsversioning">Versioning policy for this schema document</a></h2>
+    <div class="bodytext">
+     <p>
+      In keeping with the XML Schema WG's standard versioning
+      policy, this schema document will persist at
+      <a href="http://www.w3.org/2009/01/xml.xsd">
+       http://www.w3.org/2009/01/xml.xsd</a>.
+     </p>
+     <p>
+      At the date of issue it can also be found at
+      <a href="http://www.w3.org/2001/xml.xsd">
+       http://www.w3.org/2001/xml.xsd</a>.
+     </p>
+     <p>
+      The schema document at that URI may however change in the future,
+      in order to remain compatible with the latest version of XML
+      Schema itself, or with the XML namespace itself.  In other words,
+      if the XML Schema or XML namespaces change, the version of this
+      document at <a href="http://www.w3.org/2001/xml.xsd">
+       http://www.w3.org/2001/xml.xsd 
+      </a> 
+      will change accordingly; the version at 
+      <a href="http://www.w3.org/2009/01/xml.xsd">
+       http://www.w3.org/2009/01/xml.xsd 
+      </a> 
+      will not change.
+     </p>
+     <p>
+      Previous dated (and unchanging) versions of this schema 
+      document are at:
+     </p>
+     <ul>
+      <li><a href="http://www.w3.org/2009/01/xml.xsd">
+       http://www.w3.org/2009/01/xml.xsd</a></li>
+      <li><a href="http://www.w3.org/2007/08/xml.xsd">
+       http://www.w3.org/2007/08/xml.xsd</a></li>
+      <li><a href="http://www.w3.org/2004/10/xml.xsd">
+       http://www.w3.org/2004/10/xml.xsd</a></li>
+      <li><a href="http://www.w3.org/2001/03/xml.xsd">
+       http://www.w3.org/2001/03/xml.xsd</a></li>
+     </ul>
+    </div>
+   </div>
+  </xs:documentation>
+ </xs:annotation>
+
+</xs:schema>
+
diff --git a/org.argeo.app.core/src/org/argeo/app/docbook/DbkAcrUtils.java b/org.argeo.app.core/src/org/argeo/app/docbook/DbkAcrUtils.java
new file mode 100644 (file)
index 0000000..8dda2b4
--- /dev/null
@@ -0,0 +1,29 @@
+package org.argeo.app.docbook;
+
+import org.argeo.api.acr.Content;
+
+public class DbkAcrUtils {
+       /** Whether this DocBook element is of this type. */
+       public static boolean isDbk(Content content, DbkType type) {
+               return content.isContentClass(type.qName());
+       }
+
+       public static String getMediaFileref(Content node) {
+               Content mediadata;
+               if (node.hasChild(DbkType.imageobject)) {
+                       mediadata = node.child(DbkType.imageobject).child(DbkType.imagedata);
+               } else {
+                       mediadata = node.child(DbkType.videoobject).child(DbkType.videodata);
+               }
+
+               if (mediadata.containsKey(DbkAttr.fileref)) {
+                       return mediadata.attr(DbkAttr.fileref);
+               } else {
+                       return null;
+               }
+       }
+
+       /** singleton */
+       private DbkAcrUtils() {
+       }
+}
index f6cf839a38ecac79f194f28d8d13d732f987d2a2..df10c8b17591238e167aa63c8268e7b4befc654e 100644 (file)
@@ -1,7 +1,9 @@
 package org.argeo.app.docbook;
 
+import org.argeo.api.acr.QNamed;
+
 /** Supported DocBook attributes. */
-public enum DbkAttr {
+public enum DbkAttr implements QNamed.Unqualified {
        role,
        //
        fileref, contentwidth, contentdepth
index 3e3585f4b8f523f7c5ce0d5af38714949d5f1091..ff83002f8eda20207903c3bd04eb0eb66890b589 100644 (file)
@@ -1,9 +1,9 @@
 package org.argeo.app.docbook;
 
-import org.argeo.app.api.JcrName;
+import org.argeo.api.acr.QNamed;
 
 /** Supported DocBook elements */
-public enum DbkType implements JcrName {
+public enum DbkType implements QNamed {
        book, article, section,
        //
        info, title, para,
@@ -14,11 +14,12 @@ public enum DbkType implements JcrName {
        //
        ;
 
-       @Override
-       public String getPrefix() {
-               return prefix();
-       }
+//     @Override
+//     public String getPrefix() {
+//             return prefix();
+//     }
 
+       @Deprecated
        public static String prefix() {
                return "dbk";
        }
@@ -32,4 +33,9 @@ public enum DbkType implements JcrName {
                return "http://docbook.org/ns/docbook";
        }
 
+       @Override
+       public String getDefaultPrefix() {
+               return "dbk";
+       }
+
 }
index 6c959f43d3269c3e90287e508abb918564db08ed..b0d352bb6049981052c9bffc636cc1339f7ae28c 100644 (file)
@@ -70,7 +70,7 @@ public class DbkUtils {
 
        public static void setTitle(Node node, String txt) {
                Node titleNode = getOrAddDbk(node, DbkType.title);
-               JcrxApi.setXmlValue(node, titleNode, txt);
+               JcrxApi.setXmlValue(titleNode, txt);
        }
 
        public static Node getMetadata(Node infoContainer) {
@@ -103,7 +103,7 @@ public class DbkUtils {
 
        public static Node addParagraph(Node node, String txt) {
                Node p = addDbk(node, para);
-               JcrxApi.setXmlValue(node, p, txt);
+               JcrxApi.setXmlValue(p, txt);
                return p;
        }
 
diff --git a/org.argeo.app.core/src/org/argeo/app/geo/GeoToolsTest.java b/org.argeo.app.core/src/org/argeo/app/geo/GeoToolsTest.java
new file mode 100644 (file)
index 0000000..a771196
--- /dev/null
@@ -0,0 +1,221 @@
+package org.argeo.app.geo;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.InputStreamReader;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.geotools.data.DataUtilities;
+import org.geotools.data.DefaultTransaction;
+import org.geotools.data.Transaction;
+import org.geotools.data.collection.ListFeatureCollection;
+import org.geotools.data.shapefile.ShapefileDataStore;
+import org.geotools.data.shapefile.ShapefileDataStoreFactory;
+import org.geotools.data.simple.SimpleFeatureCollection;
+import org.geotools.data.simple.SimpleFeatureSource;
+import org.geotools.data.simple.SimpleFeatureStore;
+import org.geotools.feature.simple.SimpleFeatureBuilder;
+import org.geotools.geometry.jts.JTSFactoryFinder;
+import org.geotools.swing.data.JFileDataStoreChooser;
+import org.locationtech.jts.geom.Coordinate;
+import org.locationtech.jts.geom.Geometry;
+import org.locationtech.jts.geom.GeometryFactory;
+import org.locationtech.jts.geom.LineString;
+import org.locationtech.jts.geom.Point;
+import org.opengis.feature.simple.SimpleFeature;
+import org.opengis.feature.simple.SimpleFeatureType;
+
+public class GeoToolsTest {
+       public GeoToolsTest() {
+
+       }
+
+       public void init() {
+               try {
+                       main(null);
+               } catch (Exception e) {
+                       e.printStackTrace();
+               }
+       }
+
+       public void destroy() {
+
+       }
+
+       public static void main(String[] args) throws Exception {
+               final SimpleFeatureType TYPE = DataUtilities.createType("Location", "the_geom:Point:srid=4326," + // <- the
+               // geometry
+               // attribute:
+               // Point
+               // type
+                               "name:String," + // <- a String attribute
+                               "number:Integer" // a number attribute
+               );
+               final SimpleFeatureType TYPE_HULL = DataUtilities.createType("Hull", "the_geom:MultiPolygon:srid=4326");
+               System.out.println("TYPE:" + TYPE);
+
+               /*
+                * A list to collect features as we create them.
+                */
+               List<SimpleFeature> features = new ArrayList<>();
+               List<Coordinate> coordinates = new ArrayList<>();
+
+               /*
+                * GeometryFactory will be used to create the geometry attribute of each
+                * feature, using a Point object for the location.
+                */
+               GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory();
+
+               SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder(TYPE);
+
+               try (BufferedReader reader = new BufferedReader(
+                               new InputStreamReader(GeoToolsTest.class.getResourceAsStream("/org/djapps/on/apaf/locations.csv")))) {
+                       /* First line of the data file is the header */
+                       String line = reader.readLine();
+                       System.out.println("Header: " + line);
+
+                       for (line = reader.readLine(); line != null; line = reader.readLine()) {
+                               if (line.trim().length() > 0) { // skip blank lines
+                                       String[] tokens = line.split("\\,");
+
+                                       double latitude = Double.parseDouble(tokens[0]);
+                                       double longitude = Double.parseDouble(tokens[1]);
+                                       String name = tokens[2].trim();
+                                       int number = Integer.parseInt(tokens[3].trim());
+
+                                       /* Longitude (= x coord) first ! */
+                                       Coordinate coordinate = new Coordinate(longitude, latitude);
+                                       coordinates.add(coordinate);
+                                       Point point = geometryFactory.createPoint(coordinate);
+
+                                       featureBuilder.add(point);
+                                       featureBuilder.add(name);
+                                       featureBuilder.add(number);
+                                       SimpleFeature feature = featureBuilder.buildFeature(null);
+                                       features.add(feature);
+                               }
+                       }
+               }
+
+               LineString lineString = geometryFactory
+                               .createLineString(coordinates.toArray(new Coordinate[coordinates.size()]));
+               Geometry convexHull = lineString.convexHull();
+               System.out.println(convexHull.toText());
+               SimpleFeatureBuilder hullFeatureBuilder = new SimpleFeatureBuilder(TYPE_HULL);
+               hullFeatureBuilder.add(convexHull);
+               SimpleFeature hull = hullFeatureBuilder.buildFeature(null);
+
+               /*
+                * Get an output file name and create the new shapefile
+                */
+               File newFile = getNewShapeFile();
+
+               ShapefileDataStoreFactory dataStoreFactory = new ShapefileDataStoreFactory();
+
+               Map<String, Serializable> params = new HashMap<>();
+               params.put("url", newFile.toURI().toURL());
+               params.put("create spatial index", Boolean.TRUE);
+
+               ShapefileDataStore newDataStore = (ShapefileDataStore) dataStoreFactory.createNewDataStore(params);
+
+               /*
+                * TYPE is used as a template to describe the file contents
+                */
+               newDataStore.createSchema(TYPE_HULL);
+
+               /*
+                * Write the features to the shapefile
+                */
+               Transaction transaction = new DefaultTransaction("create");
+
+               String typeName = newDataStore.getTypeNames()[0];
+               SimpleFeatureSource featureSource = newDataStore.getFeatureSource(typeName);
+               SimpleFeatureType SHAPE_TYPE = featureSource.getSchema();
+               /*
+                * The Shapefile format has a couple limitations: - "the_geom" is always first,
+                * and used for the geometry attribute name - "the_geom" must be of type Point,
+                * MultiPoint, MuiltiLineString, MultiPolygon - Attribute names are limited in
+                * length - Not all data types are supported (example Timestamp represented as
+                * Date)
+                *
+                * Each data store has different limitations so check the resulting
+                * SimpleFeatureType.
+                */
+               System.out.println("SHAPE:" + SHAPE_TYPE);
+
+               if (featureSource instanceof SimpleFeatureStore) {
+                       SimpleFeatureStore featureStore = (SimpleFeatureStore) featureSource;
+                       /*
+                        * SimpleFeatureStore has a method to add features from a
+                        * SimpleFeatureCollection object, so we use the ListFeatureCollection class to
+                        * wrap our list of features.
+                        */
+                       SimpleFeatureCollection collection = new ListFeatureCollection(TYPE, Collections.singletonList(hull));
+                       featureStore.setTransaction(transaction);
+                       try {
+                               featureStore.addFeatures(collection);
+                               transaction.commit();
+                       } catch (Exception problem) {
+                               problem.printStackTrace();
+                               transaction.rollback();
+                       } finally {
+                               transaction.close();
+                       }
+               } else {
+                       System.out.println(typeName + " does not support read/write access");
+               }
+//             if (featureSource instanceof SimpleFeatureStore) {
+//                     SimpleFeatureStore featureStore = (SimpleFeatureStore) featureSource;
+//                     /*
+//                      * SimpleFeatureStore has a method to add features from a
+//                      * SimpleFeatureCollection object, so we use the ListFeatureCollection class to
+//                      * wrap our list of features.
+//                      */
+//                     SimpleFeatureCollection collection = new ListFeatureCollection(TYPE, features);
+//                     featureStore.setTransaction(transaction);
+//                     try {
+//                             featureStore.addFeatures(collection);
+//                             transaction.commit();
+//                     } catch (Exception problem) {
+//                             problem.printStackTrace();
+//                             transaction.rollback();
+//                     } finally {
+//                             transaction.close();
+//                     }
+//             } else {
+//                     System.out.println(typeName + " does not support read/write access");
+//             }
+       }
+
+       /**
+        * Prompt the user for the name and path to use for the output shapefile
+        *
+        * @param csvFile the input csv file used to create a default shapefile name
+        * @return name and path for the shapefile as a new File object
+        */
+       private static File getNewShapeFile() {
+//        String path = csvFile.getAbsolutePath();
+//        String newPath = path.substring(0, path.length() - 4) + ".shp";
+
+               JFileDataStoreChooser chooser = new JFileDataStoreChooser("shp");
+               chooser.setDialogTitle("Save shapefile");
+//        chooser.setSelectedFile(new File(newPath));
+
+               int returnVal = chooser.showSaveDialog(null);
+
+               if (returnVal != JFileDataStoreChooser.APPROVE_OPTION) {
+                       // the user cancelled the dialog
+                       System.exit(0);
+               }
+
+               File newFile = chooser.getSelectedFile();
+
+               return newFile;
+       }
+
+}
diff --git a/org.argeo.app.core/src/org/argeo/app/geo/GeoUtils.java b/org.argeo.app.core/src/org/argeo/app/geo/GeoUtils.java
new file mode 100644 (file)
index 0000000..1b9ce72
--- /dev/null
@@ -0,0 +1,109 @@
+package org.argeo.app.geo;
+
+import java.io.IOException;
+import java.io.Writer;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.measure.Quantity;
+import javax.measure.quantity.Area;
+
+import org.geotools.data.simple.SimpleFeatureCollection;
+import org.geotools.data.simple.SimpleFeatureIterator;
+import org.geotools.geometry.jts.JTS;
+import org.geotools.referencing.CRS;
+import org.geotools.referencing.crs.DefaultGeographicCRS;
+import org.locationtech.jts.geom.Coordinate;
+import org.locationtech.jts.geom.Point;
+import org.locationtech.jts.geom.Polygon;
+import org.opengis.feature.simple.SimpleFeature;
+import org.opengis.geometry.MismatchedDimensionException;
+import org.opengis.referencing.FactoryException;
+import org.opengis.referencing.crs.CoordinateReferenceSystem;
+import org.opengis.referencing.operation.MathTransform;
+import org.opengis.referencing.operation.TransformException;
+
+import si.uom.SI;
+import tech.units.indriya.quantity.Quantities;
+
+/** Utilities around geographical format, mostly wrapping GeoTools patterns. */
+public class GeoUtils {
+
+       /** In square meters. */
+       public static Quantity<Area> calcArea(SimpleFeature feature) {
+               try {
+                       Polygon p = (Polygon) feature.getDefaultGeometry();
+                       Point centroid = p.getCentroid();
+                       String code = "AUTO:42001," + centroid.getX() + "," + centroid.getY();
+                       CoordinateReferenceSystem auto = CRS.decode(code);
+
+                       MathTransform transform = CRS.findMathTransform(DefaultGeographicCRS.WGS84, auto);
+
+                       Polygon projed = (Polygon) JTS.transform(p, transform);
+                       return Quantities.getQuantity(projed.getArea(), SI.SQUARE_METRE);
+               } catch (MismatchedDimensionException | FactoryException | TransformException e) {
+                       throw new IllegalStateException("Cannot claculate area of feature");
+               }
+       }
+
+       public static void exportToSvg(SimpleFeatureCollection features, Writer out, int width, int height) {
+               try {
+                       double minY = Double.POSITIVE_INFINITY;
+                       double maxY = Double.NEGATIVE_INFINITY;
+                       double minX = Double.POSITIVE_INFINITY;
+                       double maxX = Double.NEGATIVE_INFINITY;
+                       List<String> shapes = new ArrayList<>();
+                       for (SimpleFeatureIterator it = features.features(); it.hasNext();) {
+                               SimpleFeature feature = it.next();
+                               StringBuffer sb = new StringBuffer();
+                               sb.append("<polyline style=\"stroke-width:1;stroke:#000000;fill:none;\" points=\"");
+
+                               Polygon p = (Polygon) feature.getDefaultGeometry();
+                               Point centroid = p.getCentroid();
+                               String code = "AUTO:42001," + centroid.getX() + "," + centroid.getY();
+                               CoordinateReferenceSystem auto = CRS.decode(code);
+
+                               MathTransform transform = CRS.findMathTransform(DefaultGeographicCRS.WGS84, auto);
+
+                               Polygon projed = (Polygon) JTS.transform(p, transform);
+
+                               for (Coordinate coord : projed.getCoordinates()) {
+                                       double x = coord.x;
+                                       if (x < minX)
+                                               minX = x;
+                                       if (x > maxX)
+                                               maxX = x;
+                                       double y = -coord.y;
+                                       if (y < minY)
+                                               minY = y;
+                                       if (y > maxY)
+                                               maxY = y;
+                                       sb.append(x + "," + y + " ");
+                               }
+                               sb.append("\">");
+                               sb.append("</polyline>\n");
+                               shapes.add(sb.toString());
+
+                       }
+                       double viewportHeight = maxY - minY;
+                       double viewportWidth = maxX - minX;
+                       out.write("<svg xmlns=\"http://www.w3.org/2000/svg\"\n");
+                       out.write(" width=\"" + width + "\"\n");
+                       out.write(" height=\"" + height + "\"\n");
+                       out.write(" viewBox=\"" + minX + " " + minY + " " + viewportWidth + " " + viewportHeight + "\"\n");
+                       out.write(" preserveAspectRatio=\"xMidYMid meet\"\n");
+                       out.write(">\n");
+                       for (String shape : shapes) {
+                               out.write(shape);
+                               out.write("\n");
+                       }
+                       out.write("</svg>");
+               } catch (IOException | FactoryException | MismatchedDimensionException | TransformException e) {
+                       throw new RuntimeException("Cannot export to SVG", e);
+               }
+       }
+
+       /** Singleton. */
+       private GeoUtils() {
+       }
+}
diff --git a/org.argeo.app.core/src/org/argeo/app/geo/GmlAttr.java b/org.argeo.app.core/src/org/argeo/app/geo/GmlAttr.java
new file mode 100644 (file)
index 0000000..77b0885
--- /dev/null
@@ -0,0 +1,22 @@
+package org.argeo.app.geo;
+
+import org.argeo.api.acr.QNamed;
+
+public enum GmlAttr implements QNamed {
+       uom
+       //
+       ;
+
+       public final static String UOM_SQUARE_METERS = "m2";
+
+       @Override
+       public String getNamespace() {
+               return "http://www.opengis.net/gml/3.2";
+       }
+
+       @Override
+       public String getDefaultPrefix() {
+               return "gml";
+       }
+
+}
diff --git a/org.argeo.app.core/src/org/argeo/app/geo/GmlType.java b/org.argeo.app.core/src/org/argeo/app/geo/GmlType.java
new file mode 100644 (file)
index 0000000..980a5e4
--- /dev/null
@@ -0,0 +1,20 @@
+package org.argeo.app.geo;
+
+import org.argeo.api.acr.QNamed;
+
+public enum GmlType implements QNamed {
+       measure
+       //
+       ;
+
+       @Override
+       public String getNamespace() {
+               return "http://www.opengis.net/gml/3.2";
+       }
+
+       @Override
+       public String getDefaultPrefix() {
+               return "gml";
+       }
+
+}
diff --git a/org.argeo.app.core/src/org/argeo/app/geo/GpxUtils.java b/org.argeo.app.core/src/org/argeo/app/geo/GpxUtils.java
new file mode 100644 (file)
index 0000000..5bb7d5c
--- /dev/null
@@ -0,0 +1,67 @@
+package org.argeo.app.geo;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.geotools.data.DataUtilities;
+import org.geotools.feature.SchemaException;
+import org.geotools.feature.simple.SimpleFeatureBuilder;
+import org.geotools.geometry.jts.JTSFactoryFinder;
+import org.locationtech.jts.geom.Coordinate;
+import org.locationtech.jts.geom.GeometryFactory;
+import org.locationtech.jts.geom.Polygon;
+import org.opengis.feature.simple.SimpleFeature;
+import org.opengis.feature.simple.SimpleFeatureType;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+/** Utilities around the GPX format. */
+public class GpxUtils {
+
+       public static SimpleFeature parseGpxToPolygon(InputStream in) {
+               try {
+                       final SimpleFeatureType TYPE = DataUtilities.createType("Area", "the_geom:Polygon:srid=4326");
+                       SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder(TYPE);
+
+                       GeometryFactory geometryFactory = JTSFactoryFinder.getGeometryFactory();
+                       List<Coordinate> coordinates = new ArrayList<>();
+                       SAXParserFactory factory = SAXParserFactory.newInstance();
+                       SAXParser saxParser = factory.newSAXParser();
+
+                       saxParser.parse(in, new DefaultHandler() {
+
+                               @Override
+                               public void startElement(String uri, String localName, String qName, Attributes attributes)
+                                               throws SAXException {
+                                       if ("trkpt".equals(qName)) {
+                                               Double latitude = Double.parseDouble(attributes.getValue("lat"));
+                                               Double longitude = Double.parseDouble(attributes.getValue("lon"));
+                                               Coordinate coordinate = new Coordinate(longitude, latitude);
+                                               coordinates.add(coordinate);
+                                       }
+                               }
+
+                       });
+                       // close the line string
+                       coordinates.add(coordinates.get(0));
+
+                       Polygon polygon = geometryFactory.createPolygon(coordinates.toArray(new Coordinate[coordinates.size()]));
+                       featureBuilder.add(polygon);
+                       SimpleFeature area = featureBuilder.buildFeature(null);
+                       return area;
+               } catch (ParserConfigurationException | SAXException | IOException | SchemaException e) {
+                       throw new RuntimeException("Cannot convert GPX", e);
+               }
+       }
+
+       /** Singleton. */
+       private GpxUtils() {
+       }
+}
index 52456bb34be9983ae03b0665b3c0d4d49d8bfb42..be2b507081cf009d74a3713a165fefbac0577cc9 100644 (file)
@@ -10,8 +10,8 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
-import org.argeo.util.CsvParser;
-import org.argeo.util.CsvWriter;
+import org.argeo.cms.util.CsvParser;
+import org.argeo.cms.util.CsvWriter;
 
 /** Import GeoNames administrative division from the main table. */
 public class ImportGeonamesAdmin {
index 7fd308de8d1e6c87b21113b0aaf9b20d223e159f..72c334f31b63bea9c5a8ac56c47dab0be6403e1a 100644 (file)
@@ -66,9 +66,9 @@ public class ImageProcessor {
                                                Files.deleteIfExists(temp);
                                        }
                                } else {
-                                       try (OutputStream out = outSupplier.call()) {
-                                               copyWithMetadata(() -> in, metadata);
-                                       }
+//                                     try (OutputStream out = outSupplier.call()) {
+                                       copyWithMetadata(() -> in, metadata);
+//                                     }
                                }
                        }
                } catch (Exception e) {
index 17c6cf227bdf429d525af5e353033ebb464ed173..c96126c012eb699c22dc1d781b4f9f9f5005bba8 100644 (file)
@@ -22,7 +22,7 @@ import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.parsers.SAXParser;
 import javax.xml.parsers.SAXParserFactory;
 
-import org.argeo.util.DigestUtils;
+import org.argeo.cms.util.DigestUtils;
 import org.xml.sax.Attributes;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
diff --git a/org.argeo.app.core/src/org/argeo/app/mail/EmailMigration.java b/org.argeo.app.core/src/org/argeo/app/mail/EmailMigration.java
new file mode 100644 (file)
index 0000000..8c899c2
--- /dev/null
@@ -0,0 +1,524 @@
+package org.argeo.app.mail;
+
+import static java.lang.System.Logger.Level.DEBUG;
+import static java.lang.System.Logger.Level.ERROR;
+import static org.argeo.app.mail.EmailUtils.describe;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.lang.System.Logger;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.StandardCopyOption;
+import java.time.Instant;
+import java.util.Date;
+import java.util.Enumeration;
+import java.util.Properties;
+
+import javax.mail.FetchProfile;
+import javax.mail.Folder;
+import javax.mail.Message;
+import javax.mail.MessagingException;
+import javax.mail.Multipart;
+import javax.mail.Session;
+import javax.mail.Store;
+import javax.mail.URLName;
+import javax.mail.internet.InternetHeaders;
+import javax.mail.internet.MimeBodyPart;
+import javax.mail.internet.MimeMessage;
+import javax.mail.search.HeaderTerm;
+import javax.mail.util.SharedFileInputStream;
+
+import com.sun.mail.imap.IMAPFolder;
+import com.sun.mail.mbox.MboxFolder;
+import com.sun.mail.mbox.MboxMessage;
+
+/** Migrates emails from one storage to the another one. */
+public class EmailMigration {
+       private final static Logger logger = System.getLogger(EmailMigration.class.getName());
+
+//     private String targetBaseDir;
+
+       private String sourceServer;
+       private String sourceUsername;
+       private String sourcePassword;
+
+       private String targetServer;
+       private String targetUsername;
+       private String targetPassword;
+
+       private boolean targetSupportDualTypeFolders = true;
+
+       public void process() throws MessagingException, IOException {
+//             Path baseDir = Paths.get(targetBaseDir).resolve(sourceUsername).resolve("mbox");
+
+               Store sourceStore = null;
+               try {
+                       Properties sourceProperties = System.getProperties();
+                       sourceProperties.setProperty("mail.store.protocol", "imaps");
+
+                       Session sourceSession = Session.getInstance(sourceProperties, null);
+                       // session.setDebug(true);
+                       sourceStore = sourceSession.getStore("imaps");
+                       sourceStore.connect(sourceServer, sourceUsername, sourcePassword);
+
+                       Folder defaultFolder = sourceStore.getDefaultFolder();
+//                     migrateFolders(baseDir, defaultFolder);
+
+                       // Always start with Inbox
+//                     Folder inboxFolder = sourceStore.getFolder(EmailUtils.INBOX);
+//                     migrateFolder(baseDir, inboxFolder);
+
+                       Properties targetProperties = System.getProperties();
+                       targetProperties.setProperty("mail.imap.starttls.enable", "true");
+                       targetProperties.setProperty("mail.imap.auth", "true");
+
+                       Session targetSession = Session.getInstance(targetProperties, null);
+                       // session.setDebug(true);
+                       Store targetStore = targetSession.getStore("imap");
+                       targetStore.connect(targetServer, targetUsername, targetPassword);
+
+//                     Folder targetFolder = targetStore.getFolder(EmailUtils.INBOX);
+//                     logger.log(DEBUG, "Source message count " + inboxFolder.getMessageCount());
+//                     logger.log(DEBUG, "Target message count " + targetFolder.getMessageCount());
+
+                       migrateFolders(defaultFolder, targetStore);
+               } finally {
+                       if (sourceStore != null)
+                               sourceStore.close();
+
+               }
+       }
+
+       protected void migrateFolders(Folder sourceParentFolder, Store targetStore) throws MessagingException, IOException {
+               folders: for (Folder sourceFolder : sourceParentFolder.list()) {
+                       String sourceFolderName = sourceFolder.getName();
+
+                       String sourceFolderFullName = sourceFolder.getFullName();
+                       char sourceFolderSeparator = sourceParentFolder.getSeparator();
+                       char targetFolderSeparator = targetStore.getDefaultFolder().getSeparator();
+                       String targetFolderFullName = sourceFolderFullName.replace(sourceFolderSeparator, targetFolderSeparator);
+
+                       // GMail specific
+                       if (sourceFolderFullName.equals("[Gmail]")) {
+                               migrateFolders(sourceFolder, targetStore);
+                               continue folders;
+                       }
+                       if (sourceFolderFullName.startsWith("[Gmail]")) {
+                               String subFolderName = null;
+                               // Make it configurable
+                               switch (sourceFolderName) {
+                               case "All Mail":
+                               case "Important":
+                               case "Spam":
+                                       continue folders;
+                               case "Sent Mail":
+                                       subFolderName = "Sent";
+                               default:
+                                       // does nothing
+                               }
+                               targetFolderFullName = subFolderName == null ? sourceFolder.getName() : subFolderName;
+                       }
+
+                       // nature of the source folder
+                       int messageCount = (sourceFolder.getType() & Folder.HOLDS_MESSAGES) != 0 ? sourceFolder.getMessageCount()
+                                       : 0;
+                       boolean hasSubFolders = (sourceFolder.getType() & Folder.HOLDS_FOLDERS) != 0
+                                       ? sourceFolder.list().length != 0
+                                       : false;
+
+                       Folder targetFolder;
+                       if (targetSupportDualTypeFolders) {
+                               targetFolder = targetStore.getFolder(targetFolderFullName);
+                               if (!targetFolder.exists()) {
+                                       targetFolder.create(Folder.HOLDS_FOLDERS | Folder.HOLDS_MESSAGES);
+                                       logger.log(DEBUG, "Created HOLDS_FOLDERS | HOLDS_MESSAGES folder " + targetFolder.getFullName());
+                               }
+
+                       } else {
+                               if (hasSubFolders) {// has sub-folders
+                                       if (messageCount == 0) {
+                                               targetFolder = targetStore.getFolder(targetFolderFullName);
+                                               if (!targetFolder.exists()) {
+                                                       targetFolder.create(Folder.HOLDS_FOLDERS);
+                                                       logger.log(DEBUG, "Created HOLDS_FOLDERS folder " + targetFolder.getFullName());
+                                               }
+                                       } else {// also has messages
+                                               Folder parentFolder = targetStore.getFolder(targetFolderFullName);
+                                               if (!parentFolder.exists()) {
+                                                       parentFolder.create(Folder.HOLDS_FOLDERS);
+                                                       logger.log(DEBUG, "Created HOLDS_FOLDERS folder " + parentFolder.getFullName());
+                                               }
+                                               String miscFullName = targetFolderFullName + targetFolderSeparator + "_Misc";
+                                               targetFolder = targetStore.getFolder(miscFullName);
+                                               if (!targetFolder.exists()) {
+                                                       targetFolder.create(Folder.HOLDS_MESSAGES);
+                                                       logger.log(DEBUG, "Created HOLDS_MESSAGES folder " + targetFolder.getFullName());
+                                               }
+                                       }
+                               } else {// no sub-folders
+                                       if (messageCount == 0) { // empty
+                                               logger.log(DEBUG, "Skip empty folder " + targetFolderFullName);
+                                               continue folders;
+                                       }
+                                       targetFolder = targetStore.getFolder(targetFolderFullName);
+                                       if (!targetFolder.exists()) {
+                                               targetFolder.create(Folder.HOLDS_MESSAGES);
+                                               logger.log(DEBUG, "Created HOLDS_MESSAGES folder " + targetFolder.getFullName());
+                                       }
+                               }
+                       }
+
+                       if (messageCount != 0) {
+
+                               targetFolder.open(Folder.READ_WRITE);
+                               try {
+                                       long begin = System.currentTimeMillis();
+                                       sourceFolder.open(Folder.READ_ONLY);
+                                       migrateFolder(sourceFolder, targetFolder);
+                                       long duration = System.currentTimeMillis() - begin;
+                                       logger.log(DEBUG, targetFolderFullName + " - Migration of " + messageCount + " messages took "
+                                                       + (duration / 1000) + " s (" + (duration / messageCount) + " ms per message)");
+                               } finally {
+                                       sourceFolder.close();
+                                       targetFolder.close();
+                               }
+                       }
+
+                       // recursive
+                       if (hasSubFolders) {
+                               migrateFolders(sourceFolder, targetStore);
+                       }
+               }
+       }
+
+       protected void migrateFoldersToFs(Path baseDir, Folder sourceFolder) throws MessagingException, IOException {
+               folders: for (Folder folder : sourceFolder.list()) {
+                       String folderName = folder.getName();
+
+                       if ((folder.getType() & Folder.HOLDS_MESSAGES) != 0) {
+                               // Make it configurable
+                               switch (folderName) {
+                               case "All Mail":
+                               case "Important":
+                                       continue folders;
+                               default:
+                                       // doe nothing
+                               }
+                               migrateFolderToFs(baseDir, folder);
+                       }
+                       if ((folder.getType() & Folder.HOLDS_FOLDERS) != 0) {
+                               migrateFoldersToFs(baseDir.resolve(folder.getName()), folder);
+                       }
+               }
+       }
+
+       protected void migrateFolderToFs(Path baseDir, Folder sourceFolder) throws MessagingException, IOException {
+
+               String folderName = sourceFolder.getName();
+               sourceFolder.open(Folder.READ_ONLY);
+
+               Folder targetFolder = null;
+               try {
+                       int messageCount = sourceFolder.getMessageCount();
+                       logger.log(DEBUG, folderName + " - Message count : " + messageCount);
+                       if (messageCount == 0)
+                               return;
+//                     logger.log(DEBUG, folderName + " - Unread Messages : " + sourceFolder.getUnreadMessageCount());
+
+                       boolean saveAsFiles = false;
+
+                       if (saveAsFiles) {
+                               Message messages[] = sourceFolder.getMessages();
+
+                               for (int i = 0; i < messages.length; ++i) {
+//                                     logger.log(DEBUG, "MESSAGE #" + (i + 1) + ":");
+                                       Message msg = messages[i];
+//                                     String from = "unknown";
+//                                     if (msg.getReplyTo().length >= 1) {
+//                                             from = msg.getReplyTo()[0].toString();
+//                                     } else if (msg.getFrom().length >= 1) {
+//                                             from = msg.getFrom()[0].toString();
+//                                     }
+                                       String subject = msg.getSubject();
+                                       Instant sentDate = msg.getSentDate().toInstant();
+//                                     logger.log(DEBUG, "Saving ... " + subject + " from " + from + " (" + sentDate + ")");
+                                       String fileName = sentDate + "  " + subject;
+                                       Path file = baseDir.resolve(fileName);
+                                       savePartsAsFiles(msg.getContent(), file);
+                               }
+                       } else {
+                               long begin = System.currentTimeMillis();
+                               targetFolder = openMboxTargetFolder(sourceFolder, baseDir);
+                               migrateFolder(sourceFolder, targetFolder);
+                               long duration = System.currentTimeMillis() - begin;
+                               logger.log(DEBUG, folderName + " - Migration of " + messageCount + " messages took " + (duration / 1000)
+                                               + " s (" + (duration / messageCount) + " ms per message)");
+                       }
+               } finally {
+                       sourceFolder.close();
+                       if (targetFolder != null)
+                               targetFolder.close();
+               }
+       }
+
+       protected Folder migrateFolder(Folder sourceFolder, Folder targetFolder) throws MessagingException, IOException {
+               String folderName = targetFolder.getName();
+
+               int lastSourceNumber;
+               int currentTargetMessageCount = targetFolder.getMessageCount();
+               if (currentTargetMessageCount != 0) {
+                       MimeMessage lastTargetMessage = (MimeMessage) targetFolder.getMessage(currentTargetMessageCount);
+                       logger.log(DEBUG, folderName + " - Last target message " + describe(lastTargetMessage));
+                       Date lastTargetSent = lastTargetMessage.getReceivedDate();
+                       Message[] lastSourceMessage = sourceFolder
+                                       .search(new HeaderTerm(EmailUtils.MESSAGE_ID, lastTargetMessage.getMessageID()));
+                       if (lastSourceMessage.length == 0)
+                               throw new IllegalStateException("No message found with message ID " + lastTargetMessage.getMessageID());
+                       if (lastSourceMessage.length != 1) {
+                               for (Message msg : lastSourceMessage) {
+                                       logger.log(ERROR, "Message " + describe(msg));
+
+                               }
+                               throw new IllegalStateException(
+                                               lastSourceMessage.length + " messages found with received date " + lastTargetSent.toInstant());
+                       }
+                       lastSourceNumber = lastSourceMessage[0].getMessageNumber();
+               } else {
+                       lastSourceNumber = 0;
+               }
+               logger.log(DEBUG, folderName + " - Last source message number " + lastSourceNumber);
+
+               int countToRetrieve = sourceFolder.getMessageCount() - lastSourceNumber;
+
+               FetchProfile fetchProfile = new FetchProfile();
+               fetchProfile.add(FetchProfile.Item.FLAGS);
+               fetchProfile.add(FetchProfile.Item.ENVELOPE);
+               fetchProfile.add(FetchProfile.Item.CONTENT_INFO);
+               fetchProfile.add(FetchProfile.Item.SIZE);
+               if (sourceFolder instanceof IMAPFolder) {
+                       // IMAPFolder sourceImapFolder = (IMAPFolder) sourceFolder;
+                       fetchProfile.add(IMAPFolder.FetchProfileItem.HEADERS);
+                       fetchProfile.add(IMAPFolder.FetchProfileItem.MESSAGE);
+               }
+
+               int batchSize = 100;
+               int batchCount = countToRetrieve / batchSize;
+               if (countToRetrieve % batchSize != 0)
+                       batchCount = batchCount + 1;
+               // int batchCount = 2; // for testing
+               for (int i = 0; i < batchCount; i++) {
+                       long begin = System.currentTimeMillis();
+
+                       int start = lastSourceNumber + i * batchSize + 1;
+                       int end = lastSourceNumber + (i + 1) * batchSize;
+                       if (end >= (lastSourceNumber + countToRetrieve + 1))
+                               end = lastSourceNumber + countToRetrieve;
+                       Message[] sourceMessages = sourceFolder.getMessages(start, end);
+                       sourceFolder.fetch(sourceMessages, fetchProfile);
+                       // targetFolder.appendMessages(sourceMessages);
+                       // sourceFolder.copyMessages(sourceMessages,targetFolder);
+
+                       copyMessages(sourceMessages, targetFolder);
+//                     copyMessagesToMbox(sourceMessages, targetFolder);
+
+                       String describeLast = describe(sourceMessages[sourceMessages.length - 1]);
+
+//             if (i % 10 == 9) {
+                       // free memory from fetched messages
+                       sourceFolder.close();
+                       targetFolder.close();
+
+                       sourceFolder.open(Folder.READ_ONLY);
+                       targetFolder.open(Folder.READ_WRITE);
+//                     logger.log(DEBUG, "Open/close folder in order to free memory");
+//             }
+
+                       long duration = System.currentTimeMillis() - begin;
+                       logger.log(DEBUG, folderName + " - batch " + i + " took " + (duration / 1000) + " s, "
+                                       + (duration / (end - start + 1)) + " ms per message. Last message " + describeLast);
+               }
+
+               return targetFolder;
+       }
+
+       protected Folder openMboxTargetFolder(Folder sourceFolder, Path baseDir) throws MessagingException, IOException {
+               String folderName = sourceFolder.getName();
+               if (sourceFolder.getName().equals(EmailUtils.INBOX_UPPER_CASE))
+                       folderName = EmailUtils.INBOX;// Inbox
+
+               Path targetDir = baseDir;// .resolve("mbox");
+               Files.createDirectories(targetDir);
+               Path targetPath;
+               if (((sourceFolder.getType() & Folder.HOLDS_FOLDERS) != 0) && sourceFolder.list().length != 0) {
+                       Path dir = targetDir.resolve(folderName);
+                       Files.createDirectories(dir);
+                       targetPath = dir.resolve("_Misc");
+               } else {
+                       targetPath = targetDir.resolve(folderName);
+               }
+               if (!Files.exists(targetPath))
+                       Files.createFile(targetPath);
+               URLName targetUrlName = new URLName("mbox:" + targetPath.toString());
+               Properties targetProperties = new Properties();
+               // targetProperties.setProperty("mail.mime.address.strict", "false");
+               Session targetSession = Session.getDefaultInstance(targetProperties);
+               Folder targetFolder = targetSession.getFolder(targetUrlName);
+               targetFolder.open(Folder.READ_WRITE);
+
+               return targetFolder;
+       }
+
+       protected void copyMessages(Message[] sourceMessages, Folder targetFolder) throws MessagingException {
+               targetFolder.appendMessages(sourceMessages);
+       }
+
+       protected void copyMessagesToMbox(Message[] sourceMessages, Folder targetFolder)
+                       throws MessagingException, IOException {
+               Message[] targetMessages = new Message[sourceMessages.length];
+               for (int j = 0; j < sourceMessages.length; j++) {
+                       MimeMessage sourceMm = (MimeMessage) sourceMessages[j];
+                       InternetHeaders ih = new InternetHeaders();
+                       for (Enumeration<String> e = sourceMm.getAllHeaderLines(); e.hasMoreElements();) {
+                               ih.addHeaderLine(e.nextElement());
+                       }
+                       Path tmpFileSource = Files.createTempFile("argeo-mbox-source", ".txt");
+                       Path tmpFileTarget = Files.createTempFile("argeo-mbox-target", ".txt");
+                       Files.copy(sourceMm.getRawInputStream(), tmpFileSource, StandardCopyOption.REPLACE_EXISTING);
+
+                       // we use ISO_8859_1 because it is more robust than US_ASCII with regard to
+                       // missing characters
+                       try (BufferedReader reader = Files.newBufferedReader(tmpFileSource, StandardCharsets.ISO_8859_1);
+                                       BufferedWriter writer = Files.newBufferedWriter(tmpFileTarget, StandardCharsets.ISO_8859_1);) {
+                               int lineNumber = 0;
+                               String line = null;
+                               try {
+                                       while ((line = reader.readLine()) != null) {
+                                               lineNumber++;
+                                               if (line.startsWith("From ")) {
+                                                       writer.write(">" + line);
+                                                       logger.log(DEBUG,
+                                                                       "Fix line " + lineNumber + " in " + EmailUtils.describe(sourceMm) + ": " + line);
+                                               } else {
+                                                       writer.write(line);
+                                               }
+                                               writer.newLine();
+                                       }
+                               } catch (IOException e) {
+                                       logger.log(ERROR, "Error around line " + lineNumber + " of " + tmpFileSource);
+                                       throw e;
+                               }
+                       }
+
+                       MboxMessage mboxMessage = new MboxMessage((MboxFolder) targetFolder, ih,
+                                       new SharedFileInputStream(tmpFileTarget.toFile()), sourceMm.getMessageNumber(),
+                                       EmailUtils.getUnixFrom(sourceMm), true);
+                       targetMessages[j] = mboxMessage;
+
+                       // clean up
+                       Files.delete(tmpFileSource);
+                       Files.delete(tmpFileTarget);
+               }
+               targetFolder.appendMessages(targetMessages);
+
+       }
+
+       /** Save body parts and attachments as plain files. */
+       protected void savePartsAsFiles(Object content, Path fileBase) throws IOException, MessagingException {
+               OutputStream out = null;
+               InputStream in = null;
+               try {
+                       if (content instanceof Multipart) {
+                               Multipart multi = ((Multipart) content);
+                               int parts = multi.getCount();
+                               for (int j = 0; j < parts; ++j) {
+                                       MimeBodyPart part = (MimeBodyPart) multi.getBodyPart(j);
+                                       if (part.getContent() instanceof Multipart) {
+                                               // part-within-a-part, do some recursion...
+                                               savePartsAsFiles(part.getContent(), fileBase);
+                                       } else {
+                                               String extension = "";
+                                               if (part.isMimeType("text/html")) {
+                                                       extension = "html";
+                                               } else {
+                                                       if (part.isMimeType("text/plain")) {
+                                                               extension = "txt";
+                                                       } else {
+                                                               // Try to get the name of the attachment
+                                                               extension = part.getDataHandler().getName();
+                                                       }
+                                               }
+                                               String filename = fileBase + "." + extension;
+                                               System.out.println("... " + filename);
+                                               out = new FileOutputStream(new File(filename));
+                                               in = part.getInputStream();
+                                               int k;
+                                               while ((k = in.read()) != -1) {
+                                                       out.write(k);
+                                               }
+                                       }
+                               }
+                       }
+               } finally {
+                       if (in != null) {
+                               in.close();
+                       }
+                       if (out != null) {
+                               out.flush();
+                               out.close();
+                       }
+               }
+       }
+
+       public void setSourceServer(String sourceServer) {
+               this.sourceServer = sourceServer;
+       }
+
+       public void setSourceUsername(String sourceUsername) {
+               this.sourceUsername = sourceUsername;
+       }
+
+       public void setSourcePassword(String sourcePassword) {
+               this.sourcePassword = sourcePassword;
+       }
+
+       public void setTargetServer(String targetServer) {
+               this.targetServer = targetServer;
+       }
+
+       public void setTargetUsername(String targetUsername) {
+               this.targetUsername = targetUsername;
+       }
+
+       public void setTargetPassword(String targetPassword) {
+               this.targetPassword = targetPassword;
+       }
+
+       public static void main(String args[]) throws Exception {
+               if (args.length < 6)
+                       throw new IllegalArgumentException(
+                                       "usage: <source IMAP server> <source username> <source password> <target IMAP server> <target username> <target password>");
+               String sourceServer = args[0];
+               String sourceUsername = args[1];
+               String sourcePassword = args[2];
+               String targetServer = args[3];
+               String targetUsername = args[4];
+               String targetPassword = args[5];
+
+               EmailMigration emailMigration = new EmailMigration();
+               emailMigration.setSourceServer(sourceServer);
+               emailMigration.setSourceUsername(sourceUsername);
+               emailMigration.setSourcePassword(sourcePassword);
+               emailMigration.setTargetServer(targetServer);
+               emailMigration.setTargetUsername(targetUsername);
+               emailMigration.setTargetPassword(targetPassword);
+
+               emailMigration.process();
+       }
+}
diff --git a/org.argeo.app.core/src/org/argeo/app/mail/EmailUtils.java b/org.argeo.app.core/src/org/argeo/app/mail/EmailUtils.java
new file mode 100644 (file)
index 0000000..694c17c
--- /dev/null
@@ -0,0 +1,118 @@
+package org.argeo.app.mail;
+
+import java.util.Date;
+
+import javax.mail.Address;
+import javax.mail.Flags;
+import javax.mail.Message;
+import javax.mail.MessagingException;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeMessage;
+
+/** Utilities around emails. */
+public class EmailUtils {
+       public final static String INBOX = "Inbox";
+       public final static String INBOX_UPPER_CASE = "INBOX";
+       public final static String MESSAGE_ID = "Message-ID";
+
+       public static String getMessageId(Message msg) {
+               try {
+                       return msg instanceof MimeMessage ? ((MimeMessage) msg).getMessageID() : "<N/A>";
+               } catch (MessagingException e) {
+                       throw new IllegalStateException("Cannot extract message id from " + msg, e);
+               }
+       }
+
+       public static String describe(Message msg) {
+               try {
+                       return "Message " + msg.getMessageNumber() + " " + msg.getSentDate().toInstant() + " " + getMessageId(msg);
+               } catch (MessagingException e) {
+                       throw new IllegalStateException("Cannot describe " + msg, e);
+               }
+       }
+
+       static void setHeadersFromFlags(MimeMessage msg, Flags flags) {
+               try {
+                       StringBuilder status = new StringBuilder();
+                       if (flags.contains(Flags.Flag.SEEN))
+                               status.append('R');
+                       if (!flags.contains(Flags.Flag.RECENT))
+                               status.append('O');
+                       if (status.length() > 0)
+                               msg.setHeader("Status", status.toString());
+                       else
+                               msg.removeHeader("Status");
+
+                       boolean sims = false;
+                       String s = msg.getHeader("X-Status", null);
+                       // is it a SIMS 2.0 format X-Status header?
+                       sims = s != null && s.length() == 4 && s.indexOf('$') >= 0;
+                       //status.setLength(0);
+                       if (flags.contains(Flags.Flag.DELETED))
+                               status.append('D');
+                       else if (sims)
+                               status.append('$');
+                       if (flags.contains(Flags.Flag.FLAGGED))
+                               status.append('F');
+                       else if (sims)
+                               status.append('$');
+                       if (flags.contains(Flags.Flag.ANSWERED))
+                               status.append('A');
+                       else if (sims)
+                               status.append('$');
+                       if (flags.contains(Flags.Flag.DRAFT))
+                               status.append('T');
+                       else if (sims)
+                               status.append('$');
+                       if (status.length() > 0)
+                               msg.setHeader("X-Status", status.toString());
+                       else
+                               msg.removeHeader("X-Status");
+
+                       String[] userFlags = flags.getUserFlags();
+                       if (userFlags.length > 0) {
+                               status.setLength(0);
+                               for (int i = 0; i < userFlags.length; i++)
+                                       status.append(userFlags[i]).append(' ');
+                               status.setLength(status.length() - 1); // smash trailing space
+                               msg.setHeader("X-Keywords", status.toString());
+                       }
+                       if (flags.contains(Flags.Flag.DELETED)) {
+                               s = msg.getHeader("X-Dt-Delete-Time", null);
+                               if (s == null)
+                                       // XXX - should be time
+                                       msg.setHeader("X-Dt-Delete-Time", "1");
+                       }
+               } catch (MessagingException e) {
+                       // ignore it
+               }
+       }
+
+    protected static String getUnixFrom(MimeMessage msg) {
+       Address[] afrom;
+       String from;
+       Date ddate;
+       String date;
+       try {
+           if ((afrom = msg.getFrom()) == null ||
+                   !(afrom[0] instanceof InternetAddress) ||
+                   (from = ((InternetAddress)afrom[0]).getAddress()) == null)
+               from = "UNKNOWN";
+           if ((ddate = msg.getReceivedDate()) == null ||
+                   (ddate = msg.getSentDate()) == null)
+               ddate = new Date();
+       } catch (MessagingException e) {
+           from = "UNKNOWN";
+           ddate = new Date();
+       }
+       date = ddate.toString();
+       // date is of the form "Sat Aug 12 02:30:00 PDT 1995"
+       // need to strip out the timezone
+       return "From " + from + " " +
+               date.substring(0, 20) + date.substring(24);
+    }
+
+       /** Singleton. */
+       private EmailUtils() {
+       }
+}
index ddb5650fbd243c49ed11e55ebe479a1b0693b0d7..4d2f52169738bfa1a5e01f980d27965a7bfd4a0e 100644 (file)
@@ -18,10 +18,10 @@ import javax.jcr.nodetype.NodeType;
 import org.argeo.api.cms.CmsLog;
 import org.argeo.app.api.EntityMimeType;
 import org.argeo.app.api.EntityType;
+import org.argeo.cms.util.DigestUtils;
 import org.argeo.jcr.Jcr;
 import org.argeo.jcr.JcrUtils;
 import org.argeo.jcr.JcrxApi;
-import org.argeo.util.DigestUtils;
 
 /** Utilities around ODK. */
 public class OdkUtils {
index ec9b6994b635776023ee70a9ed603dd15a05185a..3c432ad34b8020dde38c47de63b0e0e1eb0706ea 100644 (file)
@@ -1,28 +1,20 @@
 package org.argeo.app.odk;
 
-import org.argeo.app.api.JcrName;
+import org.argeo.api.acr.QNamed;
 
 /** Types related to the http://openrosa.org/xforms/xformsList namespace. */
-public enum OrxListName implements JcrName {
+public enum OrxListName implements QNamed {
        xform,
        // names
        formID, version;
 
        @Override
-       public String getPrefix() {
-               return prefix();
-       }
-
-       public static String prefix() {
+       public String getDefaultPrefix() {
                return "orxList";
        }
 
        @Override
        public String getNamespace() {
-               return namespace();
-       }
-
-       public static String namespace() {
                return "http://openrosa.org/xforms/xformsList";
        }
 
index 5c93c4158708db20f82075a888e719c5408aac5a..2b68b906e34d35da11feee7407697d9835980e1b 100644 (file)
@@ -1,26 +1,18 @@
 package org.argeo.app.odk;
 
-import org.argeo.app.api.JcrName;
+import org.argeo.api.acr.QNamed;
 
 /** Types related to the http://openrosa.org/xforms/xformsList namespace. */
-public enum OrxManifestName implements JcrName {
+public enum OrxManifestName implements QNamed {
        manifest, mediaFile;
 
        @Override
-       public String getPrefix() {
-               return prefix();
-       }
-
-       public static String prefix() {
+       public String getDefaultPrefix() {
                return "orxManifest";
        }
 
        @Override
        public String getNamespace() {
-               return namespace();
-       }
-
-       public static String namespace() {
                return "http://openrosa.org/xforms/xformsManifest";
        }
 
index cf88eb97f779fc9d3492e76f150a97ec9d18bd39..77ae7ae8cee143001ebace44db1e10d9da184d5a 100644 (file)
@@ -1,26 +1,18 @@
 package org.argeo.app.odk;
 
-import org.argeo.app.api.JcrName;
+import org.argeo.api.acr.QNamed;
 
 /** Types related to the http://openrosa.org/xforms/xformsList namespace. */
-public enum OrxType implements JcrName {
+public enum OrxType implements QNamed {
        submission, xml_submission_file;
 
        @Override
-       public String getPrefix() {
-               return prefix();
-       }
-
-       public static String prefix() {
+       public String getDefaultPrefix() {
                return "orx";
        }
 
        @Override
        public String getNamespace() {
-               return namespace();
-       }
-
-       public static String namespace() {
                return "http://openrosa.org/xforms";
        }
 
index 71228926d0bb075c70f2aa079f7435a628cce8f8..0dff64c772ec9ec1f6a894fb203a370065fe252a 100644 (file)
@@ -5,6 +5,9 @@ import javax.jcr.RepositoryException;
 
 /** Called when a user has received a new form submission. */
 public interface FormSubmissionListener {
-       /** Called after a form submission has been stored in the user area. */
+       /**
+        * Called after a form submission has been stored in the user area. The
+        * submission will be deleted if any exception is thrown.
+        */
        void formSubmissionReceived(Node node) throws RepositoryException;
 }
diff --git a/org.argeo.app.profile.acr.fs/.classpath b/org.argeo.app.profile.acr.fs/.classpath
new file mode 100644 (file)
index 0000000..81fe078
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
+       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+       <classpathentry kind="src" path="src"/>
+       <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.argeo.app.profile.acr.fs/.project b/org.argeo.app.profile.acr.fs/.project
new file mode 100644 (file)
index 0000000..bc3f767
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.argeo.app.profile.acr.fs</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.ManifestBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.SchemaBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.ds.core.builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+       </natures>
+</projectDescription>
diff --git a/org.argeo.app.profile.acr.fs/OSGI-INF/srvContentProvider.xml b/org.argeo.app.profile.acr.fs/OSGI-INF/srvContentProvider.xml
new file mode 100644 (file)
index 0000000..debf19c
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop" immediate="true" name="argeo.app.srvContentProvider">
+   <implementation class="org.argeo.cms.acr.fs.FsContentProviderService"/>
+   <reference bind="setCmsState" cardinality="1..1" interface="org.argeo.api.cms.CmsState" policy="static" />
+   <property name="acr.mount.path" type="String" value="/srv"/>
+   <service>
+      <provide interface="org.argeo.api.acr.spi.ContentProvider"/>
+   </service>
+</scr:component>
diff --git a/org.argeo.app.profile.acr.fs/OSGI-INF/sysContentProvider.xml b/org.argeo.app.profile.acr.fs/OSGI-INF/sysContentProvider.xml
new file mode 100644 (file)
index 0000000..0cbc7f0
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop" name="argeo.app.sysContentProvider">
+   <implementation class="org.argeo.cms.jcr.acr.JcrContentProvider"/>
+   <reference bind="setJcrRepository" cardinality="1..1" interface="javax.jcr.Repository" name="Repository" policy="static" target="(cn=ego)"/>
+   <property name="acr.mount.path" type="String" value="/sys"/>
+   <service>
+      <provide interface="org.argeo.api.acr.spi.ContentProvider"/>
+      <provide interface="org.argeo.cms.jcr.acr.JcrContentProvider"/>
+   </service>
+</scr:component>
diff --git a/org.argeo.app.profile.acr.fs/bnd.bnd b/org.argeo.app.profile.acr.fs/bnd.bnd
new file mode 100644 (file)
index 0000000..f976da0
--- /dev/null
@@ -0,0 +1,8 @@
+Import-Package: \
+org.argeo.cms.acr.fs,\
+org.argeo.cms.jcr.acr,\
+*
+
+Service-Component:\
+OSGI-INF/sysContentProvider.xml,\
+OSGI-INF/srvContentProvider.xml,\
diff --git a/org.argeo.app.profile.acr.fs/build.properties b/org.argeo.app.profile.acr.fs/build.properties
new file mode 100644 (file)
index 0000000..c58ea21
--- /dev/null
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               OSGI-INF/
diff --git a/org.argeo.app.profile.acr.fs/src/.gitignore b/org.argeo.app.profile.acr.fs/src/.gitignore
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/org.argeo.app.profile.acr.jcr/.classpath b/org.argeo.app.profile.acr.jcr/.classpath
new file mode 100644 (file)
index 0000000..81fe078
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
+       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+       <classpathentry kind="src" path="src"/>
+       <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.argeo.app.profile.acr.jcr/.project b/org.argeo.app.profile.acr.jcr/.project
new file mode 100644 (file)
index 0000000..632c90e
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.argeo.app.profile.acr.jcr</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.ManifestBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.SchemaBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.ds.core.builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+       </natures>
+</projectDescription>
diff --git a/org.argeo.app.profile.acr.jcr/OSGI-INF/srvContentProvider.xml b/org.argeo.app.profile.acr.jcr/OSGI-INF/srvContentProvider.xml
new file mode 100644 (file)
index 0000000..704fec7
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop" name="argeo.app.srvContentProvider">
+   <implementation class="org.argeo.cms.jcr.acr.JcrContentProvider"/>
+   <reference bind="setJcrRepository" cardinality="1..1" interface="javax.jcr.Repository" name="Repository" policy="static" target="(cn=ego)"/>
+   <property name="acr.mount.path" type="String" value="/srv"/>
+   <service>
+      <provide interface="org.argeo.api.acr.spi.ContentProvider"/>
+      <provide interface="org.argeo.cms.jcr.acr.JcrContentProvider"/>
+   </service>
+</scr:component>
diff --git a/org.argeo.app.profile.acr.jcr/OSGI-INF/sysContentProvider.xml b/org.argeo.app.profile.acr.jcr/OSGI-INF/sysContentProvider.xml
new file mode 100644 (file)
index 0000000..0cbc7f0
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="start" deactivate="stop" name="argeo.app.sysContentProvider">
+   <implementation class="org.argeo.cms.jcr.acr.JcrContentProvider"/>
+   <reference bind="setJcrRepository" cardinality="1..1" interface="javax.jcr.Repository" name="Repository" policy="static" target="(cn=ego)"/>
+   <property name="acr.mount.path" type="String" value="/sys"/>
+   <service>
+      <provide interface="org.argeo.api.acr.spi.ContentProvider"/>
+      <provide interface="org.argeo.cms.jcr.acr.JcrContentProvider"/>
+   </service>
+</scr:component>
diff --git a/org.argeo.app.profile.acr.jcr/bnd.bnd b/org.argeo.app.profile.acr.jcr/bnd.bnd
new file mode 100644 (file)
index 0000000..625b5f4
--- /dev/null
@@ -0,0 +1,7 @@
+Import-Package: \
+org.argeo.cms.jcr.acr,\
+*
+
+Service-Component:\
+OSGI-INF/sysContentProvider.xml,\
+OSGI-INF/srvContentProvider.xml,\
diff --git a/org.argeo.app.profile.acr.jcr/build.properties b/org.argeo.app.profile.acr.jcr/build.properties
new file mode 100644 (file)
index 0000000..c58ea21
--- /dev/null
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               OSGI-INF/
diff --git a/org.argeo.app.profile.acr.jcr/src/.gitignore b/org.argeo.app.profile.acr.jcr/src/.gitignore
new file mode 100644 (file)
index 0000000..e69de29
index e801ebfb4680123285c15553dc70584276fe0057..81fe078c20c05db46a8281fbb1a72875a5322b45 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
        <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
        <classpathentry kind="src" path="src"/>
        <classpathentry kind="output" path="bin"/>
index 18f346595761f1d456b28d62c94598c93c890454..3430eda7e16bbf7d7053dc49d1691d242ae1ce19 100644 (file)
@@ -6,6 +6,5 @@
    </service>
    <property name="osgi.http.whiteboard.servlet.pattern" type="String" value="/formList/*"/>
    <property name="osgi.http.whiteboard.context.select" type="String" value="(osgi.http.whiteboard.context.name=odkServletContext)"/>
-   <reference bind="addForm" cardinality="0..n" interface="org.argeo.app.odk.OdkForm" name="OdkForm" policy="dynamic" unbind="removeForm"/>
-   <reference bind="setRepository" cardinality="1..1" interface="javax.jcr.Repository" name="Repository" policy="static" target="(cn=entity)"/>
+   <reference bind="setRepository" cardinality="1..1" interface="javax.jcr.Repository" name="Repository" policy="static" target="(cn=ego)"/>
 </scr:component>
index 816524a0f9a9ab0fdaebd78005e760b55d39c24b..82ed7121f12569fc4b2cd2c7e5d97c7965c84e67 100644 (file)
@@ -6,6 +6,5 @@
    </service>
    <property name="osgi.http.whiteboard.servlet.pattern" type="String" value="/form/*"/>
    <property name="osgi.http.whiteboard.context.select" type="String" value="(osgi.http.whiteboard.context.name=odkServletContext)"/>
-   <reference bind="addForm" cardinality="0..n" interface="org.argeo.app.odk.OdkForm" name="OdkForm" policy="dynamic" unbind="removeForm"/>
-   <reference bind="setRepository" cardinality="1..1" interface="javax.jcr.Repository" name="Repository" policy="static" target="(cn=entity)"/>
+   <reference bind="setRepository" cardinality="1..1" interface="javax.jcr.Repository" name="Repository" policy="static" target="(cn=ego)"/>
 </scr:component>
index 503a148cc74361f1488cd02da530d714a8210cc6..6cac13ea78ae346ab3ec8d379db79e7eec16adb9 100644 (file)
@@ -6,5 +6,5 @@
    </service>
    <property name="osgi.http.whiteboard.servlet.pattern" type="String" value="/formManifest/*"/>
    <property name="osgi.http.whiteboard.context.select" type="String" value="(osgi.http.whiteboard.context.name=odkServletContext)"/>
-   <reference bind="setRepository" cardinality="1..1" interface="javax.jcr.Repository" name="Repository" policy="static" target="(cn=entity)"/>
+   <reference bind="setRepository" cardinality="1..1" interface="javax.jcr.Repository" name="Repository" policy="static" target="(cn=ego)"/>
 </scr:component>
index b9380d5950c62e498c7222d6909d7570c99cf8e1..40ed568e81c8a4818fd2a4ed1abdedf69dacc643 100644 (file)
@@ -7,6 +7,6 @@
    <property name="osgi.http.whiteboard.servlet.pattern" type="String" value="/submission"/>
    <property name="osgi.http.whiteboard.context.select" type="String" value="(osgi.http.whiteboard.context.name=odkServletContext)"/>
    <property name="osgi.http.whiteboard.servlet.multipart.enabled" type="String" value="true"/>
-   <reference bind="setRepository" cardinality="1..1" interface="javax.jcr.Repository" name="Repository" policy="static" target="(cn=entity)"/>
+   <reference bind="setRepository" cardinality="1..1" interface="javax.jcr.Repository" name="Repository" policy="static" target="(cn=ego)"/>
    <reference bind="addSubmissionListener" cardinality="0..n" interface="org.argeo.app.xforms.FormSubmissionListener" name="FormSubmissionListener" policy="dynamic" unbind="removeSubmissionListener"/>
 </scr:component>
index f5cd2170acf14a74885ce71b9d8402d1482363a2..a32d5d368641926b9ec41ee29ba87a7c90dd1a84 100644 (file)
@@ -14,4 +14,5 @@ Import-Package:\
 org.osgi.service.http.context,\
 javax.jcr.nodetype,\
 javax.servlet.*;version="[3,5)",\
+org.argeo.api.acr,\
 *
index 21b342112df1423a5b1524543a55082862990d35..41a3039a3df72909bba6ee1dbd5ce1f7ae6b4395 100644 (file)
@@ -23,6 +23,7 @@ import org.argeo.app.odk.OrxListName;
 import org.argeo.app.odk.OrxManifestName;
 import org.argeo.cms.auth.RemoteAuthUtils;
 import org.argeo.cms.servlet.ServletHttpRequest;
+import org.argeo.cms.servlet.ServletUtils;
 import org.argeo.jcr.Jcr;
 import org.argeo.jcr.JcrxApi;
 
@@ -39,9 +40,17 @@ public class OdkFormListServlet extends HttpServlet {
                resp.setHeader("X-OpenRosa-Version", "1.0");
                resp.setDateHeader("Date", System.currentTimeMillis());
 
-               String serverName = req.getServerName();
-               int serverPort = req.getServerPort();
-               String protocol = serverPort == 443 || req.isSecure() ? "https" : "http";
+////           String serverName = req.getServerName();
+////           int serverPort = req.getServerPort();
+////           String protocol = serverPort == 443 || req.isSecure() ? "https" : "http";
+////           String baseServer = protocol + "://" + serverName
+////                           + (serverPort == 80 || serverPort == 443 ? "" : ":" + serverPort);
+//             String requestUri=req.getRequestURI();
+//             String forwardedHost = req.getHeader("X-Forwarded-Host");
+//             URL requestUrl = new URL(req.getRequestURL().toString());
+//             String baseServer = requestUrl.getProtocol() + "://" + requestUrl.getHost()
+//                             + (requestUrl.getPort() > 0 ? ":" + requestUrl.getPort() : "");
+               StringBuilder baseServer = ServletUtils.getRequestUrlBase(req);
 
                String pathInfo = req.getPathInfo();
 
@@ -77,23 +86,17 @@ public class OdkFormListServlet extends HttpServlet {
                                        sb.append("<hash>md5:" + JcrxApi.getChecksum(node, JcrxApi.MD5) + "</hash>");
                                        if (node.hasProperty(Property.JCR_DESCRIPTION))
                                                sb.append("<name>" + node.getProperty(Property.JCR_DESCRIPTION).getString() + "</name>");
-                                       sb.append("<downloadUrl>" + protocol + "://" + serverName
-                                                       + (serverPort == 80 || serverPort == 443 ? "" : ":" + serverPort) + "/api/odk/form"
-                                                       + node.getPath() + "</downloadUrl>");
+                                       sb.append("<downloadUrl>" + baseServer + "/api/odk/form" + node.getPath() + "</downloadUrl>");
                                        if (node.hasNode(OrxManifestName.manifest.name())) {
-                                               sb.append("<manifestUrl>" + protocol + "://" + serverName
-                                                               + (serverPort == 80 || serverPort == 443 ? "" : ":" + serverPort)
-                                                               + "/api/odk/formManifest" + node.getNode(OrxManifestName.manifest.name()).getPath()
-                                                               + "</manifestUrl>");
+                                               sb.append("<manifestUrl>" + baseServer + "/api/odk/formManifest"
+                                                               + node.getNode(OrxManifestName.manifest.name()).getPath() + "</manifestUrl>");
                                        }
                                        sb.append("</xform>");
                                } else if (node.isNodeType(EntityType.formSet.get())) {
                                        sb.append("<xforms-group>");
                                        sb.append("<groupId>" + node.getPath() + "</groupId>");
                                        sb.append("<name>" + node.getProperty(Property.JCR_TITLE).getString() + "</name>");
-                                       sb.append("<listUrl>" + protocol + "://" + serverName
-                                                       + (serverPort == 80 || serverPort == 443 ? "" : ":" + serverPort) + "/api/odk/formList"
-                                                       + node.getPath() + "</listUrl>");
+                                       sb.append("<listUrl>" + baseServer + "/api/odk/formList" + node.getPath() + "</listUrl>");
                                        sb.append("</xforms-group>");
                                }
                                String str = sb.toString();
index f296170778a381e05cfbf61a52751ee8bb12839a..2c62ba10cfa647321a6eae52581db4e84a023561 100644 (file)
@@ -33,10 +33,11 @@ import org.argeo.app.api.EntityMimeType;
 import org.argeo.app.odk.OrxManifestName;
 import org.argeo.cms.auth.RemoteAuthUtils;
 import org.argeo.cms.servlet.ServletHttpRequest;
+import org.argeo.cms.servlet.ServletUtils;
+import org.argeo.cms.util.CsvWriter;
+import org.argeo.cms.util.DigestUtils;
 import org.argeo.jcr.Jcr;
 import org.argeo.jcr.JcrException;
-import org.argeo.util.CsvWriter;
-import org.argeo.util.DigestUtils;
 
 /** Describe additional files. */
 public class OdkManifestServlet extends HttpServlet {
@@ -53,9 +54,12 @@ public class OdkManifestServlet extends HttpServlet {
                if (pathInfo.startsWith("//"))
                        pathInfo = pathInfo.substring(1);
 
-               String serverName = req.getServerName();
-               int serverPort = req.getServerPort();
-               String protocol = serverPort == 443 || req.isSecure() ? "https" : "http";
+//             String serverName = req.getServerName();
+//             int serverPort = req.getServerPort();
+//             String protocol = serverPort == 443 || req.isSecure() ? "https" : "http";
+//             String baseServer = protocol + "://" + serverName
+//                             + (serverPort == 80 || serverPort == 443 ? "" : ":" + serverPort);
+               StringBuilder baseServer = ServletUtils.getRequestUrlBase(req);
 
                Session session = RemoteAuthUtils.doAs(() -> Jcr.login(repository, null), new ServletHttpRequest(req));
 
@@ -98,9 +102,8 @@ public class OdkManifestServlet extends HttpServlet {
                                                                writer.append("md5sum:" + DigestUtils.toHexString(out.getMessageDigest().digest()));
                                                                writer.append("</hash>");
                                                        }
-                                                       writer.append("<downloadUrl>" + protocol + "://" + serverName
-                                                                       + (serverPort == 80 || serverPort == 443 ? "" : ":" + serverPort)
-                                                                       + "/api/odk/formManifest" + file.getPath() + "</downloadUrl>");
+                                                       writer.append("<downloadUrl>" + baseServer + "/api/odk/formManifest" + file.getPath()
+                                                                       + "</downloadUrl>");
                                                }
                                                writer.append("</mediaFile>");
                                        }
index 4e2d535bc0af6460608fc647c63e37ae26eb85f3..9406145c9a2689dab1131d4ca5cc7f038d7b355f 100644 (file)
@@ -1,18 +1,17 @@
 package org.argeo.app.servlet.odk;
 
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
+import org.argeo.cms.auth.RemoteAuthRequest;
+import org.argeo.cms.auth.RemoteAuthResponse;
 import org.argeo.cms.servlet.PrivateWwwAuthServletContext;
 
-/** ODK specific authentication (with additional headers).*/
+/** ODK specific authentication (with additional headers). */
 public class OdkServletContext extends PrivateWwwAuthServletContext {
 
        @Override
-       protected void askForWwwAuth(HttpServletRequest request, HttpServletResponse response) {
-               super.askForWwwAuth(request, response);
-               response.setHeader("X-OpenRosa-Version", "1.0");
-               response.setDateHeader("Date", System.currentTimeMillis());
+       protected boolean authIsRequired(RemoteAuthRequest remoteAuthRequest, RemoteAuthResponse remoteAuthResponse) {
+               remoteAuthResponse.setHeader("X-OpenRosa-Version", "1.0");
+               remoteAuthResponse.setHeader("Date", Long.toString(System.currentTimeMillis()));
+               return true;
 
        }
 
index a5864d83336206d6e81c7229c05aea3febb3ef97..8dd8b0b7ddcbdcd5f31f04dfc93b9a3255b81619 100644 (file)
@@ -14,7 +14,6 @@ import javax.jcr.ImportUUIDBehavior;
 import javax.jcr.Node;
 import javax.jcr.Property;
 import javax.jcr.Repository;
-import javax.jcr.RepositoryException;
 import javax.jcr.Session;
 import javax.jcr.nodetype.NodeType;
 import javax.servlet.ServletException;
@@ -60,24 +59,24 @@ public class OdkSubmissionServlet extends HttpServlet {
                RemoteAuthRequest request = new ServletHttpRequest(req);
                Session session = RemoteAuthUtils.doAs(() -> Jcr.login(repository, null), request);
 
-               try {
-                       CmsSession cmsSession = RemoteAuthUtils.getCmsSession(request);
+               CmsSession cmsSession = RemoteAuthUtils.getCmsSession(request);
 
-                       Session adminSession = null;
-                       try {
-                               // TODO centralise at a deeper level
-                               adminSession = CmsJcrUtils.openDataAdminSession(repository, null);
-                               SuiteUtils.getOrCreateCmsSessionNode(adminSession, cmsSession);
-                       } finally {
-                               Jcr.logout(adminSession);
-                       }
+               Session adminSession = null;
+               try {
+                       // TODO centralise at a deeper level
+                       adminSession = CmsJcrUtils.openDataAdminSession(repository, null);
+                       SuiteUtils.getOrCreateCmsSessionNode(adminSession, cmsSession);
+               } finally {
+                       Jcr.logout(adminSession);
+               }
 
+               try {
                        Node cmsSessionNode = SuiteUtils.getCmsSessionNode(session, cmsSession);
                        Node submission = cmsSessionNode.addNode(submissionNameFormatter.format(Instant.now()),
                                        OrxType.submission.get());
                        for (Part part : req.getParts()) {
-                               if (log.isDebugEnabled())
-                                       log.debug("Part: " + part.getName() + ", " + part.getContentType());
+                               if (log.isTraceEnabled())
+                                       log.trace("Part: " + part.getName() + ", " + part.getContentType());
 
                                if (part.getName().equals(XML_SUBMISSION_FILE)) {
                                        Node xml = submission.addNode(XML_SUBMISSION_FILE, NodeType.NT_UNSTRUCTURED);
@@ -112,12 +111,22 @@ public class OdkSubmissionServlet extends HttpServlet {
                                        }
                                }
                        }
+
                        session.save();
-                       for (FormSubmissionListener submissionListener : submissionListeners) {
-                               submissionListener.formSubmissionReceived(submission);
+                       try {
+                               for (FormSubmissionListener submissionListener : submissionListeners) {
+                                       submissionListener.formSubmissionReceived(submission);
+                               }
+                       } catch (Exception e) {
+                               log.error("Cannot save submision, cancelling...", e);
+                               submission.remove();
+                               session.save();
+                               resp.setStatus(503);
+                               return;
                        }
-               } catch (RepositoryException e) {
-                       e.printStackTrace();
+
+               } catch (Exception e) {
+                       log.error("Cannot save submision", e);
                        resp.setStatus(503);
                        return;
                } finally {
index e801ebfb4680123285c15553dc70584276fe0057..81fe078c20c05db46a8281fbb1a72875a5322b45 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
        <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
        <classpathentry kind="src" path="src"/>
        <classpathentry kind="output" path="bin"/>
index 60f0d37bb41c09c754a0dd3ba4d8932d60b89f43..5535251861ba4f4e808e080d34a57a92ca2abbf5 100644 (file)
@@ -1,13 +1,11 @@
 Import-Package:\
+org.apache.xmlgraphics.image.loader,\
 org.osgi.service.http.context,\
 javax.jcr.nodetype,\
-org.osgi.service.event,\
-org.eclipse.swt,\
-org.eclipse.jface.viewers,\
 org.osgi.framework,\
 org.apache.xml.serializer,\
-org.eclipse.rap.rwt,\
 org.argeo.app.api,\
+org.argeo.cms.acr.xml,\
 javax.servlet.*;version="[3,5)",\
 *
 
index b84905ca53667001517c90d11c09e5af5e822c77..f2d38e1c0afd00c55726e9bcef5f61de05a98ab6 100644 (file)
@@ -1,9 +1,14 @@
 package org.argeo.app.servlet.publish;
 
+import java.io.BufferedOutputStream;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.OutputStream;
+import java.net.URI;
 import java.net.URLDecoder;
 import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
@@ -30,12 +35,16 @@ import javax.xml.transform.Transformer;
 import javax.xml.transform.TransformerConfigurationException;
 import javax.xml.transform.TransformerFactory;
 import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.sax.SAXResult;
 import javax.xml.transform.stream.StreamResult;
 import javax.xml.transform.stream.StreamSource;
 
 import org.apache.commons.io.IOUtils;
+import org.apache.fop.apps.Fop;
+import org.apache.fop.apps.FopFactory;
 import org.apache.xalan.processor.TransformerFactoryImpl;
-import org.argeo.api.cms.CmsTheme;
+import org.argeo.api.cms.CmsLog;
+import org.argeo.api.cms.ux.CmsTheme;
 import org.argeo.app.docbook.DbkType;
 import org.argeo.app.docbook.DbkUtils;
 import org.argeo.cms.auth.RemoteAuthUtils;
@@ -51,14 +60,21 @@ import org.w3c.dom.Document;
 public class DbkServlet extends HttpServlet {
        private static final long serialVersionUID = 6906020513498289335L;
 
+       private CmsLog log = CmsLog.getLog(DbkServlet.class);
+
        private Repository repository;
 
        private DocumentBuilderFactory documentBuilderFactory;
        private TransformerFactory transformerFactory;
-       private Templates docBoookTemplates;
+       private Templates docBoookHtmlTemplates;
+
+       // FOP
+       private Templates docBoookFoTemplates;
 
        private Map<String, CmsTheme> themes = Collections.synchronizedMap(new HashMap<>());
 
+       private String xslBase;
+
        @Override
        protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
 
@@ -84,6 +100,14 @@ public class DbkServlet extends HttpServlet {
                        path = path.substring(0, path.length() - "/index.html".length());
                }
 
+               boolean pdf = false;
+               if (path.toLowerCase().endsWith(".pdf")) {
+                       pdf = true;
+                       if (path.toLowerCase().endsWith("/index.pdf")) {
+                               path = path.substring(0, path.length() - "/index.pdf".length());
+                       }
+               }
+
                Session session = null;
                try {
                        session = RemoteAuthUtils.doAs(() -> Jcr.login(repository, null), new ServletHttpRequest(req));
@@ -109,42 +133,68 @@ public class DbkServlet extends HttpServlet {
                                        try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
                                                session.exportDocumentView(dbkNode.getPath(), out, true, false);
                                                arr = out.toByteArray();
-//                             System.out.println(new String(arr, StandardCharsets.UTF_8));
                                        } catch (RepositoryException e) {
                                                throw new JcrException(e);
                                        }
 
-                                       try (InputStream in = new ByteArrayInputStream(arr);
-//                                     ByteArrayOutputStream out = new ByteArrayOutputStream();
-                                       ) {
-
-                                               Result xmlOutput = new StreamResult(resp.getOutputStream());
+                                       try (InputStream in = new ByteArrayInputStream(arr);) {
 
                                                DocumentBuilder docBuilder = documentBuilderFactory.newDocumentBuilder();
-//                             Document doc = docBuilder.parse(new File(
-//                                             System.getProperty("user.home") + "/dev/git/gpl/argeo-qa/doc/platform/argeo-platform.dbk.xml"));
                                                Document doc = docBuilder.parse(in);
                                                Source xmlInput = new DOMSource(doc);
 
-                                               Transformer transformer = docBoookTemplates.newTransformer();
+                                               if (pdf) {
+                                                       // String baseUri = req.getRequestURI();
+                                                       FopFactory fopFactory = FopFactory.newInstance(URI.create(req.getRequestURL().toString()));
+                                                       resp.setContentType("application/pdf");
+
+//                                                     // DocBook to FO
+//                                                     byte[] foBytes;
+//                                                     try (ByteArrayOutputStream out = new ByteArrayOutputStream();) {
+//                                                             Result xmlOutput = new StreamResult(out);
+//                                                             Transformer docBookTransformer = docBoookFoTemplates.newTransformer();
+//                                                             docBookTransformer.transform(xmlInput, xmlOutput);
+//                                                             foBytes = out.toByteArray();
+//                                                     }
+//
+//                                                     // FO to PDF
+//                                                     try (InputStream foIn = new ByteArrayInputStream(foBytes)) {
+//                                                             Fop fop = fopFactory.newFop("application/pdf", resp.getOutputStream());
+//                                                             Transformer fopTransformer = transformerFactory.newTransformer(); // identity
+//                                                             Source src = new StreamSource(foIn);
+//                                                             Result fopResult = new SAXResult(fop.getDefaultHandler());
+//                                                             fopTransformer.transform(src, fopResult);
+//                                                     }
+//
 
-                                               // gather CSS
-                                               if (cmsTheme != null) {
-                                                       StringBuilder sb = new StringBuilder();
-                                                       for (String cssPath : cmsTheme.getWebCssPaths()) {
-                                                               sb.append(req.getContextPath()).append(req.getServletPath()).append('/');
-                                                               sb.append(themeId).append('/').append(cssPath).append(' ');
+                                                       Fop fop = fopFactory.newFop("application/pdf", resp.getOutputStream());
+                                                       Transformer docBookTransformer = getDocBoookFoTemplates().newTransformer();
+                                                       Result fopResult = new SAXResult(fop.getDefaultHandler());
+                                                       docBookTransformer.transform(xmlInput, fopResult);
+
+                                               } else {
+                                                       Result xmlOutput = new StreamResult(resp.getOutputStream());
+                                                       resp.setContentType("text/html");
+                                                       Transformer docBookTransformer = getDocBoookHtmlTemplates().newTransformer();
+
+                                                       // gather CSS
+                                                       if (cmsTheme != null) {
+                                                               StringBuilder sb = new StringBuilder();
+                                                               for (String cssPath : cmsTheme.getWebCssPaths()) {
+                                                                       sb.append(req.getContextPath()).append(req.getServletPath()).append('/');
+                                                                       sb.append(themeId).append('/').append(cssPath).append(' ');
+                                                               }
+                                                               // FIXME make it more generic
+                                                               sb.append("https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap")
+                                                                               .append(' ');
+                                                               sb.append(
+                                                                               "https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,600;1,400&display=swap")
+                                                                               .append(' ');
+                                                               if (sb.length() > 0)
+                                                                       docBookTransformer.setParameter("html.stylesheet", sb.toString());
                                                        }
-                                                       // FIXME make it more generic
-                                                       sb.append("https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap")
-                                                                       .append(' ');
-                                                       sb.append(
-                                                                       "https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,300;0,400;0,600;1,400&display=swap")
-                                                                       .append(' ');
-                                                       if (sb.length() > 0)
-                                                               transformer.setParameter("html.stylesheet", sb.toString());
+                                                       docBookTransformer.transform(xmlInput, xmlOutput);
                                                }
-                                               transformer.transform(xmlInput, xmlOutput);
 //                             resp.getOutputStream().write(out.toByteArray());
                                        } catch (Exception e) {
                                                throw new ServletException("Cannot transform " + path, e);
@@ -181,39 +231,60 @@ public class DbkServlet extends HttpServlet {
        public void init() throws ServletException {
 
                // TODO improve configuration and provisioning of DocBook XSL
-               String xslBase = System.getProperty("argeo.docbook.xsl");
+               xslBase = System.getProperty("argeo.docbook.xsl");
                if (xslBase == null) {
                        // We need namespace aware XSL!
                        // Fedora (sudo dnf install docbook5-style-xsl)
-                       String defaultXslBase = "/usr/share/sgml/docbook/xsl-ns-stylesheets";
+                       String defaultXslBase = "/usr/share/xml/docbook/stylesheet/docbook-xsl-ns/";
                        if (!Files.exists(Paths.get(defaultXslBase))) {
                                defaultXslBase = "/opt/docbook-xsl";
                                if (!Files.exists(Paths.get(defaultXslBase))) {
-                                       throw new ServletException("System property argeo.docbook.xsl is not set and default location "
-                                                       + defaultXslBase + " does not exist.");
+                                       log.error("System property argeo.docbook.xsl is not set and default location " + defaultXslBase
+                                                       + " does not exist.");
                                }
                        }
                        xslBase = defaultXslBase;
 
                }
-               String xsl = xslBase + "/html/docbook.xsl";
 
                documentBuilderFactory = DocumentBuilderFactory.newInstance();
                documentBuilderFactory.setXIncludeAware(true);
                documentBuilderFactory.setNamespaceAware(true);
 
-               // We must explicitly use the non-XSLTC transformer, as XSLTC is not working
-               // with DocBook stylesheets
-               transformerFactory = new TransformerFactoryImpl();
+       }
 
-               Source xslSource = new StreamSource(xsl);
+       protected Templates createDocBookTemplates(String xsl) {
                try {
-                       docBoookTemplates = transformerFactory.newTemplates(xslSource);
-                       if (docBoookTemplates == null)
-                               throw new ServletException("Could not instantiate XSL " + xsl);
+                       if (transformerFactory == null) {
+                               // We must explicitly use the non-XSLTC transformer, as XSLTC is not working
+                               // with DocBook stylesheets
+                               transformerFactory = new TransformerFactoryImpl();
+                       }
+                       Source xslSource = new StreamSource(xsl);
+                       Templates templates = transformerFactory.newTemplates(xslSource);
+                       if (templates == null)
+                               throw new IllegalStateException("Could not instantiate XSL " + xsl);
+                       return templates;
                } catch (TransformerConfigurationException e) {
-                       throw new ServletException("Cannot instantiate XSL " + xsl, e);
+                       throw new IllegalStateException("Cannot instantiate XSL " + xsl, e);
+               }
+
+       }
+
+       protected Templates getDocBoookHtmlTemplates() {
+               if (docBoookHtmlTemplates == null) {
+                       String htmlXsl = xslBase + "/html/docbook.xsl";
+                       docBoookHtmlTemplates = createDocBookTemplates(htmlXsl);
+               }
+               return docBoookHtmlTemplates;
+       }
+
+       protected Templates getDocBoookFoTemplates() {
+               if (docBoookFoTemplates == null) {
+                       String foXsl = xslBase + "/fo/docbook.xsl";
+                       docBoookFoTemplates = createDocBookTemplates(foXsl);
                }
+               return docBoookFoTemplates;
        }
 
        public void setRepository(Repository repository) {
@@ -228,4 +299,40 @@ public class DbkServlet extends HttpServlet {
                themes.remove(theme.getThemeId());
        }
 
+       public static void main(String[] args) throws Exception {
+               // Step 1: Construct a FopFactory by specifying a reference to the configuration
+               // file
+               // (reuse if you plan to render multiple documents!)
+               FopFactory fopFactory = FopFactory.newInstance(new File(".").toURI());
+
+               // Step 2: Set up output stream.
+               // Note: Using BufferedOutputStream for performance reasons (helpful with
+               // FileOutputStreams).
+               OutputStream out = new BufferedOutputStream(new FileOutputStream(new File(
+                               System.getProperty("user.home") + "/dev/git/unstable/argeo-qa/doc/platform/argeo-platform-test.pdf")));
+
+               try {
+                       // Step 3: Construct fop with desired output format
+                       Fop fop = fopFactory.newFop("application/pdf", out);
+
+                       // Step 4: Setup JAXP using identity transformer
+                       TransformerFactory fopTransformerFactory = TransformerFactory.newInstance();
+                       Transformer fopTransformer = fopTransformerFactory.newTransformer(); // identity transformer
+
+                       // Step 5: Setup input and output for XSLT transformation
+                       // Setup input stream
+                       Source src = new StreamSource(new File(
+                                       System.getProperty("user.home") + "/dev/git/unstable/argeo-qa/doc/platform/argeo-platform.fo"));
+
+                       // Resulting SAX events (the generated FO) must be piped through to FOP
+                       Result res = new SAXResult(fop.getDefaultHandler());
+
+                       // Step 6: Start XSLT transformation and FOP processing
+                       fopTransformer.transform(src, res);
+
+               } finally {
+                       // Clean-up
+                       out.close();
+               }
+       }
 }
index 01e212ed614f45b4b8b293474087b4f2f9337b9c..3e65d6582ab0280197d37c409fa95c2899f5ba63 100644 (file)
@@ -12,7 +12,7 @@ import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.commons.io.IOUtils;
-import org.argeo.api.cms.CmsTheme;
+import org.argeo.api.cms.ux.CmsTheme;
 
 /** Serves fonts locally. */
 public class FontsServlet extends HttpServlet {
diff --git a/org.argeo.app.servlet.publish/src/org/argeo/app/servlet/publish/FopServlet.java b/org.argeo.app.servlet.publish/src/org/argeo/app/servlet/publish/FopServlet.java
new file mode 100644 (file)
index 0000000..1ee19f0
--- /dev/null
@@ -0,0 +1,222 @@
+package org.argeo.app.servlet.publish;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.net.URI;
+import java.net.URL;
+import java.net.URLDecoder;
+import java.nio.charset.StandardCharsets;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.Map;
+import java.util.Objects;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Templates;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.URIResolver;
+import javax.xml.transform.sax.SAXResult;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.apache.fop.apps.FOPException;
+import org.apache.fop.apps.Fop;
+import org.apache.fop.apps.FopFactory;
+import org.apache.fop.apps.FopFactoryBuilder;
+import org.apache.xalan.processor.TransformerFactoryImpl;
+import org.apache.xmlgraphics.io.Resource;
+import org.apache.xmlgraphics.io.ResourceResolver;
+import org.argeo.api.acr.Content;
+import org.argeo.api.acr.ContentRepository;
+import org.argeo.api.acr.ContentSession;
+import org.argeo.app.geo.GeoUtils;
+import org.argeo.app.geo.GpxUtils;
+import org.argeo.cms.acr.xml.XmlNormalizer;
+import org.argeo.cms.auth.RemoteAuthUtils;
+import org.argeo.cms.servlet.ServletHttpRequest;
+import org.argeo.cms.util.LangUtils;
+import org.geotools.data.collection.ListFeatureCollection;
+import org.geotools.data.simple.SimpleFeatureCollection;
+import org.opengis.feature.simple.SimpleFeature;
+
+/**
+ * A servlet transforming an XML view of the data to either FOP or PDF.
+ */
+public class FopServlet extends HttpServlet {
+       private static final long serialVersionUID = 6906020513498289335L;
+
+       private final static String PROP_ARGEO_FO_XSL = "argeo.fo.xsl";
+
+       private ContentRepository contentRepository;
+
+       private DocumentBuilderFactory documentBuilderFactory;
+       private TransformerFactory transformerFactory;
+       private Templates foTemplates;
+
+       private URL xslUrl;
+
+       @Override
+       protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+               String servletPath = req.getServletPath();
+               String ext = servletPath.substring(servletPath.lastIndexOf('.'));
+               servletPath = servletPath.substring(1, servletPath.lastIndexOf('.'));
+               servletPath = servletPath.substring(servletPath.indexOf('/'), servletPath.length());
+               String path = URLDecoder.decode(servletPath, StandardCharsets.UTF_8);
+
+               boolean pdf = ".pdf".equals(ext);
+               ContentSession session = RemoteAuthUtils.doAs(() -> contentRepository.get(), new ServletHttpRequest(req));
+               Content content = session.get(path);
+
+               // dev only
+               final boolean DEV = false;
+               if (DEV) {
+                       try (InputStream in = xslUrl.openStream()) {
+                               Source xslSource = new StreamSource(in);
+                               foTemplates = transformerFactory.newTemplates(xslSource);
+                               if (foTemplates == null)
+                                       throw new IllegalStateException("Could not instantiate XSL " + xslUrl);
+                       } catch (TransformerConfigurationException | IOException e) {
+                               throw new IllegalStateException("Cannot instantiate XSL " + xslUrl, e);
+                       }
+
+                       Source xmlInput = content.adapt(Source.class);
+                       XmlNormalizer.print(xmlInput,0);
+               }
+
+               Source xmlInput = content.adapt(Source.class);
+               String systemId = req.getRequestURL().toString();
+               xmlInput.setSystemId(systemId);
+
+               URIResolver uriResolver = (href, base) -> {
+                       try {
+                               URI url = URI.create(href);
+                               if (url.getScheme() != null) {
+                                       if (url.getScheme().equals("file")) {
+                                               InputStream in = Files.newInputStream(Paths.get(URI.create(url.toString())));
+                                               return new StreamSource(in);
+                                       }
+                                       if (url.getScheme().equals("geo2svg")) {
+                                               String includePath = path + url.getPath();
+                                               String geoExt = includePath.substring(includePath.lastIndexOf('.'));
+                                               Content geoContent = session.get(includePath);
+                                               if (".gpx".equals(geoExt)) {
+                                                       try (InputStream in = geoContent.open(InputStream.class)) {
+                                                               SimpleFeature field = GpxUtils.parseGpxToPolygon(in);
+                                                               SimpleFeatureCollection features = new ListFeatureCollection(field.getType(), field);
+                                                               try (StringWriter writer = new StringWriter()) {
+                                                                       GeoUtils.exportToSvg(features, writer, 100, 100);
+                                                                       StreamSource res = new StreamSource(new StringReader(writer.toString()));
+                                                                       return res;
+                                                               }
+                                                       }
+                                               } else {
+                                                       throw new UnsupportedOperationException(geoExt + " is not supported");
+                                               }
+                                       }
+                               }
+                       } catch (IOException e) {
+                               throw new RuntimeException("Cannot process " + href);
+                       }
+
+                       String p = href.startsWith("/") ? href : path + '/' + href;
+                       Content subContent = session.get(p);
+                       return subContent.adapt(Source.class);
+               };
+
+               ResourceResolver resourceResolver = new ResourceResolver() {
+
+                       @Override
+                       public Resource getResource(URI uri) throws IOException {
+                               String subPath = uri.getPath();
+                               Content subContent = session.get(subPath);
+                               InputStream in = subContent.open(InputStream.class);
+                               return new Resource(in);
+                       }
+
+                       @Override
+                       public OutputStream getOutputStream(URI uri) throws IOException {
+                               return null;
+                       }
+               };
+
+               try {
+                       if (pdf) {
+                               FopFactoryBuilder builder = new FopFactoryBuilder(URI.create(req.getRequestURL().toString()),
+                                               resourceResolver);
+                               FopFactory fopFactory = builder.build();
+//                             FopFactory fopFactory = FopFactory.newInstance(URI.create(req.getRequestURL().toString()));
+                               resp.setContentType("application/pdf");
+                               Fop fop = fopFactory.newFop("application/pdf", resp.getOutputStream());
+                               Transformer transformer = foTemplates.newTransformer();
+                               transformer.setURIResolver(uriResolver);
+                               Result fopResult = new SAXResult(fop.getDefaultHandler());
+                               transformer.transform(xmlInput, fopResult);
+
+                       } else {
+                               Result xmlOutput = new StreamResult(resp.getOutputStream());
+                               resp.setContentType("application/xml");
+                               Transformer transformer = foTemplates.newTransformer();
+//                             transformer = transformerFactory.newTransformer();// identity
+                               transformer.setURIResolver(uriResolver);
+                               transformer.transform(xmlInput, xmlOutput);
+                       }
+               } catch (FOPException | IOException | TransformerException e) {
+                       throw new RuntimeException("Cannot process " + path, e);
+               }
+
+       }
+
+       @Override
+       public void init() throws ServletException {
+//             for (Enumeration<String> it = getServletConfig().getInitParameterNames(); it.hasMoreElements();)
+//                     System.out.println(it.nextElement());
+//             for (String str : getServletContext().getResourcePaths("/"))
+//                     System.out.println(str);
+       }
+
+       public void start(Map<String, Object> properties) {
+               documentBuilderFactory = DocumentBuilderFactory.newInstance();
+               documentBuilderFactory.setXIncludeAware(true);
+               documentBuilderFactory.setNamespaceAware(true);
+
+               // We must explicitly use the non-XSLTC transformer, as XSLTC is not working
+               // with DocBook stylesheets
+               transformerFactory = new TransformerFactoryImpl();
+//             transformerFactory = TransformerFactory.newDefaultInstance();
+               try {
+                       String xslStr = LangUtils.get(properties, PROP_ARGEO_FO_XSL);
+                       Objects.requireNonNull(xslStr);
+                       xslUrl = new URL(xslStr);
+                       try (InputStream in = xslUrl.openStream()) {
+                               Source xslSource = new StreamSource(in);
+                               foTemplates = transformerFactory.newTemplates(xslSource);
+                               if (foTemplates == null)
+                                       throw new IllegalStateException("Could not instantiate XSL " + xslUrl);
+                       }
+
+               } catch (TransformerConfigurationException | IOException e) {
+                       throw new IllegalStateException("Cannot instantiate XSL " + xslUrl, e);
+               }
+       }
+
+       public void stop(Map<String, Object> properties) {
+
+       }
+
+       public void setContentRepository(ContentRepository contentRepository) {
+               this.contentRepository = contentRepository;
+       }
+
+}
diff --git a/org.argeo.app.servlet.publish/src/org/argeo/app/servlet/publish/GeoToSvgServlet.java b/org.argeo.app.servlet.publish/src/org/argeo/app/servlet/publish/GeoToSvgServlet.java
new file mode 100644 (file)
index 0000000..c22b834
--- /dev/null
@@ -0,0 +1,67 @@
+package org.argeo.app.servlet.publish;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URLDecoder;
+import java.nio.charset.StandardCharsets;
+import java.util.Map;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.argeo.api.acr.Content;
+import org.argeo.api.acr.ContentRepository;
+import org.argeo.api.acr.ContentSession;
+import org.argeo.app.geo.GeoUtils;
+import org.argeo.app.geo.GpxUtils;
+import org.argeo.cms.auth.RemoteAuthUtils;
+import org.argeo.cms.servlet.ServletHttpRequest;
+import org.geotools.data.collection.ListFeatureCollection;
+import org.geotools.data.simple.SimpleFeatureCollection;
+import org.opengis.feature.simple.SimpleFeature;
+
+/**
+ * A servlet transforming an geographical data to SVG.
+ */
+public class GeoToSvgServlet extends HttpServlet {
+       private static final long serialVersionUID = -6346379324580671894L;
+       private ContentRepository contentRepository;
+
+       @Override
+       protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+               String servletPath = req.getServletPath();
+
+               servletPath = servletPath.substring(1, servletPath.lastIndexOf('.'));
+               servletPath = servletPath.substring(servletPath.indexOf('/'), servletPath.length());
+               String path = URLDecoder.decode(servletPath, StandardCharsets.UTF_8);
+               String ext = servletPath.substring(path.lastIndexOf('.'));
+
+               resp.setContentType("image/svg+xml");
+
+               ContentSession session = RemoteAuthUtils.doAs(() -> contentRepository.get(), new ServletHttpRequest(req));
+               Content content = session.get(path);
+               if (".gpx".equals(ext)) {
+                       try (InputStream in = content.open(InputStream.class)) {
+                               SimpleFeature field = GpxUtils.parseGpxToPolygon(in);
+
+                               SimpleFeatureCollection features = new ListFeatureCollection(field.getType(), field);
+                               GeoUtils.exportToSvg(features, resp.getWriter(), 100, 100);
+//                     log.debug("SVG:\n" + writer.toString() + "\n");
+                       }
+               }
+       }
+
+       public void start(Map<String, Object> properties) {
+       }
+
+       public void stop(Map<String, Object> properties) {
+
+       }
+
+       public void setContentRepository(ContentRepository contentRepository) {
+               this.contentRepository = contentRepository;
+       }
+
+}
index e801ebfb4680123285c15553dc70584276fe0057..81fe078c20c05db46a8281fbb1a72875a5322b45 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
        <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
        <classpathentry kind="src" path="src"/>
        <classpathentry kind="output" path="bin"/>
index 1a4e589009b49ae9c77fbc374b18dcbdc999e3e9..bcb5ecb919d822b2d4ced8785344fa28e35a7fb8 100644 (file)
@@ -1,8 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init" deactivate="destroy" name="Argeo Suite Default Theme">
-   <implementation class="org.argeo.cms.swt.osgi.BundleCmsSwtTheme"/>
+   <implementation class="org.argeo.cms.swt.osgi.BundleSvgTheme"/>
    <service>
-      <provide interface="org.argeo.api.cms.CmsTheme"/>
+      <provide interface="org.argeo.api.cms.ux.CmsTheme"/>
    </service>
    <property name="themeId" type="String" value="org.argeo.app.theme.default"/>
+   <property name="smallIconSize" type="String" value="24"/>
 </scr:component>
index 45dc19ece6f0a5ef8971041c2d8d9c35ae245c91..4743076885abadb13bd1f7be8cd791d4eafec12e 100644 (file)
@@ -1,7 +1,11 @@
 Service-Component:\
 OSGI-INF/cmsTheme.xml
 
+Private-Package: *
+
+Export-Package: !*
+
 Import-Package:\
-org.argeo.cms.swt.osgi,\
+org.argeo.cms.swt.osgi;resolution:="optional",\
 javax.servlet.*;version="[3,5)",\
 *
\ No newline at end of file
diff --git a/org.argeo.app.theme.default/icons/types/.gitignore b/org.argeo.app.theme.default/icons/types/.gitignore
new file mode 100644 (file)
index 0000000..098a566
--- /dev/null
@@ -0,0 +1,2 @@
+!svg/
+**/*.png
diff --git a/org.argeo.app.theme.default/icons/types/svg/activity.svg b/org.argeo.app.theme.default/icons/types/svg/activity.svg
new file mode 100644 (file)
index 0000000..1fbbc20
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" version="1.1" viewBox="0 0 500 500">
+  <metadata id="metadata13">
+    <rdf:RDF>
+      <cc:Work rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
+        <dc:title>activity</dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <defs id="defs4">
+    <style id="style2">.cls-1{fill:none;stroke:#305d74;stroke-linecap:round;stroke-miterlimit:10;stroke-width:40px;}</style>
+  </defs>
+  <title id="title6">activity</title>
+  <path d="m 39,321 c 28,0 56,0 84,0 22,-69.33333 44,-138.66667 66,-208 28,98.66667 56,197.33333 84,296 15.33333,-51.33333 30.66667,-102.66667 46,-154 47.33333,0 94.66667,0 142,0" id="polyline8" style="fill:none;stroke:#305d74;stroke-width:40px;stroke-linecap:round;stroke-miterlimit:10"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/add.svg b/org.argeo.app.theme.default/icons/types/svg/add.svg
new file mode 100644 (file)
index 0000000..bbc6670
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1,.cls-2{fill:none;stroke-miterlimit:10;stroke-width:125px;}.cls-1{stroke:#006838;}.cls-2{stroke:#00a551;}</style>
+  </defs>
+  <title>add</title>
+  <line class="cls-1" x1="264.81" x2="264.81" y1="44.56" y2="444.62"/>
+  <line class="cls-1" x1="464.84" x2="64.78" y1="244.59" y2="244.59"/>
+  <line class="cls-2" x1="253.03" x2="253.03" y1="33.68" y2="433.74"/>
+  <line class="cls-2" x1="453.06" x2="53" y1="233.71" y2="233.71"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/addressBook.svg b/org.argeo.app.theme.default/icons/types/svg/addressBook.svg
new file mode 100644 (file)
index 0000000..f8564d6
--- /dev/null
@@ -0,0 +1 @@
+<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500"><defs><style>.cls-1{fill:#f3964d;}.cls-2{fill:#fff;}</style></defs><title>addressBook</title><path class="cls-1" d="M320.79,127.44a4.52,4.52,0,0,0-3.31-4.32L93.09,33.23H85.27c-5.8,0-7.82-.37-7.82,4.42V389c0,9.11,6.07,17.11,14.26,19.23L313,488.55h7.82Z"/><path class="cls-1" d="M344.47,116.76v334h50.75a22.13,22.13,0,0,0,22.1-22.1V228.31l.13-192.55a22.12,22.12,0,0,0-22.1-22.1H113.49L329.77,96.84A20.79,20.79,0,0,1,344.47,116.76Z"/><path class="cls-2" d="M220.47,279.62,215.4,260c17.56-3.41,29.08-24.9,27.41-56.25-2.15-40.55-25.42-81.87-52-92.29s-46.35,14-44.19,54.54c1.67,31.51,16.15,63.3,35,80.88l-2.49,15.87c-33.15-1.69-51.73,30.67-57.56,79.54-3.28,27.46,157.66,101.31,149.66,59.15C261.42,349.81,254.67,305.51,220.47,279.62Z"/></svg>
\ No newline at end of file
diff --git a/org.argeo.app.theme.default/icons/types/svg/ascending.svg b/org.argeo.app.theme.default/icons/types/svg/ascending.svg
new file mode 100644 (file)
index 0000000..d1a171c
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:none;stroke:#f3964d;stroke-linecap:round;stroke-linejoin:round;stroke-width:20px;}.cls-2{fill:#f3964d;}</style>
+  </defs>
+  <title>ascending</title>
+  <g id="Plus">
+    <line class="cls-1" x1="119" x2="119" y1="128.38" y2="384.84"/>
+    <polygon class="cls-2" points="81.1 139.47 119 73.84 156.9 139.47 81.1 139.47"/>
+    <line class="cls-1" x1="188" x2="406" y1="376.84" y2="376.84"/>
+    <line class="cls-1" x1="188" x2="370" y1="316.84" y2="316.84"/>
+    <line class="cls-1" x1="188" x2="318" y1="250.84" y2="250.84"/>
+    <line class="cls-1" x1="188" x2="270" y1="184.84" y2="184.84"/>
+  </g>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/calendar.svg b/org.argeo.app.theme.default/icons/types/svg/calendar.svg
new file mode 100644 (file)
index 0000000..60e0ee5
--- /dev/null
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:#454545;}.cls-2,.cls-4{fill:none;stroke:#454545;stroke-miterlimit:10;stroke-width:20px;}.cls-3{fill:#fff;}.cls-4{stroke-linecap:round;}</style>
+  </defs>
+  <title>calendar</title>
+  <g id="Plus">
+    <rect class="cls-1" height="124" rx="12" ry="12" width="400" x="43.48" y="56.17"/>
+    <rect class="cls-2" height="391" rx="12" ry="12" width="391" x="48.98" y="54.67"/>
+    <rect class="cls-1" height="79" rx="12" ry="12" width="79" x="96.48" y="217.17"/>
+    <rect class="cls-1" height="79" rx="12" ry="12" width="79" x="206.48" y="217.17"/>
+    <rect class="cls-1" height="79" rx="12" ry="12" width="79" x="316.48" y="217.17"/>
+    <rect class="cls-1" height="79" rx="12" ry="12" width="79" x="96.48" y="327.17"/>
+    <rect class="cls-1" height="79" rx="12" ry="12" width="79" x="206.48" y="327.17"/>
+    <rect class="cls-1" height="79" rx="12" ry="12" width="79" x="316.48" y="327.17"/>
+    <circle class="cls-3" cx="135.98" cy="88.67" r="26.5"/>
+    <line class="cls-4" x1="135.48" x2="135.48" y1="14.17" y2="89.17"/>
+    <circle class="cls-3" cx="360.98" cy="88.67" r="26.5"/>
+    <line class="cls-4" x1="360.48" x2="360.48" y1="14.17" y2="89.17"/>
+  </g>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/close.svg b/org.argeo.app.theme.default/icons/types/svg/close.svg
new file mode 100644 (file)
index 0000000..242c922
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1,.cls-2{fill:none;stroke-miterlimit:10;stroke-width:96px;}.cls-1{stroke:#808184;}.cls-2{stroke:#58595b;}</style>
+  </defs>
+  <title>close</title>
+  <line class="cls-1" x1="91.83" x2="429.22" y1="85.31" y2="422.71"/>
+  <line class="cls-1" x1="429.22" x2="91.83" y1="85.31" y2="422.71"/>
+  <line class="cls-2" x1="72.72" x2="410.11" y1="86.08" y2="423.47"/>
+  <line class="cls-2" x1="410.11" x2="72.72" y1="86.08" y2="423.47"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/closeAll.svg b/org.argeo.app.theme.default/icons/types/svg/closeAll.svg
new file mode 100644 (file)
index 0000000..775f7a7
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1,.cls-2{fill:none;stroke-miterlimit:10;stroke-width:96px;}.cls-1{stroke:#58595b;}.cls-2{stroke:#ddd;}</style>
+  </defs>
+  <title>closeAll</title>
+  <line class="cls-1" x1="58.17" x2="375.94" y1="82.07" y2="399.84"/>
+  <line class="cls-1" x1="375.94" x2="58.17" y1="82.07" y2="399.84"/>
+  <line class="cls-2" x1="93.17" x2="410.94" y1="81.07" y2="398.84"/>
+  <line class="cls-2" x1="410.94" x2="93.17" y1="81.07" y2="398.84"/>
+  <line class="cls-1" x1="127.17" x2="444.94" y1="81.07" y2="398.84"/>
+  <line class="cls-1" x1="444.94" x2="127.17" y1="81.07" y2="398.84"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/dashboard.svg b/org.argeo.app.theme.default/icons/types/svg/dashboard.svg
new file mode 100644 (file)
index 0000000..852cd6a
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1,.cls-2{fill:none;stroke-linecap:round;stroke-miterlimit:10;}.cls-1{stroke:#305d74;stroke-width:35px;}.cls-2{stroke:#f3964d;stroke-width:50px;}.cls-3{fill:#177f95;}.cls-4{fill:#49bac5;}</style>
+  </defs>
+  <title>dashboard</title>
+  <g id="Plus">
+    <polyline class="cls-1" points="379.15 199.72 379.15 456.05 113.88 456.05 113.88 199.72"/>
+    <polyline class="cls-2" points="47.29 255.25 244 58.54 440.72 255.25"/>
+    <rect class="cls-3" height="146.05" width="83.61" x="158.39" y="294"/>
+    <rect class="cls-4" height="76.5" width="64.5" x="266.5" y="217.5"/>
+  </g>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/delete.svg b/org.argeo.app.theme.default/icons/types/svg/delete.svg
new file mode 100644 (file)
index 0000000..b2800d4
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:#454545;}.cls-2{fill:none;stroke:#fff;stroke-linecap:round;stroke-miterlimit:10;stroke-width:50px;}</style>
+  </defs>
+  <title>delete</title>
+  <g id="Plus">
+    <path class="cls-1" d="M368,474.8l-232.79.09c-14.28,0-30.79-21.78-30.79-36.06L80.65,158.69l341-.44-23,279.7C398.61,452.23,382.25,474.8,368,474.8Z"/>
+    <rect class="cls-1" height="52.93" rx="12" ry="12" width="392.28" x="55" y="77.77"/>
+    <rect class="cls-1" height="84.44" rx="19.8" ry="19.8" width="182.09" x="160.99" y="25"/>
+    <line class="cls-2" x1="253.99" x2="253.99" y1="208.67" y2="408.74"/>
+    <line class="cls-2" x1="145.52" x2="162.82" y1="207.99" y2="409.42"/>
+    <line class="cls-2" x1="358.84" x2="340.33" y1="208.12" y2="409.29"/>
+  </g>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/descending.svg b/org.argeo.app.theme.default/icons/types/svg/descending.svg
new file mode 100644 (file)
index 0000000..4f363b0
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:none;stroke:#f3964d;stroke-linecap:round;stroke-linejoin:round;stroke-width:20px;}.cls-2{fill:#f3964d;}</style>
+  </defs>
+  <title>descending</title>
+  <g id="Plus">
+    <line class="cls-1" x1="120" x2="120" y1="355.3" y2="98.84"/>
+    <polygon class="cls-2" points="157.9 344.21 120 409.84 82.1 344.21 157.9 344.21"/>
+    <line class="cls-1" x1="189" x2="407" y1="311.84" y2="311.84"/>
+    <line class="cls-1" x1="189" x2="371" y1="251.84" y2="251.84"/>
+    <line class="cls-1" x1="189" x2="319" y1="185.84" y2="185.84"/>
+    <line class="cls-1" x1="189" x2="271" y1="119.84" y2="119.84"/>
+  </g>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/document.svg b/org.argeo.app.theme.default/icons/types/svg/document.svg
new file mode 100644 (file)
index 0000000..5265430
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:#305d74;stroke:#305d74;}.cls-1,.cls-3{stroke-miterlimit:10;}.cls-2{fill:#fff;}.cls-3{fill:none;stroke:#fff;stroke-linecap:round;stroke-width:50px;}</style>
+  </defs>
+  <title>document</title>
+  <polygon class="cls-1" points="393.14 463.84 78.14 463.84 78.14 49 300.02 49 393.14 163.4 393.14 463.84"/>
+  <polygon class="cls-2" points="375.05 179.8 294.69 179.8 294.69 81.2 375.05 179.8"/>
+  <line class="cls-3" x1="127.68" x2="334.87" y1="270.73" y2="270.73"/>
+  <line class="cls-3" x1="127.68" x2="334.87" y1="391.27" y2="391.27"/>
+  <line class="cls-3" x1="132.18" x2="189.19" y1="157.12" y2="157.12"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/documents.svg b/org.argeo.app.theme.default/icons/types/svg/documents.svg
new file mode 100644 (file)
index 0000000..8e7684f
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1,.cls-5{fill:#305d74;}.cls-1,.cls-4,.cls-5{stroke:#305d74;}.cls-1,.cls-3,.cls-4,.cls-5{stroke-miterlimit:10;}.cls-2{fill:#fff;}.cls-3{fill:none;stroke:#fff;stroke-linecap:round;stroke-width:50px;}.cls-4{fill:#292561;}.cls-4,.cls-5{stroke-width:30px;}</style>
+  </defs>
+  <title>documents</title>
+  <polygon class="cls-1" points="437.14 465.84 122.14 465.84 122.14 51 344.02 51 437.14 165.4 437.14 465.84"/>
+  <polygon class="cls-2" points="419.05 181.8 338.69 181.8 338.69 83.2 419.05 181.8"/>
+  <line class="cls-3" x1="171.68" x2="378.87" y1="272.73" y2="272.73"/>
+  <line class="cls-3" x1="171.68" x2="378.87" y1="393.27" y2="393.27"/>
+  <line class="cls-3" x1="176.18" x2="233.19" y1="159.12" y2="159.12"/>
+  <line class="cls-4" x1="287" x2="51" y1="6" y2="6"/>
+  <line class="cls-5" x1="66" x2="66" y1="1" y2="389"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/email.svg b/org.argeo.app.theme.default/icons/types/svg/email.svg
new file mode 100644 (file)
index 0000000..444445b
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:#fff;stroke:#454545;stroke-linejoin:round;stroke-width:45px;}</style>
+  </defs>
+  <title>email</title>
+  <rect class="cls-1" height="295.92" width="372.28" x="61.82" y="88.28"/>
+  <polygon class="cls-1" points="65.48 88.28 430.03 88.29 247.76 305.77 65.48 88.28"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/fav.svg b/org.argeo.app.theme.default/icons/types/svg/fav.svg
new file mode 100644 (file)
index 0000000..b78263c
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:#ffe78b;stroke:#dcc068;stroke-miterlimit:10;stroke-width:5px;}</style>
+  </defs>
+  <title>fav</title>
+  <polygon class="cls-1" points="392.45 451.67 251 360.47 110.47 450.74 152.35 290.67 23.93 183.65 190.51 175.28 251.93 18 308.7 171.55 479 183.65 350.57 289.74 392.45 451.67"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/favNot.svg b/org.argeo.app.theme.default/icons/types/svg/favNot.svg
new file mode 100644 (file)
index 0000000..2902279
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:#ccc;}</style>
+  </defs>
+  <title>favNot</title>
+  <polygon class="cls-1" points="388.45 464.67 247 373.47 106.47 463.74 148.35 303.67 19.93 196.65 186.51 188.28 247.93 31 304.7 184.55 475 196.65 346.57 302.74 388.45 464.67"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/folder.svg b/org.argeo.app.theme.default/icons/types/svg/folder.svg
new file mode 100644 (file)
index 0000000..3874e6f
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:#177f95;}</style>
+  </defs>
+  <title>folder</title>
+  <path class="cls-1" d="M133.63,215.59a4.17,4.17,0,0,0-4,3L46.92,425.18v7.19c0,5.34-.34,7.2,4.06,7.2h323.4c8.38,0,15.75-5.59,17.69-13.12L466,222.79v-7.2Z"/>
+  <path class="cls-1" d="M123.8,193.8H431.21V147.09a20.36,20.36,0,0,0-20.34-20.34H226.48L189.2,74.63h-140A20.36,20.36,0,0,0,28.9,95V406.4l76.57-199.06A19.13,19.13,0,0,1,123.8,193.8Z"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/group.svg b/org.argeo.app.theme.default/icons/types/svg/group.svg
new file mode 100644 (file)
index 0000000..4a1ee49
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:#177f95;}.cls-2,.cls-3{fill:#fff;}.cls-3{stroke:#177f95;stroke-miterlimit:10;stroke-width:9px;}</style>
+  </defs>
+  <title>group</title>
+  <circle class="cls-1" cx="246" cy="245" r="236"/>
+  <path class="cls-2" d="M347.33,221.71l-4.18-15c18.42-8.76,31.56-30.88,31.56-57,0-33.76-21.89-61.12-48.89-61.12S276.93,116,276.93,149.76c0,26.23,13.28,48.42,31.85,57.08l-3.46,14.33C271,230.8,249.92,264.5,241.17,308c-4.91,24.44,175.23,33.18,169.25,0C403.09,267.37,381.42,232.31,347.33,221.71Z"/>
+  <path class="cls-2" d="M197.08,231.41l-4.18-15c18.42-8.77,31.56-30.88,31.56-57,0-33.75-21.89-61.11-48.89-61.11s-48.89,27.36-48.89,61.11c0,26.24,13.28,48.43,31.85,57.09l-3.46,14.33c-34.33,9.63-55.4,43.33-64.15,86.83-4.91,24.44,175.23,33.18,169.25,0C252.84,277.07,231.17,242,197.08,231.41Z"/>
+  <path class="cls-3" d="M273.45,272.94l-5.06-18.09c22.25-10.59,38.13-37.3,38.13-68.82,0-40.77-26.44-73.82-59.06-73.82S188.41,145.26,188.41,186c0,31.69,16.05,58.49,38.48,69l-4.19,17.3c-41.46,11.63-66.91,52.34-77.48,104.88-5.93,29.51,211.65,40.07,204.42,0C340.79,328.09,314.61,285.74,273.45,272.94Z"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/historyAscending.svg b/org.argeo.app.theme.default/icons/types/svg/historyAscending.svg
new file mode 100644 (file)
index 0000000..975310e
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:none;stroke:#f3964d;stroke-linecap:round;stroke-linejoin:round;stroke-width:25px;}.cls-2{fill:#f3964d;}</style>
+  </defs>
+  <title>historyAscending</title>
+  <path class="cls-1" d="M402.44,198.19A172,172,0,1,0,374.8,354.52"/>
+  <polygon class="cls-2" points="428.83 168.54 399.33 187.75 365.02 179.84 410.33 249.82 428.83 168.54"/>
+  <line class="cls-1" x1="233.33" x2="233.33" y1="136.82" y2="269.82"/>
+  <line class="cls-1" x1="233.33" x2="321.33" y1="269.82" y2="269.82"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/historyDescending.svg b/org.argeo.app.theme.default/icons/types/svg/historyDescending.svg
new file mode 100644 (file)
index 0000000..7c35988
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:none;stroke:#f3964d;stroke-linecap:round;stroke-linejoin:round;stroke-width:25px;}.cls-2{fill:#f3964d;}</style>
+  </defs>
+  <title>historyDescending</title>
+  <path class="cls-1" d="M86.21,197.19a172,172,0,1,1,27.64,156.33"/>
+  <polygon class="cls-2" points="123.63 178.84 89.32 186.75 59.82 167.54 78.33 248.82 123.63 178.84"/>
+  <line class="cls-1" x1="245.33" x2="245.33" y1="135.82" y2="268.82"/>
+  <line class="cls-1" x1="245.33" x2="333.33" y1="268.82" y2="268.82"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/home.svg b/org.argeo.app.theme.default/icons/types/svg/home.svg
new file mode 100644 (file)
index 0000000..0c2ba6f
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:#fff;}.cls-1,.cls-2,.cls-3{stroke:#454545;}.cls-1,.cls-2{stroke-linejoin:round;stroke-width:50px;}.cls-2{fill:none;}.cls-3{fill:#454545;stroke-miterlimit:10;}</style>
+  </defs>
+  <title>home</title>
+  <rect class="cls-1" height="246.82" width="246.82" x="128.47" y="216.77"/>
+  <polygon class="cls-2" points="65.47 216.77 251.88 30.36 438.29 216.77 65.47 216.77"/>
+  <rect class="cls-3" height="97.13" width="66.94" x="184.94" y="342.18"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/inbox.svg b/org.argeo.app.theme.default/icons/types/svg/inbox.svg
new file mode 100644 (file)
index 0000000..1acd8dd
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:none;stroke:#f3964d;stroke-linecap:round;stroke-linejoin:round;stroke-width:33px;}.cls-2{fill:#f3964d;}</style>
+  </defs>
+  <title>inbox</title>
+  <g id="Plus">
+    <line class="cls-1" x1="253.73" x2="253.73" y1="231.53" y2="69.07"/>
+    <polygon class="cls-2" points="303.1 217.08 253.73 302.57 204.37 217.08 303.1 217.08"/>
+    <line class="cls-1" x1="114.73" x2="114.73" y1="226.82" y2="404.82"/>
+    <line class="cls-1" x1="392.73" x2="392.73" y1="404.82" y2="226.82"/>
+    <line class="cls-1" x1="114.73" x2="392.73" y1="404.82" y2="404.82"/>
+  </g>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/license.svg b/org.argeo.app.theme.default/icons/types/svg/license.svg
new file mode 100644 (file)
index 0000000..994e2ec
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:none;}.cls-1,.cls-2{stroke:#454545;stroke-miterlimit:10;stroke-width:30px;}.cls-2{fill:#f3964d;}</style>
+  </defs>
+  <title>license</title>
+  <rect class="cls-1" height="276.25" width="404.67" x="42.67" y="78.19"/>
+  <circle class="cls-2" cx="319.33" cy="217" r="79.67"/>
+  <polyline class="cls-2" points="362.63 274 362.63 452.69 318.61 407.19 276.28 452.69 276.28 274"/>
+  <line class="cls-1" x1="80.67" x2="196.31" y1="271" y2="271"/>
+  <line class="cls-1" x1="88.67" x2="186.67" y1="178" y2="178"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/location.svg b/org.argeo.app.theme.default/icons/types/svg/location.svg
new file mode 100644 (file)
index 0000000..6bf408b
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:#305d74;}.cls-2{fill:#6ac59a;}.cls-3{fill:#f3964d;}.cls-4{fill:none;stroke:#fff;stroke-miterlimit:10;stroke-width:17px;}</style>
+  </defs>
+  <title>location</title>
+  <g id="Plus">
+    <polygon class="cls-1" points="432.15 447.73 71.15 447.73 94.15 313.73 393.15 284.73 432.15 447.73"/>
+    <polygon class="cls-2" points="303.87 404.93 175.17 419.23 142.67 343.83 246.67 315.23 303.87 404.93"/>
+    <path class="cls-3" d="M272.37,239.47c-3.18-11.88-24.67-17.25-54.1-15.44L190,118.58c13.37-8.43,20.78-17.4,18.84-24.64-3.66-13.64-148.6,25.2-144.94,38.84,1.94,7.24,12.84,11.3,28.63,11.91l28.25,105.46c-26.39,13.14-42.31,28.54-39.13,40.42,2.25,8.39,45.11,1.69,89.64-9.66l20.26,75.6,14.68,13.85,5.09-19.15L191.07,275.6C234.85,263.21,274.6,247.78,272.37,239.47Z"/>
+    <line class="cls-4" x1="171.65" x2="195.65" y1="137.65" y2="223.65"/>
+  </g>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/logout.svg b/org.argeo.app.theme.default/icons/types/svg/logout.svg
new file mode 100644 (file)
index 0000000..606f172
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:none;stroke:#454545;stroke-linecap:round;stroke-miterlimit:10;stroke-width:50px;}</style>
+  </defs>
+  <title>logout</title>
+  <path class="cls-1" d="M336.7,100.05a169.92,169.92,0,1,1-186.22,6"/>
+  <line class="cls-1" x1="248.59" x2="248.59" y1="233.73" y2="64.93"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/map.svg b/org.argeo.app.theme.default/icons/types/svg/map.svg
new file mode 100644 (file)
index 0000000..0f68569
--- /dev/null
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500"><defs><style>.cls-1{fill:#49bac5;}.cls-2{fill:#35987a;}.cls-3{fill:#6ac59a;}.cls-4{fill:none;stroke:#4d4d4d;stroke-linecap:round;stroke-linejoin:round;stroke-width:20px;}</style></defs><title>map</title><g id="Plus"><ellipse class="cls-1" cx="248.73" cy="250.99" rx="218.51" ry="221.63"/><path class="cls-2" d="M87.76,197.09c4.12-1.21,8.32-2.6,12.59-2.18,5.07.51,9.52,3.52,13.73,6.43a23.81,23.81,0,0,1,6,5.28c2.12,2.93,2.79,6.66,3.36,10.25a428.24,428.24,0,0,1,5.07,82.89c-.32,9.11-.63,19.23,5.22,26.16,2.95,3.52,7.12,5.7,11.17,7.8l12.33,6.37c2.91,1.5,6,3.23,7.32,6.26.92,2.17.73,4.63.53,7-1.22,14.44-1.85,30.71,7.73,41.48,4.23,4.76,10,7.82,14.72,12.1,2.18,2,4.14,4.22,6.62,5.78a36.12,36.12,0,0,0,7.47,3.14c17.43,6.15,32.22,18,46.65,29.7,2.23,1.81,4.52,3.68,5.9,6.22,3.1,5.73.7,12.84,1.37,19.34A66,66,0,0,1,214.13,473c-12.87-3.66-24.5-11.2-37.55-14.16-7.4-1.67-15.05-1.82-22.53-3.11a79.31,79.31,0,0,1-42-22,170.17,170.17,0,0,1-12.41-14.38C94.84,413.29,90,407.22,85.31,401A395.71,395.71,0,0,1,49,342.78c-2.58-5.06-5-10.18-7.13-15.47a122.74,122.74,0,0,1-7.32-28.11c-1.79-12.75-1.7-25.78-4.5-38.34-2.18-9.77-6.1-19.19-6.88-29.17s2.45-21.24,11.09-26.08c1.58-.89-.11-4.77-.86-5.66,3.92,6.41,16.77,3.46,23,3A156.19,156.19,0,0,0,87.76,197.09Z"/><path class="cls-3" d="M338.09,83.07c-6.44,2.17-13.26,2.82-19.95,4-36.86,6.43-70.48,30-89.45,62.68-4.23,7.3-7.18,18-.55,23.13,2.74,2.13,6.39,2.53,9.83,2.86l33.44,3.16c9.5.9,20.34,2.57,25.5,10.71s2,19.14-4.2,26.26-15,11.32-23.17,16-16.4,10.51-20.18,19.23c-1.89,4.36-2.53,9.16-2.94,13.9a158.24,158.24,0,0,0,.53,32.2c1,8.31,3,17.14,9.08,22.77,6.79,6.26,16.8,6.91,26,7.23l45.38,1.61c3.37.12,6.87.27,9.87,1.83s5.34,4.58,7.83,7.1c9.69,9.8,24.07,13.33,34.43,22.4,8.75,7.65,14.62,19.2,25.35,23.53,9.56,3.86,20.45.84,29.8-3.51,1.24-4.58,5.39-7.59,8.73-10.92,10.68-10.6,14.28-26.33,17.41-41.15,9.93-47,19.84-96.16,7.94-142.74-3.24-12.68-8-24.89-13.21-36.89-3.28-7.58-7.11-15.58-14.2-19.7-2.7-1.57-5.84-2.56-7.9-4.93a19.25,19.25,0,0,1-2.83-5.34c-6.68-16.07-18.64-29.17-30.38-41.92-4.45-4.83-9-9.77-14.81-12.83-7.25-3.85-19.16-5.91-24.58,1.25C354.6,73.22,348.13,79.67,338.09,83.07Z"/><ellipse class="cls-4" cx="252.03" cy="250.32" rx="224.45" ry="227.65"/><path class="cls-4" d="M362.94,52.13c4.84,11.1-11.83,27-23.19,30.86s-23.77,2.3-35.54,4.5c-25.72,4.8-44.75,26.22-61.73,46.38-10.17,12.09-21,27.85-15,42.51l52,3.31c3.93.25,8.05.56,11.37,2.7,5.86,3.78,7.2,11.72,7.94,18.72,1.26,12.09-15.08,19.75-50.73,45.2-8.5,18.63,3.44,38.62,2,59.11-.28,4.15-.35,8.57,1.71,12.18s6,5.78,9.84,7.22c29.79,11.07,70.08-8.08,91.22,15.91,4.63,5.24,7.4,11.87,11.43,17.6,12.85,18.33,50,34.48,69.92,24.57"/><path class="cls-4" d="M36.73,203.2a253.06,253.06,0,0,1,72.74-8.73c5.6.15,12,.86,15.34,5.4,2,2.7,2.52,6.22,2.92,9.58a336.22,336.22,0,0,1,.46,74.3c-2.07,19.69-3,45.11,14.87,53.18,6.66,3,15,2.75,20.22,7.87,8.8,8.57,2.1,23.31,2.42,35.68.62,23.79,27.1,36.5,49.11,44.72s47.85,24,44.77,47.62"/></g></svg>
\ No newline at end of file
diff --git a/org.argeo.app.theme.default/icons/types/svg/milestone.svg b/org.argeo.app.theme.default/icons/types/svg/milestone.svg
new file mode 100644 (file)
index 0000000..b99b69d
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:#49bac5;}.cls-2{fill:none;stroke:#fff;stroke-linecap:round;stroke-linejoin:round;stroke-width:40px;}</style>
+  </defs>
+  <title>milestone</title>
+  <rect class="cls-1" height="337.48" rx="11" ry="11" width="337.48" x="81" y="83.52"/>
+  <path class="cls-1" d="M407.48,94.52V410H92V94.52H407.48m0-22H92a22,22,0,0,0-22,22V410a22,22,0,0,0,22,22H407.48a22,22,0,0,0,22-22V94.52a22,22,0,0,0-22-22Z"/>
+  <polyline class="cls-2" points="156.1 285.83 239.74 343.74 341.07 158.77"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/mobile.svg b/org.argeo.app.theme.default/icons/types/svg/mobile.svg
new file mode 100644 (file)
index 0000000..c991bec
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1,.cls-3{fill:#fff;}.cls-1,.cls-2,.cls-3{stroke:#454545;}.cls-1,.cls-2{stroke-linejoin:round;}.cls-1{stroke-width:50px;}.cls-2{fill:none;stroke-width:92px;}.cls-3{stroke-miterlimit:10;}</style>
+  </defs>
+  <title>mobile</title>
+  <rect class="cls-1" height="286.94" transform="translate(493.25 -3.51) rotate(90)" width="430.9" x="32.93" y="101.39"/>
+  <line class="cls-2" x1="115.45" x2="391.85" y1="400.47" y2="400.47"/>
+  <circle class="cls-3" cx="249.01" cy="414.91" r="29"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/note.svg b/org.argeo.app.theme.default/icons/types/svg/note.svg
new file mode 100644 (file)
index 0000000..132478f
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:#fff;stroke-linecap:round;stroke-width:27px;}.cls-1,.cls-2{stroke:#305d74;stroke-linejoin:round;}.cls-2{fill:#305d74;stroke-width:13px;}</style>
+  </defs>
+  <title>note</title>
+  <polygon class="cls-1" points="415.44 439.47 116.18 439.47 116.18 45.37 326.97 45.37 415.44 154.05 415.44 439.47"/>
+  <polygon class="cls-2" points="380.32 162.67 315.43 162.67 315.43 83.05 380.32 162.67"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/openUserMenu.svg b/org.argeo.app.theme.default/icons/types/svg/openUserMenu.svg
new file mode 100644 (file)
index 0000000..a84bc65
--- /dev/null
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   id="Layer_1"
+   data-name="Layer 1"
+   viewBox="0 0 500 500"
+   version="1.1"
+   sodipodi:docname="openUserMenu.svg"
+   inkscape:version="1.0.2 (e86c870879, 2021-01-15)">
+  <metadata
+     id="metadata35">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+        <dc:title>Artboard 153</dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <sodipodi:namedview
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1"
+     objecttolerance="10"
+     gridtolerance="10"
+     guidetolerance="10"
+     inkscape:pageopacity="0"
+     inkscape:pageshadow="2"
+     inkscape:window-width="2309"
+     inkscape:window-height="1591"
+     id="namedview33"
+     showgrid="false"
+     inkscape:zoom="2.016"
+     inkscape:cx="151.5377"
+     inkscape:cy="249.50397"
+     inkscape:window-x="766"
+     inkscape:window-y="271"
+     inkscape:window-maximized="0"
+     inkscape:current-layer="Layer_1"
+     inkscape:pagecheckerboard="true"
+     inkscape:document-rotation="0" />
+  <defs
+     id="defs4">
+    <style
+       id="style2">.cls-1{fill:#177f95;}.cls-2{fill:#fff;}.cls-3,.cls-4{fill:#305d74;stroke:#305d74;stroke-linecap:round;stroke-miterlimit:10;}.cls-3{stroke-width:11.28px;}.cls-4{stroke-width:30.86px;}</style>
+  </defs>
+  <title
+     id="title6">Artboard 153</title>
+  <rect
+     style="fill:#00294b;stroke-width:6.987;stroke-miterlimit:10;fill-opacity:1"
+     id="rect833"
+     width="579.83307"
+     height="554.9361"
+     x="-32.365406"
+     y="-23.750851" />
+  <polygon
+     class="cls-3"
+     points="389.25,409.19 340.72,360.35 437.77,360.35 "
+     id="polygon28"
+     transform="matrix(1.7950921,0,0,2.8439895,-448.72886,-847.64073)"
+     style="stroke:none;stroke-width:3.09231254;stroke-miterlimit:10;stroke-dasharray:none;stroke-opacity:1;fill:#ffffff;fill-opacity:1" />
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/organisation.svg b/org.argeo.app.theme.default/icons/types/svg/organisation.svg
new file mode 100644 (file)
index 0000000..767dc00
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:#305d74;}.cls-2{fill:#fff;}</style>
+  </defs>
+  <title>organisation</title>
+  <rect class="cls-1" height="303.21" width="176.99" x="256.65" y="129"/>
+  <rect class="cls-2" height="54.7" width="54.7" x="343.5" y="173.99"/>
+  <rect class="cls-2" height="54.7" width="54.7" x="343.5" y="259.2"/>
+  <rect class="cls-2" height="54.7" width="54.7" x="343.5" y="346.72"/>
+  <rect class="cls-1" height="393.49" width="266.78" x="50.22" y="63"/>
+  <rect class="cls-2" height="73.01" width="73.01" x="92.5" y="110.99"/>
+  <rect class="cls-2" height="73.01" width="73.01" x="207.14" y="111.03"/>
+  <rect class="cls-2" height="73.01" width="73.01" x="92.14" y="234.03"/>
+  <rect class="cls-2" height="73.01" width="73.01" x="211.12" y="234.02"/>
+  <rect class="cls-2" height="73.01" width="73.01" x="92.14" y="347.03"/>
+  <rect class="cls-2" height="73.01" width="73.01" x="213.14" y="344.03"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/organisationContact.svg b/org.argeo.app.theme.default/icons/types/svg/organisationContact.svg
new file mode 100644 (file)
index 0000000..67c9efd
--- /dev/null
@@ -0,0 +1 @@
+<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500"><defs><style>.cls-1{fill:#177f95;}.cls-2{fill:#fff;}</style></defs><title>organisationContact</title><circle class="cls-1" cx="246.5" cy="242.5" r="232.5"/><rect class="cls-2" x="270.45" y="132.45" width="138.48" height="237.24"/><rect class="cls-1" x="338.4" y="167.65" width="42.8" height="42.8"/><rect class="cls-1" x="338.4" y="234.32" width="42.8" height="42.8"/><rect class="cls-1" x="338.4" y="302.8" width="42.8" height="42.8"/><rect class="cls-2" x="108.93" y="80.81" width="208.74" height="307.88"/><rect class="cls-1" x="142.01" y="118.36" width="57.12" height="57.12"/><rect class="cls-1" x="231.71" y="118.38" width="57.12" height="57.12"/><rect class="cls-1" x="141.73" y="214.62" width="57.12" height="57.12"/><rect class="cls-1" x="234.82" y="214.62" width="57.12" height="57.12"/><rect class="cls-1" x="141.73" y="303.04" width="57.12" height="57.12"/><rect class="cls-1" x="236.4" y="300.69" width="57.12" height="57.12"/></svg>
\ No newline at end of file
diff --git a/org.argeo.app.theme.default/icons/types/svg/people.svg b/org.argeo.app.theme.default/icons/types/svg/people.svg
new file mode 100644 (file)
index 0000000..e28542f
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:#f3964d;}.cls-2,.cls-3{fill:#fff;}.cls-3{stroke:#f3964d;stroke-miterlimit:10;stroke-width:9px;}</style>
+  </defs>
+  <title>people</title>
+  <circle class="cls-1" cx="250.65" cy="245.31" r="236"/>
+  <path class="cls-2" d="M352,222l-4.19-15c18.42-8.77,31.57-30.88,31.57-57,0-33.75-21.89-61.12-48.9-61.12s-48.89,27.37-48.89,61.12c0,26.24,13.29,48.42,31.86,57.09L310,221.48c-34.32,9.63-55.39,43.33-64.15,86.83-4.91,24.44,175.24,33.18,169.25,0C407.74,267.68,386.07,232.62,352,222Z"/>
+  <path class="cls-2" d="M201.74,231.71l-4.19-15c18.42-8.76,31.57-30.87,31.57-57,0-33.75-21.89-61.12-48.9-61.12S131.33,126,131.33,159.76c0,26.23,13.29,48.42,31.86,57.09l-3.47,14.33c-34.32,9.62-55.4,43.33-64.15,86.83-4.91,24.44,175.24,33.18,169.25,0C257.49,277.38,235.82,242.32,201.74,231.71Z"/>
+  <path class="cls-3" d="M278.1,273.24l-5.05-18.09c22.24-10.58,38.12-37.29,38.12-68.81,0-40.77-26.44-73.82-59.05-73.82s-59.06,33.05-59.06,73.82c0,31.68,16.05,58.48,38.48,68.95l-4.18,17.31c-41.46,11.62-66.92,52.33-77.48,104.87-5.94,29.52,211.64,40.08,204.42,0C345.44,328.4,319.27,286.05,278.1,273.24Z"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/person.svg b/org.argeo.app.theme.default/icons/types/svg/person.svg
new file mode 100644 (file)
index 0000000..b29b335
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:#f3964d;}.cls-2{fill:#fff;}</style>
+  </defs>
+  <title>person</title>
+  <circle class="cls-1" cx="259" cy="249" r="235"/>
+  <path class="cls-2" d="M285.92,264.66l-5.24-18.73c23-11,39.49-38.63,39.49-71.27,0-42.23-27.39-76.46-61.17-76.46s-61.16,34.23-61.16,76.46c0,32.81,16.62,60.57,39.85,71.41L233.36,264C190.42,276,164.05,318.2,153.11,372.62c-6.15,30.57,219.21,41.51,211.72,0C355.66,321.79,328.55,277.93,285.92,264.66Z"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/project-01.svg b/org.argeo.app.theme.default/icons/types/svg/project-01.svg
new file mode 100644 (file)
index 0000000..c94ba9b
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:#fff;}.cls-2{fill:#35987a;}.cls-3,.cls-4,.cls-5,.cls-6{fill:none;}.cls-3,.cls-4{stroke:#35987a;stroke-linecap:round;stroke-width:49px;}.cls-3,.cls-5,.cls-6{stroke-miterlimit:10;}.cls-4{stroke-linejoin:round;}.cls-5,.cls-6{stroke:#000;}.cls-5{stroke-width:51px;}.cls-6{stroke-width:9px;}</style>
+  </defs>
+  <title>project-01</title>
+  <rect class="cls-1" height="382.19" rx="13.5" ry="13.5" width="317" x="67.5" y="56.34"/>
+  <path class="cls-2" d="M371,69.84V425H81V69.84H371m0-27H81a27,27,0,0,0-27,27V425a27,27,0,0,0,27,27H371a27,27,0,0,0,27-27V69.84a27,27,0,0,0-27-27Z"/>
+  <line class="cls-3" x1="132.5" x2="321.5" y1="132" y2="132"/>
+  <line class="cls-4" x1="132.5" x2="308.5" y1="248.5" y2="248.5"/>
+  <line class="cls-5" x1="309.73" x2="480.45" y1="337.71" y2="125.58"/>
+  <polygon class="cls-6" points="287.3 331.2 321.68 358.04 267.58 389.45 287.3 331.2"/>
+  <line class="cls-4" x1="128.5" x2="238.5" y1="360.5" y2="360.5"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/refresh.svg b/org.argeo.app.theme.default/icons/types/svg/refresh.svg
new file mode 100644 (file)
index 0000000..638fd55
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:none;stroke:#f58430;stroke-miterlimit:10;stroke-width:64px;}.cls-2{fill:#f58430;}</style>
+  </defs>
+  <title>refresh</title>
+  <path class="cls-1" d="M395,365.3A189.26,189.26,0,0,1,246,437.72c-101.78,0-184.83-80.18-189.42-180.83"/>
+  <polygon class="cls-2" points="299.56 353.88 435.57 248.1 459.2 418.78 299.56 353.88"/>
+  <path class="cls-1" d="M96.88,118.68A189.29,189.29,0,0,1,246,46.26c102,0,185.18,80.53,189.45,181.47"/>
+  <polygon class="cls-2" points="192.34 130.1 56.33 235.88 32.7 65.2 192.34 130.1"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/report.svg b/org.argeo.app.theme.default/icons/types/svg/report.svg
new file mode 100644 (file)
index 0000000..9321310
--- /dev/null
@@ -0,0 +1 @@
+<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500"><defs><style>.cls-1{fill:#177f95;}.cls-2{fill:#fff;}</style></defs><title>report</title><rect class="cls-1" x="52.5" y="43.18" width="400" height="371.64"/><rect class="cls-2" x="78.09" y="126.75" width="350" height="40"/><rect class="cls-2" x="78.09" y="198.02" width="350" height="40"/><rect class="cls-2" x="78.09" y="267.28" width="350" height="40"/><rect class="cls-2" x="78.09" y="338.55" width="350" height="40"/><rect class="cls-1" x="178.79" y="89.15" width="14.67" height="312.96"/><rect class="cls-1" x="311.49" y="88.17" width="14.67" height="312.96"/></svg>
\ No newline at end of file
diff --git a/org.argeo.app.theme.default/icons/types/svg/save.svg b/org.argeo.app.theme.default/icons/types/svg/save.svg
new file mode 100644 (file)
index 0000000..09660dd
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:#454545;}</style>
+  </defs>
+  <title>save</title>
+  <path class="cls-1" d="M21.12,19.33V479H480.77V121.64L370.45,19.33Zm316,143.84H165V48.6H337.08Zm-229.65,86H394.11V450.36H107.43Z"/>
+  <rect class="cls-1" height="57.88" transform="translate(440.03 211.23) rotate(-180)" width="57.88" x="191.08" y="76.68"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/saveAll.svg b/org.argeo.app.theme.default/icons/types/svg/saveAll.svg
new file mode 100644 (file)
index 0000000..3f2ebde
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1,.cls-2,.cls-3{fill:#454545;}.cls-2,.cls-3{stroke:#4f4d4e;}.cls-2,.cls-3,.cls-4,.cls-5{stroke-miterlimit:10;}.cls-2,.cls-4{stroke-width:30px;}.cls-3,.cls-5{stroke-width:40px;}.cls-4,.cls-5{fill:none;stroke:#7c7c7c;}</style>
+  </defs>
+  <title>saveAll</title>
+  <path class="cls-1" d="M170.19,125.05v338.3H508.48v-263l-81.19-75.31ZM402.73,230.92H276.06V146.6H402.73Zm-169,63.28h211V442.29h-211Z"/>
+  <rect class="cls-1" height="42.6" transform="translate(633.14 377.12) rotate(-180)" width="42.6" x="295.27" y="167.26"/>
+  <line class="cls-2" x1="376.88" x2="88.45" y1="70.98" y2="70.98"/>
+  <line class="cls-3" x1="108.19" x2="108.19" y1="68.98" y2="418.1"/>
+  <line class="cls-4" x1="321.63" x2="11.28" y1="2.33" y2="2.33"/>
+  <line class="cls-5" x1="29.79" x2="29.79" y1="1.33" y2="383.52"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/search.svg b/org.argeo.app.theme.default/icons/types/svg/search.svg
new file mode 100644 (file)
index 0000000..6fa30df
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:#231f20;stroke-width:31px;}.cls-1,.cls-2{stroke:#454545;stroke-miterlimit:10;}.cls-2{fill:none;stroke-linecap:round;stroke-width:60px;}</style>
+  </defs>
+  <title>search</title>
+  <path class="cls-1" d="M173,40.34A133.52,133.52,0,1,0,306.47,173.85,133.52,133.52,0,0,0,173,40.34Zm0,252.12a118.61,118.61,0,1,1,118.6-118.61A118.6,118.6,0,0,1,173,292.46Z"/>
+  <line class="cls-2" x1="269.72" x2="432.42" y1="279.01" y2="441.72"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/settings.svg b/org.argeo.app.theme.default/icons/types/svg/settings.svg
new file mode 100644 (file)
index 0000000..da3b784
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:#454545;stroke-linecap:round;stroke-linejoin:round;stroke-width:20px;}.cls-1,.cls-2{stroke:#454545;}.cls-2{fill:none;stroke-miterlimit:10;stroke-width:50px;}</style>
+  </defs>
+  <title>settings</title>
+  <g id="Plus">
+    <rect class="cls-1" height="44.41" width="43.85" x="228.54" y="59.66"/>
+    <rect class="cls-1" height="44.41" width="43.85" x="395.17" y="219.53"/>
+    <rect class="cls-1" height="44.41" width="43.85" x="228.54" y="397.17"/>
+    <rect class="cls-1" height="44.41" width="43.85" x="61.92" y="228.41"/>
+    <polygon class="cls-1" points="158.69 366.08 127.69 397.48 96.68 366.08 127.69 334.68 158.69 366.08"/>
+    <polygon class="cls-1" points="404.25 366.08 373.24 397.48 342.24 366.08 373.24 334.68 404.25 366.08"/>
+    <polygon class="cls-1" points="404.25 135.16 373.24 166.56 342.24 135.16 373.24 103.75 404.25 135.16"/>
+    <polygon class="cls-1" points="167.46 126.27 136.46 157.68 105.45 126.27 136.46 94.87 167.46 126.27"/>
+    <circle class="cls-2" cx="250.48" cy="250.61" r="126.5"/>
+  </g>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/tag.svg b/org.argeo.app.theme.default/icons/types/svg/tag.svg
new file mode 100644 (file)
index 0000000..4ce586d
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:none;stroke:#454545;stroke-linecap:round;stroke-miterlimit:10;stroke-width:44px;}</style>
+  </defs>
+  <title>tag</title>
+  <g id="Plus">
+    <line class="cls-1" x1="218.31" x2="183.35" y1="84.43" y2="401.51"/>
+    <line class="cls-1" x1="327.65" x2="292.69" y1="88.49" y2="405.57"/>
+    <line class="cls-1" x1="373.91" x2="134.88" y1="186" y2="186"/>
+    <line class="cls-1" x1="363.91" x2="124.88" y1="294" y2="294"/>
+  </g>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/task.svg b/org.argeo.app.theme.default/icons/types/svg/task.svg
new file mode 100644 (file)
index 0000000..09e81ed
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:#35987a;}.cls-2{fill:#fff;}.cls-3{fill:#007f00;stroke:#fff;stroke-linecap:round;stroke-miterlimit:10;stroke-width:50px;}</style>
+  </defs>
+  <title>task</title>
+  <rect class="cls-1" height="435.25" width="345.2" x="61" y="24.75"/>
+  <circle class="cls-2" cx="130" cy="133" r="24"/>
+  <line class="cls-3" x1="206" x2="335" y1="133" y2="133"/>
+  <line class="cls-3" x1="205" x2="334.67" y1="245" y2="244.93"/>
+  <line class="cls-3" x1="209" x2="334.67" y1="352" y2="352.24"/>
+  <circle class="cls-2" cx="130" cy="240" r="24"/>
+  <circle class="cls-2" cx="130" cy="352" r="24"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/task_1.svg b/org.argeo.app.theme.default/icons/types/svg/task_1.svg
new file mode 100644 (file)
index 0000000..246ea19
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:#fff;}.cls-2{fill:#177f95;}.cls-3{fill:none;stroke:#177f95;stroke-linecap:round;stroke-linejoin:round;stroke-width:40px;}</style>
+  </defs>
+  <title>task_1</title>
+  <g id="Plus">
+    <rect class="cls-1" height="381" width="302" x="79" y="69"/>
+    <path class="cls-2" d="M367,83V436H93V83H367m16-28H77A12,12,0,0,0,65,67V452a12,12,0,0,0,12,12H383a12,12,0,0,0,12-12V67a12,12,0,0,0-12-12Z"/>
+    <path class="cls-1" d="M126.11,97.5a14.06,14.06,0,0,1-5.61-1V42.22a14.24,14.24,0,0,1,5.61-1h49.61L177.5,34c2.8-11.29,24.39-23.47,54.39-23.47S283.47,22.68,286.27,34l1.79,7.21h45.83a14.24,14.24,0,0,1,5.61,1V96.46a14.06,14.06,0,0,1-5.61,1Z"/>
+    <path class="cls-2" d="M231.89,20c12.79,0,24.88,2.46,34.05,6.93,7.91,3.85,10.73,7.79,11.11,9.33l3.58,14.42H330V88H130V50.68h53.15l3.58-14.42c.38-1.54,3.19-5.48,11.11-9.33C207,22.46,219.1,20,231.89,20m0-19c-32.48,0-59.31,13.35-63.61,30.68H126.11c-8.31,0-15.11,3.77-15.11,8.37V98.63c0,4.6,6.8,8.37,15.11,8.37H333.89c8.31,0,15.11-3.77,15.11-8.37V40.05c0-4.6-6.8-8.37-15.11-8.37h-38.4C291.2,14.35,264.37,1,231.89,1Z"/>
+    <polyline class="cls-3" points="137.05 294.2 220.48 351.96 321.55 167.46"/>
+    <ellipse class="cls-2" cx="230" cy="46.5" rx="19.5" ry="16.5"/>
+  </g>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/telephone.svg b/org.argeo.app.theme.default/icons/types/svg/telephone.svg
new file mode 100644 (file)
index 0000000..b74bc81
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:#454545;}</style>
+  </defs>
+  <title>telephone</title>
+  <path class="cls-1" d="M394.07,312s-17.27-20.72-36.38-6.42c-14.24,10.65-39.84,34.34-46,40.08,0,0-42.79-22.81-68.11-43.64-37.51-30.84-62.59-68.92-75.73-90.58L158,192.93c3.42-3.68,29.63-31.74,41-47,14.27-19.1-6.42-36.36-6.42-36.36s-58.21-58.21-71.46-69.76S92.6,34.68,92.6,34.68c-27.89,18-56.78,33.68-58.5,109C34,214.2,87.57,286.92,145.44,343.22c58,63.6,137.61,127.32,214.55,127.25,75.31-1.69,91-30.6,109-58.49,0,0,6.44-15.25-5.12-28.51S394.07,312,394.07,312Z"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/timeLine.svg b/org.argeo.app.theme.default/icons/types/svg/timeLine.svg
new file mode 100644 (file)
index 0000000..45c5e7e
--- /dev/null
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1,.cls-2,.cls-4,.cls-6,.cls-8{fill:none;}.cls-1,.cls-7,.cls-8{stroke:#f3964d;}.cls-1,.cls-2,.cls-8{stroke-linecap:round;}.cls-1,.cls-2{stroke-linejoin:round;}.cls-1,.cls-7{stroke-width:20px;}.cls-2,.cls-4,.cls-6{stroke:#454545;}.cls-2,.cls-4{stroke-width:5px;}.cls-3{fill:#f3964d;}.cls-4,.cls-6,.cls-7,.cls-8{stroke-miterlimit:10;}.cls-5{fill:#6ac59a;}.cls-6{stroke-width:4px;}.cls-7{fill:#fff;}.cls-8{stroke-width:9px;}</style>
+  </defs>
+  <title>timeLine</title>
+  <g id="Plus">
+    <line class="cls-1" x1="55" x2="441" y1="422.36" y2="422.36"/>
+    <line class="cls-2" x1="62.5" x2="221.5" y1="216.34" y2="94.38"/>
+    <line class="cls-2" x1="221.5" x2="391.5" y1="94.86" y2="157.86"/>
+    <circle class="cls-3" cx="129" cy="166.36" r="20"/>
+    <circle class="cls-3" cx="222" cy="95.36" r="20"/>
+    <circle class="cls-3" cx="392" cy="158.36" r="20"/>
+    <line class="cls-4" x1="209" x2="55" y1="260.36" y2="382.36"/>
+    <line class="cls-1" x1="55" x2="55" y1="59.36" y2="422.36"/>
+    <circle class="cls-5" cx="116" cy="334.36" r="20"/>
+    <line class="cls-6" x1="209" x2="300" y1="260.36" y2="321.36"/>
+    <circle class="cls-5" cx="209" cy="260.36" r="20"/>
+    <line class="cls-4" x1="300" x2="407" y1="321.36" y2="246.36"/>
+    <circle class="cls-5" cx="300" cy="321.36" r="20"/>
+    <circle class="cls-5" cx="407" cy="246.36" r="20"/>
+    <circle class="cls-7" cx="417.83" cy="385.36" r="51"/>
+    <line class="cls-8" x1="417.83" x2="417.83" y1="387.36" y2="343.36"/>
+    <line class="cls-8" x1="417.33" x2="442.33" y1="387.86" y2="387.86"/>
+    <polyline class="cls-3" points="23.92 60.86 54.33 30.46 84.73 60.86"/>
+  </g>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/todo.svg b/org.argeo.app.theme.default/icons/types/svg/todo.svg
new file mode 100644 (file)
index 0000000..fa1652f
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" viewBox="0 0 500 500">
+  <defs>
+    <style>.cls-1{fill:#35987a;}.cls-2{fill:#6ac59a;stroke:#35987a;stroke-linecap:round;stroke-miterlimit:10;stroke-width:50px;}</style>
+  </defs>
+  <title>todo</title>
+  <path class="cls-1" d="M381,56.74V435H81V56.74H381m0-28H81a28,28,0,0,0-28,28V435a28,28,0,0,0,28,28H381a28,28,0,0,0,28-28V56.74a28,28,0,0,0-28-28Z"/>
+  <circle class="cls-1" cx="137" cy="147" r="23.5"/>
+  <path class="cls-1" d="M137,124a23,23,0,1,1-23,23,23,23,0,0,1,23-23m0-1a24,24,0,1,0,24,24,24,24,0,0,0-24-24Z"/>
+  <line class="cls-2" x1="206" x2="335" y1="147" y2="147"/>
+  <line class="cls-2" x1="205" x2="334.67" y1="259" y2="258.93"/>
+  <line class="cls-2" x1="209" x2="335" y1="366" y2="366"/>
+  <circle class="cls-1" cx="137" cy="254" r="23.5"/>
+  <path class="cls-1" d="M137,231a23,23,0,1,1-23,23,23,23,0,0,1,23-23m0-1a24,24,0,1,0,24,24,24,24,0,0,0-24-24Z"/>
+  <circle class="cls-1" cx="137" cy="366" r="23.5"/>
+  <path class="cls-1" d="M137,343a23,23,0,1,1-23,23,23,23,0,0,1,23-23m0-1a24,24,0,1,0,24,24,24,24,0,0,0-24-24Z"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/user.svg b/org.argeo.app.theme.default/icons/types/svg/user.svg
new file mode 100644 (file)
index 0000000..00997db
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:svg="http://www.w3.org/2000/svg" data-name="Layer 1" id="Layer_1" inkscape:version="0.92.2 5c3e80d, 2017-08-06" sodipodi:docname="user.svg" version="1.1" viewBox="0 0 500 500">
+  <metadata id="metadata15">
+    <rdf:RDF>
+      <cc:Work rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <sodipodi:namedview bordercolor="#666666" borderopacity="1" gridtolerance="10" guidetolerance="10" id="namedview13" inkscape:current-layer="Layer_1" inkscape:cx="250" inkscape:cy="250" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-height="774" inkscape:window-maximized="0" inkscape:window-width="1317" inkscape:window-x="0" inkscape:window-y="0" inkscape:zoom="0.472" objecttolerance="10" pagecolor="#ffffff" showgrid="false"/>
+  <defs id="defs4">
+    <style id="style2">.cls-1{fill:#177f95;}.cls-2{fill:#fff;}</style>
+  </defs>
+  <title id="title6">user</title>
+  <path d="M 244.5 21 A 228.5 228.5 0 0 0 16 249.5 A 228.5 228.5 0 0 0 244.5 478 A 228.5 228.5 0 0 0 473 249.5 A 228.5 228.5 0 0 0 244.5 21 z M 244.5293 102.86914 C 277.3793 102.86914 304 136.15094 304 177.21094 C 304 209.00094 288.00008 235.84977 265.58008 246.50977 L 270.66992 264.73047 C 312.12992 277.63047 338.49016 320.26922 347.41016 369.69922 C 354.68016 410.05922 135.53906 399.41922 141.53906 369.69922 C 152.14906 316.78922 177.77906 275.79008 219.53906 264.08008 L 223.75 246.65039 C 201.16 236.11039 185 209.12094 185 177.21094 C 185 136.15094 211.6793 102.86914 244.5293 102.86914 z " id="circle8" style="fill:#177f95;fill-opacity:1"/>
+</svg>
diff --git a/org.argeo.app.theme.default/icons/types/svg/users.svg b/org.argeo.app.theme.default/icons/types/svg/users.svg
new file mode 100644 (file)
index 0000000..bb0e00d
--- /dev/null
@@ -0,0 +1 @@
+<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 500 500"><defs><style>.cls-1{fill:#177f95;}.cls-2{fill:#fff;}</style></defs><title>users</title><path class="cls-1" d="M322.79,130.44a4.52,4.52,0,0,0-3.31-4.32L95.09,36.23H87.27c-5.8,0-7.82-.37-7.82,4.42V392c0,9.11,6.07,17.11,14.26,19.23L315,491.55h7.82Z"/><path class="cls-1" d="M346.47,119.76v334h50.75a22.13,22.13,0,0,0,22.1-22.1V231.31l.13-192.55a22.12,22.12,0,0,0-22.1-22.1H115.49L331.77,99.84A20.79,20.79,0,0,1,346.47,119.76Z"/><path class="cls-2" d="M222.47,282.62,217.4,263c17.56-3.41,29.08-24.9,27.41-56.25-2.15-40.55-25.42-81.87-52-92.29s-46.35,14-44.19,54.54c1.67,31.51,16.15,63.3,35,80.88l-2.49,15.87c-33.15-1.69-51.73,30.67-57.56,79.54-3.28,27.46,157.66,101.31,149.66,59.15C263.42,352.81,256.67,308.51,222.47,282.62Z"/></svg>
\ No newline at end of file
diff --git a/org.argeo.app.theme.default/rap/argeo.css b/org.argeo.app.theme.default/rap/argeo.css
new file mode 100644 (file)
index 0000000..0351d05
--- /dev/null
@@ -0,0 +1,151 @@
+.argeo-suite-header {
+       color: white;
+       background-color: #00294b;
+}
+
+.argeo-suite-headerTitle {
+       font: bold 24px sans-serif;
+       color: white;
+       background-color: #00294b;
+}
+
+.argeo-suite-leadPane {
+       background-color: #eee;
+}
+
+Label.argeo-suite-leadPane {
+       color: #888;
+       background-color: #eee;
+}
+
+Button.argeo-suite-leadPane:hover {
+       cursor:pointer;
+}
+
+.argeo-suite-recentItems {
+       font: bold 16px sans-serif;
+       color: white;
+       background-color: #00294b;
+       padding: 8px 16px;
+}
+
+.argeo-suite-titleContainer {
+       background-color: #00294b;
+       padding: 6px 8px 4px 8px;
+}
+
+.argeo-suite-titleLabel {
+       font: bold 16px sans-serif;
+       color: white;
+       background-color: #00294b;
+}
+
+.argeo-suite-subTitleLabel {
+       font: italic 16px sans-serif;
+       color: #777;
+       padding: 4px 8px;
+}
+
+.argeo-suite-simpleLabel {
+       font: bold 16px sans-serif;
+       padding: 0px;
+}
+
+.argeo-suite-simpleText {
+       font: 16px sans-serif;
+       padding: 0px;
+}
+
+.argeo-suite-titleCell {
+       font: bold 16px sans-serif;
+       background-color: #ddd;
+}
+
+.argeo-suite-inlineButton {
+       padding: 0px 4px;
+       font: 16px sans-serif;
+       border: 1px solid white;
+       color: white;
+       background-image: none;
+       background-color: #00294b;
+}
+
+.argeo-suite-inlineButton:hover {
+       color: #00294b;
+       background-color: white;
+}
+
+Composite.argeo-suite-mainTabBody {
+       background-color: #eee;
+       border: 1px solid #bbb;
+}
+
+.argeo-suite-mainTab {
+       background-color: #eee;
+       border: 1px solid #888;
+}
+
+ToolItem.argeo-suite-mainTab {
+       border: none;
+       background-color: #eee;
+}
+
+ToolItem.argeo-suite-mainTab:hover {
+       background-color: #eee;
+}
+
+
+Button.argeo-suite-mainTab {
+       border: 1px solid #eee;
+       background-color: #eee;
+}
+
+.argeo-suite-mainTab:hover {
+       background-color: #eee;
+}
+
+Button.argeo-suite-mainTab:hover {
+       cursor: pointer;
+       background-color: #eee;
+}
+
+.argeo-suite-mainTabSelected {
+       font: bold 16px sans-serif;
+       color: white;
+       /*background-color: #00294b;*/
+       background-color: #5882b5;
+       border:1px solid #888;
+}
+
+ToolItem.argeo-suite-mainTabSelected {
+       border: none;
+}
+
+ToolItem.argeo-suite-mainTabSelected:hover {
+       background-color: #5882b5;
+}
+
+Button.argeo-suite-mainTabSelected {
+       border: none;
+}
+
+.argeo-suite-navigationBar{
+       background-color:#ddd;
+}
+
+.argeo-suite-navigationTitle{
+       background-color:#ddd;
+       font:bold 16px sans-serif;
+}
+
+.argeo-suite-navigationButton{
+       color:#777;
+       background-color:#ddd;
+       font:bold 16px sans-serif;
+}
+
+.argeo-suite-navigationButton:hover{
+       cursor:pointer;
+       color:#ddd;
+       background-color:#777;
+}
diff --git a/org.argeo.app.theme.default/rap/defaults.css b/org.argeo.app.theme.default/rap/defaults.css
new file mode 100644 (file)
index 0000000..24b1f7c
--- /dev/null
@@ -0,0 +1,43 @@
+Display,
+Label,
+Text,
+Tree,
+Table,
+Button,
+TreeColumn,
+TableColumn,
+{
+       font: 16px sans-serif;
+}
+
+Sash {
+  border: 1px solid white;
+  background-image: none;
+  background-color: white;
+}
+
+Sash:hover {
+  border: 1px solid #5882b5;
+  background-color: #5882b5;
+}
+
+Tree-Cell {
+    padding: 3px 3px 0px;
+    spacing: 3px;
+}
+
+Table-Cell {
+    padding: 3px 3px 0px;
+    spacing: 5px;
+}
+
+Tree-RowOverlay:selected {
+       color:#fff;
+       background-color:#5882b5;
+}
+
+Table-RowOverlay:selected {
+       color:#fff;
+       background-color:#5882b5;
+}
+
diff --git a/org.argeo.app.theme.default/rap/work.css b/org.argeo.app.theme.default/rap/work.css
deleted file mode 100644 (file)
index c0aaeb1..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-.argeo-suite-header {
-       color: white;
-       background-color: #00294b;
-}
-
-.argeo-suite-headerTitle {
-       font: bold 18px sans-serif;
-       color: white;
-       background-color: #00294b;
-}
-
-.argeo-suite-leadPane {
-       background-color: #eee;
-}
-
-Label.argeo-suite-leadPane {
-       font: 14px sans-serif;
-       color: #888;
-       background-color: #eee;
-}
-
-Button.argeo-suite-leadPane:hover {
-       cursor:pointer;
-}
-
-.argeo-suite-recentItems {
-       font: bold 14px sans-serif;
-       color: white;
-       background-color: #00294b;
-       padding: 8px 16px;
-}
-
-.argeo-suite-titleContainer {
-       background-color: #00294b;
-       padding: 6px 8px 4px 8px;
-}
-
-.argeo-suite-titleLabel {
-       font: bold 14px sans-serif;
-       color: white;
-       background-color: #00294b;
-}
-
-.argeo-suite-subTitleLabel {
-       font: italic 14px sans-serif;
-       color: #777;
-       padding: 4px 8px;
-}
-
-.argeo-suite-simpleLabel {
-       font: bold 14px sans-serif;
-       padding: 0px;
-}
-
-.argeo-suite-simpleText {
-       font: 14px sans-serif;
-       padding: 0px;
-}
-
-.argeo-suite-titleCell {
-       font: bold 14px sans-serif;
-       background-color: #ddd;
-}
-
-.argeo-suite-inlineButton {
-       padding: 0px 4px;
-       font: 12px sans-serif;
-       border: 1px solid white;
-       color: white;
-       background-image: none;
-       background-color: #00294b;
-}
-
-.argeo-suite-inlineButton:hover {
-       color: #00294b;
-       background-color: white;
-}
-
-Composite.argeo-suite-mainTabBody {
-       background-color: #eee;
-       border: 1px solid #bbb;
-}
-
-.argeo-suite-mainTab {
-       background-color: #eee;
-       border: 1px solid #888;
-}
-
-ToolItem.argeo-suite-mainTab {
-       border: none;
-       background-color: #eee;
-}
-
-ToolItem.argeo-suite-mainTab:hover {
-       background-color: #eee;
-}
-
-
-Button.argeo-suite-mainTab {
-       border: 1px solid #eee;
-       background-color: #eee;
-}
-
-.argeo-suite-mainTab:hover {
-       background-color: #eee;
-}
-
-Button.argeo-suite-mainTab:hover {
-       cursor: pointer;
-       background-color: #eee;
-}
-
-.argeo-suite-mainTabSelected {
-       font: bold 14px sans-serif;
-       color: white;
-       /*background-color: #00294b;*/
-       background-color: #5882b5;
-       border:1px solid #888;
-}
-
-ToolItem.argeo-suite-mainTabSelected {
-       border: none;
-}
-
-ToolItem.argeo-suite-mainTabSelected:hover {
-       background-color: #5882b5;
-}
-
-Button.argeo-suite-mainTabSelected {
-       border: none;
-}
-
-Sash {
-  border: 1px solid white;
-  background-image: none;
-  background-color: white;
-}
-
-Sash:hover {
-  border: 1px solid #5882b5;
-  background-color: #5882b5;
-}
-
-TreeItem{
-       background-color:#fff;
-}
-
-Tree-RowOverlay:selected {
-       color:#fff;
-       background-color:#5882b5;
-}
-
-TableItem{
-       background-color:#fff;
-}
-
-Table-RowOverlay:selected {
-       color:#fff;
-       background-color:#5882b5;
-}
-
-.argeo-suite-navigationBar{
-       background-color:#ddd;
-}
-
-.argeo-suite-navigationTitle{
-       background-color:#ddd;
-       font:bold 14px sans-serif;
-}
-
-.argeo-suite-navigationButton{
-       color:#777;
-       background-color:#ddd;
-       font:bold 14px sans-serif;
-}
-
-.argeo-suite-navigationButton:hover{
-       cursor:pointer;
-       color:#ddd;
-       background-color:#777;
-}
diff --git a/org.argeo.app.ui.rap/.gitignore b/org.argeo.app.ui.rap/.gitignore
deleted file mode 100644 (file)
index 09e3bc9..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-/bin/
-/target/
diff --git a/org.argeo.app.ui.rap/.project b/org.argeo.app.ui.rap/.project
deleted file mode 100644 (file)
index 51bc8dd..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-       <name>org.argeo.app.ui.rap</name>
-       <comment></comment>
-       <projects>
-       </projects>
-       <buildSpec>
-               <buildCommand>
-                       <name>org.eclipse.pde.ManifestBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.SchemaBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.ds.core.builder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-       </buildSpec>
-       <natures>
-               <nature>org.eclipse.pde.PluginNature</nature>
-       </natures>
-</projectDescription>
diff --git a/org.argeo.app.ui.rap/META-INF/.gitignore b/org.argeo.app.ui.rap/META-INF/.gitignore
deleted file mode 100644 (file)
index 4854a41..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/MANIFEST.MF
diff --git a/org.argeo.app.ui.rap/OSGI-INF/cmsWebApp.xml b/org.argeo.app.ui.rap/OSGI-INF/cmsWebApp.xml
deleted file mode 100644 (file)
index 4f807c1..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init" deactivate="destroy" name="Argeo Suite Web App">
-   <implementation class="org.argeo.cms.web.CmsWebApp"/>
-   <property name="contextName" type="String" value="argeo"/>
-   <reference bind="setCmsApp" cardinality="1..1" interface="org.argeo.api.cms.CmsApp" name="CmsApp" policy="dynamic" target="(service.pid=argeo.suite.ui.app)" unbind="unsetCmsApp"/>
-   <reference bind="setEventAdmin" cardinality="1..1" interface="org.osgi.service.event.EventAdmin" name="EventAdmin" policy="static"/>
-</scr:component>
diff --git a/org.argeo.app.ui.rap/bnd.bnd b/org.argeo.app.ui.rap/bnd.bnd
deleted file mode 100644 (file)
index 140b5e0..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-Service-Component: OSGI-INF/cmsWebApp.xml
-
-Import-Package:\
-org.argeo.cms.web;resolution:=optional,\
-org.eclipse.rap.rwt.application;resolution:=optional,\
-*;resolution:=optional
diff --git a/org.argeo.app.ui.rap/build.properties b/org.argeo.app.ui.rap/build.properties
deleted file mode 100644 (file)
index 6210e84..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-output.. = bin/
-bin.includes = META-INF/,\
-               .,\
-               OSGI-INF/
-source.. = src/
diff --git a/org.argeo.app.ui.rap/src/.gitignore b/org.argeo.app.ui.rap/src/.gitignore
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/org.argeo.app.ui/.classpath b/org.argeo.app.ui/.classpath
deleted file mode 100644 (file)
index e801ebf..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/>
-       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
-       <classpathentry kind="src" path="src"/>
-       <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/org.argeo.app.ui/.gitignore b/org.argeo.app.ui/.gitignore
deleted file mode 100644 (file)
index 09e3bc9..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-/bin/
-/target/
diff --git a/org.argeo.app.ui/.project b/org.argeo.app.ui/.project
deleted file mode 100644 (file)
index a7893bd..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-       <name>org.argeo.app.ui</name>
-       <comment></comment>
-       <projects>
-       </projects>
-       <buildSpec>
-               <buildCommand>
-                       <name>org.eclipse.jdt.core.javabuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.ManifestBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.SchemaBuilder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-               <buildCommand>
-                       <name>org.eclipse.pde.ds.core.builder</name>
-                       <arguments>
-                       </arguments>
-               </buildCommand>
-       </buildSpec>
-       <natures>
-               <nature>org.eclipse.pde.PluginNature</nature>
-               <nature>org.eclipse.jdt.core.javanature</nature>
-       </natures>
-</projectDescription>
diff --git a/org.argeo.app.ui/META-INF/.gitignore b/org.argeo.app.ui/META-INF/.gitignore
deleted file mode 100644 (file)
index 4854a41..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/MANIFEST.MF
diff --git a/org.argeo.app.ui/OSGI-INF/adminLeadPane.xml b/org.argeo.app.ui/OSGI-INF/adminLeadPane.xml
deleted file mode 100644 (file)
index 0a2818a..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init" deactivate="destroy" immediate="false" name="Admin Lead Pane">
-   <implementation class="org.argeo.app.ui.DefaultLeadPane"/>
-   <service>
-      <provide interface="org.argeo.cms.ui.CmsUiProvider"/>
-   </service>
-   <properties entry="config/adminLeadPane.properties"/>
-   <property name="defaultLayers" type="String">argeo.suite.ui.termsLayer
-   </property>
-   <reference bind="addLayer" cardinality="1..n" interface="org.argeo.app.ui.SuiteLayer" name="SuiteLayer" policy="dynamic" unbind="removeLayer"/>
-</scr:component>
diff --git a/org.argeo.app.ui/OSGI-INF/cmsApp.xml b/org.argeo.app.ui/OSGI-INF/cmsApp.xml
deleted file mode 100644 (file)
index 20373ae..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init" deactivate="destroy" name="Argeo Suite App">
-   <implementation class="org.argeo.app.ui.SuiteApp"/>
-   <service>
-      <provide interface="org.argeo.api.cms.CmsApp"/>
-      <provide interface="org.osgi.service.event.EventHandler"/>
-   </service>
-   <properties entry="config/cmsApp.properties"/>
-   <reference bind="addUiProvider" cardinality="0..n" interface="org.argeo.cms.ui.CmsUiProvider" name="CmsUiProvider" policy="dynamic" unbind="removeUiProvider"/>
-   <reference bind="addTheme" cardinality="1..n" interface="org.argeo.api.cms.CmsTheme" name="CmsTheme" policy="dynamic" unbind="removeTheme"/>
-   <reference bind="setRepository" cardinality="1..1" interface="javax.jcr.Repository" name="Repository" policy="dynamic" target="(cn=ego)"/>
-   <reference bind="addLayer" cardinality="1..n" interface="org.argeo.app.ui.SuiteLayer" name="SuiteLayer" policy="dynamic" unbind="removeLayer"/>
-   <reference bind="setCmsUserManager" cardinality="1..1" interface="org.argeo.cms.CmsUserManager" name="CmsUserManager" policy="static"/>
-</scr:component>
diff --git a/org.argeo.app.ui/OSGI-INF/contentEntryArea.xml b/org.argeo.app.ui/OSGI-INF/contentEntryArea.xml
deleted file mode 100644 (file)
index ecc37c7..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
-   <implementation class="org.argeo.app.ui.library.ContentEntryArea"/>
-   <service>
-      <provide interface="org.argeo.cms.ui.CmsUiProvider"/>
-   </service>
-   <properties entry="config/contentEntryArea.properties"/>
-</scr:component>
diff --git a/org.argeo.app.ui/OSGI-INF/contentLayer.xml b/org.argeo.app.ui/OSGI-INF/contentLayer.xml
deleted file mode 100644 (file)
index 35c4c3a..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="Content Layer">
-   <implementation class="org.argeo.app.ui.DefaultEditionLayer"/>
-   <service>
-      <provide interface="org.argeo.app.ui.SuiteLayer"/>
-   </service>
-   <reference bind="setEntryArea" cardinality="1..1" interface="org.argeo.cms.ui.CmsUiProvider" name="CmsUiProvider" policy="dynamic" target="(service.pid=argeo.library.ui.contentEntryArea)"/>
-   <properties entry="config/contentLayer.properties"/>
-</scr:component>
diff --git a/org.argeo.app.ui/OSGI-INF/dashboard.xml b/org.argeo.app.ui/OSGI-INF/dashboard.xml
deleted file mode 100644 (file)
index 9ee5857..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="Default Dashboard">
-   <implementation class="org.argeo.app.ui.DefaultDashboard"/>
-   <service>
-      <provide interface="org.argeo.cms.ui.CmsUiProvider"/>
-   </service>
-   <properties entry="config/dashboard.properties"/>
-</scr:component>
diff --git a/org.argeo.app.ui/OSGI-INF/dashboardLayer.xml b/org.argeo.app.ui/OSGI-INF/dashboardLayer.xml
deleted file mode 100644 (file)
index 436a8e6..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="Dashboard Layer">
-   <implementation class="org.argeo.app.ui.DefaultEditionLayer"/>
-   <service>
-      <provide interface="org.argeo.app.ui.SuiteLayer"/>
-   </service>
-   <properties entry="config/dashboardLayer.properties"/>
-   <reference bind="setEntryArea" cardinality="1..1" interface="org.argeo.cms.ui.CmsUiProvider" name="CmsUiProvider" policy="dynamic" target="(service.pid=argeo.suite.ui.recentItems)"/>
-</scr:component>
diff --git a/org.argeo.app.ui/OSGI-INF/documentUiProvider.xml b/org.argeo.app.ui/OSGI-INF/documentUiProvider.xml
deleted file mode 100644 (file)
index 3711fd5..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
-   <implementation class="org.argeo.app.ui.publish.DocumentUiProvider"/>
-   <service>
-      <provide interface="org.argeo.cms.ui.CmsUiProvider"/>
-   </service>
-   <properties entry="config/documentUiProvider.properties"/>
-</scr:component>
diff --git a/org.argeo.app.ui/OSGI-INF/documentsFolder.xml b/org.argeo.app.ui/OSGI-INF/documentsFolder.xml
deleted file mode 100644 (file)
index fef4582..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="Documents Folder">
-   <implementation class="org.argeo.app.ui.library.DocumentsFolderUiProvider"/>
-   <service>
-      <provide interface="org.argeo.cms.ui.CmsUiProvider"/>
-   </service>
-   <properties entry="config/documentsFolder.properties"/>
-   <reference bind="setNodeFileSystemProvider" cardinality="1..1" interface="java.nio.file.spi.FileSystemProvider" name="FileSystemProvider" policy="dynamic" target="(service.pid=org.argeo.api.fsProvider)"/>
-</scr:component>
diff --git a/org.argeo.app.ui/OSGI-INF/eventRecorder.xml b/org.argeo.app.ui/OSGI-INF/eventRecorder.xml
deleted file mode 100644 (file)
index ab1a6ae..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init" deactivate="destroy" name="Event Recorder">
-   <implementation class="org.argeo.app.ui.EventRecorder"/>
-   <service>
-      <provide interface="org.osgi.service.event.EventHandler"/>
-   </service>
-   <properties entry="config/eventRecorder.properties"/>
-</scr:component>
diff --git a/org.argeo.app.ui/OSGI-INF/footer.xml b/org.argeo.app.ui/OSGI-INF/footer.xml
deleted file mode 100644 (file)
index 5e9a857..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init" deactivate="destroy" immediate="false" name="Default Suite Footer">
-   <implementation class="org.argeo.app.ui.DefaultFooter"/>
-   <service>
-      <provide interface="org.argeo.cms.ui.CmsUiProvider"/>
-   </service>
-   <properties entry="config/footer.properties"/>
-</scr:component>
diff --git a/org.argeo.app.ui/OSGI-INF/fsEntryArea.xml b/org.argeo.app.ui/OSGI-INF/fsEntryArea.xml
deleted file mode 100644 (file)
index e7190db..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
-   <implementation class="org.argeo.app.ui.library.DocumentsTreeUiProvider"/>
-   <service>
-      <provide interface="org.argeo.cms.ui.CmsUiProvider"/>
-   </service>
-   <properties entry="config/contentEntryArea.properties"/>
-   <reference bind="setNodeFileSystemProvider" cardinality="1..1" interface="java.nio.file.spi.FileSystemProvider" name="FileSystemProvider" policy="dynamic" target="(service.pid=org.argeo.api.fsProvider)"/>
-   <reference bind="setRepository" cardinality="1..1" interface="javax.jcr.Repository" name="Repository" policy="static" target="(cn=ego)"/>
-</scr:component>
diff --git a/org.argeo.app.ui/OSGI-INF/header.xml b/org.argeo.app.ui/OSGI-INF/header.xml
deleted file mode 100644 (file)
index 0c83dc6..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init" deactivate="destroy" immediate="false" name="Default Suite Header">
-   <implementation class="org.argeo.app.ui.DefaultHeader"/>
-   <service>
-      <provide interface="org.argeo.cms.ui.CmsUiProvider"/>
-   </service>
-   <properties entry="config/header.properties"/>
-</scr:component>
diff --git a/org.argeo.app.ui/OSGI-INF/l10n/bundle.properties b/org.argeo.app.ui/OSGI-INF/l10n/bundle.properties
deleted file mode 100644 (file)
index 8b76a47..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-dashboard=dashboard
-#people=contacts
-documents=documents
-locations=locations
-recentItems=recent items
-
-appTitle=Argeo Suite
-
-#
-# PEOPLE
-# org.argeo.people.ui.PeopleMsg
-#
-person=Person
-organisation=Organisation
-
-# NewPersonWizard
-firstName=First Name
-lastName=Last Name
-salutation=Salutation
-email=Email
-personWizardWindowTitle=New person
-personWizardPageTitle=Create a contact
-
-# NewOrgWizard
-legalName=Legal name
-legalForm=Legal form
-vatId=VAT ID
-orgWizardWindowTitle=New organisation
-orgWizardPageTitle=Create an organisation
-
-
-# ContextAddressComposite
-chooseAnOrganisation=Choose an organisation
-street=Street
-streetComplement=Street complement
-zipCode=Zip code
-city=City
-state=State
-country=Country
-geopoint=Geopoint
-
-# FilteredOrderableEntityTable
-filterHelp=Type filter criterion separated by a space
-
-# BankAccountComposite
-accountHolder=Account holder
-bankName=Bank name
-currency=Currency
-accountNumber=Account number
-bankNumber=Bank number
-BIC=BIC
-IBAN=IBAN
-
-# EditJobDialog
-position=Role
-chosenItem=Chose item
-department=Department
-isPrimary=Is primary
-searchAndChooseEntity=Search and choose a corresponding entity
-
-# ContactListCTab (e4)
-notes=Notes
-addAContact=Add a contact
-contactValue=Contact value
-linkedCompany=Linked company
-
-# OrgAdminInfoCTab (e4)
-paymentAccount=Payment account
-
-# OrgEditor (e4)
-orgDetails=Details
-orgActivityLog=Activity log
-team=Team
-orgAdmin=Admin.
-
-# PersonEditor (e4)
-personDetails=Contact details
-personActivityLog=Activity log
-personOrgs=Organisations
-personSecurity=Security
-
-# PersonSecurityCTab (e4)
-resetPassword=Reset password
-
-# Generic
-label=Label
-aCustomLabel=A custom label
-description=Description
-value=Value
-name=Name
-primary=Primary
-add=Add
-save=Save
-pickUp=Pick up
-
-# Tags
-confirmNewTag=Tag #{0} is not yet registered. Are you sure you want to create it?
-cannotCreateTag=Tag #{0} is not yet registered and you don't have enough rights to create it.
-
-# People
-people=people
-
-# Library
-content=content
-
-# Geo
-map=map
-
diff --git a/org.argeo.app.ui/OSGI-INF/l10n/bundle_de.properties b/org.argeo.app.ui/OSGI-INF/l10n/bundle_de.properties
deleted file mode 100644 (file)
index 0af19c2..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-dashboard=dashboard
-people=Kontakte
-documents=Dokumente
-locations=Orte
-recentItems=neulich
-
-appTitle=Argeo Suite
-
-#
-# PEOPLE
-# org.argeo.people.ui.PeopleMsg
-#
-person=Person
-organisation=Organisation
-
-# NewPersonWizard
-firstName=Vorname
-lastName=Nachname
-salutation=Salutation
-email=E-Mail
-personWizardWindowTitle=Neue Person
-personWizardPageTitle=Kontakt erstellen
-
-# NewOrgWizard
-legalName=Name
-legalForm=Geschäftsform
-vatId=Ust ID
-orgWizardWindowTitle=Neue Organisation
-orgWizardPageTitle=Organisation erstellen
-
-
-# ContextAddressComposite
-chooseAnOrganisation=Organisation wählen
-street=Strasse
-streetComplement=Strasse Zusatz
-zipCode=PLZ
-city=Stadt
-state=Bundesland
-country=Land
-geopoint=Geopoint
-
-# FilteredOrderableEntityTable
-filterHelp=Type filter criterion separated by a space
-
-# BankAccountComposite
-accountHolder=Kontoinhaber 
-bankName=Name der Bank
-currency=Währung
-accountNumber=Kontonummer
-bankNumber=BLZ
-BIC=BIC
-IBAN=IBAN
-
-# EditJobDialog
-position=Rolle
-chosenItem=Auswahl
-department=Abteilung
-isPrimary=Ist Primär
-searchAndChooseEntity=Suche und wähle ein zugehöriges Objekt
-
-# ContactListCTab (e4)
-notes=Bemerkungen
-addAContact=Kontakt hinzufügen
-contactValue=Kontakt value
-linkedCompany=zugehörige Firma
-
-# OrgAdminInfoCTab (e4)
-paymentAccount=Geschäftskonto
-
-# OrgEditor (e4)
-orgDetails=Details
-orgActivityLog=Aktivitäten Log
-team=Team
-orgAdmin=Admin.
-
-# PersonEditor (e4)
-personDetails=Kontakt Daten
-personActivityLog=Aktivitäten Log
-personOrgs=Organisationen
-personSecurity=Sicherheit
-
-# PersonSecurityCTab (e4)
-resetPassword=Passwort zurücksetzen
-
-# Generic
-label=Beschriftung
-aCustomLabel=Eine spezifische Beschriftung
-description=Beschreibung
-value=Wert
-name=Name
-primary=Haupt-
-add=Hinzufügen
-save=Speichern
-pickUp=Aussuchen
-
-# Tags
-confirmNewTag=Das Hashtag '{0}' existiert noch nicht. WollenSie es hinzufügen?
-cannotCreateTag=Das Hashtag '{0}' existiert nicht uns Sie haben nicht die Rechte, um es hinzufügen.
diff --git a/org.argeo.app.ui/OSGI-INF/l10n/bundle_fr.properties b/org.argeo.app.ui/OSGI-INF/l10n/bundle_fr.properties
deleted file mode 100644 (file)
index 225e5fd..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-dashboard=dashboard
-people=contacts
-documents=documents
-locations=lieux
-recentItems=récent
-
-appTitle=Argeo Suite
-
-#
-# GENERIC
-#
-
-#
-# PEOPLE
-# org.argeo.people.ui.PeopleMsg
-#
-person=Personne
-organisation=Organisation
-
-# NewPersonWizard
-firstName=Prénom
-lastName=Nom
-salutation=Salutation
-email=Email
-personWizardWindowTitle=Nouvelle personne
-personWizardPageTitle=Créer un contact
-
-# NewOrgWizard
-legalName=Nom
-legalForm=Forme légale
-vatId=ID TVA
-orgWizardWindowTitle=Nouvelle organisation
-orgWizardPageTitle=Créer une organisation
-
-
-# ContextAddressComposite
-chooseAnOrganisation=Choisir une organisation
-street=Rue
-streetComplement=Complément rue
-zipCode=Code postal
-city=Ville
-state=État
-country=Pays
-geopoint=Géocoordonnées
-
-# FilteredOrderableEntityTable
-filterHelp=Sasir les critères de filtrage séparés par des espaces 
-
-# BankAccountComposite
-accountHolder=Propriétaire du compte
-bankName=Nom de la banque
-currency=Devise
-accountNumber=Numéro de compte
-bankNumber=Numéro de banque
-BIC=BIC
-IBAN=IBAN
-
-# EditJobDialog
-position=Rôle
-chosenItem=Choisir une Ã©lément
-department=Service
-isPrimary=Principal
-searchAndChooseEntity=Cherhcer et choisir l'entitée correspondante
-
-# ContactListCTab (e4)
-notes=Notes
-addAContact=Ajouter un contact
-contactValue=Valeur
-linkedCompany=Entreprise liée
-
-# OrgAdminInfoCTab (e4)
-paymentAccount=Compte de paiement
-
-# OrgEditor (e4)
-orgDetails=Détails
-orgActivityLog=Activités
-team=Équipe
-orgAdmin=Admin.
-
-# PersonEditor (e4)
-personDetails=Détails du contact
-personActivityLog=Activités
-personOrgs=Organisations
-personSecurity=Accès
-
-# PersonSecurityCTab (e4)
-resetPassword=Force le mot de passe
-
-# Generic
-label=Étiquette
-aCustomLabel=Une Ã©tiquette spécifique
-description=Description
-value=Valeur
-name=Nom
-primary=Principal
-add=Ajouter
-save=Sauver
-pickUp=Choisir
-
-# Tags
-confirmNewTag=Le tag #{0} n'existe pas encore. Voulez-vous le créer?
-cannotCreateTag=Le tag #{0} n'existe pas encore et vous n'avez pas les droits pour le créer.
diff --git a/org.argeo.app.ui/OSGI-INF/leadPane.xml b/org.argeo.app.ui/OSGI-INF/leadPane.xml
deleted file mode 100644 (file)
index c2c2104..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init" deactivate="destroy" immediate="false" name="Default Lead Pane">
-   <implementation class="org.argeo.app.ui.DefaultLeadPane"/>
-   <service>
-      <provide interface="org.argeo.cms.ui.CmsUiProvider"/>
-   </service>
-   <properties entry="config/leadPane.properties"/>
-   <property name="defaultLayers" type="String">argeo.suite.ui.dashboardLayer
-argeo.library.ui.contentLayer
-argeo.people.ui.peopleLayer
-argeo.geo.ui.mapLayer
-   </property>
-   <reference bind="addLayer" cardinality="1..n" interface="org.argeo.app.ui.SuiteLayer" name="SuiteLayer" policy="dynamic" unbind="removeLayer"/>
-</scr:component>
diff --git a/org.argeo.app.ui/OSGI-INF/loginScreen.xml b/org.argeo.app.ui/OSGI-INF/loginScreen.xml
deleted file mode 100644 (file)
index f79396f..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="Default Login Screen">
-   <implementation class="org.argeo.app.ui.DefaultLoginScreen"/>
-   <properties entry="config/loginScreen.properties"/>
-   <service>
-      <provide interface="org.argeo.cms.ui.CmsUiProvider"/>
-   </service>
-   <reference bind="setCmsContext" cardinality="1..1" interface="org.argeo.api.cms.CmsContext" name="CmsContext" policy="static"/>
-</scr:component>
diff --git a/org.argeo.app.ui/OSGI-INF/mapLayer.xml b/org.argeo.app.ui/OSGI-INF/mapLayer.xml
deleted file mode 100644 (file)
index f90cd78..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init" deactivate="destroy" name="Map Layer">
-   <implementation class="org.argeo.app.ui.DefaultEditionLayer"/>
-   <properties entry="config/mapLayer.properties"/>
-   <service>
-      <provide interface="org.argeo.app.ui.SuiteLayer"/>
-   </service>
-   <reference bind="setWorkArea" cardinality="1..1" interface="org.argeo.cms.ui.CmsUiProvider" name="CmsUiProvider" policy="dynamic" target="(service.pid=argeo.geo.ui.overviewMap)"/>
-</scr:component>
diff --git a/org.argeo.app.ui/OSGI-INF/overviewMap.xml b/org.argeo.app.ui/OSGI-INF/overviewMap.xml
deleted file mode 100644 (file)
index 662cbe8..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
-   <implementation class="org.argeo.app.ui.openlayers.OverviewMap"/>
-   <properties entry="config/overviewMap.properties"/>
-   <service>
-      <provide interface="org.argeo.cms.ui.CmsUiProvider"/>
-   </service>
-</scr:component>
diff --git a/org.argeo.app.ui/OSGI-INF/peopleEntryArea.xml b/org.argeo.app.ui/OSGI-INF/peopleEntryArea.xml
deleted file mode 100644 (file)
index c68a753..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
-   <implementation class="org.argeo.app.ui.people.PeopleEntryArea"/>
-   <service>
-      <provide interface="org.argeo.cms.ui.CmsUiProvider"/>
-   </service>
-   <properties entry="config/peopleEntryArea.properties"/>
-   <reference bind="setCmsUserManager" cardinality="1..1" interface="org.argeo.cms.CmsUserManager" name="CmsUserManager" policy="static"/>
-</scr:component>
diff --git a/org.argeo.app.ui/OSGI-INF/peopleLayer.xml b/org.argeo.app.ui/OSGI-INF/peopleLayer.xml
deleted file mode 100644 (file)
index 159da12..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init" deactivate="destroy" name="People Layer">
-   <implementation class="org.argeo.app.ui.DefaultEditionLayer"/>
-   <properties entry="config/peopleLayer.properties"/>
-   <service>
-      <provide interface="org.argeo.app.ui.SuiteLayer"/>
-   </service>
-   <reference bind="setEntryArea" cardinality="1..1" interface="org.argeo.cms.ui.CmsUiProvider" name="CmsUiProvider" policy="dynamic" target="(service.pid=argeo.people.ui.peopleEntryArea)"/>
-</scr:component>
diff --git a/org.argeo.app.ui/OSGI-INF/personUiProvider.xml b/org.argeo.app.ui/OSGI-INF/personUiProvider.xml
deleted file mode 100644 (file)
index 4bcfef1..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init">
-   <implementation class="org.argeo.app.ui.people.PersonUiProvider"/>
-   <service>
-      <provide interface="org.argeo.cms.ui.CmsUiProvider"/>
-   </service>
-   <properties entry="config/personUiProvider.properties"/>
-   <property name="availableRoles" type="String">
-   </property>
-   <reference bind="setCmsUserManager" cardinality="1..1" interface="org.argeo.cms.CmsUserManager" name="CmsUserManager" policy="static"/>
-</scr:component>
diff --git a/org.argeo.app.ui/OSGI-INF/recentItems.xml b/org.argeo.app.ui/OSGI-INF/recentItems.xml
deleted file mode 100644 (file)
index 21c23e3..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init" name="Default Recent Items">
-   <implementation class="org.argeo.app.ui.RecentItems"/>
-   <service>
-      <provide interface="org.argeo.cms.ui.CmsUiProvider"/>
-   </service>
-   <properties entry="config/recentItems.properties"/>
-</scr:component>
diff --git a/org.argeo.app.ui/OSGI-INF/termsEntryArea.xml b/org.argeo.app.ui/OSGI-INF/termsEntryArea.xml
deleted file mode 100644 (file)
index 0435f69..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="Terms Entry Area">
-   <implementation class="org.argeo.app.ui.TermsEntryArea"/>
-   <service>
-      <provide interface="org.argeo.cms.ui.CmsUiProvider"/>
-   </service>
-   <properties entry="config/termsEntryArea.properties"/>
-</scr:component>
diff --git a/org.argeo.app.ui/OSGI-INF/termsLayer.xml b/org.argeo.app.ui/OSGI-INF/termsLayer.xml
deleted file mode 100644 (file)
index 9483e05..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="Terms Layer">
-   <implementation class="org.argeo.app.ui.DefaultEditionLayer"/>
-   <service>
-      <provide interface="org.argeo.app.ui.SuiteLayer"/>
-   </service>
-   <properties entry="config/termsLayer.properties"/>
-   <reference bind="setEntryArea" cardinality="1..1" interface="org.argeo.cms.ui.CmsUiProvider" name="CmsUiProvider" policy="dynamic" target="(service.pid=argeo.suite.ui.termsEntryArea)"/>
-</scr:component>
diff --git a/org.argeo.app.ui/OSGI-INF/wwwLayer.xml b/org.argeo.app.ui/OSGI-INF/wwwLayer.xml
deleted file mode 100644 (file)
index 0fc0edb..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init" deactivate="destroy">
-   <implementation class="org.argeo.app.ui.DefaultEditionLayer"/>
-   <properties entry="config/wwwLayer.properties"/>
-   <service>
-      <provide interface="org.argeo.app.ui.SuiteLayer"/>
-   </service>
-   <reference bind="setWorkArea" cardinality="1..1" interface="org.argeo.cms.ui.CmsUiProvider" name="CmsUiProvider" policy="dynamic" target="(service.pid=argeo.publishing.ui.documentUiProvider)"/>
-</scr:component>
diff --git a/org.argeo.app.ui/bnd.bnd b/org.argeo.app.ui/bnd.bnd
deleted file mode 100644 (file)
index e36f705..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-Service-Component:\
-OSGI-INF/cmsApp.xml,\
-OSGI-INF/eventRecorder.xml,\
-OSGI-INF/header.xml,\
-OSGI-INF/footer.xml,\
-OSGI-INF/leadPane.xml,\
-OSGI-INF/loginScreen.xml,\
-OSGI-INF/recentItems.xml,\
-OSGI-INF/adminLeadPane.xml,\
-OSGI-INF/termsEntryArea.xml,\
-OSGI-INF/termsLayer.xml,\
-OSGI-INF/dashboard.xml,\
-OSGI-INF/dashboardLayer.xml,\
-OSGI-INF/peopleEntryArea.xml,\
-OSGI-INF/peopleLayer.xml,\
-OSGI-INF/personUiProvider.xml,\
-OSGI-INF/contentEntryArea.xml,\
-OSGI-INF/contentLayer.xml,\
-OSGI-INF/documentsFolder.xml,\
-OSGI-INF/fsEntryArea.xml,\
-OSGI-INF/mapLayer.xml,\
-OSGI-INF/overviewMap.xml,\
-OSGI-INF/wwwLayer.xml,\
-OSGI-INF/documentUiProvider.xml,\
-
-
-
-Import-Package:\
-org.argeo.cms.ui.widgets,\
-org.eclipse.swt,\
-org.osgi.framework,\
-org.eclipse.core.commands.common,\
-org.eclipse.jface.window,\
-org.eclipse.jface.dialogs,\
-org.eclipse.rap.rwt,\
-javax.servlet.*;version="[3,5)",\
-*
diff --git a/org.argeo.app.ui/build.properties b/org.argeo.app.ui/build.properties
deleted file mode 100644 (file)
index d829967..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-output.. = bin/
-bin.includes = META-INF/,\
-               .,\
-               OSGI-INF/,\
-               config/,\
-               OSGI-INF/loginScreen.xml,\
-               OSGI-INF/dashboard.xml,\
-               OSGI-INF/recentItems.xml,\
-               OSGI-INF/dashboardLayer.xml
-source.. = src/
diff --git a/org.argeo.app.ui/config/adminLeadPane.properties b/org.argeo.app.ui/config/adminLeadPane.properties
deleted file mode 100644 (file)
index 90b9b04..0000000
+++ /dev/null
@@ -1 +0,0 @@
-service.pid=argeo.suite.ui.adminLeadPane
diff --git a/org.argeo.app.ui/config/cmsApp.properties b/org.argeo.app.ui/config/cmsApp.properties
deleted file mode 100644 (file)
index 1dec00e..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-service.pid=argeo.suite.ui.app
-
-event.topics=argeo/suite/*
\ No newline at end of file
diff --git a/org.argeo.app.ui/config/contentEntryArea.properties b/org.argeo.app.ui/config/contentEntryArea.properties
deleted file mode 100644 (file)
index 855fe97..0000000
+++ /dev/null
@@ -1 +0,0 @@
-service.pid=argeo.library.ui.contentEntryArea
diff --git a/org.argeo.app.ui/config/contentLayer.properties b/org.argeo.app.ui/config/contentLayer.properties
deleted file mode 100644 (file)
index c1ca8e3..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-service.pid=argeo.library.ui.contentLayer
-
-title=%content
-icon=documents
-
-entity.type=nt:folder,nt:file,entity:space,entity:document
diff --git a/org.argeo.app.ui/config/dashboard.properties b/org.argeo.app.ui/config/dashboard.properties
deleted file mode 100644 (file)
index 1832543..0000000
+++ /dev/null
@@ -1 +0,0 @@
-service.pid=argeo.suite.ui.dashboard
diff --git a/org.argeo.app.ui/config/dashboardLayer.properties b/org.argeo.app.ui/config/dashboardLayer.properties
deleted file mode 100644 (file)
index 79abe4c..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-service.pid=argeo.suite.ui.dashboardLayer
-
-title=Dashboard
-icon=dashboard
\ No newline at end of file
diff --git a/org.argeo.app.ui/config/documentUiProvider.properties b/org.argeo.app.ui/config/documentUiProvider.properties
deleted file mode 100644 (file)
index 855735d..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-service.pid=argeo.publishing.ui.documentUiProvider
-
-entity.type=entity:document,nt:file
\ No newline at end of file
diff --git a/org.argeo.app.ui/config/documentsFolder.properties b/org.argeo.app.ui/config/documentsFolder.properties
deleted file mode 100644 (file)
index 349e930..0000000
+++ /dev/null
@@ -1 +0,0 @@
-entity.type=nt:folder
\ No newline at end of file
diff --git a/org.argeo.app.ui/config/eventRecorder.properties b/org.argeo.app.ui/config/eventRecorder.properties
deleted file mode 100644 (file)
index 6503863..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-service.pid=argeo.suite.ui.eventRecorder
-
-event.topics=argeo/suite/*
\ No newline at end of file
diff --git a/org.argeo.app.ui/config/footer.properties b/org.argeo.app.ui/config/footer.properties
deleted file mode 100644 (file)
index 12aca56..0000000
+++ /dev/null
@@ -1 +0,0 @@
-service.pid=argeo.suite.ui.footer
diff --git a/org.argeo.app.ui/config/fsEntryArea.properties b/org.argeo.app.ui/config/fsEntryArea.properties
deleted file mode 100644 (file)
index 0bceaf0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-service.pid=argeo.library.ui.fsEntryArea
diff --git a/org.argeo.app.ui/config/header.properties b/org.argeo.app.ui/config/header.properties
deleted file mode 100644 (file)
index 034d5f5..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-service.pid=argeo.suite.ui.header
-argeo.suite.ui=true
-
-argeo.suite.ui.header.title=%appTitle
\ No newline at end of file
diff --git a/org.argeo.app.ui/config/leadPane.properties b/org.argeo.app.ui/config/leadPane.properties
deleted file mode 100644 (file)
index 0d7b193..0000000
+++ /dev/null
@@ -1 +0,0 @@
-service.pid=argeo.suite.ui.leadPane
diff --git a/org.argeo.app.ui/config/loginScreen.properties b/org.argeo.app.ui/config/loginScreen.properties
deleted file mode 100644 (file)
index 332614d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-service.pid=argeo.suite.ui.loginScreen
diff --git a/org.argeo.app.ui/config/mapLayer.properties b/org.argeo.app.ui/config/mapLayer.properties
deleted file mode 100644 (file)
index 37bf3c7..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-service.pid=argeo.geo.ui.mapLayer
-
-title=%map
-icon=map
-
-entity.type=entity:geopoint
diff --git a/org.argeo.app.ui/config/overviewMap.properties b/org.argeo.app.ui/config/overviewMap.properties
deleted file mode 100644 (file)
index d842c98..0000000
+++ /dev/null
@@ -1 +0,0 @@
-service.pid=argeo.geo.ui.overviewMap
diff --git a/org.argeo.app.ui/config/peopleEntryArea.properties b/org.argeo.app.ui/config/peopleEntryArea.properties
deleted file mode 100644 (file)
index 37b28f9..0000000
+++ /dev/null
@@ -1 +0,0 @@
-service.pid=argeo.people.ui.peopleEntryArea
diff --git a/org.argeo.app.ui/config/peopleLayer.properties b/org.argeo.app.ui/config/peopleLayer.properties
deleted file mode 100644 (file)
index adadb7b..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-service.pid=argeo.people.ui.peopleLayer
-
-icon=people
-weights=5000,5000
-title=%people
-
-entity.type=entity:person
\ No newline at end of file
diff --git a/org.argeo.app.ui/config/personUiProvider.properties b/org.argeo.app.ui/config/personUiProvider.properties
deleted file mode 100644 (file)
index 8c40c7d..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-service.pid=argeo.people.ui.personUiProvider
-
-entity.type=entity:person
\ No newline at end of file
diff --git a/org.argeo.app.ui/config/recentItems.properties b/org.argeo.app.ui/config/recentItems.properties
deleted file mode 100644 (file)
index 7321c55..0000000
+++ /dev/null
@@ -1 +0,0 @@
-service.pid=argeo.suite.ui.recentItems
diff --git a/org.argeo.app.ui/config/termsEntryArea.properties b/org.argeo.app.ui/config/termsEntryArea.properties
deleted file mode 100644 (file)
index cd31517..0000000
+++ /dev/null
@@ -1 +0,0 @@
-service.pid=argeo.suite.ui.termsEntryArea
diff --git a/org.argeo.app.ui/config/termsLayer.properties b/org.argeo.app.ui/config/termsLayer.properties
deleted file mode 100644 (file)
index 2c0532e..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-service.pid=argeo.suite.ui.termsLayer
-title=Terms
-icon=dashboard
-
-entity.type=entity:terms,entity:term
\ No newline at end of file
diff --git a/org.argeo.app.ui/config/wwwLayer.properties b/org.argeo.app.ui/config/wwwLayer.properties
deleted file mode 100644 (file)
index d29fa5b..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-service.pid=argeo.publishing.ui.wwwLayer
-
-title=Web
-icon=map
\ No newline at end of file
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/DefaultDashboard.java b/org.argeo.app.ui/src/org/argeo/app/ui/DefaultDashboard.java
deleted file mode 100644 (file)
index 50fbed6..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-package org.argeo.app.ui;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-
-import org.argeo.api.cms.CmsView;
-import org.argeo.cms.auth.CurrentUser;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.ui.CmsUiProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-
-/** Provides a dashboard. */
-public class DefaultDashboard implements CmsUiProvider {
-
-       @Override
-       public Control createUi(Composite parent, Node context) throws RepositoryException {
-               parent.setLayout(new GridLayout());
-               CmsView cmsView = CmsSwtUtils.getCmsView(parent);
-               if (cmsView.isAnonymous())
-                       throw new IllegalStateException("No user is not logged in");
-
-               Label lbl = new Label(parent, SWT.NONE);
-               lbl.setText("Welcome " + CurrentUser.getDisplayName() + "!");
-
-               return lbl;
-       }
-
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/DefaultEditionLayer.java b/org.argeo.app.ui/src/org/argeo/app/ui/DefaultEditionLayer.java
deleted file mode 100644 (file)
index 579157d..0000000
+++ /dev/null
@@ -1,286 +0,0 @@
-package org.argeo.app.ui;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-
-import org.argeo.api.cms.CmsTheme;
-import org.argeo.app.ui.widgets.TabbedArea;
-import org.argeo.cms.Localized;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.ui.CmsUiProvider;
-import org.argeo.jcr.JcrException;
-import org.argeo.util.LangUtils;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.wiring.BundleWiring;
-
-/** An app layer based on an entry area and an editor area. */
-public class DefaultEditionLayer implements SuiteLayer {
-       private CmsUiProvider entryArea;
-       private CmsUiProvider defaultView;
-       private CmsUiProvider workArea;
-       private List<String> weights = new ArrayList<>();
-       private boolean startMaximized = false;
-       private boolean fixedEntryArea = false;
-       private boolean singleTab = false;
-       private Localized title = null;
-
-       @Override
-       public Control createUi(Composite parent, Node context) throws RepositoryException {
-               // TODO Factorize more, or split into more specialised classes?
-               if (entryArea != null) {
-                       if (fixedEntryArea) {
-                               FixedEditionArea editionArea = new FixedEditionArea(parent, parent.getStyle());
-                               Control entryAreaC = entryArea.createUi(editionArea.getEntryArea(), context);
-                               CmsSwtUtils.style(entryAreaC, SuiteStyle.entryArea);
-                               if (this.defaultView != null) {
-                                       editionArea.getTabbedArea().view(defaultView, context);
-                               }
-                               return editionArea;
-                       } else {
-                               SashFormEditionArea editionArea = new SashFormEditionArea(parent, parent.getStyle());
-                               entryArea.createUi(editionArea.getEntryArea(), context);
-                               if (this.defaultView != null) {
-                                       editionArea.getTabbedArea().view(defaultView, context);
-                               }
-                               return editionArea;
-                       }
-               } else {
-                       if (this.workArea != null) {
-                               Composite area = new Composite(parent, SWT.NONE);
-                               this.workArea.createUi(area, context);
-                               return area;
-                       }
-                       CmsTheme theme = CmsSwtUtils.getCmsTheme(parent);
-                       TabbedArea tabbedArea = createTabbedArea(parent, theme);
-                       return tabbedArea;
-               }
-       }
-
-       @Override
-       public void view(CmsUiProvider uiProvider, Composite workAreaC, Node context) {
-               if (workArea != null) {
-                       try {
-                               CmsSwtUtils.clear(workAreaC);
-                               workArea.createUi(workAreaC, context);
-                               workAreaC.layout(true, true);
-                               return;
-                       } catch (RepositoryException e) {
-                               throw new JcrException("Cannot rebuild work area", e);
-                       }
-               }
-
-               // tabbed area
-               TabbedArea tabbedArea = findTabbedArea(workAreaC);
-               if (tabbedArea == null)
-                       throw new IllegalArgumentException("Unsupported work area " + workAreaC.getClass().getName());
-               if (uiProvider == null) {
-                       // reset
-                       tabbedArea.closeAllTabs();
-                       if (this.defaultView != null) {
-                               tabbedArea.view(defaultView, context);
-                       }
-               } else {
-                       tabbedArea.view(uiProvider, context);
-               }
-       }
-
-       @Override
-       public Node getCurrentContext(Composite workArea) {
-               TabbedArea tabbedArea = findTabbedArea(workArea);
-               if (tabbedArea == null)
-                       return null;
-               return tabbedArea.getCurrentContext();
-       }
-
-       private TabbedArea findTabbedArea(Composite workArea) {
-               TabbedArea tabbedArea = null;
-               if (workArea instanceof SashFormEditionArea) {
-                       tabbedArea = ((SashFormEditionArea) workArea).getTabbedArea();
-               } else if (workArea instanceof FixedEditionArea) {
-                       tabbedArea = ((FixedEditionArea) workArea).getTabbedArea();
-               } else if (workArea instanceof TabbedArea) {
-                       tabbedArea = (TabbedArea) workArea;
-               }
-               return tabbedArea;
-       }
-
-       @Override
-       public void open(CmsUiProvider uiProvider, Composite workArea, Node context) {
-               TabbedArea tabbedArea = ((SashFormEditionArea) workArea).getTabbedArea();
-               tabbedArea.open(uiProvider, context);
-       }
-
-       @Override
-       public Localized getTitle() {
-               return title;
-       }
-
-       public void init(BundleContext bundleContext, Map<String, Object> properties) {
-               weights = LangUtils.toStringList(properties.get(Property.weights.name()));
-               startMaximized = properties.containsKey(Property.startMaximized.name())
-                               && "true".equals(properties.get(Property.startMaximized.name()));
-               fixedEntryArea = properties.containsKey(Property.fixedEntryArea.name())
-                               && "true".equals(properties.get(Property.fixedEntryArea.name()));
-               if (fixedEntryArea && weights.size() != 0) {
-                       throw new IllegalArgumentException("Property " + Property.weights.name() + " should not be set if property "
-                                       + Property.fixedEntryArea.name() + " is set.");
-               }
-               singleTab = properties.containsKey(Property.singleTab.name())
-                               && "true".equals(properties.get(Property.singleTab.name()));
-
-               String titleStr = (String) properties.get(SuiteLayer.Property.title.name());
-               if (titleStr != null) {
-                       if (titleStr.startsWith("%")) {
-                               title = new Localized() {
-
-                                       @Override
-                                       public String name() {
-                                               return titleStr;
-                                       }
-
-                                       @Override
-                                       public ClassLoader getL10nClassLoader() {
-                                               return bundleContext != null
-                                                               ? bundleContext.getBundle().adapt(BundleWiring.class).getClassLoader()
-                                                               : getClass().getClassLoader();
-                                       }
-                               };
-                       } else {
-                               title = new Localized.Untranslated(titleStr);
-                       }
-               }
-       }
-
-       public void destroy(BundleContext bundleContext, Map<String, String> properties) {
-
-       }
-
-       public void setEntryArea(CmsUiProvider entryArea) {
-               this.entryArea = entryArea;
-       }
-
-       public void setWorkArea(CmsUiProvider workArea) {
-               this.workArea = workArea;
-       }
-
-       public void setDefaultView(CmsUiProvider defaultView) {
-               this.defaultView = defaultView;
-       }
-
-       TabbedArea createTabbedArea(Composite parent, CmsTheme theme) {
-               TabbedArea tabbedArea = new TabbedArea(parent, SWT.NONE);
-               tabbedArea.setSingleTab(singleTab);
-               tabbedArea.setBodyStyle(SuiteStyle.mainTabBody.style());
-               tabbedArea.setTabStyle(SuiteStyle.mainTab.style());
-               tabbedArea.setTabSelectedStyle(SuiteStyle.mainTabSelected.style());
-               tabbedArea.setCloseIcon(SuiteIcon.close.getSmallIcon(theme));
-               tabbedArea.setLayoutData(CmsSwtUtils.fillAll());
-               return tabbedArea;
-       }
-
-//     /** A work area based on an entry area and and a tabbed area. */
-       class SashFormEditionArea extends SashForm {
-               private static final long serialVersionUID = 2219125778722702618L;
-               private TabbedArea tabbedArea;
-               private Composite entryC;
-
-               SashFormEditionArea(Composite parent, int style) {
-                       super(parent, SWT.HORIZONTAL);
-                       CmsTheme theme = CmsSwtUtils.getCmsTheme(parent);
-
-                       Composite editorC;
-                       if (SWT.RIGHT_TO_LEFT == (style & SWT.RIGHT_TO_LEFT)) {// arabic, hebrew, etc.
-                               editorC = new Composite(this, SWT.BORDER);
-                               entryC = new Composite(this, SWT.BORDER);
-                       } else {
-                               entryC = new Composite(this, SWT.NONE);
-                               editorC = new Composite(this, SWT.NONE);
-                       }
-
-                       // sash form specific
-                       if (weights.size() != 0) {
-                               int[] actualWeight = new int[weights.size()];
-                               for (int i = 0; i < weights.size(); i++) {
-                                       actualWeight[i] = Integer.parseInt(weights.get(i));
-                               }
-                               setWeights(actualWeight);
-                       } else {
-                               int[] actualWeights = new int[] { 3000, 7000 };
-                               setWeights(actualWeights);
-                       }
-                       if (startMaximized)
-                               setMaximizedControl(editorC);
-
-                       GridLayout editorAreaLayout = CmsSwtUtils.noSpaceGridLayout();
-//                     editorAreaLayout.verticalSpacing = 0;
-//                     editorAreaLayout.marginBottom = 0;
-//                     editorAreaLayout.marginHeight = 0;
-//                     editorAreaLayout.marginLeft = 0;
-//                     editorAreaLayout.marginRight = 0;
-                       editorC.setLayout(editorAreaLayout);
-
-                       tabbedArea = createTabbedArea(editorC, theme);
-               }
-
-               TabbedArea getTabbedArea() {
-                       return tabbedArea;
-               }
-
-               Composite getEntryArea() {
-                       return entryC;
-               }
-
-       }
-
-       class FixedEditionArea extends Composite {
-               private static final long serialVersionUID = -5525672639277322465L;
-               private TabbedArea tabbedArea;
-               private Composite entryC;
-
-               public FixedEditionArea(Composite parent, int style) {
-                       super(parent, style);
-                       CmsTheme theme = CmsSwtUtils.getCmsTheme(parent);
-
-                       setLayout(CmsSwtUtils.noSpaceGridLayout(2));
-
-                       Composite editorC;
-                       if (SWT.RIGHT_TO_LEFT == (style & SWT.RIGHT_TO_LEFT)) {// arabic, hebrew, etc.
-                               editorC = new Composite(this, SWT.NONE);
-                               entryC = new Composite(this, SWT.NONE);
-                       } else {
-                               entryC = new Composite(this, SWT.NONE);
-                               editorC = new Composite(this, SWT.NONE);
-                       }
-                       entryC.setLayoutData(CmsSwtUtils.fillHeight());
-
-                       GridLayout editorAreaLayout = CmsSwtUtils.noSpaceGridLayout();
-//                     editorAreaLayout.verticalSpacing = 0;
-//                     editorAreaLayout.marginBottom = 0;
-//                     editorAreaLayout.marginHeight = 0;
-//                     editorAreaLayout.marginLeft = 0;
-//                     editorAreaLayout.marginRight = 0;
-                       editorC.setLayout(editorAreaLayout);
-                       editorC.setLayoutData(CmsSwtUtils.fillAll());
-
-                       tabbedArea = createTabbedArea(editorC, theme);
-               }
-
-               TabbedArea getTabbedArea() {
-                       return tabbedArea;
-               }
-
-               Composite getEntryArea() {
-                       return entryC;
-               }
-       }
-
-}
\ No newline at end of file
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/DefaultFooter.java b/org.argeo.app.ui/src/org/argeo/app/ui/DefaultFooter.java
deleted file mode 100644 (file)
index 62a3a23..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.argeo.app.ui;
-
-import java.util.Map;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.ui.CmsUiProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.osgi.framework.BundleContext;
-
-/** Footer of a standard Argeo Suite application. */
-public class DefaultFooter implements CmsUiProvider {
-       @Override
-       public Control createUi(Composite parent, Node context) throws RepositoryException {
-               parent.setLayout(CmsSwtUtils.noSpaceGridLayout());
-               Composite content = new Composite(parent, SWT.NONE);
-               content.setLayoutData(new GridData(0, 0));
-               Control contentControl = createContent(content, context);
-
-               // TODO support and guarantee
-
-               return contentControl;
-       }
-
-       protected Control createContent(Composite parent, Node context) throws RepositoryException {
-               return parent;
-       }
-
-       public void init(BundleContext bundleContext, Map<String, String> properties) {
-       }
-
-       public void destroy(BundleContext bundleContext, Map<String, String> properties) {
-
-       }
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/DefaultHeader.java b/org.argeo.app.ui/src/org/argeo/app/ui/DefaultHeader.java
deleted file mode 100644 (file)
index d304493..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-package org.argeo.app.ui;
-
-import java.util.Map;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-
-import org.argeo.api.cms.CmsTheme;
-import org.argeo.api.cms.CmsView;
-import org.argeo.cms.Localized;
-import org.argeo.cms.auth.CurrentUser;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.ui.CmsUiProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.wiring.BundleWiring;
-
-/** Header of a standard Argeo Suite application. */
-public class DefaultHeader implements CmsUiProvider {
-       public final static String TITLE_PROPERTY = "argeo.suite.ui.header.title";
-       private Localized title = null;
-
-       @Override
-       public Control createUi(Composite parent, Node context) throws RepositoryException {
-               CmsView cmsView = CmsSwtUtils.getCmsView(parent);
-               CmsTheme theme = CmsSwtUtils.getCmsTheme(parent);
-
-               parent.setLayout(CmsSwtUtils.noSpaceGridLayout(new GridLayout(3, true)));
-
-               // TODO right to left
-               Composite lead = new Composite(parent, SWT.NONE);
-               CmsSwtUtils.style(lead, SuiteStyle.header);
-               lead.setLayoutData(new GridData(SWT.LEAD, SWT.CENTER, true, false));
-               lead.setLayout(new GridLayout());
-               Label lbl = new Label(lead, SWT.NONE);
-//             String title = properties.get(TITLE_PROPERTY);
-//             // TODO expose the localized
-//             lbl.setText(LocaleUtils.isLocaleKey(title) ? LocaleUtils.local(title, getClass().getClassLoader()).toString()
-//                             : title);
-               lbl.setText(title.lead());
-               CmsSwtUtils.style(lbl, SuiteStyle.headerTitle);
-               lbl.setLayoutData(CmsSwtUtils.fillWidth());
-
-               Composite middle = new Composite(parent, SWT.NONE);
-               CmsSwtUtils.style(middle, SuiteStyle.header);
-               middle.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false));
-               middle.setLayout(new GridLayout());
-
-               Composite end = new Composite(parent, SWT.NONE);
-               CmsSwtUtils.style(end, SuiteStyle.header);
-               end.setLayoutData(new GridData(SWT.END, SWT.CENTER, true, false));
-
-               if (!cmsView.isAnonymous()) {
-                       end.setLayout(new GridLayout(2, false));
-                       Label userL = new Label(end, SWT.NONE);
-                       CmsSwtUtils.style(userL, SuiteStyle.header);
-                       userL.setText(CurrentUser.getDisplayName());
-                       Button logoutB = new Button(end, SWT.FLAT);
-//                     CmsUiUtils.style(logoutB, SuiteStyle.header);
-                       logoutB.setImage(SuiteIcon.logout.getSmallIcon(theme));
-                       logoutB.addSelectionListener(new SelectionAdapter() {
-                               private static final long serialVersionUID = 7116760083964201233L;
-
-                               @Override
-                               public void widgetSelected(SelectionEvent e) {
-                                       cmsView.logout();
-                               }
-
-                       });
-               } else {
-                       end.setLayout(new GridLayout(1, false));
-                       // required in order to avoid wrong height after logout
-                       new Label(end, SWT.NONE).setText("");
-
-               }
-               return lbl;
-       }
-
-       public void init(BundleContext bundleContext, Map<String, String> properties) {
-               String titleStr = (String) properties.get(TITLE_PROPERTY);
-               if (titleStr != null) {
-                       if (titleStr.startsWith("%")) {
-                               title = new Localized() {
-
-                                       @Override
-                                       public String name() {
-                                               return titleStr;
-                                       }
-
-                                       @Override
-                                       public ClassLoader getL10nClassLoader() {
-                                               return bundleContext != null
-                                                               ? bundleContext.getBundle().adapt(BundleWiring.class).getClassLoader()
-                                                               : getClass().getClassLoader();
-                                       }
-                               };
-                       } else {
-                               title = new Localized.Untranslated(titleStr);
-                       }
-               }
-       }
-
-       public void destroy(BundleContext bundleContext, Map<String, String> properties) {
-
-       }
-
-       public Localized getTitle() {
-               return title;
-       }
-
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/DefaultLeadPane.java b/org.argeo.app.ui/src/org/argeo/app/ui/DefaultLeadPane.java
deleted file mode 100644 (file)
index 5650e9c..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-package org.argeo.app.ui;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeMap;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-
-import org.argeo.api.cms.CmsView;
-import org.argeo.app.api.RankedObject;
-import org.argeo.app.core.SuiteUtils;
-import org.argeo.api.cms.CmsLog;
-import org.argeo.cms.Localized;
-import org.argeo.cms.auth.CurrentUser;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.ui.CmsUiProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.framework.wiring.BundleWiring;
-
-/** Side pane listing various perspectives. */
-public class DefaultLeadPane implements CmsUiProvider {
-       private final static CmsLog log = CmsLog.getLog(DefaultLeadPane.class);
-
-       public static enum Property {
-               defaultLayers, adminLayers;
-       }
-
-       private Map<String, RankedObject<SuiteLayer>> layers = Collections.synchronizedSortedMap(new TreeMap<>());
-       private List<String> defaultLayers;
-       private List<String> adminLayers = new ArrayList<>();
-
-       private ClassLoader l10nClassLoader;
-
-       @Override
-       public Control createUi(Composite parent, Node node) throws RepositoryException {
-               CmsView cmsView = CmsSwtUtils.getCmsView(parent);
-               parent.setLayout(CmsSwtUtils.noSpaceGridLayout());
-               Composite appLayersC = new Composite(parent, SWT.NONE);
-               CmsSwtUtils.style(appLayersC, SuiteStyle.leadPane);
-               GridLayout layout = new GridLayout();
-               layout.verticalSpacing = 10;
-               layout.marginTop = 10;
-               layout.marginLeft = 10;
-               layout.marginRight = 10;
-               appLayersC.setLayout(layout);
-               appLayersC.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
-
-               Composite adminLayersC;
-               if (!adminLayers.isEmpty()) {
-                       adminLayersC = new Composite(parent, SWT.NONE);
-                       CmsSwtUtils.style(adminLayersC, SuiteStyle.leadPane);
-                       GridLayout adminLayout = new GridLayout();
-                       adminLayout.verticalSpacing = 10;
-                       adminLayout.marginBottom = 10;
-                       adminLayout.marginLeft = 10;
-                       adminLayout.marginRight = 10;
-                       adminLayersC.setLayout(adminLayout);
-                       adminLayersC.setLayoutData(new GridData(SWT.FILL, SWT.BOTTOM, false, true));
-               } else {
-                       adminLayersC = null;
-               }
-
-//             boolean isAdmin = cmsView.doAs(() -> CurrentUser.isInRole(NodeConstants.ROLE_USER_ADMIN));
-               Set<String> userRoles = cmsView.doAs(() -> CurrentUser.roles());
-               Button first = null;
-               layers: for (String layerDef : defaultLayers) {
-                       layerDef = layerDef.trim();
-                       if ("".equals(layerDef))
-                               continue layers;// skip empty lines
-                       String[] semiColArr = layerDef.split(";");
-                       String layerId = semiColArr[0];
-                       Set<String> layerRoles = SuiteUtils.extractRoles(semiColArr);
-                       if (layers.containsKey(layerId)) {
-                               if (!layerRoles.isEmpty()) {
-                                       Set<String> intersection = new HashSet<String>(layerRoles);
-                                       intersection.retainAll(userRoles);
-                                       if (intersection.isEmpty())
-                                               continue layers;// skip unauthorized layer
-                               }
-                               RankedObject<SuiteLayer> layerObj = layers.get(layerId);
-
-                               Localized title = null;
-                               if (!adminLayers.contains(layerId)) {
-                                       String titleStr = (String) layerObj.getProperties().get(SuiteLayer.Property.title.name());
-                                       if (titleStr != null) {
-                                               if (titleStr.startsWith("%")) {
-                                                       // LocaleUtils.local(titleStr, getClass().getClassLoader());
-                                                       title = () -> titleStr;
-                                               } else {
-                                                       title = new Localized.Untranslated(titleStr);
-                                               }
-                                       }
-                               }
-
-                               String iconName = (String) layerObj.getProperties().get(SuiteLayer.Property.icon.name());
-                               SuiteIcon icon = null;
-                               if (iconName != null)
-                                       icon = SuiteIcon.valueOf(iconName);
-
-                               Composite buttonParent;
-                               if (adminLayers.contains(layerId))
-                                       buttonParent = adminLayersC;
-                               else
-                                       buttonParent = appLayersC;
-                               Button b = SuiteUiUtils.createLayerButton(buttonParent, layerId, title, icon, l10nClassLoader);
-                               if (first == null)
-                                       first = b;
-                       }
-               }
-               return first;
-       }
-
-       public void init(BundleContext bundleContext, Map<String, Object> properties) {
-               l10nClassLoader = bundleContext != null ? bundleContext.getBundle().adapt(BundleWiring.class).getClassLoader()
-                               : getClass().getClassLoader();
-
-               String[] defaultLayers = (String[]) properties.get(Property.defaultLayers.toString());
-               if (defaultLayers == null)
-                       throw new IllegalArgumentException("Default layers must be set.");
-               this.defaultLayers = Arrays.asList(defaultLayers);
-               if (log.isDebugEnabled())
-                       log.debug("Default layers: " + Arrays.asList(defaultLayers));
-               String[] adminLayers = (String[]) properties.get(Property.adminLayers.toString());
-               if (adminLayers != null) {
-                       this.adminLayers = Arrays.asList(adminLayers);
-                       if (log.isDebugEnabled())
-                               log.debug("Admin layers: " + Arrays.asList(adminLayers));
-               }
-       }
-
-       public void destroy(BundleContext bundleContext, Map<String, String> properties) {
-
-       }
-
-       public void addLayer(SuiteLayer layer, Map<String, Object> properties) {
-               if (properties.containsKey(Constants.SERVICE_PID)) {
-                       String pid = (String) properties.get(Constants.SERVICE_PID);
-                       RankedObject.putIfHigherRank(layers, pid, layer, properties);
-               }
-       }
-
-       public void removeLayer(SuiteLayer layer, Map<String, Object> properties) {
-               if (properties.containsKey(Constants.SERVICE_PID)) {
-                       String pid = (String) properties.get(Constants.SERVICE_PID);
-                       if (layers.containsKey(pid)) {
-                               if (layers.get(pid).equals(new RankedObject<SuiteLayer>(layer, properties))) {
-                                       layers.remove(pid);
-                               }
-                       }
-               }
-       }
-
-//     protected Button createLayerButton(Composite parent, String layer, Localized msg, CmsIcon icon) {
-//             CmsTheme theme = CmsTheme.getCmsTheme(parent);
-//             Button button = new Button(parent, SWT.PUSH);
-//             CmsUiUtils.style(button, SuiteStyle.leadPane);
-//             if (icon != null)
-//                     button.setImage(icon.getBigIcon(theme));
-//             button.setLayoutData(new GridData(SWT.CENTER, SWT.BOTTOM, true, false));
-//             // button.setToolTipText(msg.lead());
-//             if (msg != null) {
-//                     Label lbl = new Label(parent, SWT.CENTER);
-//                     CmsUiUtils.style(lbl, SuiteStyle.leadPane);
-//                     // CmsUiUtils.markup(lbl);
-//                     ClassLoader l10nClassLoader = getClass().getClassLoader();
-//                     String txt = LocaleUtils.lead(msg, l10nClassLoader);
-////                   String txt = msg.lead();
-//                     lbl.setText(txt);
-//                     lbl.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, true, false));
-//             }
-//             CmsUiUtils.sendEventOnSelect(button, SuiteEvent.switchLayer.topic(), SuiteEvent.LAYER, layer);
-//             return button;
-//     }
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/DefaultLoginScreen.java b/org.argeo.app.ui/src/org/argeo/app/ui/DefaultLoginScreen.java
deleted file mode 100644 (file)
index e9b466f..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-package org.argeo.app.ui;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-
-import org.argeo.api.cms.CmsContext;
-import org.argeo.api.cms.CmsView;
-import org.argeo.cms.auth.CurrentUser;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.swt.auth.CmsLogin;
-import org.argeo.cms.ui.CmsUiProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-/** Provides a login screen. */
-public class DefaultLoginScreen implements CmsUiProvider {
-       private CmsContext cmsContext;
-
-       @Override
-       public Control createUi(Composite parent, Node context) throws RepositoryException {
-               CmsView cmsView = CmsSwtUtils.getCmsView(parent);
-               if (!cmsView.isAnonymous())
-                       throw new IllegalStateException(CurrentUser.getUsername() + " is already logged in");
-
-               parent.setLayout(new GridLayout());
-               Composite loginArea = new Composite(parent, SWT.NONE);
-               loginArea.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, true));
-
-               CmsLogin cmsLogin = new CmsLogin(cmsView, cmsContext);
-               cmsLogin.createUi(loginArea);
-               return cmsLogin.getCredentialsBlock();
-       }
-
-       public void setCmsContext(CmsContext cmsContext) {
-               this.cmsContext = cmsContext;
-       }
-
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/EventRecorder.java b/org.argeo.app.ui/src/org/argeo/app/ui/EventRecorder.java
deleted file mode 100644 (file)
index 0607952..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-package org.argeo.app.ui;
-
-import org.argeo.api.cms.CmsLog;
-import org.osgi.service.event.Event;
-import org.osgi.service.event.EventHandler;
-
-/** Record UI events. */
-public class EventRecorder implements EventHandler {
-       private final static CmsLog log = CmsLog.getLog(EventRecorder.class);
-
-       public void init() {
-
-       }
-
-       public void destroy() {
-
-       }
-
-       @Override
-       public void handleEvent(Event event) {
-               if (log.isTraceEnabled())
-                       log.trace(event);
-
-       }
-
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/RecentItems.java b/org.argeo.app.ui/src/org/argeo/app/ui/RecentItems.java
deleted file mode 100644 (file)
index c4272e6..0000000
+++ /dev/null
@@ -1,364 +0,0 @@
-package org.argeo.app.ui;
-
-import static org.argeo.eclipse.ui.EclipseUiUtils.notEmpty;
-
-import java.util.List;
-import java.util.Map;
-
-import javax.jcr.Node;
-import javax.jcr.NodeIterator;
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-import javax.jcr.observation.Event;
-import javax.jcr.observation.EventIterator;
-import javax.jcr.observation.EventListener;
-import javax.jcr.query.Query;
-import javax.jcr.query.QueryResult;
-
-import org.argeo.api.cms.CmsTheme;
-import org.argeo.app.api.EntityType;
-import org.argeo.app.core.XPathUtils;
-import org.argeo.app.ui.widgets.DelayedText;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.ui.CmsUiProvider;
-import org.argeo.eclipse.ui.EclipseUiUtils;
-import org.argeo.jcr.Jcr;
-import org.argeo.jcr.JcrUtils;
-import org.eclipse.jface.layout.TableColumnLayout;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.ToolItem;
-
-/** List recent items. */
-public class RecentItems implements CmsUiProvider {
-       private final static int SEARCH_TEXT_DELAY = 800;
-       private final static int SEARCH_DEFAULT_LIMIT = 100;
-
-       private CmsTheme theme;
-
-       private String entityType;
-
-       static enum Property {
-               entityTypes;
-       }
-
-       @Override
-       public Control createUi(Composite parent, Node context) throws RepositoryException {
-               theme = CmsSwtUtils.getCmsTheme(parent);
-               parent.setLayout(new GridLayout());
-//             parent.setLayout(CmsUiUtils.noSpaceGridLayout());
-               parent.setLayout(new GridLayout());
-
-//             Composite top = new Composite(parent, SWT.BORDER);
-//             CmsUiUtils.style(top, SuiteStyle.recentItems);
-//             top.setLayoutData(CmsUiUtils.fillWidth());
-//             top.setLayout(CmsUiUtils.noSpaceGridLayout(2));
-//             Label lbl = new Label(top, SWT.FLAT);
-//             lbl.setLayoutData(CmsUiUtils.fillWidth());
-//             lbl.setText(SuiteMsg.recentItems.lead());
-//             CmsUiUtils.style(lbl, SuiteStyle.recentItems);
-//
-//             ToolBar topToolBar = new ToolBar(top, SWT.NONE);
-//             ToolItem addItem = new ToolItem(topToolBar, SWT.FLAT);
-////           CmsUiUtils.style(addItem, SuiteStyle.recentItems);
-//             addItem.setImage(SuiteIcon.add.getSmallIcon(theme));
-
-               if (context == null)
-                       return null;
-               SingleEntityViewer entityViewer = new SingleEntityViewer(parent, SWT.NONE, context.getSession());
-               entityViewer.createUi();
-               entityViewer.getViewer().getTable().setLayoutData(CmsSwtUtils.fillAll());
-
-               Composite bottom = new Composite(parent, SWT.NONE);
-               bottom.setLayoutData(CmsSwtUtils.fillWidth());
-               bottom.setLayout(CmsSwtUtils.noSpaceGridLayout());
-               ToolBar bottomToolBar = new ToolBar(bottom, SWT.NONE);
-               bottomToolBar.setLayoutData(new GridData(SWT.END, SWT.FILL, true, false));
-               ToolItem deleteItem = new ToolItem(bottomToolBar, SWT.FLAT);
-               deleteItem.setEnabled(false);
-//             CmsUiUtils.style(deleteItem, SuiteStyle.recentItems);
-               deleteItem.setImage(SuiteIcon.delete.getSmallIcon(theme));
-               ToolItem addItem = new ToolItem(bottomToolBar, SWT.FLAT);
-               addItem.setImage(SuiteIcon.add.getSmallIcon(theme));
-               entityViewer.getViewer().addDoubleClickListener(new IDoubleClickListener() {
-
-                       @Override
-                       public void doubleClick(DoubleClickEvent event) {
-                               Node node = (Node) entityViewer.getViewer().getStructuredSelection().getFirstElement();
-                               if (node != null)
-                                       CmsSwtUtils.getCmsView(parent).sendEvent(SuiteEvent.openNewPart.topic(),
-                                                       SuiteEvent.eventProperties(node));
-
-                       }
-               });
-               entityViewer.getViewer().addSelectionChangedListener(new ISelectionChangedListener() {
-                       public void selectionChanged(SelectionChangedEvent event) {
-                               Node node = (Node) entityViewer.getViewer().getStructuredSelection().getFirstElement();
-                               if (node != null) {
-                                       CmsSwtUtils.getCmsView(parent).sendEvent(SuiteEvent.refreshPart.topic(),
-                                                       SuiteEvent.eventProperties(node));
-                                       deleteItem.setEnabled(true);
-                               } else {
-                                       deleteItem.setEnabled(false);
-                               }
-                       }
-               });
-
-               return entityViewer.filterTxt;
-
-       }
-
-       public void init(Map<String, String> properties) {
-               // TODO manage multiple entities
-               entityType = properties.get(Property.entityTypes.name());
-       }
-
-       class SingleEntityViewer {
-               Composite parent;
-               Text filterTxt;
-               TableViewer viewer;
-               Session session;
-
-               public SingleEntityViewer(Composite parent, int style, Session session) {
-                       this.parent = parent;
-                       this.session = session;
-               }
-
-               public void createUi() {
-                       // MainLayout
-                       addFilterPanel(parent);
-                       viewer = createListPart(parent, new SingleEntityLabelProvider());
-                       refreshFilteredList();
-
-                       try {
-                               String[] nodeTypes = entityType != null && entityType.contains(":") ? new String[] { entityType }
-                                               : null;
-                               session.getWorkspace().getObservationManager().addEventListener(new EventListener() {
-
-                                       @Override
-                                       public void onEvent(EventIterator events) {
-                                               parent.getDisplay().asyncExec(() -> refreshFilteredList());
-                                       }
-                               }, Event.PROPERTY_CHANGED | Event.NODE_ADDED | Event.NODE_REMOVED | Event.PROPERTY_ADDED, "/", true,
-                                               null, nodeTypes, false);
-                       } catch (RepositoryException e) {
-                               throw new IllegalStateException("Cannot add JCR observer", e);
-                       }
-
-               }
-
-               private void addFilterPanel(Composite parent) {
-                       // Use a delayed text: the query won't be done until the user stop
-                       // typing for 800ms
-                       int style = SWT.BORDER | SWT.SEARCH | SWT.ICON_CANCEL;
-                       DelayedText delayedText = new DelayedText(parent, style, SEARCH_TEXT_DELAY);
-                       filterTxt = delayedText.getText();
-                       filterTxt.setLayoutData(EclipseUiUtils.fillWidth());
-
-                       // final ServerPushSession pushSession = new ServerPushSession();
-                       delayedText.addListener((s) -> refreshFilteredList());
-//                     delayedText.addDelayedModifyListener(null, new ModifyListener() {
-//                             private static final long serialVersionUID = 5003010530960334977L;
-//
-//                             public void modifyText(ModifyEvent event) {
-//                                     delayedText.getText().getDisplay().asyncExec(new Runnable() {
-//                                             @Override
-//                                             public void run() {
-//                                                     refreshFilteredList();
-//                                             }
-//                                     });
-//                                     // pushSession.stop();
-//                             }
-//                     });
-
-                       // Jump to the first item of the list using the down arrow
-                       filterTxt.addKeyListener(new KeyListener() {
-                               private static final long serialVersionUID = -4523394262771183968L;
-
-                               @Override
-                               public void keyReleased(KeyEvent e) {
-                               }
-
-                               @Override
-                               public void keyPressed(KeyEvent e) {
-                                       // boolean shiftPressed = (e.stateMask & SWT.SHIFT) != 0;
-                                       // boolean altPressed = (e.stateMask & SWT.ALT) != 0;
-                                       if (e.keyCode == SWT.ARROW_DOWN || e.keyCode == SWT.TAB) {
-//                                     Object first = entityViewer.getElementAt(0);
-//                                     if (first != null) {
-//                                             entityViewer.getTable().setFocus();
-//                                             entityViewer.setSelection(new StructuredSelection(first), true);
-//                                     }
-                                               e.doit = false;
-                                       }
-                               }
-                       });
-
-//                     parent.addDisposeListener((e) -> {
-//                             delayedText.close();
-//                     });
-               }
-
-               protected TableViewer createListPart(Composite parent, ILabelProvider labelProvider) {
-//                     parent.setLayout(new GridLayout());
-//                     parent.setLayout(CmsUiUtils.noSpaceGridLayout());
-
-                       Composite tableComposite = new Composite(parent, SWT.NONE);
-                       GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_VERTICAL
-                                       | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
-                       tableComposite.setLayoutData(gd);
-
-                       TableViewer viewer = new TableViewer(tableComposite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
-                       viewer.setLabelProvider(labelProvider);
-
-                       TableColumn singleColumn = new TableColumn(viewer.getTable(), SWT.V_SCROLL);
-                       TableColumnLayout tableColumnLayout = new TableColumnLayout();
-                       tableColumnLayout.setColumnData(singleColumn, new ColumnWeightData(85));
-                       tableComposite.setLayout(tableColumnLayout);
-
-                       // Corresponding table & style
-                       Table table = viewer.getTable();
-//                     Listener[] mouseDownListeners = table.getListeners(SWT.MouseDown);
-//                     for (Listener listener :  table.getListeners(SWT.MouseDown))
-//                             table.removeListener(SWT.MouseDown, listener);
-//                     for (Listener listener :  table.getListeners(SWT.MouseUp))
-//                             table.removeListener(SWT.MouseUp, listener);
-//                     for (Listener listener :  table.getListeners(SWT.MouseDoubleClick))
-//                             table.removeListener(SWT.MouseDoubleClick, listener);
-//                     
-//                     table.addMouseListener(new MouseListener() {
-//
-//                             @Override
-//                             public void mouseUp(MouseEvent e) {
-//                                     System.out.println("Mouse up: "+e);
-//                             }
-//
-//                             @Override
-//                             public void mouseDown(MouseEvent e) {
-//                                     System.out.println("Mouse down: "+e);
-//                             }
-//
-//                             @Override
-//                             public void mouseDoubleClick(MouseEvent e) {
-//                                     System.out.println("Mouse double: "+e);
-//
-//                             }
-//                     });
-                       table.setLinesVisible(true);
-                       table.setHeaderVisible(false);
-                       // CmsUiUtils.markup(table);
-                       // CmsUiUtils.setItemHeight(table, 26);
-
-                       viewer.setContentProvider(new BasicNodeListContentProvider());
-                       return viewer;
-               }
-
-//             public boolean setFocus() {
-//                     refreshFilteredList();
-//                     return parent.setFocus();
-//             }
-
-               public void forceRefresh(Object object) {
-                       refreshFilteredList();
-               }
-
-               protected void refreshFilteredList() {
-                       try {
-                               String filter = filterTxt.getText();
-                               // Prevents the query on the full repository
-                               // if (isEmpty(filter)) {
-                               // entityViewer.setInput(null);
-                               // return;
-                               // }
-
-                               // XPATH Query
-                               String xpathQueryStr;
-                               if (entityType != null) {
-                                       int indexColumn = entityType.indexOf(':');
-                                       if (indexColumn > 0) {// JCR node type
-                                               xpathQueryStr = "//element(*, " + entityType + ") order by @jcr:created descending";
-                                       } else {
-                                               xpathQueryStr = entityType.contains(":") ? "//element(*, " + entityType + ")"
-                                                               : "//element(*, " + EntityType.entity.get() + ")[@entity:type='" + entityType + "']";
-                                       }
-                               } else {
-                                       xpathQueryStr = "//element(*, " + EntityType.entity.get() + ")";
-                               }
-//                     String xpathQueryStr = "//element(*, " + ConnectTypes.CONNECT_ENTITY + ")";
-                               String xpathFilter = XPathUtils.getFreeTextConstraint(filter);
-                               if (notEmpty(xpathFilter))
-                                       xpathQueryStr += "[" + xpathFilter + "]";
-
-//                             long begin = System.currentTimeMillis();
-                               // session.refresh(false);
-                               Query xpathQuery = XPathUtils.createQuery(session, xpathQueryStr);
-
-                               xpathQuery.setLimit(SEARCH_DEFAULT_LIMIT);
-                               QueryResult result = xpathQuery.execute();
-
-                               NodeIterator nit = result.getNodes();
-                               viewer.setInput(JcrUtils.nodeIteratorToList(nit));
-//                             if (log.isTraceEnabled()) {
-//                                     long end = System.currentTimeMillis();
-//                                     log.trace("Quick Search - Found: " + nit.getSize() + " in " + (end - begin)
-//                                                     + " ms by executing XPath query (" + xpathQueryStr + ").");
-//                             }
-                       } catch (RepositoryException e) {
-                               throw new IllegalStateException("Unable to list entities", e);
-                       }
-               }
-
-               public TableViewer getViewer() {
-                       return viewer;
-               }
-
-               class SingleEntityLabelProvider extends ColumnLabelProvider {
-                       private static final long serialVersionUID = -2209337675781795677L;
-
-                       @Override
-                       public String getText(Object element) {
-                               return Jcr.getTitle((Node) element);
-                       }
-
-               }
-
-               class BasicNodeListContentProvider implements IStructuredContentProvider {
-                       private static final long serialVersionUID = 1L;
-                       // keep a cache of the Nodes in the content provider to be able to
-                       // manage long request
-                       private List<Node> nodes;
-
-                       public void dispose() {
-                       }
-
-                       /** Expects a list of nodes as a new input */
-                       @SuppressWarnings("unchecked")
-                       public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-                               nodes = (List<Node>) newInput;
-                       }
-
-                       public Object[] getElements(Object arg0) {
-                               return nodes.toArray();
-                       }
-               }
-       }
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/SuiteApp.java b/org.argeo.app.ui/src/org/argeo/app/ui/SuiteApp.java
deleted file mode 100644 (file)
index e4d40cf..0000000
+++ /dev/null
@@ -1,642 +0,0 @@
-package org.argeo.app.ui;
-
-import static org.argeo.api.cms.CmsView.CMS_VIEW_UID_PROPERTY;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Objects;
-import java.util.Set;
-import java.util.TreeMap;
-import java.util.TreeSet;
-
-import javax.jcr.Node;
-import javax.jcr.Repository;
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-import javax.jcr.nodetype.NodeType;
-import javax.naming.InvalidNameException;
-import javax.naming.ldap.LdapName;
-
-import org.argeo.api.cms.CmsSession;
-import org.argeo.api.cms.CmsTheme;
-import org.argeo.api.cms.CmsUi;
-import org.argeo.api.cms.CmsView;
-import org.argeo.app.api.EntityConstants;
-import org.argeo.app.api.EntityNames;
-import org.argeo.app.api.EntityType;
-import org.argeo.app.api.RankedObject;
-import org.argeo.app.core.SuiteUtils;
-import org.argeo.api.cms.CmsLog;
-import org.argeo.cms.AbstractCmsApp;
-import org.argeo.cms.CmsUserManager;
-import org.argeo.cms.LocaleUtils;
-import org.argeo.cms.Localized;
-import org.argeo.cms.jcr.CmsJcrUtils;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.swt.dialogs.CmsFeedback;
-import org.argeo.cms.ui.CmsUiProvider;
-import org.argeo.eclipse.ui.specific.UiContext;
-import org.argeo.jcr.Jcr;
-import org.argeo.jcr.JcrException;
-import org.argeo.util.LangUtils;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.osgi.framework.Constants;
-import org.osgi.service.event.Event;
-import org.osgi.service.event.EventHandler;
-import org.osgi.service.useradmin.User;
-
-/** The Argeo Suite App. */
-public class SuiteApp extends AbstractCmsApp implements EventHandler {
-       private final static CmsLog log = CmsLog.getLog(SuiteApp.class);
-
-       public final static String PUBLIC_BASE_PATH_PROPERTY = "publicBasePath";
-       public final static String DEFAULT_UI_NAME_PROPERTY = "defaultUiName";
-       public final static String DEFAULT_THEME_ID_PROPERTY = "defaultThemeId";
-       public final static String DEFAULT_LAYER_PROPERTY = "defaultLayer";
-       private final static String LOGIN = "login";
-       private final static String HOME_STATE = "~";
-
-       private String publicBasePath = null;
-
-       private String pidPrefix;
-       private String headerPid;
-       private String footerPid;
-       private String leadPanePid;
-       private String adminLeadPanePid;
-       private String loginScreenPid;
-
-       private String defaultUiName = "app";
-       private String adminUiName = "admin";
-
-       // FIXME such default names make refactoring more dangerous
-       @Deprecated
-       private String defaultLayerPid = "argeo.suite.ui.dashboardLayer";
-       @Deprecated
-       private String defaultThemeId = "org.argeo.app.theme.default";
-
-       private Map<String, RankedObject<CmsUiProvider>> uiProvidersByPid = Collections.synchronizedMap(new HashMap<>());
-       private Map<String, RankedObject<CmsUiProvider>> uiProvidersByType = Collections.synchronizedMap(new HashMap<>());
-       private Map<String, RankedObject<SuiteLayer>> layersByPid = Collections.synchronizedSortedMap(new TreeMap<>());
-       private Map<String, RankedObject<SuiteLayer>> layersByType = Collections.synchronizedSortedMap(new TreeMap<>());
-
-       private CmsUserManager cmsUserManager;
-
-       // TODO make more optimal or via CmsSession/CmsView
-       private Map<String, SuiteUi> managedUis = new HashMap<>();
-
-       private Repository repository;
-
-       public void init(Map<String, Object> properties) {
-               if (log.isDebugEnabled())
-                       log.info("Argeo Suite App started");
-
-               if (properties.containsKey(DEFAULT_UI_NAME_PROPERTY))
-                       defaultUiName = LangUtils.get(properties, DEFAULT_UI_NAME_PROPERTY);
-               if (properties.containsKey(DEFAULT_THEME_ID_PROPERTY))
-                       defaultThemeId = LangUtils.get(properties, DEFAULT_THEME_ID_PROPERTY);
-               if (properties.containsKey(DEFAULT_LAYER_PROPERTY))
-                       defaultLayerPid = LangUtils.get(properties, DEFAULT_LAYER_PROPERTY);
-               publicBasePath = LangUtils.get(properties, PUBLIC_BASE_PATH_PROPERTY);
-
-               if (properties.containsKey(Constants.SERVICE_PID)) {
-                       String servicePid = properties.get(Constants.SERVICE_PID).toString();
-                       if (servicePid.endsWith(".app")) {
-                               pidPrefix = servicePid.substring(0, servicePid.length() - "app".length());
-                       }
-               }
-
-               if (pidPrefix == null)
-                       throw new IllegalArgumentException("PID prefix must be set.");
-
-               headerPid = pidPrefix + "header";
-               footerPid = pidPrefix + "footer";
-               leadPanePid = pidPrefix + "leadPane";
-               adminLeadPanePid = pidPrefix + "adminLeadPane";
-               loginScreenPid = pidPrefix + "loginScreen";
-       }
-
-       public void destroy(Map<String, Object> properties) {
-               for (SuiteUi ui : managedUis.values())
-                       if (!ui.isDisposed())
-                               ui.dispose();
-               if (log.isDebugEnabled())
-                       log.info("Argeo Suite App stopped");
-
-       }
-
-       @Override
-       public Set<String> getUiNames() {
-               HashSet<String> uiNames = new HashSet<>();
-               uiNames.add(defaultUiName);
-               uiNames.add(adminUiName);
-               return uiNames;
-       }
-
-       @Override
-       public CmsUi initUi(Object parent) {
-               Composite uiParent = (Composite) parent;
-               String uiName = uiParent.getData(UI_NAME_PROPERTY) != null ? uiParent.getData(UI_NAME_PROPERTY).toString()
-                               : null;
-               CmsView cmsView = CmsSwtUtils.getCmsView(uiParent);
-               if (cmsView == null)
-                       throw new IllegalStateException("No CMS view is registered.");
-               CmsTheme theme = getTheme(uiName);
-               if (theme != null)
-                       CmsSwtUtils.registerCmsTheme(uiParent.getShell(), theme);
-               SuiteUi argeoSuiteUi = new SuiteUi(uiParent, SWT.INHERIT_DEFAULT);
-               String uid = cmsView.getUid();
-               managedUis.put(uid, argeoSuiteUi);
-               argeoSuiteUi.addDisposeListener((e) -> {
-                       managedUis.remove(uid);
-                       if (log.isDebugEnabled())
-                               log.debug("Suite UI " + uid + " has been disposed.");
-               });
-               return argeoSuiteUi;
-       }
-
-       @Override
-       public String getThemeId(String uiName) {
-               String themeId = System.getProperty("org.argeo.app.theme.default");
-               if (themeId != null)
-                       return themeId;
-               return defaultThemeId;
-       }
-
-       @Override
-       public void refreshUi(CmsUi cmsUi, String state) {
-               try {
-                       Node context = null;
-                       SuiteUi ui = (SuiteUi) cmsUi;
-
-                       String uiName = Objects.toString(ui.getParent().getData(UI_NAME_PROPERTY), null);
-                       if (uiName == null)
-                               throw new IllegalStateException("UI name should not be null");
-                       CmsView cmsView = CmsSwtUtils.getCmsView(ui);
-                       CmsUiProvider headerUiProvider = findUiProvider(headerPid);
-                       CmsUiProvider footerUiProvider = findUiProvider(footerPid);
-                       CmsUiProvider leadPaneUiProvider;
-                       if (adminUiName.equals(uiName)) {
-                               leadPaneUiProvider = findUiProvider(adminLeadPanePid);
-                       } else {
-                               leadPaneUiProvider = findUiProvider(leadPanePid);
-                       }
-
-                       Localized appTitle = null;
-                       if (headerUiProvider instanceof DefaultHeader) {
-                               appTitle = ((DefaultHeader) headerUiProvider).getTitle();
-                       }
-                       ui.setTitle(appTitle);
-
-                       if (cmsView.isAnonymous() && publicBasePath == null) {// internal app, must login
-                               ui.logout();
-                               if (headerUiProvider != null)
-                                       refreshPart(headerUiProvider, ui.getHeader(), context);
-                               ui.refreshBelowHeader(false);
-                               refreshPart(findUiProvider(loginScreenPid), ui.getBelowHeader(), context);
-                               if (footerUiProvider != null)
-                                       refreshPart(footerUiProvider, ui.getFooter(), context);
-                               ui.layout(true, true);
-                               setState(ui, LOGIN);
-                       } else {
-                               if (LOGIN.equals(state))
-                                       state = null;
-                               CmsSession cmsSession = cmsView.getCmsSession();
-                               if (ui.getUserDir() == null) {
-                                       // FIXME NPE on CMSSession when logging in from anonymous
-                                       if (cmsSession == null || cmsView.isAnonymous()) {
-                                               assert publicBasePath != null;
-                                               ui.initSessions(getRepository(), publicBasePath);
-                                       } else {
-                                               Session adminSession = null;
-                                               try {
-                                                       adminSession = CmsJcrUtils.openDataAdminSession(getRepository(), null);
-                                                       Node userDir = SuiteUtils.getOrCreateCmsSessionNode(adminSession, cmsSession);
-                                                       ui.initSessions(getRepository(), userDir.getPath());
-                                               } finally {
-                                                       Jcr.logout(adminSession);
-                                               }
-                                       }
-                               }
-                               initLocale(cmsSession);
-                               context = stateToNode(ui, state);
-                               if (context == null)
-                                       context = ui.getUserDir();
-
-                               if (headerUiProvider != null)
-                                       refreshPart(headerUiProvider, ui.getHeader(), context);
-                               ui.refreshBelowHeader(true);
-                               for (String key : layersByPid.keySet()) {
-                                       SuiteLayer layer = layersByPid.get(key).get();
-                                       ui.addLayer(key, layer);
-                               }
-
-                               if (leadPaneUiProvider != null)
-                                       refreshPart(leadPaneUiProvider, ui.getLeadPane(), context);
-                               if (footerUiProvider != null)
-                                       refreshPart(footerUiProvider, ui.getFooter(), context);
-                               ui.layout(true, true);
-                               setState(ui, state != null ? state : defaultLayerPid);
-                       }
-               } catch (Exception e) {
-                       CmsFeedback.show("Unexpected exception", e);
-               }
-       }
-
-       private void initLocale(CmsSession cmsSession) {
-               if (cmsSession == null)
-                       return;
-               Locale locale = cmsSession.getLocale();
-               UiContext.setLocale(locale);
-               LocaleUtils.setThreadLocale(locale);
-
-       }
-
-       private void refreshPart(CmsUiProvider uiProvider, Composite part, Node context) {
-               CmsSwtUtils.clear(part);
-               uiProvider.createUiPart(part, context);
-       }
-
-       private CmsUiProvider findUiProvider(String pid) {
-               if (!uiProvidersByPid.containsKey(pid))
-                       return null;
-               return uiProvidersByPid.get(pid).get();
-       }
-
-       private SuiteLayer findLayer(String pid) {
-               if (!layersByPid.containsKey(pid))
-                       return null;
-               return layersByPid.get(pid).get();
-       }
-
-       private <T> T findByType(Map<String, RankedObject<T>> byType, Node context) {
-               if (context == null)
-                       throw new IllegalArgumentException("A node should be provided");
-               try {
-                       // mixins
-                       Set<String> types = new TreeSet<>();
-                       for (NodeType mixinType : context.getMixinNodeTypes()) {
-                               String mixinTypeName = mixinType.getName();
-                               if (byType.containsKey(mixinTypeName)) {
-                                       types.add(mixinTypeName);
-                               }
-                               for (NodeType superType : mixinType.getDeclaredSupertypes()) {
-                                       if (byType.containsKey(superType.getName())) {
-                                               types.add(superType.getName());
-                                       }
-                               }
-                       }
-                       // primary node type
-                       NodeType primaryType = context.getPrimaryNodeType();
-                       String primaryTypeName = primaryType.getName();
-                       if (byType.containsKey(primaryTypeName)) {
-                               types.add(primaryTypeName);
-                       }
-                       for (NodeType superType : primaryType.getDeclaredSupertypes()) {
-                               if (byType.containsKey(superType.getName())) {
-                                       types.add(superType.getName());
-                               }
-                       }
-                       // entity type
-                       if (context.isNodeType(EntityType.entity.get())) {
-                               if (context.hasProperty(EntityNames.ENTITY_TYPE)) {
-                                       String entityTypeName = context.getProperty(EntityNames.ENTITY_TYPE).getString();
-                                       if (byType.containsKey(entityTypeName)) {
-                                               types.add(entityTypeName);
-                                       }
-                               }
-                       }
-
-//                     if (context.getPath().equals("/")) {// root node
-//                             types.add("nt:folder");
-//                     }
-                       if (CmsJcrUtils.isUserHome(context) && byType.containsKey("nt:folder")) {// home node
-                               types.add("nt:folder");
-                       }
-
-                       if (types.size() == 0)
-                               throw new IllegalArgumentException("No type found for " + context + " (" + listTypes(context) + ")");
-                       String type = types.iterator().next();
-                       if (!byType.containsKey(type))
-                               throw new IllegalArgumentException("No component found for " + context + " with type " + type);
-                       return byType.get(type).get();
-               } catch (RepositoryException e) {
-                       throw new IllegalStateException(e);
-               }
-       }
-
-       private static String listTypes(Node context) {
-               try {
-                       StringBuilder sb = new StringBuilder();
-                       sb.append(context.getPrimaryNodeType().getName());
-                       for (NodeType superType : context.getPrimaryNodeType().getDeclaredSupertypes()) {
-                               sb.append(' ');
-                               sb.append(superType.getName());
-                       }
-
-                       for (NodeType nodeType : context.getMixinNodeTypes()) {
-                               sb.append(' ');
-                               sb.append(nodeType.getName());
-                               if (nodeType.getName().equals(EntityType.local.get()))
-                                       sb.append('/').append(context.getProperty(EntityNames.ENTITY_TYPE).getString());
-                               for (NodeType superType : nodeType.getDeclaredSupertypes()) {
-                                       sb.append(' ');
-                                       sb.append(superType.getName());
-                               }
-                       }
-                       return sb.toString();
-               } catch (RepositoryException e) {
-                       throw new JcrException(e);
-               }
-       }
-
-       @Override
-       public void setState(CmsUi cmsUi, String state) {
-               if (state == null)
-                       return;
-               if (!state.startsWith("/")) {
-                       if (cmsUi instanceof SuiteUi) {
-                               SuiteUi ui = (SuiteUi) cmsUi;
-                               if (LOGIN.equals(state)) {
-                                       String appTitle = "";
-                                       if (ui.getTitle() != null)
-                                               appTitle = ui.getTitle().lead();
-                                       ui.getCmsView().stateChanged(state, appTitle);
-                                       return;
-                               }
-                               Map<String, Object> properties = new HashMap<>();
-                               String layerId = HOME_STATE.equals(state) ? defaultLayerPid : state;
-                               properties.put(SuiteEvent.LAYER, layerId);
-                               properties.put(SuiteEvent.NODE_PATH, HOME_STATE);
-                               ui.getCmsView().sendEvent(SuiteEvent.switchLayer.topic(), properties);
-                       }
-                       return;
-               }
-               SuiteUi suiteUi = (SuiteUi) cmsUi;
-               Node node = stateToNode(suiteUi, state);
-               if (node == null) {
-                       suiteUi.getCmsView().navigateTo(HOME_STATE);
-               } else {
-                       suiteUi.getCmsView().sendEvent(SuiteEvent.switchLayer.topic(), SuiteEvent.eventProperties(node));
-                       suiteUi.getCmsView().sendEvent(SuiteEvent.refreshPart.topic(), SuiteEvent.eventProperties(node));
-               }
-       }
-
-       // TODO move it to an internal package?
-       static String nodeToState(Node node) {
-               return '/' + Jcr.getWorkspaceName(node) + Jcr.getPath(node);
-       }
-
-       private Node stateToNode(SuiteUi suiteUi, String state) {
-               if (suiteUi == null)
-                       return null;
-               if (state == null || !state.startsWith("/"))
-                       return null;
-
-               String path = state.substring(1);
-               String workspace;
-               if (path.equals("")) {
-                       workspace = null;
-                       path = "/";
-               } else {
-                       int index = path.indexOf('/');
-                       if (index == 0) {
-                               log.error("Cannot interpret " + state);
-//                             cmsView.navigateTo("~");
-                               return null;
-                       } else if (index > 0) {
-                               workspace = path.substring(0, index);
-                               path = path.substring(index);
-                       } else {// index<0, assuming root node
-                               workspace = path;
-                               path = "/";
-                       }
-               }
-               Session session = suiteUi.getSession(workspace);
-               if (session == null)
-                       return null;
-               Node node = Jcr.getNode(session, path);
-               return node;
-       }
-
-       /*
-        * Events management
-        */
-
-       @Override
-       public void handleEvent(Event event) {
-
-               // Specific UI related events
-               SuiteUi ui = getRelatedUi(event);
-               if (ui == null)
-                       return;
-               try {
-                       String appTitle = "";
-                       if (ui.getTitle() != null)
-                               appTitle = ui.getTitle().lead() + " - ";
-
-//                     String currentLayerId = ui.getCurrentLayerId();
-//                     SuiteLayer currentLayer = currentLayerId != null ? layersByPid.get(currentLayerId).get() : null;
-                       if (SuiteUiUtils.isTopic(event, SuiteEvent.refreshPart)) {
-                               Node node = getNode(ui, event);
-                               if (node == null)
-                                       return;
-                               CmsUiProvider uiProvider = findByType(uiProvidersByType, node);
-                               SuiteLayer layer = findByType(layersByType, node);
-                               ui.switchToLayer(layer, node);
-                               ui.getCmsView().runAs(() -> layer.view(uiProvider, ui.getCurrentWorkArea(), node));
-                               ui.getCmsView().stateChanged(nodeToState(node), appTitle + Jcr.getTitle(node));
-                       } else if (SuiteUiUtils.isTopic(event, SuiteEvent.openNewPart)) {
-                               Node node = getNode(ui, event);
-                               if (node == null)
-                                       return;
-                               CmsUiProvider uiProvider = findByType(uiProvidersByType, node);
-                               SuiteLayer layer = findByType(layersByType, node);
-                               ui.switchToLayer(layer, node);
-                               ui.getCmsView().runAs(() -> layer.open(uiProvider, ui.getCurrentWorkArea(), node));
-                               ui.getCmsView().stateChanged(nodeToState(node), appTitle + Jcr.getTitle(node));
-                       } else if (SuiteUiUtils.isTopic(event, SuiteEvent.switchLayer)) {
-                               String layerId = get(event, SuiteEvent.LAYER);
-                               if (layerId != null) {
-//                                     ui.switchToLayer(layerId, ui.getUserDir());
-                                       SuiteLayer suiteLayer = findLayer(layerId);
-                                       if (suiteLayer == null)
-                                               throw new IllegalArgumentException("No layer '" + layerId + "' available.");
-                                       Localized layerTitle = suiteLayer.getTitle();
-                                       // FIXME make sure we don't rebuild the work area twice
-                                       Composite workArea = ui.getCmsView().doAs(() -> ui.switchToLayer(layerId, ui.getUserDir()));
-                                       String title = null;
-                                       if (layerTitle != null)
-                                               title = layerTitle.lead();
-                                       Node nodeFromState = getNode(ui, event);
-                                       if (nodeFromState != null && nodeFromState.getPath().equals(ui.getUserDir().getPath())) {
-                                               // default layer view is forced
-                                               String state = defaultLayerPid.equals(layerId) ? "~" : layerId;
-                                               ui.getCmsView().stateChanged(state, appTitle + title);
-                                               suiteLayer.view(null, workArea, nodeFromState);
-                                       } else {
-                                               Node layerCurrentContext = suiteLayer.getCurrentContext(workArea);
-                                               if (layerCurrentContext != null) {
-                                                       // layer was already showing a context so we set the state to it
-                                                       ui.getCmsView().stateChanged(nodeToState(layerCurrentContext),
-                                                                       appTitle + Jcr.getTitle(layerCurrentContext));
-                                               } else {
-                                                       // no context was shown
-                                                       ui.getCmsView().stateChanged(layerId, appTitle + title);
-                                               }
-                                       }
-                               } else {
-                                       Node node = getNode(ui, event);
-                                       if (node != null) {
-                                               SuiteLayer layer = findByType(layersByType, node);
-                                               ui.getCmsView().runAs(() -> ui.switchToLayer(layer, node));
-                                       }
-                               }
-                       }
-               } catch (Exception e) {
-                       log.error("Cannot handle event " + event, e);
-//                     CmsView.getCmsView(ui).exception(e);
-               }
-
-       }
-
-       private Node getNode(SuiteUi ui, Event event) {
-               String nodePath = get(event, SuiteEvent.NODE_PATH);
-               if (nodePath != null && nodePath.equals(HOME_STATE))
-                       return ui.getUserDir();
-               String workspaceName = get(event, SuiteEvent.WORKSPACE);
-               Session session = ui.getSession(workspaceName);
-               Node node;
-               if (nodePath == null) {
-                       // look for a user
-                       String username = get(event, SuiteEvent.USERNAME);
-                       if (username == null)
-                               return null;
-                       User user = cmsUserManager.getUser(username);
-                       if (user == null)
-                               return null;
-                       LdapName userDn;
-                       try {
-                               userDn = new LdapName(user.getName());
-                       } catch (InvalidNameException e) {
-                               throw new IllegalArgumentException("Badly formatted username", e);
-                       }
-                       String userNodePath = SuiteUtils.getUserNodePath(userDn);
-                       if (Jcr.itemExists(session, userNodePath))
-                               node = Jcr.getNode(session, userNodePath);
-                       else {
-                               Session adminSession = null;
-                               try {
-                                       adminSession = CmsJcrUtils.openDataAdminSession(getRepository(), workspaceName);
-                                       SuiteUtils.getOrCreateUserNode(adminSession, userDn);
-                               } finally {
-                                       Jcr.logout(adminSession);
-                               }
-                               node = Jcr.getNode(session, userNodePath);
-                       }
-               } else {
-                       node = Jcr.getNode(session, nodePath);
-               }
-               return node;
-       }
-
-       private SuiteUi getRelatedUi(Event event) {
-               return managedUis.get(get(event, CMS_VIEW_UID_PROPERTY));
-       }
-
-       public static String get(Event event, String key) {
-               Object value = event.getProperty(key);
-               if (value == null)
-                       return null;
-//                     throw new IllegalArgumentException("Property " + key + " must be set");
-               return value.toString();
-
-       }
-
-       /*
-        * Dependency injection.
-        */
-
-       public void addUiProvider(CmsUiProvider uiProvider, Map<String, Object> properties) {
-               if (properties.containsKey(Constants.SERVICE_PID)) {
-                       String pid = (String) properties.get(Constants.SERVICE_PID);
-                       RankedObject.putIfHigherRank(uiProvidersByPid, pid, uiProvider, properties);
-               }
-               if (properties.containsKey(EntityConstants.TYPE)) {
-                       List<String> types = LangUtils.toStringList(properties.get(EntityConstants.TYPE));
-                       for (String type : types)
-                               RankedObject.putIfHigherRank(uiProvidersByType, type, uiProvider, properties);
-               }
-       }
-
-       public void removeUiProvider(CmsUiProvider uiProvider, Map<String, Object> properties) {
-               if (properties.containsKey(Constants.SERVICE_PID)) {
-                       String pid = (String) properties.get(Constants.SERVICE_PID);
-                       if (uiProvidersByPid.containsKey(pid)) {
-                               if (uiProvidersByPid.get(pid).equals(new RankedObject<CmsUiProvider>(uiProvider, properties))) {
-                                       uiProvidersByPid.remove(pid);
-                               }
-                       }
-               }
-               if (properties.containsKey(EntityConstants.TYPE)) {
-                       List<String> types = LangUtils.toStringList(properties.get(EntityConstants.TYPE));
-                       for (String type : types) {
-                               if (uiProvidersByType.containsKey(type)) {
-                                       if (uiProvidersByType.get(type).equals(new RankedObject<CmsUiProvider>(uiProvider, properties))) {
-                                               uiProvidersByType.remove(type);
-                                       }
-                               }
-                       }
-               }
-       }
-
-       public void addLayer(SuiteLayer layer, Map<String, Object> properties) {
-               if (properties.containsKey(Constants.SERVICE_PID)) {
-                       String pid = (String) properties.get(Constants.SERVICE_PID);
-                       RankedObject.putIfHigherRank(layersByPid, pid, layer, properties);
-               }
-               if (properties.containsKey(EntityConstants.TYPE)) {
-                       List<String> types = LangUtils.toStringList(properties.get(EntityConstants.TYPE));
-                       for (String type : types)
-                               RankedObject.putIfHigherRank(layersByType, type, layer, properties);
-               }
-       }
-
-       public void removeLayer(SuiteLayer layer, Map<String, Object> properties) {
-               if (properties.containsKey(Constants.SERVICE_PID)) {
-                       String pid = (String) properties.get(Constants.SERVICE_PID);
-                       if (layersByPid.containsKey(pid)) {
-                               if (layersByPid.get(pid).equals(new RankedObject<SuiteLayer>(layer, properties))) {
-                                       layersByPid.remove(pid);
-                               }
-                       }
-               }
-               if (properties.containsKey(EntityConstants.TYPE)) {
-                       List<String> types = LangUtils.toStringList(properties.get(EntityConstants.TYPE));
-                       for (String type : types) {
-                               if (layersByType.containsKey(type)) {
-                                       if (layersByType.get(type).equals(new RankedObject<CmsUiProvider>(layer, properties))) {
-                                               layersByType.remove(type);
-                                       }
-                               }
-                       }
-               }
-       }
-
-       public void setCmsUserManager(CmsUserManager cmsUserManager) {
-               this.cmsUserManager = cmsUserManager;
-       }
-
-       public Repository getRepository() {
-               return repository;
-       }
-
-       public void setRepository(Repository repository) {
-               this.repository = repository;
-       }
-
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/SuiteEvent.java b/org.argeo.app.ui/src/org/argeo/app/ui/SuiteEvent.java
deleted file mode 100644 (file)
index 6eaa607..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.argeo.app.ui;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.jcr.Node;
-
-import org.argeo.api.cms.CmsEvent;
-import org.argeo.jcr.Jcr;
-import org.osgi.service.useradmin.User;
-
-/** Events specific to Argeo Suite. */
-public enum SuiteEvent implements CmsEvent {
-       openNewPart, refreshPart, switchLayer;
-
-       public final static String LAYER = "layer";
-//     public final static String NODE_ID = "nodeId";
-       public final static String NODE_PATH = "path";
-       public final static String USERNAME = "username";
-       public final static String WORKSPACE = "workspace";
-
-       public String getTopicBase() {
-               return "argeo/suite/ui";
-       }
-
-       public static Map<String, Object> eventProperties(Node node) {
-               Map<String, Object> properties = new HashMap<>();
-               properties.put(NODE_PATH, Jcr.getPath(node));
-               properties.put(WORKSPACE, Jcr.getWorkspaceName(node));
-               return properties;
-       }
-
-       public static Map<String, Object> eventProperties(User user) {
-               Map<String, Object> properties = new HashMap<>();
-               properties.put(USERNAME, user.getName());
-               return properties;
-       }
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/SuiteIcon.java b/org.argeo.app.ui/src/org/argeo/app/ui/SuiteIcon.java
deleted file mode 100644 (file)
index bfc92c3..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-package org.argeo.app.ui;
-
-import org.argeo.cms.swt.CmsIcon;
-
-/** Icon names used by Argeo Suite. */
-public enum SuiteIcon implements CmsIcon {
-       add, save, close, closeAll, search, delete, logout, dashboard,
-       // people
-       people, person, organisation,
-       // library
-       documents, document, folder,
-       // admin and settings
-       settings, user,
-       // misc
-       task, tag, location, inbox, map;
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/SuiteLayer.java b/org.argeo.app.ui/src/org/argeo/app/ui/SuiteLayer.java
deleted file mode 100644 (file)
index a92994f..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-package org.argeo.app.ui;
-
-import javax.jcr.Node;
-
-import org.argeo.cms.Localized;
-import org.argeo.cms.ui.CmsUiProvider;
-import org.eclipse.swt.widgets.Composite;
-
-/** An UI layer for the main work area. */
-public interface SuiteLayer extends CmsUiProvider {
-       static enum Property {
-               title, icon, weights, startMaximized, singleTab, fixedEntryArea;
-       }
-
-       void view(CmsUiProvider uiProvider, Composite workArea, Node context);
-       
-       Node getCurrentContext(Composite workArea);
-
-       default void open(CmsUiProvider uiProvider, Composite workArea, Node context) {
-               view(uiProvider, workArea, context);
-       }
-
-       default Localized getTitle() {
-               return null;
-       }
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/SuiteMsg.java b/org.argeo.app.ui/src/org/argeo/app/ui/SuiteMsg.java
deleted file mode 100644 (file)
index fae15df..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.argeo.app.ui;
-
-import org.argeo.cms.Localized;
-
-/** Localized messages. */
-public enum SuiteMsg implements Localized {
-       dashboard, people, documents, locations, recentItems,
-       // NewPersonWizard
-       firstName, lastName, salutation, email, personWizardWindowTitle, personWizardPageTitle,
-       // NewOrgWizard
-       orgWizardWindowTitle, orgWizardPageTitle, legalName, legalForm, vatId,
-       // ContextAddressComposite
-       chooseAnOrganisation, street, streetComplement, zipCode, city, state, country, geopoint,
-       // FilteredOrderableEntityTable
-       filterHelp,
-       // BankAccountComposite
-       accountHolder, bankName, currency, accountNumber, bankNumber, BIC, IBAN,
-       // EditJobDialog
-       position, chosenItem, department, isPrimary, searchAndChooseEntity,
-       // ContactListCTab (e4)
-       notes, addAContact, contactValue, linkedCompany,
-       // OrgAdminInfoCTab (e4)
-       paymentAccount,
-       // OrgEditor (e4)
-       orgDetails, orgActivityLog, team, orgAdmin,
-       // PersonEditor (e4)
-       personDetails, personActivityLog, personOrgs, personSecurity,
-       // PersonSecurityCTab (e4)
-       resetPassword,
-       // Generic
-       label, aCustomLabel, description, value, name, primary, add, save, pickup,
-       // Tag
-       confirmNewTag, cannotCreateTag;
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/SuiteStyle.java b/org.argeo.app.ui/src/org/argeo/app/ui/SuiteStyle.java
deleted file mode 100644 (file)
index 7afd23c..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.argeo.app.ui;
-
-import org.argeo.api.cms.CmsStyle;
-
-/** Styles used by Argeo Suite work UI. */
-public enum SuiteStyle implements CmsStyle {
-       // header
-       header, headerTitle, headerMenu, headerMenuItem,
-       // footer
-       footer,
-       // recent items
-       recentItems,
-       // lead pane
-       leadPane, leadPaneItem, leadPaneSectionTitle, leadPaneSubSectionTitle,
-       // entry area
-       entryArea,
-       // group composite
-       titleContainer, titleLabel, subTitleLabel, formLine, formColumn, navigationBar, navigationTitle, navigationButton,
-       // forms elements
-       simpleLabel, simpleText, simpleInput,
-       // table
-       titleCell,
-       // layers
-       workArea,
-       // tabbed area
-       mainTabBody, mainTabSelected, mainTab,
-       // buttons
-       inlineButton;
-
-       @Override
-       public String getClassPrefix() {
-               return "argeo-suite";
-       }
-
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/SuiteUi.java b/org.argeo.app.ui/src/org/argeo/app/ui/SuiteUi.java
deleted file mode 100644 (file)
index b2e4385..0000000
+++ /dev/null
@@ -1,258 +0,0 @@
-package org.argeo.app.ui;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.jcr.Node;
-import javax.jcr.Repository;
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-
-import org.argeo.api.cms.CmsUi;
-import org.argeo.api.cms.CmsView;
-import org.argeo.api.cms.CmsLog;
-import org.argeo.api.cms.CmsConstants;
-import org.argeo.cms.Localized;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.jcr.Jcr;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FormLayout;
-import org.eclipse.swt.widgets.Composite;
-
-/** The view for the default ergonomics of Argeo Suite. */
-class SuiteUi extends Composite implements CmsUi {
-       private static final long serialVersionUID = 6207018859086689108L;
-       private final static CmsLog log = CmsLog.getLog(SuiteUi.class);
-
-       private Localized title;
-       private Composite header;
-       private Composite footer;
-       private Composite belowHeader;
-       private Composite leadPane;
-       private Composite sidePane;
-       private Composite dynamicArea;
-
-       private Session sysSession;
-       private Session homeSession;
-       private Node userDir;
-
-       private Map<String, SuiteLayer> layers = new HashMap<>();
-       private Map<String, Composite> workAreas = new HashMap<>();
-       private String currentLayerId = null;
-
-       private CmsView cmsView;
-
-       public SuiteUi(Composite parent, int style) {
-               super(parent, style);
-               cmsView = CmsSwtUtils.getCmsView(parent);
-               this.setLayout(CmsSwtUtils.noSpaceGridLayout());
-
-               header = new Composite(this, SWT.NONE);
-               header.setLayout(CmsSwtUtils.noSpaceGridLayout());
-               CmsSwtUtils.style(header, SuiteStyle.header);
-               header.setLayoutData(CmsSwtUtils.fillWidth());
-
-               belowHeader = new Composite(this, SWT.NONE);
-               belowHeader.setLayoutData(CmsSwtUtils.fillAll());
-
-               footer = new Composite(this, SWT.NONE);
-               footer.setLayout(CmsSwtUtils.noSpaceGridLayout());
-               CmsSwtUtils.style(footer, SuiteStyle.footer);
-               footer.setLayoutData(CmsSwtUtils.fillWidth());
-       }
-
-       public void refreshBelowHeader(boolean initApp) {
-               CmsSwtUtils.clear(belowHeader);
-               int style = getStyle();
-               if (initApp) {
-                       belowHeader.setLayout(CmsSwtUtils.noSpaceGridLayout(3));
-
-                       if (SWT.RIGHT_TO_LEFT == (style & SWT.RIGHT_TO_LEFT)) {// arabic, hebrew, etc.
-                               sidePane = new Composite(belowHeader, SWT.NONE);
-                               sidePane.setLayout(CmsSwtUtils.noSpaceGridLayout());
-                               sidePane.setLayoutData(CmsSwtUtils.fillHeight());
-                               dynamicArea = new Composite(belowHeader, SWT.NONE);
-                               leadPane = new Composite(belowHeader, SWT.NONE);
-                       } else {
-                               leadPane = new Composite(belowHeader, SWT.NONE);
-                               dynamicArea = new Composite(belowHeader, SWT.NONE);
-                               sidePane = new Composite(belowHeader, SWT.NONE);
-                               sidePane.setLayout(CmsSwtUtils.noSpaceGridLayout());
-                               sidePane.setLayoutData(CmsSwtUtils.fillHeight());
-                       }
-                       leadPane.setLayoutData(CmsSwtUtils.fillHeight());
-                       leadPane.setLayout(CmsSwtUtils.noSpaceGridLayout());
-                       CmsSwtUtils.style(leadPane, SuiteStyle.leadPane);
-
-                       dynamicArea.setLayoutData(CmsSwtUtils.fillAll());
-                       dynamicArea.setLayout(new FormLayout());
-
-               } else {
-                       belowHeader.setLayout(CmsSwtUtils.noSpaceGridLayout());
-               }
-       }
-
-       /*
-        * LAYERS
-        */
-
-       Composite getCurrentWorkArea() {
-               if (currentLayerId == null)
-                       throw new IllegalStateException("No current layer");
-               return workAreas.get(currentLayerId);
-       }
-
-       String getCurrentLayerId() {
-               return currentLayerId;
-       }
-
-       private Composite getLayer(String id, Node context) {
-               if (!layers.containsKey(id))
-                       return null;
-               if (!workAreas.containsKey(id))
-                       initLayer(id, layers.get(id), context);
-               return workAreas.get(id);
-       }
-
-       Composite switchToLayer(String layerId, Node context) {
-               Composite current = null;
-               if (currentLayerId != null) {
-                       current = getCurrentWorkArea();
-                       if (currentLayerId.equals(layerId))
-                               return current;
-               }
-               if (context == null) {
-                       if (!cmsView.isAnonymous())
-                               context = userDir;
-               }
-               Composite toShow = getLayer(layerId, context);
-               if (toShow != null) {
-                       currentLayerId = layerId;
-                       if (!isDisposed()) {
-//                             getDisplay().syncExec(() -> {
-                               if (!toShow.isDisposed()) {
-                                       toShow.moveAbove(null);
-                               } else {
-                                       log.warn("Cannot show work area because it is disposed.");
-                                       toShow = initLayer(layerId, layers.get(layerId), context);
-                                       toShow.moveAbove(null);
-                               }
-                               dynamicArea.layout(true, true);
-//                             });
-                       }
-                       return toShow;
-               } else {
-                       return current;
-               }
-       }
-
-       Composite switchToLayer(SuiteLayer layer, Node context) {
-               // TODO make it more robust
-               for (String layerId : layers.keySet()) {
-                       SuiteLayer l = layers.get(layerId);
-                       if (layer == l) {
-                               return switchToLayer(layerId, context);
-                       }
-               }
-               throw new IllegalArgumentException("Layer is not registered.");
-       }
-
-       void addLayer(String id, SuiteLayer layer) {
-               layers.put(id, layer);
-       }
-
-       void removeLayer(String id) {
-               layers.remove(id);
-               if (workAreas.containsKey(id)) {
-                       Composite workArea = workAreas.remove(id);
-                       if (!workArea.isDisposed())
-                               workArea.dispose();
-               }
-       }
-
-       protected Composite initLayer(String id, SuiteLayer layer, Node context) {
-               Composite workArea = cmsView.doAs(() -> (Composite) layer.createUiPart(dynamicArea, context));
-               CmsSwtUtils.style(workArea, SuiteStyle.workArea);
-               workArea.setLayoutData(CmsSwtUtils.coverAll());
-               workAreas.put(id, workArea);
-               return workArea;
-       }
-
-       synchronized void logout() {
-               userDir = null;
-               Jcr.logout(sysSession);
-               Jcr.logout(homeSession);
-               currentLayerId = null;
-               workAreas.clear();
-       }
-
-       /*
-        * GETTERS / SETTERS
-        */
-
-       Composite getHeader() {
-               return header;
-       }
-
-       Composite getFooter() {
-               return footer;
-       }
-
-       Composite getLeadPane() {
-               return leadPane;
-       }
-
-       Composite getSidePane() {
-               return sidePane;
-       }
-
-       Composite getBelowHeader() {
-               return belowHeader;
-       }
-
-//     Session getSysSession() {
-//             return sysSession;
-//     }
-//
-       synchronized void initSessions(Repository repository, String userDirPath) throws RepositoryException {
-               this.sysSession = repository.login();
-               this.homeSession = repository.login(CmsConstants.HOME_WORKSPACE);
-               userDir = sysSession.getNode(userDirPath);
-               addDisposeListener((e) -> {
-                       Jcr.logout(sysSession);
-                       Jcr.logout(homeSession);
-               });
-       }
-
-       Node getUserDir() {
-               return userDir;
-       }
-
-       Session getSysSession() {
-               return sysSession;
-       }
-
-       Session getSession(String workspaceName) {
-               if (workspaceName == null)
-                       return sysSession;
-               if (CmsConstants.SYS_WORKSPACE.equals(workspaceName))
-                       return sysSession;
-               else if (CmsConstants.HOME_WORKSPACE.equals(workspaceName))
-                       return homeSession;
-               else
-                       throw new IllegalArgumentException("Unknown workspace " + workspaceName);
-       }
-
-       public CmsView getCmsView() {
-               return cmsView;
-       }
-
-       public Localized getTitle() {
-               return title;
-       }
-
-       public void setTitle(Localized title) {
-               this.title = title;
-       }
-
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/SuiteUiUtils.java b/org.argeo.app.ui/src/org/argeo/app/ui/SuiteUiUtils.java
deleted file mode 100644 (file)
index 504fbd2..0000000
+++ /dev/null
@@ -1,454 +0,0 @@
-package org.argeo.app.ui;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.nio.file.Files;
-import java.nio.file.Paths;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-
-import org.apache.commons.io.IOUtils;
-import org.argeo.api.cms.CmsEditable;
-import org.argeo.api.cms.CmsEvent;
-import org.argeo.api.cms.CmsStyle;
-import org.argeo.api.cms.CmsTheme;
-import org.argeo.api.cms.CmsView;
-import org.argeo.app.api.EntityNames;
-import org.argeo.app.api.EntityType;
-import org.argeo.app.api.SuiteRole;
-import org.argeo.cms.LocaleUtils;
-import org.argeo.cms.Localized;
-import org.argeo.cms.auth.CurrentUser;
-import org.argeo.cms.swt.CmsIcon;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.swt.dialogs.LightweightDialog;
-import org.argeo.cms.ui.util.CmsLink;
-import org.argeo.cms.ui.util.CmsUiUtils;
-import org.argeo.eclipse.ui.EclipseUiUtils;
-import org.argeo.jcr.Jcr;
-import org.argeo.jcr.JcrUtils;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.ScrolledComposite;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.graphics.ImageData;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.osgi.service.event.Event;
-
-/** UI utilities related to the APAF project. */
-public class SuiteUiUtils {
-
-       /** Singleton. */
-       private SuiteUiUtils() {
-       }
-
-       /** creates a title bar composite with label and optional button */
-       public static void addTitleBar(Composite parent, String title, Boolean isEditable) {
-               Composite titleBar = new Composite(parent, SWT.NONE);
-               titleBar.setLayoutData(CmsSwtUtils.fillWidth());
-               CmsSwtUtils.style(titleBar, SuiteStyle.titleContainer);
-
-               titleBar.setLayout(CmsSwtUtils.noSpaceGridLayout(new GridLayout(2, false)));
-               Label titleLbl = new Label(titleBar, SWT.NONE);
-               titleLbl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
-               CmsSwtUtils.style(titleLbl, SuiteStyle.titleLabel);
-               titleLbl.setText(title);
-
-               if (isEditable) {
-                       Button editBtn = new Button(titleBar, SWT.PUSH);
-                       editBtn.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false));
-                       CmsSwtUtils.style(editBtn, SuiteStyle.inlineButton);
-                       editBtn.setText("Edit");
-               }
-       }
-
-       public static Label addFormLabel(Composite parent, String label) {
-               Label lbl = new Label(parent, SWT.WRAP);
-               lbl.setText(label);
-               // lbl.setLayoutData(new GridData(SWT.LEAD, SWT.CENTER, true, true));
-               CmsSwtUtils.style(lbl, SuiteStyle.simpleLabel);
-               return lbl;
-       }
-
-       public static Text addFormTextField(Composite parent, String text, String message) {
-               return addFormTextField(parent, text, message, SWT.NONE);
-       }
-
-       public static Text addFormTextField(Composite parent, String text, String message, int style) {
-               Text txt = new Text(parent, style);
-               if (text != null)
-                       txt.setText(text);
-               if (message != null)
-                       txt.setMessage(message);
-               txt.setLayoutData(new GridData(SWT.LEAD, SWT.CENTER, true, true));
-               CmsSwtUtils.style(txt, SuiteStyle.simpleText);
-               return txt;
-       }
-
-       public static Text addFormInputField(Composite parent, String placeholder) {
-               Text txt = new Text(parent, SWT.BORDER);
-
-               GridData gridData = CmsSwtUtils.fillWidth();
-               txt.setLayoutData(gridData);
-
-               if (placeholder != null)
-                       txt.setText(placeholder);
-
-               CmsSwtUtils.style(txt, SuiteStyle.simpleInput);
-               return txt;
-       }
-
-       /** creates a single horizontal-block composite for key:value display */
-       public static Text addFormLine(Composite parent, String label, String text) {
-               Composite lineComposite = new Composite(parent, SWT.NONE);
-               lineComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
-               lineComposite.setLayout(new GridLayout(2, false));
-               CmsSwtUtils.style(lineComposite, SuiteStyle.formLine);
-               addFormLabel(lineComposite, label);
-               Text txt = addFormTextField(lineComposite, text, null);
-               txt.setEditable(false);
-               txt.setLayoutData(CmsSwtUtils.fillWidth());
-               return txt;
-       }
-
-       public static Text addFormLine(Composite parent, String label, Node node, String property,
-                       CmsEditable cmsEditable) {
-               Composite lineComposite = new Composite(parent, SWT.NONE);
-               lineComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
-               lineComposite.setLayout(new GridLayout(2, false));
-               CmsSwtUtils.style(lineComposite, SuiteStyle.formLine);
-               addFormLabel(lineComposite, label);
-               String text = Jcr.get(node, property);
-//             int style = cmsEditable.isEditing() ? SWT.WRAP : SWT.WRAP;
-               Text txt = addFormTextField(lineComposite, text, null, SWT.WRAP);
-               if (cmsEditable != null && cmsEditable.isEditing()) {
-                       txt.addModifyListener((e) -> {
-                               Jcr.set(node, property, txt.getText());
-                               Jcr.save(node);
-                       });
-               } else {
-                       txt.setEditable(false);
-               }
-               txt.setLayoutData(CmsSwtUtils.fillWidth());
-               return txt;
-       }
-
-       public static Text addFormInput(Composite parent, String label, String placeholder) {
-               Composite lineComposite = new Composite(parent, SWT.NONE);
-               lineComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
-               lineComposite.setLayout(new GridLayout(2, false));
-               CmsSwtUtils.style(lineComposite, SuiteStyle.formLine);
-               addFormLabel(lineComposite, label);
-               Text txt = addFormInputField(lineComposite, placeholder);
-               txt.setLayoutData(CmsSwtUtils.fillWidth());
-               return txt;
-       }
-
-       /**
-        * creates a single horizontal-block composite for key:value display, with
-        * offset value
-        */
-       public static Text addFormLine(Composite parent, String label, String text, Integer offset) {
-               Composite lineComposite = new Composite(parent, SWT.NONE);
-               lineComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
-               lineComposite.setLayout(new GridLayout(3, false));
-               CmsSwtUtils.style(lineComposite, SuiteStyle.formLine);
-               Label offsetLbl = new Label(lineComposite, SWT.NONE);
-               GridData gridData = new GridData();
-               gridData.widthHint = offset;
-               offsetLbl.setLayoutData(gridData);
-               addFormLabel(lineComposite, label);
-               Text txt = addFormTextField(lineComposite, text, null);
-               txt.setLayoutData(CmsSwtUtils.fillWidth());
-               return txt;
-       }
-
-       /** creates a single vertical-block composite for key:value display */
-       public static Text addFormColumn(Composite parent, String label, String text) {
-//             Composite columnComposite = new Composite(parent, SWT.NONE);
-//             columnComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
-//             columnComposite.setLayout(new GridLayout(1, false));
-               addFormLabel(parent, label);
-               Text txt = addFormTextField(parent, text, null);
-               txt.setEditable(false);
-               txt.setLayoutData(CmsSwtUtils.fillWidth());
-               return txt;
-       }
-
-       public static Text addFormColumn(Composite parent, String label, Node node, String property,
-                       CmsEditable cmsEditable) {
-//             Composite columnComposite = new Composite(parent, SWT.NONE);
-//             columnComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
-//             columnComposite.setLayout(new GridLayout(1, false));
-               addFormLabel(parent, label);
-               String text = Jcr.get(node, property);
-//             int style = cmsEditable.isEditing() ? SWT.WRAP : SWT.WRAP;
-               Text txt = addFormTextField(parent, text, null, SWT.WRAP);
-               if (cmsEditable != null && cmsEditable.isEditing()) {
-                       txt.addModifyListener((e) -> {
-                               Jcr.set(node, property, txt.getText());
-                               Jcr.save(node);
-                       });
-               } else {
-                       txt.setEditable(false);
-               }
-               txt.setLayoutData(CmsSwtUtils.fillWidth());
-               return txt;
-       }
-
-       public static Label createBoldLabel(Composite parent, Localized localized) {
-               Label label = new Label(parent, SWT.LEAD);
-               label.setText(localized.lead());
-               label.setFont(EclipseUiUtils.getBoldFont(parent));
-               label.setLayoutData(new GridData(SWT.LEAD, SWT.CENTER, false, false));
-               return label;
-       }
-
-       public static Label addFormPicture(Composite parent, String label, Node fileNode) throws RepositoryException {
-               Composite lineComposite = new Composite(parent, SWT.NONE);
-               lineComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
-               lineComposite.setLayout(new GridLayout(2, true));
-               CmsSwtUtils.style(lineComposite, SuiteStyle.formLine);
-               addFormLabel(lineComposite, label);
-
-               return addPicture(lineComposite, fileNode);
-       }
-
-       public static Label addPicture(Composite parent, Node fileNode) throws RepositoryException {
-               return addPicture(parent, fileNode, null);
-       }
-
-       public static Label addPicture(Composite parent, Node fileNode, Integer maxWidth) throws RepositoryException {
-               return addPicture(parent, fileNode, maxWidth, null);
-       }
-
-       public static Label addPicture(Composite parent, Node fileNode, Integer maxWidth, Node link)
-                       throws RepositoryException {
-               Node content = fileNode.getNode(Node.JCR_CONTENT);
-
-               boolean test = false;
-               if (test) {
-                       try (InputStream in = JcrUtils.getFileAsStream(fileNode);
-                                       OutputStream out = Files.newOutputStream(Paths.get("/home/mbaudier/tmp/" + fileNode.getName()));) {
-//                             BufferedImage img = ImageIO.read(in);
-//                             System.out.println(fileNode.getName() + ": width=" + img.getWidth() + ", height=" + img.getHeight());
-                               IOUtils.copy(in, out);
-                       } catch (IOException e) {
-                               throw new RuntimeException(e);
-                       }
-
-//                     try (InputStream in = JcrUtils.getFileAsStream(fileNode);) {
-//                             ImageData imageData = new ImageData(in);
-//                             System.out.println(fileNode.getName() + ": width=" + imageData.width + ", height=" + imageData.height);
-//                     } catch (IOException e) {
-//                             throw new RuntimeException(e);
-//                     }
-               }
-               // TODO move it deeper in the middleware.
-               if (!content.isNodeType(EntityType.box.get())) {
-                       if (content.getSession().hasPermission(content.getPath(), Session.ACTION_SET_PROPERTY)) {
-                               try (InputStream in = JcrUtils.getFileAsStream(fileNode)) {
-                                       ImageData imageData = new ImageData(in);
-                                       content.addMixin(EntityType.box.get());
-                                       content.setProperty(EntityNames.SVG_WIDTH, imageData.width);
-                                       content.setProperty(EntityNames.SVG_HEIGHT, imageData.height);
-                                       content.getSession().save();
-                               } catch (IOException e) {
-                                       throw new RuntimeException(e);
-                               }
-                       }
-               }
-
-               // TODO optimise
-               Long width;
-               Long height;
-               if (content.isNodeType(EntityType.box.get())) {
-                       width = content.getProperty(EntityNames.SVG_WIDTH).getLong();
-                       height = content.getProperty(EntityNames.SVG_HEIGHT).getLong();
-               } else {
-                       try (InputStream in = JcrUtils.getFileAsStream(fileNode)) {
-                               ImageData imageData = new ImageData(in);
-                               width = Long.valueOf(imageData.width);
-                               height = Long.valueOf(imageData.height);
-                       } catch (IOException e) {
-                               throw new RuntimeException(e);
-                       }
-               }
-
-               if (maxWidth != null && width > maxWidth) {
-                       Double ratio = maxWidth.doubleValue() / width.doubleValue();
-                       width = maxWidth.longValue();
-                       height = Math.round(ratio * height);
-               }
-               Label img = new Label(parent, SWT.NONE);
-               CmsSwtUtils.markup(img);
-               StringBuffer txt = new StringBuffer();
-               String target = toLink(link);
-               if (target != null)
-                       txt.append("<a href='").append(target).append("'>");
-               txt.append(CmsUiUtils.img(fileNode, width.toString(), height.toString()));
-               if (target != null)
-                       txt.append("</a>");
-               img.setText(txt.toString());
-               if (parent.getLayout() instanceof GridLayout) {
-                       GridData gd = new GridData(SWT.CENTER, SWT.CENTER, false, false);
-                       gd.widthHint = width.intValue();
-                       gd.heightHint = height.intValue();
-                       img.setLayoutData(gd);
-               }
-
-               if (target == null)
-                       img.addMouseListener(new MouseListener() {
-                               private static final long serialVersionUID = -1362242049325206168L;
-
-                               @Override
-                               public void mouseUp(MouseEvent e) {
-                               }
-
-                               @Override
-                               public void mouseDown(MouseEvent e) {
-                               }
-
-                               @Override
-                               public void mouseDoubleClick(MouseEvent e) {
-                                       LightweightDialog dialog = new LightweightDialog(img.getShell()) {
-
-                                               @Override
-                                               protected Control createDialogArea(Composite parent) {
-                                                       parent.setLayout(new GridLayout());
-                                                       ScrolledComposite scroll = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
-                                                       scroll.setLayoutData(CmsSwtUtils.fillAll());
-                                                       scroll.setLayout(CmsSwtUtils.noSpaceGridLayout());
-                                                       scroll.setExpandHorizontal(true);
-                                                       scroll.setExpandVertical(true);
-                                                       // scroll.setAlwaysShowScrollBars(true);
-
-                                                       Composite c = new Composite(scroll, SWT.NONE);
-                                                       scroll.setContent(c);
-                                                       c.setLayout(new GridLayout());
-                                                       c.setLayoutData(CmsSwtUtils.fillAll());
-                                                       Label bigImg = new Label(c, SWT.NONE);
-                                                       CmsSwtUtils.markup(bigImg);
-                                                       bigImg.setText(CmsUiUtils.img(fileNode, Jcr.get(content, EntityNames.SVG_WIDTH),
-                                                                       Jcr.get(content, EntityNames.SVG_HEIGHT)));
-                                                       bigImg.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, true));
-                                                       return bigImg;
-                                               }
-
-                                               @Override
-                                               protected Point getInitialSize() {
-                                                       Point shellSize = img.getShell().getSize();
-                                                       return new Point(shellSize.x - 100, shellSize.y - 100);
-                                               }
-
-                                       };
-                                       dialog.open();
-                               }
-                       });
-               return img;
-       }
-
-       public static String toLink(Node node) {
-               return node != null ? "#" + CmsUiUtils.cleanPathForUrl(SuiteApp.nodeToState(node)) : null;
-       }
-
-       public static Control addLink(Composite parent, String label, Node node, CmsStyle style)
-                       throws RepositoryException {
-               String target = toLink(node);
-               CmsLink link = new CmsLink(label, target, style);
-               return link.createUi(parent, node);
-       }
-
-       public static Control addExternalLink(Composite parent, String label, String url, String plainCssAnchorClass,
-                       boolean newWindow) throws RepositoryException {
-               Label lbl = new Label(parent, SWT.NONE);
-               CmsSwtUtils.markup(lbl);
-               StringBuilder txt = new StringBuilder();
-               txt.append("<a class='" + plainCssAnchorClass + "'");
-               txt.append(" href='").append(url).append("'");
-               if (newWindow) {
-                       txt.append(" target='blank_'");
-               }
-               txt.append(">");
-               txt.append(label);
-               txt.append("</a>");
-               lbl.setText(txt.toString());
-               return lbl;
-       }
-
-       public static boolean isCoworker(CmsView cmsView) {
-               boolean coworker = cmsView.doAs(() -> CurrentUser.isInRole(SuiteRole.coworker.dn()));
-               return coworker;
-       }
-
-       public static boolean isTopic(Event event, CmsEvent cmsEvent) {
-               return event.getTopic().equals(cmsEvent.topic());
-       }
-
-       public static Button createLayerButton(Composite parent, String layer, Localized msg, CmsIcon icon,
-                       ClassLoader l10nClassLoader) {
-               CmsTheme theme = CmsSwtUtils.getCmsTheme(parent);
-               Button button = new Button(parent, SWT.PUSH);
-               CmsSwtUtils.style(button, SuiteStyle.leadPane);
-               if (icon != null)
-                       button.setImage(icon.getBigIcon(theme));
-               button.setLayoutData(new GridData(SWT.CENTER, SWT.BOTTOM, true, false));
-               // button.setToolTipText(msg.lead());
-               if (msg != null) {
-                       Label lbl = new Label(parent, SWT.CENTER);
-                       CmsSwtUtils.style(lbl, SuiteStyle.leadPane);
-                       String txt = LocaleUtils.lead(msg, l10nClassLoader);
-//                     String txt = msg.lead();
-                       lbl.setText(txt);
-                       lbl.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, true, false));
-               }
-               CmsSwtUtils.sendEventOnSelect(button, SuiteEvent.switchLayer.topic(), SuiteEvent.LAYER, layer);
-               return button;
-       }
-
-//     public static String createAndConfigureEntity(Shell shell, Session referenceSession, String mainMixin,
-//                     String... additionnalProps) {
-//
-//             Session tmpSession = null;
-//             Session mainSession = null;
-//             try {
-//                     // FIXME would not work if home is another physical workspace
-//                     tmpSession = referenceSession.getRepository().login(NodeConstants.HOME_WORKSPACE);
-//                     Node draftNode = null;
-//                     for (int i = 0; i < additionnalProps.length - 1; i += 2) {
-//                             draftNode.setProperty(additionnalProps[i], additionnalProps[i + 1]);
-//                     }
-//                     Wizard wizard = null;
-//                     CmsWizardDialog dialog = new CmsWizardDialog(shell, wizard);
-//                     // WizardDialog dialog = new WizardDialog(shell, wizard);
-//                     if (dialog.open() == Window.OK) {
-//                             String parentPath = null;// "/" + appService.getBaseRelPath(mainMixin);
-//                             // FIXME it should be possible to specify the workspace
-//                             mainSession = referenceSession.getRepository().login();
-//                             Node parent = mainSession.getNode(parentPath);
-//                             Node task = null;// appService.publishEntity(parent, mainMixin, draftNode);
-////                           task = appService.saveEntity(task, false);
-//                             referenceSession.refresh(true);
-//                             return task.getPath();
-//                     }
-//                     return null;
-//             } catch (RepositoryException e1) {
-//                     throw new JcrException(
-//                                     "Unable to create " + mainMixin + " entity with session " + referenceSession.toString(), e1);
-//             } finally {
-//                     JcrUtils.logoutQuietly(tmpSession);
-//                     JcrUtils.logoutQuietly(mainSession);
-//             }
-//     }
-
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/TermsEntryArea.java b/org.argeo.app.ui/src/org/argeo/app/ui/TermsEntryArea.java
deleted file mode 100644 (file)
index 97d8c1f..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-package org.argeo.app.ui;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-
-import org.argeo.cms.ui.CmsUiProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-
-/** Entry area for managing th etypologies. */
-public class TermsEntryArea implements CmsUiProvider {
-
-       @Override
-       public Control createUi(Composite parent, Node context) throws RepositoryException {
-               parent.setLayout(new GridLayout());
-               Label lbl = new Label(parent, SWT.NONE);
-               lbl.setText("Typologies");
-               return lbl;
-       }
-
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/dialogs/NewPersonPage.java b/org.argeo.app.ui/src/org/argeo/app/ui/dialogs/NewPersonPage.java
deleted file mode 100644 (file)
index 380330f..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-package org.argeo.app.ui.dialogs;
-
-import org.argeo.app.ui.SuiteMsg;
-import org.argeo.app.ui.SuiteUiUtils;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-
-public class NewPersonPage extends WizardPage {
-       private static final long serialVersionUID = -944349994177526468L;
-       protected Text lastNameTxt;
-       protected Text firstNameTxt;
-       protected Text emailTxt;
-
-       protected NewPersonPage(String pageName) {
-               super(pageName);
-               setTitle(SuiteMsg.personWizardPageTitle.lead());
-       }
-
-       @Override
-       public void createControl(Composite parent) {
-               parent.setLayout(new GridLayout(2, false));
-
-               // FirstName
-               SuiteUiUtils.createBoldLabel(parent, SuiteMsg.firstName);
-               firstNameTxt = new Text(parent, SWT.BORDER);
-               firstNameTxt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
-
-               // LastName
-               SuiteUiUtils.createBoldLabel(parent, SuiteMsg.lastName);
-               lastNameTxt = new Text(parent, SWT.BORDER);
-               lastNameTxt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
-
-               SuiteUiUtils.createBoldLabel(parent, SuiteMsg.email);
-               emailTxt = new Text(parent, SWT.BORDER);
-               emailTxt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
-
-               ModifyListener ml = new ModifyListener() {
-                       private static final long serialVersionUID = -1628130380128946886L;
-
-                       @Override
-                       public void modifyText(ModifyEvent event) {
-                               getContainer().updateButtons();
-                       }
-               };
-
-               firstNameTxt.addModifyListener(ml);
-               lastNameTxt.addModifyListener(ml);
-               emailTxt.addModifyListener(ml);
-
-               // Don't forget this.
-               setControl(firstNameTxt);
-               firstNameTxt.setFocus();
-
-       }
-
-//     public void updateNode(Node node, PeopleService peopleService, ResourcesService resourcesService) {
-//             ConnectJcrUtils.setJcrProperty(node, PeopleNames.PEOPLE_LAST_NAME, PropertyType.STRING, lastNameTxt.getText());
-//             ConnectJcrUtils.setJcrProperty(node, PeopleNames.PEOPLE_FIRST_NAME, PropertyType.STRING,
-//                             firstNameTxt.getText());
-//             ConnectJcrUtils.setJcrProperty(node, PeopleNames.PEOPLE_DISPLAY_NAME, PropertyType.STRING,
-//                             firstNameTxt.getText() + " " + lastNameTxt.getText());
-//             String email = emailTxt.getText();
-//             ConnectJcrUtils.setJcrProperty(node, PeopleNames.PEOPLE_PRIMARY_EMAIL, PropertyType.STRING, email);
-//             PeopleJcrUtils.createEmail(resourcesService, peopleService, node, email, true, null, null);
-//     }
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/dialogs/NewPersonWizard.java b/org.argeo.app.ui/src/org/argeo/app/ui/dialogs/NewPersonWizard.java
deleted file mode 100644 (file)
index ee9f5b9..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-package org.argeo.app.ui.dialogs;
-
-import static org.argeo.eclipse.ui.EclipseUiUtils.isEmpty;
-
-import javax.jcr.Node;
-
-import org.argeo.app.ui.SuiteMsg;
-import org.argeo.app.ui.SuiteUiUtils;
-import org.argeo.eclipse.ui.EclipseUiUtils;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-
-/** Ask first & last name. Update the passed node on finish */
-public class NewPersonWizard extends Wizard {
-       // private final static Log log = LogFactory.getLog(NewPersonWizard.class);
-
-       // Context
-       private Node person;
-
-       // This page widgets
-       protected Text lastNameTxt;
-       protected Text firstNameTxt;
-       // private Button useDistinctDisplayNameBtn;
-       // private Text displayNameTxt;
-
-       public NewPersonWizard(Node person) {
-               this.person = person;
-       }
-
-       @Override
-       public void addPages() {
-               try {
-                       MainInfoPage page = new MainInfoPage("Main page");
-                       addPage(page);
-               } catch (Exception e) {
-                       throw new RuntimeException("Cannot add page to wizard", e);
-               }
-               setWindowTitle(SuiteMsg.personWizardWindowTitle.lead());
-       }
-
-       /**
-        * Called when the user click on 'Finish' in the wizard. The task is then
-        * created and the corresponding session saved.
-        */
-       @Override
-       public boolean performFinish() {
-               String lastName = lastNameTxt.getText();
-               String firstName = firstNameTxt.getText();
-               // String displayName = displayNameTxt.getText();
-               // boolean useDistinct = useDistinctDisplayNameBtn.getSelection();
-               if (EclipseUiUtils.isEmpty(lastName) && EclipseUiUtils.isEmpty(firstName)) {
-                       MessageDialog.openError(getShell(), "Non-valid information",
-                                       "Please enter at least a name that is not empty.");
-                       return false;
-               } else {
-//                     ConnectJcrUtils.setJcrProperty(person, PEOPLE_LAST_NAME, PropertyType.STRING, lastName);
-//                     ConnectJcrUtils.setJcrProperty(person, PEOPLE_FIRST_NAME, PropertyType.STRING, firstName);
-//                     String fullName = firstName + " " + lastName;
-//                     ConnectJcrUtils.setJcrProperty(person, PEOPLE_DISPLAY_NAME, PropertyType.STRING, fullName);
-                       return true;
-               }
-       }
-
-       @Override
-       public boolean performCancel() {
-               return true;
-       }
-
-       @Override
-       public boolean canFinish() {
-               String lastName = lastNameTxt.getText();
-               String firstName = firstNameTxt.getText();
-               if (isEmpty(lastName) && isEmpty(firstName)) {
-                       return false;
-               } else
-                       return true;
-       }
-
-       protected class MainInfoPage extends WizardPage {
-               private static final long serialVersionUID = 1L;
-
-               public MainInfoPage(String pageName) {
-                       super(pageName);
-                       setTitle(SuiteMsg.personWizardPageTitle.lead());
-                       // setMessage("Please enter a last name and/or a first name.");
-               }
-
-               public void createControl(Composite parent) {
-                       parent.setLayout(new GridLayout(2, false));
-
-                       // FirstName
-                       SuiteUiUtils.createBoldLabel(parent, SuiteMsg.firstName);
-                       firstNameTxt = new Text(parent, SWT.BORDER);
-                       // firstNameTxt.setMessage("a first name");
-                       firstNameTxt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
-
-                       // LastName
-                       SuiteUiUtils.createBoldLabel(parent, SuiteMsg.lastName);
-                       lastNameTxt = new Text(parent, SWT.BORDER);
-                       // lastNameTxt.setMessage("a last name");
-                       lastNameTxt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
-
-                       // Display Name
-                       // useDistinctDisplayNameBtn = new Button(parent, SWT.CHECK);
-                       // useDistinctDisplayNameBtn.setText("Define a disting display name");
-                       // useDistinctDisplayNameBtn.setLayoutData(new GridData(SWT.FILL, SWT.CENTER,
-                       // true, false, 2, 1));
-                       //
-                       // ConnectWorkbenchUtils.createBoldLabel(parent, "Display Name");
-                       // displayNameTxt = new Text(parent, SWT.BORDER);
-                       // displayNameTxt.setMessage("an optional display name");
-                       // displayNameTxt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true,
-                       // false));
-                       // displayNameTxt.setEnabled(false);
-                       //
-                       // useDistinctDisplayNameBtn.addSelectionListener(new SelectionAdapter() {
-                       // private static final long serialVersionUID = 1L;
-                       //
-                       // @Override
-                       // public void widgetSelected(SelectionEvent e) {
-                       // displayNameTxt.setEnabled(useDistinctDisplayNameBtn.getSelection());
-                       // }
-                       // });
-
-                       ModifyListener ml = new ModifyListener() {
-                               private static final long serialVersionUID = -1628130380128946886L;
-
-                               @Override
-                               public void modifyText(ModifyEvent event) {
-                                       getContainer().updateButtons();
-                               }
-                       };
-
-                       firstNameTxt.addModifyListener(ml);
-                       lastNameTxt.addModifyListener(ml);
-                       // displayNameTxt.addModifyListener(ml);
-
-                       // Don't forget this.
-                       setControl(firstNameTxt);
-                       firstNameTxt.setFocus();
-               }
-       }
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/dialogs/NewUserWizard.java b/org.argeo.app.ui/src/org/argeo/app/ui/dialogs/NewUserWizard.java
deleted file mode 100644 (file)
index 2071872..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-package org.argeo.app.ui.dialogs;
-
-import static org.argeo.eclipse.ui.EclipseUiUtils.isEmpty;
-
-import javax.jcr.Node;
-
-import org.argeo.app.ui.SuiteMsg;
-import org.argeo.app.ui.SuiteUiUtils;
-import org.argeo.eclipse.ui.EclipseUiUtils;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-
-/** Ask first & last name. Update the passed node on finish */
-public class NewUserWizard extends Wizard {
-       // private final static Log log = LogFactory.getLog(NewPersonWizard.class);
-
-       // Context
-       private Node person;
-
-       // This page widgets
-       protected Text lastNameTxt;
-       protected Text firstNameTxt;
-       // private Button useDistinctDisplayNameBtn;
-       // private Text displayNameTxt;
-
-       public NewUserWizard(Node person) {
-               this.person = person;
-       }
-
-       @Override
-       public void addPages() {
-               try {
-                       MainInfoPage page = new MainInfoPage("Main page");
-                       addPage(page);
-               } catch (Exception e) {
-                       throw new RuntimeException("Cannot add page to wizard", e);
-               }
-               setWindowTitle(SuiteMsg.personWizardWindowTitle.lead());
-       }
-
-       /**
-        * Called when the user click on 'Finish' in the wizard. The task is then
-        * created and the corresponding session saved.
-        */
-       @Override
-       public boolean performFinish() {
-               String lastName = lastNameTxt.getText();
-               String firstName = firstNameTxt.getText();
-               // String displayName = displayNameTxt.getText();
-               // boolean useDistinct = useDistinctDisplayNameBtn.getSelection();
-               if (EclipseUiUtils.isEmpty(lastName) && EclipseUiUtils.isEmpty(firstName)) {
-                       MessageDialog.openError(getShell(), "Non-valid information",
-                                       "Please enter at least a name that is not empty.");
-                       return false;
-               } else {
-//                     ConnectJcrUtils.setJcrProperty(person, PEOPLE_LAST_NAME, PropertyType.STRING, lastName);
-//                     ConnectJcrUtils.setJcrProperty(person, PEOPLE_FIRST_NAME, PropertyType.STRING, firstName);
-//                     String fullName = firstName + " " + lastName;
-//                     ConnectJcrUtils.setJcrProperty(person, PEOPLE_DISPLAY_NAME, PropertyType.STRING, fullName);
-                       return true;
-               }
-       }
-
-       @Override
-       public boolean performCancel() {
-               return true;
-       }
-
-       @Override
-       public boolean canFinish() {
-               String lastName = lastNameTxt.getText();
-               String firstName = firstNameTxt.getText();
-               if (isEmpty(lastName) && isEmpty(firstName)) {
-                       return false;
-               } else
-                       return true;
-       }
-
-       protected class MainInfoPage extends WizardPage {
-               private static final long serialVersionUID = 1L;
-
-               public MainInfoPage(String pageName) {
-                       super(pageName);
-                       setTitle(SuiteMsg.personWizardPageTitle.lead());
-                       // setMessage("Please enter a last name and/or a first name.");
-               }
-
-               public void createControl(Composite parent) {
-                       parent.setLayout(new GridLayout(2, false));
-
-                       // FirstName
-                       SuiteUiUtils.createBoldLabel(parent, SuiteMsg.firstName);
-                       firstNameTxt = new Text(parent, SWT.BORDER);
-                       // firstNameTxt.setMessage("a first name");
-                       firstNameTxt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
-
-                       // LastName
-                       SuiteUiUtils.createBoldLabel(parent, SuiteMsg.lastName);
-                       lastNameTxt = new Text(parent, SWT.BORDER);
-                       // lastNameTxt.setMessage("a last name");
-                       lastNameTxt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
-
-                       // Display Name
-                       // useDistinctDisplayNameBtn = new Button(parent, SWT.CHECK);
-                       // useDistinctDisplayNameBtn.setText("Define a disting display name");
-                       // useDistinctDisplayNameBtn.setLayoutData(new GridData(SWT.FILL, SWT.CENTER,
-                       // true, false, 2, 1));
-                       //
-                       // ConnectWorkbenchUtils.createBoldLabel(parent, "Display Name");
-                       // displayNameTxt = new Text(parent, SWT.BORDER);
-                       // displayNameTxt.setMessage("an optional display name");
-                       // displayNameTxt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true,
-                       // false));
-                       // displayNameTxt.setEnabled(false);
-                       //
-                       // useDistinctDisplayNameBtn.addSelectionListener(new SelectionAdapter() {
-                       // private static final long serialVersionUID = 1L;
-                       //
-                       // @Override
-                       // public void widgetSelected(SelectionEvent e) {
-                       // displayNameTxt.setEnabled(useDistinctDisplayNameBtn.getSelection());
-                       // }
-                       // });
-
-                       ModifyListener ml = new ModifyListener() {
-                               private static final long serialVersionUID = -1628130380128946886L;
-
-                               @Override
-                               public void modifyText(ModifyEvent event) {
-                                       getContainer().updateButtons();
-                               }
-                       };
-
-                       firstNameTxt.addModifyListener(ml);
-                       lastNameTxt.addModifyListener(ml);
-                       // displayNameTxt.addModifyListener(ml);
-
-                       // Don't forget this.
-                       setControl(firstNameTxt);
-                       firstNameTxt.setFocus();
-               }
-       }
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/docbook/AbstractDbkViewer.java b/org.argeo.app.ui/src/org/argeo/app/ui/docbook/AbstractDbkViewer.java
deleted file mode 100644 (file)
index 5012805..0000000
+++ /dev/null
@@ -1,1034 +0,0 @@
-package org.argeo.app.ui.docbook;
-
-import static org.argeo.app.docbook.DbkType.para;
-import static org.argeo.app.docbook.DbkUtils.addDbk;
-import static org.argeo.app.docbook.DbkUtils.isDbk;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Observer;
-
-import javax.jcr.Item;
-import javax.jcr.Node;
-import javax.jcr.NodeIterator;
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-
-import org.argeo.api.cms.Cms2DSize;
-import org.argeo.api.cms.CmsEditable;
-import org.argeo.api.cms.CmsLog;
-import org.argeo.app.docbook.DbkAttr;
-import org.argeo.app.docbook.DbkType;
-import org.argeo.app.docbook.DbkUtils;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.ui.viewers.AbstractPageViewer;
-import org.argeo.cms.ui.viewers.EditablePart;
-import org.argeo.cms.ui.viewers.NodePart;
-import org.argeo.cms.ui.viewers.PropertyPart;
-import org.argeo.cms.ui.viewers.Section;
-import org.argeo.cms.ui.viewers.SectionPart;
-import org.argeo.cms.ui.widgets.EditableText;
-import org.argeo.cms.ui.widgets.StyledControl;
-import org.argeo.jcr.Jcr;
-import org.argeo.jcr.JcrException;
-import org.argeo.jcr.JcrUtils;
-import org.eclipse.rap.fileupload.FileDetails;
-import org.eclipse.rap.fileupload.FileUploadEvent;
-import org.eclipse.rap.fileupload.FileUploadHandler;
-import org.eclipse.rap.fileupload.FileUploadListener;
-import org.eclipse.rap.rwt.RWT;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-/** Base class for text viewers and editors. */
-public abstract class AbstractDbkViewer extends AbstractPageViewer implements KeyListener, Observer {
-       private static final long serialVersionUID = -2401274679492339668L;
-       private final static CmsLog log = CmsLog.getLog(AbstractDbkViewer.class);
-
-       private final Section mainSection;
-
-       private TextInterpreter textInterpreter = new DbkTextInterpreter();
-       private DbkImageManager imageManager;
-
-       private FileUploadListener fileUploadListener;
-       private DbkContextMenu styledTools;
-
-       private final boolean flat;
-
-       private boolean showMainTitle = true;
-
-       private Integer maxMediaWidth = null;
-       private String defaultSectionStyle;
-
-       protected AbstractDbkViewer(Section parent, int style, CmsEditable cmsEditable) {
-               super(parent, style, cmsEditable);
-//             CmsView cmsView = CmsView.getCmsView(parent);
-//             imageManager = cmsView.getImageManager();
-               flat = SWT.FLAT == (style & SWT.FLAT);
-
-               if (getCmsEditable().canEdit()) {
-                       fileUploadListener = new FUL();
-                       styledTools = new DbkContextMenu(this, parent.getShell());
-               }
-               this.mainSection = parent;
-               Node baseFolder = Jcr.getParent(mainSection.getNode());
-               imageManager = new DbkImageManager(baseFolder);
-               initModelIfNeeded(mainSection.getNode());
-               // layout(this.mainSection);
-       }
-
-       @Override
-       public Control getControl() {
-               return mainSection;
-       }
-
-       protected void refresh(Control control) throws RepositoryException {
-               if (!(control instanceof Section))
-                       return;
-               long begin = System.currentTimeMillis();
-               Section section = (Section) control;
-               if (section instanceof TextSection) {
-                       CmsSwtUtils.clear(section);
-                       Node node = section.getNode();
-                       TextSection textSection = (TextSection) section;
-                       String style = node.hasProperty(DbkAttr.role.name()) ? node.getProperty(DbkAttr.role.name()).getString()
-                                       : getDefaultSectionStyle();
-                       if (style != null)
-                               CmsSwtUtils.style(textSection, style);
-
-                       // Title
-                       Node titleNode = null;
-                       // We give priority to ./title vs ./info/title, like the DocBook XSL
-                       if (node.hasNode(DbkType.title.get())) {
-                               titleNode = node.getNode(DbkType.title.get());
-                       } else if (node.hasNode(DbkType.info.get() + '/' + DbkType.title.get())) {
-                               titleNode = node.getNode(DbkType.info.get() + '/' + DbkType.title.get());
-                       }
-
-                       if (titleNode != null) {
-                               boolean showTitle = getMainSection() == section ? showMainTitle : true;
-                               if (showTitle) {
-                                       if (section.getHeader() == null)
-                                               section.createHeader();
-                                       DbkSectionTitle title = newSectionTitle(textSection, titleNode);
-                                       title.setLayoutData(CmsSwtUtils.fillWidth());
-                                       updateContent(title);
-                               }
-                       }
-
-                       // content
-                       for (NodeIterator ni = node.getNodes(); ni.hasNext();) {
-                               Node child = ni.nextNode();
-                               SectionPart sectionPart = null;
-                               if (isDbk(child, DbkType.mediaobject)) {
-                                       if (child.hasNode(DbkType.imageobject.get())) {
-                                               sectionPart = newImg(textSection, child);
-                                       } else if (child.hasNode(DbkType.videoobject.get())) {
-                                               sectionPart = newVideo(textSection, child);
-                                       } else {
-                                               throw new IllegalArgumentException("Unsupported media object " + child);
-                                       }
-                               } else if (isDbk(child, DbkType.info)) {
-                                       // TODO enrich UI based on info
-                               } else if (isDbk(child, DbkType.title)) {
-                                       // already managed
-                               } else if (isDbk(child, para)) {
-                                       sectionPart = newParagraph(textSection, child);
-                               } else if (isDbk(child, DbkType.section)) {
-                                       sectionPart = newSectionPart(textSection, child);
-//                                     if (sectionPart == null)
-//                                             throw new IllegalArgumentException("Unsupported node " + child);
-                                       // TODO list node types in exception
-                               } else {
-                                       throw new IllegalArgumentException("Unsupported node type for " + child);
-                               }
-                               if (sectionPart != null && sectionPart instanceof Control)
-                                       ((Control) sectionPart).setLayoutData(CmsSwtUtils.fillWidth());
-                       }
-
-//                     if (!flat)
-                       for (NodeIterator ni = section.getNode().getNodes(DbkType.section.get()); ni.hasNext();) {
-                               Node child = ni.nextNode();
-                               if (isDbk(child, DbkType.section)) {
-                                       TextSection newSection = newTextSection(section, child);
-                                       newSection.setLayoutData(CmsSwtUtils.fillWidth());
-                                       refresh(newSection);
-                               }
-                       }
-               } else {
-                       for (Section s : section.getSubSections().values())
-                               refresh(s);
-               }
-               // section.layout(true, true);
-               long duration = System.currentTimeMillis() - begin;
-//             System.out.println(duration + " ms - " + DbkUtils.getTitle(section.getNode()));
-       }
-
-       /** To be overridden in order to provide additional SectionPart types */
-       protected TextSection newTextSection(Section section, Node node) {
-               return new TextSection(section, SWT.NONE, node);
-       }
-
-       /** To be overridden in order to provide additional SectionPart types */
-       protected SectionPart newSectionPart(TextSection textSection, Node node) {
-               return null;
-       }
-
-       // CRUD
-       protected Paragraph newParagraph(TextSection parent, Node node) throws RepositoryException {
-               Paragraph paragraph = new Paragraph(parent, parent.getStyle(), node);
-               updateContent(paragraph);
-               paragraph.setLayoutData(CmsSwtUtils.fillWidth());
-               paragraph.setMouseListener(getMouseListener());
-               paragraph.setFocusListener(getFocusListener());
-               return paragraph;
-       }
-
-       protected DbkImg newImg(TextSection parent, Node node) {
-               try {
-                       DbkImg img = new DbkImg(parent, parent.getStyle(), node, imageManager);
-                       GridData imgGd;
-                       if (maxMediaWidth != null) {
-                               imgGd = new GridData(SWT.CENTER, SWT.FILL, false, false);
-                               imgGd.widthHint = maxMediaWidth;
-                               img.setPreferredSize(new Cms2DSize(maxMediaWidth, 0));
-                       } else {
-                               imgGd = CmsSwtUtils.grabWidth(SWT.CENTER, SWT.DEFAULT);
-                       }
-                       img.setLayoutData(imgGd);
-                       updateContent(img);
-                       img.setMouseListener(getMouseListener());
-                       img.setFocusListener(getFocusListener());
-                       return img;
-               } catch (RepositoryException e) {
-                       throw new JcrException("Cannot add new image " + node, e);
-               }
-       }
-
-       protected DbkVideo newVideo(TextSection parent, Node node) {
-               try {
-                       DbkVideo video = new DbkVideo(parent, getCmsEditable().canEdit() ? SWT.NONE : SWT.READ_ONLY, node);
-                       GridData gd;
-                       if (maxMediaWidth != null) {
-                               gd = new GridData(SWT.CENTER, SWT.FILL, false, false);
-                               // TODO, manage size
-//                             gd.widthHint = maxMediaWidth;
-//                             gd.heightHint = (int) (gd.heightHint * 0.5625);
-                       } else {
-                               gd = new GridData(SWT.CENTER, SWT.FILL, false, false);
-//                             gd.widthHint = video.getWidth();
-//                             gd.heightHint = video.getHeight();
-                       }
-                       video.setLayoutData(gd);
-                       updateContent(video);
-                       return video;
-               } catch (RepositoryException e) {
-                       throw new JcrException("Cannot add new image " + node, e);
-               }
-       }
-
-       protected DbkSectionTitle newSectionTitle(TextSection parent, Node titleNode) throws RepositoryException {
-               int style = parent.getStyle();
-               Composite titleParent = newSectionHeader(parent);
-               if (parent.isTitleReadOnly())
-                       style = style | SWT.READ_ONLY;
-               DbkSectionTitle title = new DbkSectionTitle(titleParent, style, titleNode);
-               updateContent(title);
-               title.setMouseListener(getMouseListener());
-               title.setFocusListener(getFocusListener());
-               return title;
-       }
-
-       /**
-        * To be overridden in order to provide additional processing at the section
-        * level.
-        * 
-        * @return the parent to use for the {@link DbkSectionTitle}, by default
-        *         {@link Section#getHeader()}
-        */
-       protected Composite newSectionHeader(TextSection section) {
-               return section.getHeader();
-       }
-
-       protected DbkSectionTitle prepareSectionTitle(Section newSection, String titleText) throws RepositoryException {
-               Node sectionNode = newSection.getNode();
-               Node titleNode = DbkUtils.getOrAddDbk(sectionNode, DbkType.title);
-               getTextInterpreter().write(titleNode, titleText);
-               if (newSection.getHeader() == null)
-                       newSection.createHeader();
-               DbkSectionTitle sectionTitle = newSectionTitle((TextSection) newSection, sectionNode);
-               return sectionTitle;
-       }
-
-       protected void updateContent(EditablePart part) throws RepositoryException {
-               if (part instanceof SectionPart) {
-                       SectionPart sectionPart = (SectionPart) part;
-                       Node partNode = sectionPart.getNode();
-
-                       if (part instanceof StyledControl && (sectionPart.getSection() instanceof TextSection)) {
-                               TextSection section = (TextSection) sectionPart.getSection();
-                               StyledControl styledControl = (StyledControl) part;
-                               if (isDbk(partNode, para)) {
-                                       String style = partNode.hasProperty(DbkAttr.role.name())
-                                                       ? partNode.getProperty(DbkAttr.role.name()).getString()
-                                                       : section.getDefaultTextStyle();
-                                       styledControl.setStyle(style);
-                               }
-                       }
-                       // use control AFTER setting style, since it may have been reset
-
-                       if (part instanceof EditableText) {
-                               EditableText paragraph = (EditableText) part;
-                               if (paragraph == getEdited())
-                                       paragraph.setText(textInterpreter.raw(partNode));
-                               else
-                                       paragraph.setText(textInterpreter.readSimpleHtml(partNode));
-                       } else if (part instanceof DbkImg) {
-                               DbkImg editableImage = (DbkImg) part;
-                               // imageManager.load(partNode, part.getControl(),
-                               // editableImage.getPreferredImageSize());
-                       } else if (part instanceof DbkVideo) {
-                               DbkVideo video = (DbkVideo) part;
-                               video.load(part.getControl());
-                       }
-               } else if (part instanceof DbkSectionTitle) {
-                       DbkSectionTitle title = (DbkSectionTitle) part;
-                       title.setStyle(title.getSection().getTitleStyle());
-                       // use control AFTER setting style
-                       if (title == getEdited())
-                               title.setText(textInterpreter.read(title.getNode()));
-                       else
-                               title.setText(textInterpreter.readSimpleHtml(title.getNode()));
-               }
-       }
-
-       // OVERRIDDEN FROM PARENT VIEWER
-       @Override
-       protected void save(EditablePart part) throws RepositoryException {
-               if (part instanceof EditableText) {
-                       EditableText et = (EditableText) part;
-                       if (!et.getEditable())
-                               return;
-                       String text = ((Text) et.getControl()).getText();
-
-                       // String[] lines = text.split("[\r\n]+");
-                       String[] lines = { text };
-                       assert lines.length != 0;
-                       saveLine(part, lines[0]);
-                       if (lines.length > 1) {
-                               ArrayList<Control> toLayout = new ArrayList<Control>();
-                               if (part instanceof Paragraph) {
-                                       Paragraph currentParagraph = (Paragraph) et;
-                                       Section section = currentParagraph.getSection();
-                                       Node sectionNode = section.getNode();
-                                       Node currentParagraphN = currentParagraph.getNode();
-                                       for (int i = 1; i < lines.length; i++) {
-                                               Node newNode = addDbk(sectionNode, para);
-                                               // newNode.addMixin(CmsTypes.CMS_STYLED);
-                                               saveLine(newNode, lines[i]);
-                                               // second node was create as last, if it is not the next
-                                               // one, it
-                                               // means there are some in between and we can take the
-                                               // one at
-                                               // index+1 for the re-order
-                                               if (newNode.getIndex() > currentParagraphN.getIndex() + 1) {
-                                                       sectionNode.orderBefore(p(newNode.getIndex()), p(currentParagraphN.getIndex() + 1));
-                                               }
-                                               Paragraph newParagraph = newParagraph((TextSection) section, newNode);
-                                               newParagraph.moveBelow(currentParagraph);
-                                               toLayout.add(newParagraph);
-
-                                               currentParagraph = newParagraph;
-                                               currentParagraphN = newNode;
-                                       }
-                               }
-                               // TODO or rather return the created paragraphs?
-                               layout(toLayout.toArray(new Control[toLayout.size()]));
-                       }
-                       persistChanges(et.getNode());
-               }
-       }
-
-       protected void saveLine(EditablePart part, String line) {
-               if (part instanceof NodePart) {
-                       saveLine(((NodePart) part).getNode(), line);
-               } else if (part instanceof PropertyPart) {
-                       saveLine(((PropertyPart) part).getProperty(), line);
-               } else {
-                       throw new IllegalArgumentException("Unsupported part " + part);
-               }
-       }
-
-       protected void saveLine(Item item, String line) {
-               line = line.trim();
-               textInterpreter.write(item, line);
-       }
-
-       @Override
-       protected void prepare(EditablePart part, Object caretPosition) {
-               Control control = part.getControl();
-               if (control instanceof Text) {
-                       Text text = (Text) control;
-                       if (caretPosition != null)
-                               if (caretPosition instanceof Integer)
-                                       text.setSelection((Integer) caretPosition);
-                               else if (caretPosition instanceof Point) {
-//                                     layout(text);
-//                                     // TODO find a way to position the caret at the right place
-//                                     Point clickLocation = (Point) caretPosition;
-//                                     Point withinText = text.toControl(clickLocation);
-//                                     Rectangle bounds = text.getBounds();
-//                                     int width = bounds.width;
-//                                     int height = bounds.height;
-//                                     int textLength = text.getText().length();
-//                                     float area = width * height;
-//                                     float proportion = withinText.y * width + withinText.x;
-//                                     int pos = (int) (textLength * (proportion / area));
-//                                     text.setSelection(pos);
-                               }
-                       text.setData(RWT.ACTIVE_KEYS, new String[] { "BACKSPACE", "ESC", "TAB", "SHIFT+TAB", "ALT+ARROW_LEFT",
-                                       "ALT+ARROW_RIGHT", "ALT+ARROW_UP", "ALT+ARROW_DOWN", "RETURN", "CTRL+RETURN", "ENTER", "DELETE" });
-                       text.setData(RWT.CANCEL_KEYS, new String[] { "RETURN", "ALT+ARROW_LEFT", "ALT+ARROW_RIGHT" });
-                       text.addKeyListener(this);
-               } else if (part instanceof DbkImg) {
-                       ((DbkImg) part).setFileUploadListener(fileUploadListener);
-               }
-       }
-
-       // REQUIRED BY CONTEXT MENU
-       void setParagraphStyle(Paragraph paragraph, String style) {
-               try {
-                       Node paragraphNode = paragraph.getNode();
-                       if (style == null) {// default
-                               if (paragraphNode.hasProperty(DbkAttr.role.name()))
-                                       paragraphNode.getProperty(DbkAttr.role.name()).remove();
-                       } else {
-                               paragraphNode.setProperty(DbkAttr.role.name(), style);
-                       }
-                       persistChanges(paragraphNode);
-                       updateContent(paragraph);
-                       layoutPage();
-               } catch (RepositoryException e1) {
-                       throw new JcrException("Cannot set style " + style + " on " + paragraph, e1);
-               }
-       }
-
-       SectionPart insertPart(Section section, Node node) {
-               try {
-                       refresh(section);
-                       layoutPage();
-                       for (Control control : section.getChildren()) {
-                               if (control instanceof SectionPart) {
-                                       SectionPart sectionPart = (SectionPart) control;
-                                       Node partNode = sectionPart.getNode();
-                                       if (partNode.getPath().equals(node.getPath()))
-                                               return sectionPart;
-                               }
-                       }
-                       throw new IllegalStateException("New section part " + node + "not found");
-               } catch (RepositoryException e) {
-                       throw new JcrException("Cannot insert part " + node + " in section " + section.getNode(), e);
-               }
-       }
-
-       void addParagraph(SectionPart partBefore, String txt) {
-               Section section = partBefore.getSection();
-               SectionPart nextSectionPart = section.nextSectionPart(partBefore);
-               Node newNode = addDbk(section.getNode(), para);
-               textInterpreter.write(newNode, txt != null ? txt : "");
-               if (nextSectionPart != null) {
-                       try {
-                               Node nextNode = nextSectionPart.getNode();
-                               section.getNode().orderBefore(Jcr.getIndexedName(newNode), Jcr.getIndexedName(nextNode));
-                       } catch (RepositoryException e) {
-                               throw new JcrException("Cannot order " + newNode + " before " + nextSectionPart.getNode(), e);
-                       }
-               }
-               Jcr.save(newNode);
-               Paragraph paragraph = (Paragraph) insertPart(partBefore.getSection(), newNode);
-               edit(paragraph, 0);
-       }
-
-       void deletePart(SectionPart sectionPart) {
-               try {
-                       Node node = sectionPart.getNode();
-                       Session session = node.getSession();
-                       if (sectionPart instanceof DbkImg) {
-                               if (!isDbk(node, DbkType.mediaobject))
-                                       throw new IllegalArgumentException("Node " + node + " is not a media object.");
-                       }
-                       node.remove();
-                       session.save();
-                       if (sectionPart instanceof Control)
-                               ((Control) sectionPart).dispose();
-                       layoutPage();
-               } catch (RepositoryException e1) {
-                       throw new JcrException("Cannot delete " + sectionPart, e1);
-               }
-       }
-
-       void deleteSection(Section section) {
-               try {
-                       Node node = section.getNode();
-                       Session session = node.getSession();
-                       node.remove();
-                       session.save();
-                       section.dispose();
-                       layoutPage();
-               } catch (RepositoryException e1) {
-                       throw new JcrException("Cannot delete " + section, e1);
-               }
-       }
-
-       String getRawParagraphText(Paragraph paragraph) {
-               return textInterpreter.raw(paragraph.getNode());
-       }
-
-       // COMMANDS
-       protected void splitEdit() {
-               checkEdited();
-               try {
-                       if (getEdited() instanceof Paragraph) {
-                               Paragraph paragraph = (Paragraph) getEdited();
-                               Text text = (Text) paragraph.getControl();
-                               int caretPosition = text.getCaretPosition();
-                               String txt = text.getText();
-                               String first = txt.substring(0, caretPosition);
-                               String second = txt.substring(caretPosition);
-                               Node firstNode = paragraph.getNode();
-                               Node sectionNode = firstNode.getParent();
-
-                               // FIXME set content the DocBook way
-                               // firstNode.setProperty(CMS_CONTENT, first);
-                               Node secondNode = addDbk(sectionNode, para);
-                               // secondNode.addMixin(CmsTypes.CMS_STYLED);
-
-                               // second node was create as last, if it is not the next one, it
-                               // means there are some in between and we can take the one at
-                               // index+1 for the re-order
-                               if (secondNode.getIndex() > firstNode.getIndex() + 1) {
-                                       sectionNode.orderBefore(p(secondNode.getIndex()), p(firstNode.getIndex() + 1));
-                               }
-
-                               // if we die in between, at least we still have the whole text
-                               // in the first node
-                               try {
-                                       textInterpreter.write(secondNode, second);
-                                       textInterpreter.write(firstNode, first);
-                               } catch (Exception e) {
-                                       // so that no additional nodes are created:
-                                       JcrUtils.discardUnderlyingSessionQuietly(firstNode);
-                                       throw e;
-                               }
-
-                               persistChanges(firstNode);
-
-                               Paragraph secondParagraph = paragraphSplitted(paragraph, secondNode);
-                               edit(secondParagraph, 0);
-                       } else if (getEdited() instanceof DbkSectionTitle) {
-                               DbkSectionTitle sectionTitle = (DbkSectionTitle) getEdited();
-                               Text text = (Text) sectionTitle.getControl();
-                               String txt = text.getText();
-                               int caretPosition = text.getCaretPosition();
-                               Section section = sectionTitle.getSection();
-                               Node sectionNode = section.getNode();
-                               Node paragraphNode = addDbk(sectionNode, para);
-                               // paragraphNode.addMixin(CmsTypes.CMS_STYLED);
-
-                               textInterpreter.write(paragraphNode, txt.substring(caretPosition));
-                               textInterpreter.write(sectionNode.getNode(DbkType.title.get()), txt.substring(0, caretPosition));
-                               sectionNode.orderBefore(p(paragraphNode.getIndex()), p(1));
-                               persistChanges(sectionNode);
-
-                               Paragraph paragraph = sectionTitleSplitted(sectionTitle, paragraphNode);
-                               // section.layout();
-                               edit(paragraph, 0);
-                       }
-               } catch (RepositoryException e) {
-                       throw new JcrException("Cannot split " + getEdited(), e);
-               }
-       }
-
-       protected void mergeWithPrevious() {
-               checkEdited();
-               try {
-                       Paragraph paragraph = (Paragraph) getEdited();
-                       Text text = (Text) paragraph.getControl();
-                       String txt = text.getText();
-                       Node paragraphNode = paragraph.getNode();
-                       if (paragraphNode.getIndex() == 1)
-                               return;// do nothing
-                       Node sectionNode = paragraphNode.getParent();
-                       Node previousNode = sectionNode.getNode(p(paragraphNode.getIndex() - 1));
-                       String previousTxt = textInterpreter.read(previousNode);
-                       textInterpreter.write(previousNode, previousTxt + txt);
-                       paragraphNode.remove();
-                       persistChanges(sectionNode);
-
-                       Paragraph previousParagraph = paragraphMergedWithPrevious(paragraph, previousNode);
-                       edit(previousParagraph, previousTxt.length());
-               } catch (RepositoryException e) {
-                       throw new JcrException("Cannot stop editing", e);
-               }
-       }
-
-       protected void mergeWithNext() {
-               checkEdited();
-               try {
-                       Paragraph paragraph = (Paragraph) getEdited();
-                       Text text = (Text) paragraph.getControl();
-                       String txt = text.getText();
-                       Node paragraphNode = paragraph.getNode();
-                       Node sectionNode = paragraphNode.getParent();
-                       NodeIterator paragraphNodes = sectionNode.getNodes(DbkType.para.get());
-                       long size = paragraphNodes.getSize();
-                       if (paragraphNode.getIndex() == size)
-                               return;// do nothing
-                       Node nextNode = sectionNode.getNode(p(paragraphNode.getIndex() + 1));
-                       String nextTxt = textInterpreter.read(nextNode);
-                       textInterpreter.write(paragraphNode, txt + nextTxt);
-
-                       Section section = paragraph.getSection();
-                       Paragraph removed = (Paragraph) section.getSectionPart(nextNode.getIdentifier());
-
-                       nextNode.remove();
-                       persistChanges(sectionNode);
-
-                       paragraphMergedWithNext(paragraph, removed);
-                       edit(paragraph, txt.length());
-               } catch (RepositoryException e) {
-                       throw new JcrException("Cannot stop editing", e);
-               }
-       }
-
-       protected synchronized void upload(EditablePart part) {
-               try {
-                       if (part instanceof SectionPart) {
-                               SectionPart sectionPart = (SectionPart) part;
-                               Node partNode = sectionPart.getNode();
-                               int partIndex = partNode.getIndex();
-                               Section section = sectionPart.getSection();
-                               Node sectionNode = section.getNode();
-
-                               if (part instanceof Paragraph) {
-                                       // FIXME adapt to DocBook
-//                                     Node newNode = sectionNode.addNode(DocBookNames.DBK_MEDIAOBJECT, NodeType.NT_FILE);
-//                                     newNode.addNode(Node.JCR_CONTENT, NodeType.NT_RESOURCE);
-//                                     JcrUtils.copyBytesAsFile(sectionNode, p(newNode.getIndex()), new byte[0]);
-//                                     if (partIndex < newNode.getIndex() - 1) {
-//                                             // was not last
-//                                             sectionNode.orderBefore(p(newNode.getIndex()), p(partIndex - 1));
-//                                     }
-//                                     // sectionNode.orderBefore(p(partNode.getIndex()),
-//                                     // p(newNode.getIndex()));
-//                                     persistChanges(sectionNode);
-//                                     DbkImg img = newImg((TextSection) section, newNode);
-//                                     edit(img, null);
-//                                     layout(img.getControl());
-                               } else if (part instanceof DbkImg) {
-                                       if (getEdited() == part)
-                                               return;
-                                       edit(part, null);
-                                       layoutPage();
-                               }
-                       }
-               } catch (RepositoryException e) {
-                       throw new JcrException("Cannot upload", e);
-               }
-       }
-
-       protected void deepen() {
-               if (flat)
-                       return;
-               checkEdited();
-               try {
-                       if (getEdited() instanceof Paragraph) {
-                               Paragraph paragraph = (Paragraph) getEdited();
-                               Text text = (Text) paragraph.getControl();
-                               String txt = text.getText();
-                               Node paragraphNode = paragraph.getNode();
-                               Section section = paragraph.getSection();
-                               Node sectionNode = section.getNode();
-                               // main title
-                               if (section == mainSection && section instanceof TextSection && paragraphNode.getIndex() == 1
-                                               && !sectionNode.hasNode(DbkType.title.get())) {
-                                       DbkSectionTitle sectionTitle = prepareSectionTitle(section, txt);
-                                       edit(sectionTitle, 0);
-                                       return;
-                               }
-                               Node newSectionNode = addDbk(sectionNode, DbkType.section);
-                               // newSectionNode.addMixin(NodeType.MIX_TITLE);
-                               sectionNode.orderBefore(h(newSectionNode.getIndex()), h(1));
-
-                               int paragraphIndex = paragraphNode.getIndex();
-                               String sectionPath = sectionNode.getPath();
-                               String newSectionPath = newSectionNode.getPath();
-                               while (sectionNode.hasNode(p(paragraphIndex + 1))) {
-                                       Node parag = sectionNode.getNode(p(paragraphIndex + 1));
-                                       sectionNode.getSession().move(sectionPath + '/' + p(paragraphIndex + 1),
-                                                       newSectionPath + '/' + DbkType.para.get());
-                                       SectionPart sp = section.getSectionPart(parag.getIdentifier());
-                                       if (sp instanceof Control)
-                                               ((Control) sp).dispose();
-                               }
-                               // create title
-                               Node titleNode = DbkUtils.addDbk(newSectionNode, DbkType.title);
-                               // newSectionNode.addNode(DocBookType.TITLE, DocBookType.TITLE);
-                               getTextInterpreter().write(titleNode, txt);
-
-                               TextSection newSection = new TextSection(section, section.getStyle(), newSectionNode);
-                               newSection.setLayoutData(CmsSwtUtils.fillWidth());
-                               newSection.moveBelow(paragraph);
-
-                               // dispose
-                               paragraphNode.remove();
-                               paragraph.dispose();
-
-                               refresh(newSection);
-                               newSection.getParent().layout();
-                               layout(newSection);
-                               persistChanges(sectionNode);
-                       } else if (getEdited() instanceof DbkSectionTitle) {
-                               DbkSectionTitle sectionTitle = (DbkSectionTitle) getEdited();
-                               Section section = sectionTitle.getSection();
-                               Section parentSection = section.getParentSection();
-                               if (parentSection == null)
-                                       return;// cannot deepen main section
-                               Node sectionN = section.getNode();
-                               Node parentSectionN = parentSection.getNode();
-                               if (sectionN.getIndex() == 1)
-                                       return;// cannot deepen first section
-                               Node previousSectionN = parentSectionN.getNode(h(sectionN.getIndex() - 1));
-                               NodeIterator subSections = previousSectionN.getNodes(DbkType.section.get());
-                               int subsectionsCount = (int) subSections.getSize();
-                               previousSectionN.getSession().move(sectionN.getPath(),
-                                               previousSectionN.getPath() + "/" + h(subsectionsCount + 1));
-                               section.dispose();
-                               TextSection newSection = new TextSection(section, section.getStyle(), sectionN);
-                               refresh(newSection);
-                               persistChanges(previousSectionN);
-                       }
-               } catch (RepositoryException e) {
-                       throw new JcrException("Cannot deepen " + getEdited(), e);
-               }
-       }
-
-       protected void undeepen() {
-               if (flat)
-                       return;
-               checkEdited();
-               try {
-                       if (getEdited() instanceof Paragraph) {
-                               upload(getEdited());
-                       } else if (getEdited() instanceof DbkSectionTitle) {
-                               DbkSectionTitle sectionTitle = (DbkSectionTitle) getEdited();
-                               Section section = sectionTitle.getSection();
-                               Node sectionNode = section.getNode();
-                               Section parentSection = section.getParentSection();
-                               if (parentSection == null)
-                                       return;// cannot undeepen main section
-
-                               // choose in which section to merge
-                               Section mergedSection;
-                               if (sectionNode.getIndex() == 1)
-                                       mergedSection = section.getParentSection();
-                               else {
-                                       Map<String, Section> parentSubsections = parentSection.getSubSections();
-                                       ArrayList<Section> lst = new ArrayList<Section>(parentSubsections.values());
-                                       mergedSection = lst.get(sectionNode.getIndex() - 1);
-                               }
-                               Node mergedNode = mergedSection.getNode();
-                               boolean mergedHasSubSections = mergedNode.hasNode(DbkType.section.get());
-
-                               // title as paragraph
-                               Node newParagrapheNode = addDbk(mergedNode, para);
-                               // newParagrapheNode.addMixin(CmsTypes.CMS_STYLED);
-                               if (mergedHasSubSections)
-                                       mergedNode.orderBefore(p(newParagrapheNode.getIndex()), h(1));
-                               String txt = getTextInterpreter().read(sectionNode.getNode(DbkType.title.get()));
-                               getTextInterpreter().write(newParagrapheNode, txt);
-                               // move
-                               NodeIterator paragraphs = sectionNode.getNodes(para.get());
-                               while (paragraphs.hasNext()) {
-                                       Node p = paragraphs.nextNode();
-                                       SectionPart sp = section.getSectionPart(p.getIdentifier());
-                                       if (sp instanceof Control)
-                                               ((Control) sp).dispose();
-                                       mergedNode.getSession().move(p.getPath(), mergedNode.getPath() + '/' + para.get());
-                                       if (mergedHasSubSections)
-                                               mergedNode.orderBefore(p(p.getIndex()), h(1));
-                               }
-
-                               Iterator<Section> subsections = section.getSubSections().values().iterator();
-                               // NodeIterator sections = sectionNode.getNodes(CMS_H);
-                               while (subsections.hasNext()) {
-                                       Section subsection = subsections.next();
-                                       Node s = subsection.getNode();
-                                       mergedNode.getSession().move(s.getPath(), mergedNode.getPath() + '/' + DbkType.section.get());
-                                       subsection.dispose();
-                               }
-
-                               // remove section
-                               section.getNode().remove();
-                               section.dispose();
-
-                               refresh(mergedSection);
-                               mergedSection.getParent().layout();
-                               layout(mergedSection);
-                               persistChanges(mergedNode);
-                       }
-               } catch (RepositoryException e) {
-                       throw new JcrException("Cannot undeepen " + getEdited(), e);
-               }
-       }
-
-       // UI CHANGES
-       protected Paragraph paragraphSplitted(Paragraph paragraph, Node newNode) throws RepositoryException {
-               Section section = paragraph.getSection();
-               updateContent(paragraph);
-               Paragraph newParagraph = newParagraph((TextSection) section, newNode);
-               newParagraph.setLayoutData(CmsSwtUtils.fillWidth());
-               newParagraph.moveBelow(paragraph);
-               layout(paragraph.getControl(), newParagraph.getControl());
-               return newParagraph;
-       }
-
-       protected Paragraph sectionTitleSplitted(DbkSectionTitle sectionTitle, Node newNode) throws RepositoryException {
-               updateContent(sectionTitle);
-               Paragraph newParagraph = newParagraph(sectionTitle.getSection(), newNode);
-               // we assume beforeFirst is not null since there was a sectionTitle
-               newParagraph.moveBelow(sectionTitle.getSection().getHeader());
-               layout(sectionTitle.getControl(), newParagraph.getControl());
-               return newParagraph;
-       }
-
-       protected Paragraph paragraphMergedWithPrevious(Paragraph removed, Node remaining) throws RepositoryException {
-               Section section = removed.getSection();
-               removed.dispose();
-
-               Paragraph paragraph = (Paragraph) section.getSectionPart(remaining.getIdentifier());
-               updateContent(paragraph);
-               layout(paragraph.getControl());
-               return paragraph;
-       }
-
-       protected void paragraphMergedWithNext(Paragraph remaining, Paragraph removed) throws RepositoryException {
-               removed.dispose();
-               updateContent(remaining);
-               layout(remaining.getControl());
-       }
-
-       // UTILITIES
-       protected String p(Integer index) {
-               StringBuilder sb = new StringBuilder(6);
-               sb.append(para.get()).append('[').append(index).append(']');
-               return sb.toString();
-       }
-
-       protected String h(Integer index) {
-               StringBuilder sb = new StringBuilder(5);
-               sb.append(DbkType.section.get()).append('[').append(index).append(']');
-               return sb.toString();
-       }
-
-       // GETTERS / SETTERS
-       public Section getMainSection() {
-               return mainSection;
-       }
-
-       public boolean isFlat() {
-               return flat;
-       }
-
-       public TextInterpreter getTextInterpreter() {
-               return textInterpreter;
-       }
-
-       // KEY LISTENER
-       @Override
-       public void keyPressed(KeyEvent ke) {
-               if (log.isTraceEnabled())
-                       log.trace(ke);
-
-               if (getEdited() == null)
-                       return;
-               boolean altPressed = (ke.stateMask & SWT.ALT) != 0;
-               boolean shiftPressed = (ke.stateMask & SWT.SHIFT) != 0;
-               boolean ctrlPressed = (ke.stateMask & SWT.CTRL) != 0;
-
-               try {
-                       // Common
-                       if (ke.keyCode == SWT.ESC) {
-//                             cancelEdit();
-                               saveEdit();
-                       } else if (ke.character == '\r') {
-                               if (!shiftPressed)
-                                       splitEdit();
-                       } else if (ke.character == 'z') {
-                               if (ctrlPressed)
-                                       cancelEdit();
-                       } else if (ke.character == 'S') {
-                               if (ctrlPressed)
-                                       saveEdit();
-                       } else if (ke.character == '\t') {
-                               if (!shiftPressed) {
-                                       deepen();
-                               } else if (shiftPressed) {
-                                       undeepen();
-                               }
-                       } else {
-                               if (getEdited() instanceof Paragraph) {
-                                       Paragraph paragraph = (Paragraph) getEdited();
-                                       Section section = paragraph.getSection();
-                                       if (altPressed && ke.keyCode == SWT.ARROW_RIGHT) {
-                                               edit(section.nextSectionPart(paragraph), 0);
-                                       } else if (altPressed && ke.keyCode == SWT.ARROW_LEFT) {
-                                               edit(section.previousSectionPart(paragraph), 0);
-                                       } else if (ke.character == SWT.BS) {
-                                               Text text = (Text) paragraph.getControl();
-                                               int caretPosition = text.getCaretPosition();
-                                               if (caretPosition == 0) {
-                                                       mergeWithPrevious();
-                                               }
-                                       } else if (ke.character == SWT.DEL) {
-                                               Text text = (Text) paragraph.getControl();
-                                               int caretPosition = text.getCaretPosition();
-                                               int charcount = text.getCharCount();
-                                               if (caretPosition == charcount) {
-                                                       mergeWithNext();
-                                               }
-                                       }
-                               }
-                       }
-               } catch (Exception e) {
-                       ke.doit = false;
-                       notifyEditionException(e);
-               }
-       }
-
-       @Override
-       public void keyReleased(KeyEvent e) {
-       }
-
-       // MOUSE LISTENER
-       @Override
-       protected MouseListener createMouseListener() {
-               return new ML();
-       }
-
-       private class ML extends MouseAdapter {
-               private static final long serialVersionUID = 8526890859876770905L;
-
-               @Override
-               public void mouseDoubleClick(MouseEvent e) {
-                       if (e.button == 1) {
-                               Control source = (Control) e.getSource();
-                               EditablePart composite = findDataParent(source);
-                               Point point = new Point(e.x, e.y);
-                               if (composite instanceof DbkImg) {
-                                       if (getCmsEditable().canEdit()) {
-                                               if (getCmsEditable().isEditing() && !(getEdited() instanceof DbkImg)) {
-                                                       if (source == mainSection)
-                                                               return;
-                                                       EditablePart part = findDataParent(source);
-                                                       upload(part);
-                                               } else {
-                                                       getCmsEditable().startEditing();
-                                               }
-                                       }
-                               } else if (source instanceof Label) {
-                                       Label lbl = (Label) source;
-                                       Rectangle bounds = lbl.getBounds();
-                                       float width = bounds.width;
-                                       float height = bounds.height;
-                                       float textLength = lbl.getText().length();
-                                       float area = width * height;
-                                       float charArea = area / textLength;
-                                       float lines = textLength / width;
-                                       float proportion = point.y * width + point.x;
-                                       int pos = (int) (textLength * (proportion / area));
-                                       // TODO refine it
-                                       edit(composite, (Integer) pos);
-                               } else {
-                                       edit(composite, source.toDisplay(point));
-                               }
-                       }
-               }
-
-               @Override
-               public void mouseDown(MouseEvent e) {
-                       if (getCmsEditable().isEditing()) {
-                               if (e.button == 3) {
-                                       EditablePart composite = findDataParent((Control) e.getSource());
-                                       if (styledTools != null) {
-                                               List<String> styles = getAvailableStyles(composite);
-                                               styledTools.show(composite, new Point(e.x, e.y), styles);
-                                       }
-                               }
-                       }
-               }
-
-               @Override
-               public void mouseUp(MouseEvent e) {
-               }
-       }
-
-       protected List<String> getAvailableStyles(EditablePart editablePart) {
-               return new ArrayList<>();
-       }
-
-       public void setMaxMediaWidth(Integer maxMediaWidth) {
-               this.maxMediaWidth = maxMediaWidth;
-       }
-
-       public void setShowMainTitle(boolean showMainTitle) {
-               this.showMainTitle = showMainTitle;
-       }
-
-       public String getDefaultSectionStyle() {
-               return defaultSectionStyle;
-       }
-
-       public void setDefaultSectionStyle(String defaultSectionStyle) {
-               this.defaultSectionStyle = defaultSectionStyle;
-       }
-
-       // FILE UPLOAD LISTENER
-       private class FUL implements FileUploadListener {
-               public void uploadProgress(FileUploadEvent event) {
-                       // TODO Monitor upload progress
-               }
-
-               public void uploadFailed(FileUploadEvent event) {
-                       throw new RuntimeException("Upload failed " + event, event.getException());
-               }
-
-               public void uploadFinished(FileUploadEvent event) {
-                       for (FileDetails file : event.getFileDetails()) {
-                               if (log.isDebugEnabled())
-                                       log.debug("Received: " + file.getFileName());
-                       }
-                       mainSection.getDisplay().syncExec(new Runnable() {
-                               @Override
-                               public void run() {
-                                       saveEdit();
-                               }
-                       });
-                       FileUploadHandler uploadHandler = (FileUploadHandler) event.getSource();
-                       uploadHandler.dispose();
-               }
-       }
-}
\ No newline at end of file
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/docbook/CustomDbkEditor.java b/org.argeo.app.ui/src/org/argeo/app/ui/docbook/CustomDbkEditor.java
deleted file mode 100644 (file)
index 16845ae..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.argeo.app.ui.docbook;
-
-import javax.jcr.Node;
-
-import org.argeo.api.cms.CmsEditable;
-import org.argeo.cms.ui.viewers.Section;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Manages hardcoded sections as an arbitrary hierarchy under the main section,
- * which contains no text and no title.
- */
-public class CustomDbkEditor extends AbstractDbkViewer {
-       private static final long serialVersionUID = 656302500183820802L;
-
-       public CustomDbkEditor(Composite parent, int style, Node textNode, CmsEditable cmsEditable) {
-               this(new Section(parent, style, textNode), style, cmsEditable);
-       }
-
-       public CustomDbkEditor(Section parent, int style, CmsEditable cmsEditable) {
-               super(parent, style, cmsEditable);
-       }
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkContextMenu.java b/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkContextMenu.java
deleted file mode 100644 (file)
index cf45ef9..0000000
+++ /dev/null
@@ -1,230 +0,0 @@
-package org.argeo.app.ui.docbook;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.jcr.Node;
-
-import org.argeo.api.cms.CmsEditable;
-import org.argeo.app.docbook.DbkMsg;
-import org.argeo.app.docbook.DbkUtils;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.swt.MouseDown;
-import org.argeo.cms.ui.viewers.EditablePart;
-import org.argeo.cms.ui.viewers.NodePart;
-import org.argeo.cms.ui.viewers.Section;
-import org.argeo.cms.ui.viewers.SectionPart;
-import org.argeo.cms.ui.widgets.EditableText;
-import org.argeo.cms.ui.widgets.Img;
-import org.argeo.jcr.Jcr;
-import org.eclipse.rap.rwt.RWT;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.ShellEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-/** Dialog to edit a text part. */
-class DbkContextMenu {
-       private final AbstractDbkViewer textViewer;
-
-       private Shell shell;
-
-       DbkContextMenu(AbstractDbkViewer textViewer, Shell parentShell) {
-//             shell = new Shell(display, SWT.NO_TRIM | SWT.BORDER | SWT.ON_TOP);
-               shell = new Shell(parentShell, SWT.BORDER);
-//             super(display, SWT.NO_TRIM | SWT.BORDER | SWT.ON_TOP);
-               this.textViewer = textViewer;
-               shell.setLayout(new GridLayout());
-               // shell.setData(RWT.CUSTOM_VARIANT, TEXT_STYLED_TOOLS_DIALOG);
-
-               shell.addShellListener(new ToolsShellListener());
-       }
-
-       void show(EditablePart editablePart, Point location, List<String> availableStyles) {
-               if (shell.isVisible())
-                       shell.setVisible(false);
-               CmsSwtUtils.clear(shell);
-               Composite parent = shell;
-               CmsEditable cmsEditable = textViewer.getCmsEditable();
-//             if (availableStyles.isEmpty())
-//                     return;
-
-               if (editablePart instanceof Paragraph) {
-                       Paragraph paragraph = (Paragraph) editablePart;
-                       deletePartB(parent, DbkMsg.deleteParagraph.lead(), paragraph);
-                       insertMediaB(parent,  paragraph);
-
-               } else if (editablePart instanceof Img) {
-                       Img img = (Img) editablePart;
-                       deletePartB(parent, DbkMsg.deleteMedia.lead(), img);
-                       insertMediaB(parent, img);
-                       insertParagraphB(parent, DbkMsg.insertParagraph.lead(), img);
-
-               } else if (editablePart instanceof DbkSectionTitle) {
-                       DbkSectionTitle sectionTitle = (DbkSectionTitle) editablePart;
-                       TextSection section = sectionTitle.getSection();
-                       if (!section.isTitleReadOnly()) {
-                               Label deleteB = new Label(shell, SWT.NONE);
-                               deleteB.setText(DbkMsg.deleteSection.lead());
-                               deleteB.addMouseListener((MouseDown) (e) -> {
-                                       textViewer.deleteSection(section);
-                                       hide();
-                               });
-                       }
-                       insertMediaB(parent,  sectionTitle.getSection(), sectionTitle);
-               }
-
-               StyledToolMouseListener stml = new StyledToolMouseListener(editablePart);
-               List<StyleButton> styleButtons = new ArrayList<DbkContextMenu.StyleButton>();
-               if (cmsEditable.isEditing()) {
-                       for (String style : availableStyles) {
-                               StyleButton styleButton = new StyleButton(shell, SWT.WRAP);
-                               if (!"".equals(style))
-                                       styleButton.setStyle(style);
-                               else
-                                       styleButton.setStyle(null);
-                               styleButton.setMouseListener(stml);
-                               styleButtons.add(styleButton);
-                       }
-               } else if (cmsEditable.canEdit()) {
-                       // Edit
-//                     Label editButton = new Label(shell, SWT.NONE);
-//                     editButton.setText("Edit");
-//                     editButton.addMouseListener(stml);
-               }
-
-               if (editablePart instanceof Paragraph) {
-                       final int size = 32;
-                       String text = textViewer.getRawParagraphText((Paragraph) editablePart);
-                       String textToShow = text.length() > size ? text.substring(0, size - 3) + "..." : text;
-                       for (StyleButton styleButton : styleButtons) {
-                               styleButton.setText((styleButton.style == null ? "default" : styleButton.style) + " : " + textToShow);
-                       }
-               }
-
-               shell.pack();
-               shell.layout();
-               if (editablePart instanceof Control) {
-                       int height = shell.getSize().y;
-                       int parentShellHeight = shell.getShell().getSize().y;
-                       if ((location.y + height) < parentShellHeight) {
-                               shell.setLocation(((Control) editablePart).toDisplay(location.x, location.y));
-                       } else {
-                               shell.setLocation(((Control) editablePart).toDisplay(location.x, location.y - parentShellHeight));
-                       }
-               }
-
-               if (shell.getChildren().length != 0)
-                       shell.open();
-       }
-
-       void hide() {
-               shell.setVisible(false);
-       }
-
-       protected void insertMediaB(Composite parent, SectionPart sectionPart) {
-               insertMediaB(parent,  sectionPart.getSection(), sectionPart);
-       }
-
-       protected void insertMediaB(Composite parent, Section section, NodePart nodePart) {
-               Label insertPictureB = new Label(parent, SWT.NONE);
-               insertPictureB.setText(DbkMsg.insertPicture.lead());
-               insertPictureB.addMouseListener((MouseDown) (e) -> {
-                       Node newNode = DbkUtils.insertImageAfter(nodePart.getNode());
-                       Jcr.save(newNode);
-                       textViewer.insertPart(section, newNode);
-                       hide();
-               });
-               Label insertVideoB = new Label(parent, SWT.NONE);
-               insertVideoB.setText(DbkMsg.insertVideo.lead());
-               insertVideoB.addMouseListener((MouseDown) (e) -> {
-                       Node newNode = DbkUtils.insertVideoAfter(nodePart.getNode());
-                       Jcr.save(newNode);
-                       textViewer.insertPart(section, newNode);
-                       hide();
-               });
-
-       }
-
-       protected void insertParagraphB(Composite parent, String msg, SectionPart sectionPart) {
-               Label insertMediaB = new Label(parent, SWT.NONE);
-               insertMediaB.setText(msg);
-               insertMediaB.addMouseListener((MouseDown) (e) -> {
-                       textViewer.addParagraph(sectionPart, null);
-                       hide();
-               });
-       }
-
-       protected void deletePartB(Composite parent, String msg, SectionPart sectionPart) {
-               Label deleteB = new Label(shell, SWT.NONE);
-               deleteB.setText(msg);
-               deleteB.addMouseListener((MouseDown) (e) -> {
-                       textViewer.deletePart(sectionPart);
-                       hide();
-               });
-       }
-
-       class StyleButton extends EditableText {
-               private static final long serialVersionUID = 7731102609123946115L;
-
-               String style;
-
-               public StyleButton(Composite parent, int style) {
-                       super(parent, style);
-               }
-
-               @Override
-               public void setStyle(String style) {
-                       this.style = style;
-                       super.setStyle(style);
-               }
-
-//             private Label label;
-//
-//             public StyleButton(Composite parent, int swtStyle) {
-//                     super(parent, SWT.NONE);
-//                     setLayout(new GridLayout());
-//                     label = new Label(this, swtStyle);
-//             }
-//
-//             public Label getLabel() {
-//                     return label;
-//             }
-
-       }
-
-       class StyledToolMouseListener extends MouseAdapter {
-               private static final long serialVersionUID = 8516297091549329043L;
-               private EditablePart editablePart;
-
-               public StyledToolMouseListener(EditablePart editablePart) {
-                       super();
-                       this.editablePart = editablePart;
-               }
-
-               @Override
-               public void mouseDown(MouseEvent e) {
-                       // TODO make it more robust.
-                       Label sb = (Label) e.getSource();
-                       Object style = sb.getData(RWT.CUSTOM_VARIANT);
-                       textViewer.setParagraphStyle((Paragraph) editablePart, style == null ? null : style.toString());
-                       hide();
-               }
-       }
-
-       class ToolsShellListener extends org.eclipse.swt.events.ShellAdapter {
-               private static final long serialVersionUID = 8432350564023247241L;
-
-               @Override
-               public void shellDeactivated(ShellEvent e) {
-                       hide();
-               }
-
-       }
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkImageManager.java b/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkImageManager.java
deleted file mode 100644 (file)
index 32bbdd9..0000000
+++ /dev/null
@@ -1,175 +0,0 @@
-package org.argeo.app.ui.docbook;
-
-import static javax.jcr.Node.JCR_CONTENT;
-import static javax.jcr.Property.JCR_DATA;
-import static javax.jcr.nodetype.NodeType.NT_FILE;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.UnsupportedEncodingException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URLEncoder;
-import java.nio.charset.StandardCharsets;
-
-import javax.jcr.Binary;
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-import javax.jcr.nodetype.NodeType;
-
-import org.argeo.api.cms.Cms2DSize;
-import org.argeo.api.cms.CmsImageManager;
-import org.argeo.app.api.EntityNames;
-import org.argeo.app.api.EntityType;
-import org.argeo.app.docbook.DbkAttr;
-import org.argeo.app.docbook.DbkType;
-import org.argeo.app.docbook.DbkUtils;
-import org.argeo.cms.ui.util.CmsUiUtils;
-import org.argeo.cms.ui.util.DefaultImageManager;
-import org.argeo.jcr.JcrException;
-import org.argeo.jcr.JcrUtils;
-import org.eclipse.swt.graphics.ImageData;
-
-/** Add DocBook images support to {@link CmsImageManager}. */
-public class DbkImageManager extends DefaultImageManager {
-       private Node baseFolder = null;
-
-       public DbkImageManager(Node baseFolder) {
-               this.baseFolder = baseFolder;
-       }
-
-       Node getImageDataNode(Node mediaObjectNode) {
-               try {
-                       if (mediaObjectNode.hasNode(DbkType.imageobject.get())) {
-                               Node imageDataNode = mediaObjectNode.getNode(DbkType.imageobject.get())
-                                               .getNode(DbkType.imagedata.get());
-                               return imageDataNode;
-                       } else {
-                               throw new IllegalStateException("No image data found for " + mediaObjectNode);
-                       }
-               } catch (RepositoryException e) {
-                       throw new JcrException(e);
-               }
-       }
-
-       @Override
-       public Binary getImageBinary(Node node) {
-               Node fileNode = null;
-               if (DbkUtils.isDbk(node, DbkType.mediaobject)) {
-                       Node imageDataNode = getImageDataNode(node);
-                       fileNode = getFileNode(imageDataNode);
-               }
-               try {
-                       if (node.isNodeType(NT_FILE)) {
-                               fileNode = node;
-                       }
-                       if (fileNode != null) {
-                               return node.getNode(JCR_CONTENT).getProperty(JCR_DATA).getBinary();
-                       } else {
-                               return null;
-                       }
-               } catch (RepositoryException e) {
-                       throw new JcrException(e);
-               }
-       }
-
-       public Cms2DSize getImageSize(Node mediaObjectNode) {
-               Node imageDataNode = getImageDataNode(mediaObjectNode);
-               Node fileNode = getFileNode(imageDataNode);
-               if (fileNode == null)
-                       return new Cms2DSize(0, 0);
-               try {
-                       Cms2DSize intrinsicSize;
-                       if (fileNode.hasProperty(EntityNames.SVG_WIDTH) && fileNode.hasProperty(EntityNames.SVG_HEIGHT)) {
-                               int width = (int) fileNode.getProperty(EntityNames.SVG_WIDTH).getLong();
-                               int height = (int) fileNode.getProperty(EntityNames.SVG_HEIGHT).getLong();
-                               intrinsicSize = new Cms2DSize(width, height);
-                       } else {
-                               try (InputStream in = JcrUtils.getFileAsStream(fileNode)) {
-                                       ImageData id = new ImageData(in);
-                                       intrinsicSize = updateSize(fileNode, id);
-                               } catch (IOException e) {
-                                       throw new RuntimeException("Cannot load file " + fileNode, e);
-                               }
-                       }
-                       // TODO interpret image data infos
-                       return intrinsicSize;
-               } catch (RepositoryException e) {
-                       throw new JcrException(e);
-               }
-       }
-
-       protected Cms2DSize updateSize(Node fileNode, ImageData id) throws RepositoryException {
-               fileNode.addMixin(EntityType.box.get());
-               fileNode.setProperty(EntityNames.SVG_WIDTH, id.width);
-               fileNode.setProperty(EntityNames.SVG_HEIGHT, id.height);
-               return new Cms2DSize(id.width, id.height);
-       }
-
-       @Override
-       protected void processNewImageFile(Node mediaObjectNode, Node fileNode, ImageData id)
-                       throws RepositoryException, IOException {
-               Node imageDataNode = getImageDataNode(mediaObjectNode);
-               updateSize(fileNode, id);
-               String filePath = fileNode.getPath();
-               String relPath = filePath.substring(baseFolder.getPath().length() + 1);
-               imageDataNode.setProperty(DbkAttr.fileref.name(), relPath);
-       }
-
-       @Override
-       public String getImageUrl(Node mediaObjectNode) {
-               Node imageDataNode = getImageDataNode(mediaObjectNode);
-               // TODO factorise
-               String fileref = null;
-               try {
-                       if (imageDataNode.hasProperty(DbkAttr.fileref.name()))
-                               fileref = imageDataNode.getProperty(DbkAttr.fileref.name()).getString();
-               } catch (RepositoryException e) {
-                       throw new JcrException(e);
-               }
-               if (fileref == null)
-                       return null;
-               URI fileUri;
-               try {
-                       // FIXME it messes up with the '/'
-                       fileUri = new URI(URLEncoder.encode(fileref, StandardCharsets.UTF_8.toString()));
-               } catch (URISyntaxException | UnsupportedEncodingException e) {
-                       throw new IllegalArgumentException("File ref in " + imageDataNode + " is badly formatted", e);
-               }
-               if (fileUri.getScheme() != null)
-                       return fileUri.toString();
-               // local
-               Node fileNode = getFileNode(imageDataNode);
-               String url = CmsUiUtils.getDataPathForUrl(fileNode);
-               return url;
-       }
-
-       protected Node getFileNode(Node imageDataNode) {
-               // FIXME make URL use case more robust
-               try {
-                       String fileref = null;
-                       if (imageDataNode.hasProperty(DbkAttr.fileref.name()))
-                               fileref = imageDataNode.getProperty(DbkAttr.fileref.name()).getString();
-                       if (fileref == null)
-                               return null;
-                       Node fileNode;
-                       if (fileref.startsWith("/"))
-                               fileNode = baseFolder.getSession().getNode(fileref);
-                       else
-                               fileNode = baseFolder.getNode(fileref);
-                       return fileNode;
-               } catch (RepositoryException e) {
-                       throw new JcrException(e);
-               }
-       }
-
-       protected Node getMediaFolder() {
-               try {
-                       // TODO check edition status
-                       Node mediaFolder = JcrUtils.getOrAdd(baseFolder, EntityNames.MEDIA, NodeType.NT_FOLDER);
-                       return mediaFolder;
-               } catch (RepositoryException e) {
-                       throw new JcrException("Cannot get media folder", e);
-               }
-       }
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkImg.java b/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkImg.java
deleted file mode 100644 (file)
index ca9b388..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-package org.argeo.app.ui.docbook;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.ui.widgets.Img;
-import org.eclipse.rap.fileupload.FileUploadEvent;
-import org.eclipse.rap.fileupload.FileUploadHandler;
-import org.eclipse.rap.fileupload.FileUploadListener;
-import org.eclipse.rap.fileupload.FileUploadReceiver;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-/** DocBook specific image area. */
-public class DbkImg extends Img {
-       private static final long serialVersionUID = -6150996708899219074L;
-
-       public DbkImg(Composite parent, int swtStyle, Node imgNode, DbkImageManager imageManager)
-                       throws RepositoryException {
-               super(parent, swtStyle, imgNode, imageManager);
-       }
-
-       @Override
-       protected Node getUploadFolder() {
-               Node mediaFolder = ((DbkImageManager) getImageManager()).getMediaFolder();
-               return mediaFolder;
-       }
-
-       @Override
-       protected String getUploadName() {
-               return null;
-       }
-
-       @Override
-       protected void setContainerLayoutData(Composite composite) {
-               composite.setLayoutData(CmsSwtUtils.grabWidth(SWT.CENTER, SWT.DEFAULT));
-       }
-
-       @Override
-       protected void setControlLayoutData(Control control) {
-               control.setLayoutData(CmsSwtUtils.grabWidth(SWT.CENTER, SWT.DEFAULT));
-       }
-
-       @Override
-       protected FileUploadHandler prepareUpload(FileUploadReceiver receiver) {
-               FileUploadHandler fileUploadHandler = super.prepareUpload(receiver);
-               fileUploadHandler.addUploadListener(new FileUploadListener() {
-
-                       @Override
-                       public void uploadProgress(FileUploadEvent event) {
-                               // TODO Auto-generated method stub
-
-                       }
-
-                       @Override
-                       public void uploadFinished(FileUploadEvent event) {
-                       }
-
-                       @Override
-                       public void uploadFailed(FileUploadEvent event) {
-                               // TODO Auto-generated method stub
-
-                       }
-               });
-               return fileUploadHandler;
-       }
-
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkSectionTitle.java b/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkSectionTitle.java
deleted file mode 100644 (file)
index b537333..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-package org.argeo.app.ui.docbook;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-
-import org.argeo.cms.ui.viewers.EditablePart;
-import org.argeo.cms.ui.viewers.NodePart;
-import org.argeo.cms.ui.widgets.EditableText;
-import org.eclipse.swt.widgets.Composite;
-
-/** The title of a section, based on an XML text node. */
-public class DbkSectionTitle extends EditableText implements EditablePart, NodePart {
-       private static final long serialVersionUID = -1787983154946583171L;
-
-       private final TextSection section;
-
-       public DbkSectionTitle(Composite parent, int swtStyle, Node titleNode) throws RepositoryException {
-               super(parent, swtStyle, titleNode);
-               section = (TextSection) TextSection.findSection(this);
-       }
-
-       public TextSection getSection() {
-               return section;
-       }
-
-       @Override
-       public Node getItem() throws RepositoryException {
-               return getNode();
-       }
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkTextInterpreter.java b/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkTextInterpreter.java
deleted file mode 100644 (file)
index ff12348..0000000
+++ /dev/null
@@ -1,283 +0,0 @@
-package org.argeo.app.ui.docbook;
-
-import static org.argeo.app.docbook.DbkType.para;
-import static org.argeo.app.docbook.DbkType.title;
-import static org.argeo.app.docbook.DbkUtils.isDbk;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringReader;
-import java.nio.charset.StandardCharsets;
-import java.util.List;
-
-import javax.jcr.ImportUUIDBehavior;
-import javax.jcr.Item;
-import javax.jcr.Node;
-import javax.jcr.NodeIterator;
-import javax.jcr.Property;
-import javax.jcr.PropertyIterator;
-import javax.jcr.RepositoryException;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import org.apache.commons.io.IOUtils;
-import org.argeo.app.docbook.DbkAttr;
-import org.argeo.app.docbook.DbkType;
-import org.argeo.jcr.Jcr;
-import org.argeo.jcr.JcrException;
-
-/** Based on HTML with a few Wiki-like shortcuts. */
-public class DbkTextInterpreter implements TextInterpreter {
-       private DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
-
-       private String linkCssClass = DbkType.link.name();
-
-       @Override
-       public void write(Item item, String content) {
-               try {
-                       if (item instanceof Node) {
-                               Node node = (Node) item;
-                               if (isDbk(node, para) || isDbk(node, title)) {
-                                       String raw = convertToStorage(node, content);
-                                       validateBeforeStoring(raw);
-
-                                       String jcrUuid = node.getIdentifier();
-//                                     if (node.hasProperty(Property.JCR_UUID))
-//                                             jcrUuid = node.getProperty(Property.JCR_UUID).getString();
-//                                     else {
-//                                             // TODO use time based
-//                                             jcrUuid = UUID.randomUUID().toString();
-//                                             node.setProperty(Property.JCR_UUID, jcrUuid);
-//                                             node.getSession().save();
-//                                     }
-
-                                       StringBuilder namespaces = new StringBuilder();
-                                       namespaces.append(" xmlns:dbk=\"http://docbook.org/ns/docbook\"");
-                                       namespaces.append(" xmlns:jcr=\"http://www.jcp.org/jcr/1.0\"");
-                                       namespaces.append(" xmlns:xlink=\"http://www.w3.org/1999/xlink\"");
-                                       raw = "<" + node.getName() + " jcr:uuid=\"" + jcrUuid + "\"" + namespaces + ">" + raw + "</"
-                                                       + node.getName() + ">";
-//                                     System.out.println(raw);
-                                       try (InputStream in = new ByteArrayInputStream(raw.getBytes(StandardCharsets.UTF_8))) {
-                                               node.getSession().importXML(node.getParent().getPath(), in,
-                                                               ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING);
-                                               // node.getSession().save();
-                                       } catch (IOException e) {
-                                               throw new IllegalArgumentException("Cannot parse raw content of " + node, e);
-                                       }
-
-//                                     try {
-//                                             DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
-//                                             Document document;
-//                                             try (Reader in = new StringReader(raw)) {
-//                                                     document = documentBuilder.parse(new InputSource(in));
-//                                             }
-//                                             NodeList nl = document.getChildNodes();
-//                                             for (int i = 0; i < nl.getLength(); i++) {
-//                                                     org.w3c.dom.Node n = nl.item(i);
-//                                                     if (node instanceof Text) {
-//
-//                                                     }
-//                                             }
-//                                     } catch (ParserConfigurationException | SAXException | IOException e) {
-//                                             throw new IllegalArgumentException("Cannot parse raw content of " + node, e);
-//                                     }
-
-//                                     Node jcrText;
-//                                     if (!node.hasNode(Jcr.JCR_XMLTEXT))
-//                                             jcrText = node.addNode(Jcr.JCR_XMLTEXT, JcrxType.JCRX_XMLTEXT);
-//                                     else
-//                                             jcrText = node.getNode(Jcr.JCR_XMLTEXT);
-//                                     jcrText.setProperty(Jcr.JCR_XMLCHARACTERS, raw);
-                               } else {
-                                       throw new IllegalArgumentException("Don't know how to interpret " + node);
-                               }
-                       } else {// property
-                               Property property = (Property) item;
-                               property.setValue(content);
-                       }
-                       // item.getSession().save();
-               } catch (RepositoryException e) {
-                       throw new JcrException("Cannot set content on " + item, e);
-               }
-       }
-
-       @Override
-       public String read(Item item) {
-               try {
-                       String raw = raw(item);
-                       return convertFromStorage(item, raw);
-               } catch (RepositoryException e) {
-                       throw new JcrException("Cannot get " + item + " for edit", e);
-               }
-       }
-
-       @Override
-       public String raw(Item item) {
-               try {
-                       item.getSession().refresh(true);
-                       if (item instanceof Node) {
-                               Node node = (Node) item;
-                               if (isDbk(node, para) || isDbk(node, title)) {
-                                       StringBuilder sb = new StringBuilder();
-                                       readXml(node, sb);
-//                                     NodeIterator nit = node.getNodes();
-//                                     while (nit.hasNext()) {
-//                                             Node child = nit.nextNode();
-//                                             if (child.getName().equals(Jcr.JCR_XMLTEXT)) {
-//                                                     Node jcrText = node.getNode(Jcr.JCR_XMLTEXT);
-//                                                     String txt = jcrText.getProperty(Jcr.JCR_XMLCHARACTERS).getString();
-//                                                     // TODO make it more robust
-//                                                     // txt = txt.replace("\n", "").replace("\t", "");
-//                                                     txt = txt.replace("\t", "  ");
-//                                                     sb.append(txt);
-//                                             } else {
-//                                                     try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
-//                                                             child.getSession().exportDocumentView(child.getPath(), out, true, false);
-//                                                             sb.append(new String(out.toByteArray(), StandardCharsets.UTF_8));
-//                                                     } catch (IOException e) {
-//                                                             throw new IllegalStateException("Cannot export " + child, e);
-//                                                     }
-//                                             }
-//                                     }
-                                       return sb.toString();
-                               } else {
-                                       throw new IllegalArgumentException("Don't know how to interpret " + node);
-                               }
-                       } else {// property
-                               Property property = (Property) item;
-                               return property.getString();
-                       }
-               } catch (RepositoryException e) {
-                       throw new JcrException("Cannot get " + item + " content", e);
-               }
-       }
-
-       private void readXml(Node node, StringBuilder sb) throws RepositoryException {
-               NodeIterator nit = node.getNodes();
-               while (nit.hasNext()) {
-                       Node child = nit.nextNode();
-                       if (child.getName().equals(Jcr.JCR_XMLTEXT)) {
-                               String txt = child.getProperty(Jcr.JCR_XMLCHARACTERS).getString();
-                               // TODO make it more robust
-                               // txt = txt.replace("\n", "").replace("\t", "");
-                               txt = txt.replace("\t", "  ");
-                               sb.append(txt);
-                       } else {
-                               sb.append('<').append(child.getName());
-                               PropertyIterator pit = child.getProperties();
-                               properties: while (pit.hasNext()) {
-                                       Property p = pit.nextProperty();
-                                       if (p.getName().startsWith("jcr:"))
-                                               continue properties;
-                                       sb.append(' ').append(p.getName()).append("=\"").append(p.getString()).append('\"');
-                               }
-                               sb.append('>');
-                               readXml(child, sb);
-//                             try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
-//                                     child.getSession().exportDocumentView(child.getPath(), out, true, false);
-//                                     sb.append(new String(out.toByteArray(), StandardCharsets.UTF_8));
-//                             } catch (IOException e) {
-//                                     throw new IllegalStateException("Cannot export " + child, e);
-//                             }
-                               sb.append("</").append(child.getName()).append('>');
-                       }
-               }
-       }
-
-       private void readAsSimpleHtml(Node node, StringBuilder sb) throws RepositoryException {
-               NodeIterator nit = node.getNodes();
-               while (nit.hasNext()) {
-                       Node child = nit.nextNode();
-                       if (child.getName().equals(Jcr.JCR_XMLTEXT)) {
-                               String txt = child.getProperty(Jcr.JCR_XMLCHARACTERS).getString();
-                               // TODO make it more robust
-                               // txt = txt.replace("\n", "").replace("\t", "");
-                               txt = txt.replace("\t", "  ");
-                               String html = textToSimpleHtml(txt);
-                               sb.append(html);
-                       } else if (child.getName().equals(DbkType.link.get())) {
-                               if (child.hasProperty(DbkAttr.XLINK_HREF)) {
-                                       String href = child.getProperty(DbkAttr.XLINK_HREF).getString();
-                                       // TODO deal with other forbidden XML characters?
-                                       href = href.replace("&", "&amp;");
-                                       sb.append("<a class='" + linkCssClass + "' href='").append(href).append("'>");
-                                       readAsSimpleHtml(child, sb);
-                                       sb.append("</a>");
-                               }
-                       } else {
-                               // ignore
-                       }
-               }
-       }
-
-       private String textToSimpleHtml(String raw) {
-               // FIXME the saved data should be corrected instead.
-               if (raw.indexOf('&') >= 0) {
-                       raw = raw.replace("&", "&amp;");
-               }
-               if (raw.indexOf('<') >= 0) {
-                       raw = raw.replace("<", "&lt;");
-               }
-               if (raw.indexOf('>') >= 0) {
-                       raw = raw.replace(">", "&gt;");
-               }
-               if (raw.indexOf('\"') >= 0) {
-                       raw = raw.replace("\"", "&quot;");
-               }
-               if (raw.indexOf('\'') >= 0) {
-                       raw = raw.replace("\'", "&apos;");
-               }
-//             raw = "<span style='text-align:justify'>" + raw + "</span>";
-               if (raw.length() == 0)
-                       return raw;
-               try (StringReader reader = new StringReader(raw)) {
-                       List<String> lines = IOUtils.readLines(reader);
-                       if (lines.size() == 1)
-                               return lines.get(0);
-                       StringBuilder sb = new StringBuilder(raw.length() + lines.size() * BR_LENGTH);
-                       for (int i = 0; i < lines.size(); i++) {
-                               if (i != 0)
-                                       sb.append("<br/>");
-                               sb.append(lines.get(i));
-                       }
-                       return sb.toString();
-               } catch (IOException e) {
-                       throw new RuntimeException(e);
-               }
-       }
-
-       final static int BR_LENGTH = "<br/>".length();
-
-       public String readSimpleHtml(Item item) {
-               try {
-                       StringBuilder sb = new StringBuilder();
-//                     sb.append("<div style='text-align: justify;'>");
-                       readAsSimpleHtml((Node) item, sb);
-//                     sb.append("</div>");
-//                     System.out.println(sb);
-                       return sb.toString();
-               } catch (RepositoryException e) {
-                       throw new JcrException("Cannot convert " + item + " to simple HTML", e);
-               }
-       }
-
-       // EXTENSIBILITY
-       /**
-        * To be overridden, in order to make sure that only valid strings are being
-        * stored.
-        */
-       protected void validateBeforeStoring(String raw) {
-       }
-
-       /** To be overridden, in order to support additional formatting. */
-       protected String convertToStorage(Item item, String content) throws RepositoryException {
-               return content;
-
-       }
-
-       /** To be overridden, in order to support additional formatting. */
-       protected String convertFromStorage(Item item, String content) throws RepositoryException {
-               return content;
-       }
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkVideo.java b/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkVideo.java
deleted file mode 100644 (file)
index c8aee51..0000000
+++ /dev/null
@@ -1,227 +0,0 @@
-package org.argeo.app.ui.docbook;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.List;
-import java.util.Map;
-
-import javax.jcr.Item;
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-
-import org.argeo.app.docbook.DbkAttr;
-import org.argeo.app.docbook.DbkType;
-import org.argeo.app.docbook.DbkUtils;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.swt.Selected;
-import org.argeo.cms.ui.viewers.NodePart;
-import org.argeo.cms.ui.viewers.Section;
-import org.argeo.cms.ui.viewers.SectionPart;
-import org.argeo.cms.ui.widgets.StyledControl;
-import org.argeo.jcr.Jcr;
-import org.argeo.jcr.JcrException;
-import org.argeo.util.naming.NamingUtils;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.browser.Browser;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Text;
-
-public class DbkVideo extends StyledControl implements SectionPart, NodePart {
-       private static final long serialVersionUID = -8753232181570351880L;
-       private Section section;
-
-       private int width = 640;
-       private int height = 360;
-
-       private boolean editable;
-
-       public DbkVideo(Composite parent, int style, Node node) {
-               this(Section.findSection(parent), parent, style, node);
-       }
-
-       DbkVideo(Section section, Composite parent, int style, Node node) {
-               super(parent, style, node);
-               editable = !(SWT.READ_ONLY == (style & SWT.READ_ONLY));
-               this.section = section;
-               setStyle(DbkType.videoobject.name());
-       }
-
-       @Override
-       protected Control createControl(Composite box, String style) {
-               Node mediaobject = getNode();
-               Composite wrapper = new Composite(box, SWT.NONE);
-               wrapper.setLayout(CmsSwtUtils.noSpaceGridLayout());
-
-               Composite browserC = new Composite(wrapper, SWT.NONE);
-               browserC.setLayout(CmsSwtUtils.noSpaceGridLayout());
-               GridData gd = new GridData(SWT.CENTER, SWT.FILL, true, true);
-               gd.widthHint = getWidth();
-               gd.heightHint = getHeight();
-               browserC.setLayoutData(gd);
-//             wrapper.setLayoutData(CmsUiUtils.fillAll());
-               Browser browser = new Browser(browserC, SWT.NONE);
-
-               if (editable) {
-                       Composite editor = new Composite(wrapper, SWT.BORDER);
-                       editor.setLayout(new GridLayout(3, false));
-                       editor.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
-                       String fileref = DbkUtils.getMediaFileref(mediaobject);
-                       Text text = new Text(editor, SWT.SINGLE);
-                       if (fileref != null)
-                               text.setText(fileref);
-                       else
-                               text.setMessage("Embed URL of the video");
-                       text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
-                       Button updateB = new Button(editor, SWT.FLAT);
-                       updateB.setText("Update");
-                       updateB.addSelectionListener(new Selected() {
-
-                               @Override
-                               public void widgetSelected(SelectionEvent e) {
-                                       try {
-                                               Node videodata = mediaobject.getNode(DbkType.videoobject.get())
-                                                               .getNode(DbkType.videodata.get());
-                                               String txt = text.getText();
-                                               URI uri;
-                                               try {
-                                                       uri = new URI(txt);
-                                               } catch (URISyntaxException e1) {
-                                                       text.setText("");
-                                                       text.setMessage("Invalid URL");
-                                                       return;
-                                               }
-
-                                               // Transform watch URL in embed
-                                               // YouTube
-                                               String videoId = null;
-                                               if ("www.youtube.com".equals(uri.getHost()) || "youtube.com".equals(uri.getHost())
-                                                               || "youtu.be".equals(uri.getHost())) {
-                                                       if ("www.youtube.com".equals(uri.getHost()) || "youtube.com".equals(uri.getHost())) {
-                                                               if ("/watch".equals(uri.getPath())) {
-                                                                       Map<String, List<String>> map = NamingUtils.queryToMap(uri);
-                                                                       videoId = map.get("v").get(0);
-                                                               }
-                                                       } else if ("youtu.be".equals(uri.getHost())) {
-                                                               videoId = uri.getPath().substring(1);
-                                                       }
-                                                       if (videoId != null) {
-                                                               try {
-                                                                       uri = new URI("https://www.youtube.com/embed/" + videoId);
-                                                                       text.setText(uri.toString());
-                                                               } catch (URISyntaxException e1) {
-                                                                       throw new IllegalStateException(e1);
-                                                               }
-                                                       }
-                                               }
-
-                                               // Vimeo
-                                               if ("vimeo.com".equals(uri.getHost())) {
-                                                       videoId = uri.getPath().substring(1);
-                                                       if (videoId != null) {
-                                                               try {
-                                                                       uri = new URI("https://player.vimeo.com/video/" + videoId);
-                                                                       text.setText(uri.toString());
-                                                               } catch (URISyntaxException e1) {
-                                                                       throw new IllegalStateException(e1);
-                                                               }
-                                                       }
-                                               }
-
-                                               videodata.setProperty(DbkAttr.fileref.name(), uri.toString());
-                                               // TODO better integrate it in the edition lifecycle
-                                               videodata.getSession().save();
-                                               load(browser);
-                                       } catch (RepositoryException e1) {
-                                               throw new JcrException("Cannot update " + mediaobject, e1);
-                                       }
-
-                               }
-                       });
-
-                       Button deleteB = new Button(editor, SWT.FLAT);
-                       deleteB.setText("Delete");
-                       deleteB.addSelectionListener(new Selected() {
-
-                               @Override
-                               public void widgetSelected(SelectionEvent e) {
-                                       try {
-                                               mediaobject.remove();
-                                               mediaobject.getSession().save();
-                                               dispose();
-                                               getSection().getParent().layout(true, true);
-                                       } catch (RepositoryException e1) {
-                                               throw new JcrException("Cannot update " + mediaobject, e1);
-                                       }
-
-                               }
-                       });
-               }
-
-               // TODO caption
-               return browser;
-       }
-
-       public void load(Control control) {
-               try {
-                       if (control instanceof Browser) {
-                               Browser browser = (Browser) control;
-                               getNode().getSession();
-                               String fileref = DbkUtils.getMediaFileref(getNode());
-                               if (fileref != null) {
-                                       // TODO manage self-hosted videos
-                                       // TODO for YouTube videos, check whether the URL starts with
-                                       // https://www.youtube.com/embed/ and not https://www.youtube.com/watch?v=
-                                       StringBuilder html = new StringBuilder();
-                                       html.append(
-                                                       "<iframe frameborder=\"0\" allow=\"autoplay; fullscreen; picture-in-picture\" allowfullscreen=\"true\"");
-                                       // TODO make size configurable
-                                       html.append("width=\"").append(width).append("\" height=\"").append(height).append("\" ");
-                                       html.append("src=\"").append(fileref).append("\" ");
-                                       html.append("/>");
-                                       browser.setText(html.toString());
-                               }
-                       }
-               } catch (RepositoryException e) {
-                       throw new JcrException("Cannot retrieve src for video " + getNode(), e);
-               }
-       }
-
-       @Override
-       protected void setContainerLayoutData(Composite composite) {
-               composite.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, true));
-       }
-
-       @Override
-       protected void setControlLayoutData(Control control) {
-               control.setLayoutData(CmsSwtUtils.fillAll());
-       }
-
-       @Override
-       public Item getItem() throws RepositoryException {
-               return getNode();
-       }
-
-       @Override
-       public String getPartId() {
-               return getNodeId();
-       }
-
-       @Override
-       public Section getSection() {
-               return section;
-       }
-
-       public int getWidth() {
-               return width;
-       }
-
-       public int getHeight() {
-               return height;
-       }
-
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DocumentPage.java b/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DocumentPage.java
deleted file mode 100644 (file)
index 8aba8b7..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-package org.argeo.app.ui.docbook;
-
-import javax.jcr.Node;
-import javax.jcr.NodeIterator;
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-import javax.jcr.nodetype.NodeType;
-
-import org.argeo.api.cms.CmsEditable;
-import org.argeo.app.docbook.DbkType;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.ui.CmsUiProvider;
-import org.argeo.cms.ui.util.CmsLink;
-import org.argeo.cms.ui.viewers.JcrVersionCmsEditable;
-import org.argeo.cms.ui.widgets.ScrolledPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * Display the text of the context, and provide an editor if the user can edit.
- */
-public class DocumentPage implements CmsUiProvider {
-       public final static String WWW = "www";
-
-       @Override
-       public Control createUi(Composite parent, Node context) throws RepositoryException {
-
-               ScrolledPage page = new ScrolledPage(parent, SWT.NONE);
-               page.setLayout(CmsSwtUtils.noSpaceGridLayout());
-               GridData textGd = CmsSwtUtils.fillAll();
-               page.setLayoutData(textGd);
-
-               if (context.isNodeType(DbkType.article.get())) {
-                       CmsEditable cmsEditable = new JcrVersionCmsEditable(context);
-                       if (cmsEditable.canEdit())
-                               new TextEditorHeader(cmsEditable, parent, SWT.NONE).setLayoutData(CmsSwtUtils.fillWidth());
-                       if (!cmsEditable.isEditing())
-                               cmsEditable.startEditing();
-                       new DocumentTextEditor(page, SWT.FLAT, context, cmsEditable);
-               } else {
-                       parent.setBackgroundMode(SWT.INHERIT_NONE);
-                       if (context.getSession().hasPermission(context.getPath(), Session.ACTION_ADD_NODE)) {
-//                             new DocumentTextEditor(page, SWT.FLAT, indexNode, cmsEditable);
-//                             textGd.heightHint = 400;
-
-                               for (NodeIterator ni = context.getNodes(); ni.hasNext();) {
-                                       Node textNode = ni.nextNode();
-                                       if (textNode.isNodeType(NodeType.NT_FOLDER))
-                                               new CmsLink(textNode.getName() + "/", textNode.getPath()).createUi(parent, textNode);
-                               }
-                               for (NodeIterator ni = context.getNodes(); ni.hasNext();) {
-                                       Node textNode = ni.nextNode();
-                                       if (textNode.isNodeType(DbkType.article.get()) && !textNode.getName().equals(WWW))
-                                               new CmsLink(textNode.getName(), textNode.getPath()).createUi(parent, textNode);
-                               }
-                       }
-               }
-               return page;
-       }
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DocumentTextEditor.java b/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DocumentTextEditor.java
deleted file mode 100644 (file)
index 8f3a10c..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.argeo.app.ui.docbook;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-
-import org.argeo.api.cms.CmsEditable;
-import org.argeo.app.docbook.DbkType;
-import org.argeo.app.docbook.DbkUtils;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.eclipse.swt.widgets.Composite;
-
-/** Text editor where sections and subsections can be managed by the user. */
-public class DocumentTextEditor extends AbstractDbkViewer {
-       private static final long serialVersionUID = 6049661610883342325L;
-
-       public DocumentTextEditor(Composite parent, int style, Node textNode, CmsEditable cmsEditable) {
-               super(new TextSection(parent, style, textNode), style, cmsEditable);
-//             refresh();
-               getMainSection().setLayoutData(CmsSwtUtils.fillWidth());
-       }
-
-       @Override
-       protected void initModel(Node textNode) throws RepositoryException {
-               if (isFlat()) {
-                       DbkUtils.addParagraph(textNode, "");
-               }
-//             else
-//                     textNode.setProperty(DocBookNames.DBK_TITLE, textNode.getName());
-       }
-
-       @Override
-       protected Boolean isModelInitialized(Node textNode) throws RepositoryException {
-               return textNode.hasNode(DbkType.title.get()) || textNode.hasNode(DbkType.para.get())
-                               || (!isFlat() && textNode.hasNode(DbkType.section.get()));
-       }
-
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/docbook/Paragraph.java b/org.argeo.app.ui/src/org/argeo/app/ui/docbook/Paragraph.java
deleted file mode 100644 (file)
index ef23d96..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.argeo.app.ui.docbook;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-
-import org.argeo.app.docbook.DbkType;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.ui.viewers.SectionPart;
-import org.argeo.cms.ui.widgets.EditableText;
-import org.argeo.cms.ui.widgets.TextStyles;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-
-/** An editable paragraph. */
-public class Paragraph extends EditableText implements SectionPart {
-       private static final long serialVersionUID = 3746457776229542887L;
-
-       private final TextSection section;
-
-       public Paragraph(TextSection section, int style, Node node) throws RepositoryException {
-               super(section, style, node);
-               this.section = section;
-               CmsSwtUtils.style(this, DbkType.para.name());
-       }
-
-       public TextSection getSection() {
-               return section;
-       }
-
-       @Override
-       protected Label createLabel(Composite box, String style) {
-               Label lbl = super.createLabel(box, style);
-               CmsSwtUtils.disableMarkupValidation(lbl);
-               return lbl;
-       }
-
-       @Override
-       public String getPartId() {
-               return getNodeId();
-       }
-
-       @Override
-       public Node getItem() throws RepositoryException {
-               return getNode();
-       }
-
-       @Override
-       public String toString() {
-               return "Paragraph #" + getPartId();
-       }
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/docbook/TextEditorHeader.java b/org.argeo.app.ui/src/org/argeo/app/ui/docbook/TextEditorHeader.java
deleted file mode 100644 (file)
index 31251aa..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-package org.argeo.app.ui.docbook;
-
-import java.util.Observable;
-import java.util.Observer;
-
-import org.argeo.api.cms.CmsEditable;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.ui.widgets.TextStyles;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-/** Adds editing capabilities to a page editing text */
-public class TextEditorHeader implements SelectionListener, Observer {
-       private static final long serialVersionUID = 4186756396045701253L;
-
-       private final CmsEditable cmsEditable;
-       private Button publish;
-
-       private Composite parent;
-       private Composite display;
-       private Object layoutData;
-
-       public TextEditorHeader(CmsEditable cmsEditable, Composite parent, int style) {
-               this.cmsEditable = cmsEditable;
-               this.parent = parent;
-               if (this.cmsEditable instanceof Observable)
-                       ((Observable) this.cmsEditable).addObserver(this);
-               refresh();
-       }
-
-       protected void refresh() {
-               if (display != null && !display.isDisposed())
-                       display.dispose();
-               display = null;
-               publish = null;
-               if (cmsEditable.isEditing()) {
-                       display = new Composite(parent, SWT.NONE);
-                       // display.setBackgroundMode(SWT.INHERIT_NONE);
-                       display.setLayoutData(layoutData);
-                       display.setLayout(CmsSwtUtils.noSpaceGridLayout());
-                       CmsSwtUtils.style(display, TextStyles.TEXT_EDITOR_HEADER);
-                       publish = new Button(display, SWT.FLAT | SWT.PUSH);
-                       publish.setText(getPublishButtonLabel());
-                       CmsSwtUtils.style(publish, TextStyles.TEXT_EDITOR_HEADER);
-                       publish.addSelectionListener(this);
-                       display.moveAbove(null);
-               }
-               parent.layout();
-       }
-
-       private String getPublishButtonLabel() {
-               if (cmsEditable.isEditing())
-                       return "Publish";
-               else
-                       return "Edit";
-       }
-
-       @Override
-       public void widgetSelected(SelectionEvent e) {
-               if (e.getSource() == publish) {
-                       if (cmsEditable.isEditing()) {
-                               cmsEditable.stopEditing();
-                       } else {
-                               cmsEditable.startEditing();
-                       }
-                       // publish.setText(getPublishButtonLabel());
-               }
-       }
-
-       @Override
-       public void widgetDefaultSelected(SelectionEvent e) {
-       }
-
-       @Override
-       public void update(Observable o, Object arg) {
-               if (o == cmsEditable) {
-                       // publish.setText(getPublishButtonLabel());
-                       refresh();
-               }
-       }
-
-       public void setLayoutData(Object layoutData) {
-               this.layoutData = layoutData;
-               if (display != null && !display.isDisposed())
-                       display.setLayoutData(layoutData);
-       }
-
-}
\ No newline at end of file
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/docbook/TextInterpreter.java b/org.argeo.app.ui/src/org/argeo/app/ui/docbook/TextInterpreter.java
deleted file mode 100644 (file)
index 9da2f6f..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.argeo.app.ui.docbook;
-
-import javax.jcr.Item;
-
-/** Convert from/to data layer to/from presentation layer. */
-public interface TextInterpreter {
-       String raw(Item item);
-
-       String read(Item item);
-
-       String readSimpleHtml(Item item);
-
-       void write(Item item, String content);
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/docbook/TextSection.java b/org.argeo.app.ui/src/org/argeo/app/ui/docbook/TextSection.java
deleted file mode 100644 (file)
index 3967834..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-package org.argeo.app.ui.docbook;
-
-import javax.jcr.Node;
-
-import org.argeo.app.docbook.DbkType;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.ui.viewers.EditablePart;
-import org.argeo.cms.ui.viewers.Section;
-import org.argeo.cms.ui.widgets.TextStyles;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-/** An editable section. */
-public class TextSection extends Section {
-       private static final long serialVersionUID = -8625209546243220689L;
-       private String defaultTextStyle = DbkType.para.name();
-       private String titleStyle;
-
-       private final boolean flat;
-
-       private boolean titleReadOnly = false;
-
-       private final int level;
-
-       public TextSection(Composite parent, int style, Node node) {
-               this(parent, findSection(parent), style, node);
-       }
-
-       public TextSection(TextSection section, int style, Node node) {
-               this(section, section.getParentSection(), style, node);
-       }
-
-       private TextSection(Composite parent, Section parentSection, int style, Node node) {
-               super(parent, parentSection, style, node);
-               flat = SWT.FLAT == (style & SWT.FLAT);
-               if (parentSection instanceof TextSection) {
-                       level = ((TextSection) parentSection).getLevel() + 1;
-               } else {
-                       level = 0;
-               }
-               CmsSwtUtils.style(this, DbkType.section.name());
-       }
-
-       public String getDefaultTextStyle() {
-               return defaultTextStyle;
-       }
-
-       public boolean isFlat() {
-               return flat;
-       }
-
-       /** The level of this section, similar to h1, h2, etc. in HTML. */
-       public int getLevel() {
-               return level;
-       }
-
-       public String getTitleStyle() {
-               if (titleStyle != null)
-                       return titleStyle;
-               // TODO make base H styles configurable
-//             Integer relativeDepth = getRelativeDepth();
-//             System.out.println("Level: " + getLevel());
-               return "h" + (getLevel() + 1);
-       }
-
-       public void setDefaultTextStyle(String defaultTextStyle) {
-               this.defaultTextStyle = defaultTextStyle;
-       }
-
-       public void setTitleStyle(String titleStyle) {
-               this.titleStyle = titleStyle;
-       }
-
-       public boolean isTitleReadOnly() {
-               return titleReadOnly;
-       }
-
-       public void setTitleReadOnly(boolean titleReadOnly) {
-               this.titleReadOnly = titleReadOnly;
-       }
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/forms/AbstractTermsPart.java b/org.argeo.app.ui/src/org/argeo/app/ui/forms/AbstractTermsPart.java
deleted file mode 100644 (file)
index 0ce2ed1..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-package org.argeo.app.ui.forms;
-
-import javax.jcr.Item;
-
-import org.argeo.api.cms.CmsTheme;
-import org.argeo.app.api.Term;
-import org.argeo.app.api.TermsManager;
-import org.argeo.app.api.Typology;
-import org.argeo.cms.Localized;
-import org.argeo.cms.swt.CmsIcon;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.ui.viewers.EditablePart;
-import org.argeo.cms.ui.widgets.ContextOverlay;
-import org.argeo.cms.ui.widgets.StyledControl;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.ToolItem;
-
-/** Common logic between single and mutliple terms editable part. */
-public abstract class AbstractTermsPart extends StyledControl implements EditablePart {
-       private static final long serialVersionUID = -5497097995341927710L;
-       protected final TermsManager termsManager;
-       protected final Typology typology;
-
-       private final boolean editable;
-
-       private CmsIcon deleteIcon;
-       private CmsIcon addIcon;
-       private CmsIcon cancelIcon;
-
-       private Color highlightColor;
-       private Composite highlight;
-
-       protected final CmsTheme theme;
-       
-       public AbstractTermsPart(Composite parent, int style, Item item, TermsManager termsManager, String typology) {
-               super(parent, style, item);
-               if (item == null)
-                       throw new IllegalArgumentException("Item cannot be null");
-               this.termsManager = termsManager;
-               this.typology = termsManager.getTypology(typology);
-               this.theme = CmsSwtUtils.getCmsTheme(parent);
-               editable = !(SWT.READ_ONLY == (style & SWT.READ_ONLY));
-               highlightColor = parent.getDisplay().getSystemColor(SWT.COLOR_GRAY);
-       }
-
-       public boolean isEditable() {
-               return editable;
-       }
-
-       protected void createHighlight(Composite block) {
-               highlight = new Composite(block, SWT.NONE);
-               highlight.setBackground(highlightColor);
-               GridData highlightGd = new GridData(SWT.FILL, SWT.FILL, false, false);
-               highlightGd.widthHint = 5;
-               highlightGd.heightHint = 3;
-               highlight.setLayoutData(highlightGd);
-
-       }
-
-       protected String getTermLabel(Term term) {
-               if (term instanceof Localized)
-                       return ((Localized) term).lead();
-               else
-                       return term.getName();
-
-       }
-
-       protected abstract void refresh(ContextOverlay contextArea, String filter, Text txt);
-
-       protected boolean isTermSelectable(Term term) {
-               return true;
-       }
-
-       protected void processTermListLabel(Term term, Label label) {
-
-       }
-
-       protected void setControlLayoutData(Control control) {
-               control.setLayoutData(CmsSwtUtils.fillAll());
-       }
-
-       protected void setContainerLayoutData(Composite composite) {
-               composite.setLayoutData(CmsSwtUtils.fillAll());
-       }
-
-       //
-       // STYLING
-       //
-       public void setDeleteIcon(CmsIcon deleteIcon) {
-               this.deleteIcon = deleteIcon;
-       }
-
-       public void setAddIcon(CmsIcon addIcon) {
-               this.addIcon = addIcon;
-       }
-
-       public void setCancelIcon(CmsIcon cancelIcon) {
-               this.cancelIcon = cancelIcon;
-       }
-
-       protected TermsManager getTermsManager() {
-               return termsManager;
-       }
-
-       protected void styleDelete(ToolItem deleteItem) {
-               if (deleteIcon != null)
-                       deleteItem.setImage(deleteIcon.getSmallIcon(theme));
-               else
-                       deleteItem.setText("-");
-       }
-
-       protected void styleCancel(ToolItem cancelItem) {
-               if (cancelIcon != null)
-                       cancelItem.setImage(cancelIcon.getSmallIcon(theme));
-               else
-                       cancelItem.setText("X");
-       }
-
-       protected void styleAdd(ToolItem addItem) {
-               if (addIcon != null)
-                       addItem.setImage(addIcon.getSmallIcon(theme));
-               else
-                       addItem.setText("+");
-       }
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/forms/MultiTermsPart.java b/org.argeo.app.ui/src/org/argeo/app/ui/forms/MultiTermsPart.java
deleted file mode 100644 (file)
index 4a56b41..0000000
+++ /dev/null
@@ -1,206 +0,0 @@
-package org.argeo.app.ui.forms;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.jcr.Item;
-
-import org.argeo.api.cms.CmsLog;
-import org.argeo.app.api.Term;
-import org.argeo.app.api.TermsManager;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.swt.MouseDoubleClick;
-import org.argeo.cms.swt.MouseDown;
-import org.argeo.cms.swt.Selected;
-import org.argeo.cms.ui.forms.FormStyle;
-import org.argeo.cms.ui.viewers.EditablePart;
-import org.argeo.cms.ui.widgets.ContextOverlay;
-import org.argeo.jcr.Jcr;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.layout.RowLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.ToolItem;
-
-/** {@link EditablePart} for multiple terms. */
-public class MultiTermsPart extends AbstractTermsPart {
-       private static final long serialVersionUID = -4961135649177920808L;
-       private final static CmsLog log = CmsLog.getLog(MultiTermsPart.class);
-
-       public MultiTermsPart(Composite parent, int style, Item item, TermsManager termsManager, String typology) {
-               super(parent, style, item, termsManager, typology);
-       }
-
-       @Override
-       protected Control createControl(Composite box, String style) {
-               Composite placeholder = new Composite(box, SWT.NONE);
-
-               boolean vertical = SWT.VERTICAL == (getStyle() & SWT.VERTICAL);
-               RowLayout rl = new RowLayout(vertical ? SWT.VERTICAL : SWT.HORIZONTAL);
-               rl = CmsSwtUtils.noMarginsRowLayout(rl);
-//             rl.wrap = true;
-//             rl.justify = true;
-               placeholder.setLayout(rl);
-               List<Term> currentValue = getValue();
-               if (currentValue != null && !currentValue.isEmpty()) {
-                       for (Term value : currentValue) {
-                               Composite block = new Composite(placeholder, SWT.NONE);
-                               block.setLayout(CmsSwtUtils.noSpaceGridLayout(3));
-                               Label lbl = new Label(block, SWT.NONE);
-                               String display = getTermLabel(value);
-                               lbl.setText(display);
-                               CmsSwtUtils.style(lbl, style == null ? FormStyle.propertyText.style() : style);
-                               processTermListLabel(value, lbl);
-                               if (isEditable())
-                                       lbl.addMouseListener((MouseDoubleClick) (e) -> {
-                                               startEditing();
-                                       });
-                               if (isEditing()) {
-                                       ToolBar toolBar = new ToolBar(block, SWT.HORIZONTAL);
-                                       ToolItem deleteItem = new ToolItem(toolBar, SWT.FLAT);
-                                       styleDelete(deleteItem);
-                                       deleteItem.addSelectionListener((Selected) (e) -> {
-                                               // we retrieve them again here because they may have changed
-                                               List<Term> curr = getValue();
-                                               List<Term> newValue = new ArrayList<>();
-                                               for (Term v : curr) {
-                                                       if (!v.equals(value))
-                                                               newValue.add(v);
-                                               }
-                                               setValue(newValue);
-                                               block.dispose();
-                                               layout(true, true);
-                                       });
-
-                               }
-                       }
-               } else {// empty
-                       if (isEditable() && !isEditing()) {
-                               ToolBar toolBar = new ToolBar(placeholder, SWT.HORIZONTAL);
-                               ToolItem addItem = new ToolItem(toolBar, SWT.FLAT);
-                               styleAdd(addItem);
-                               addItem.addSelectionListener((Selected) (e) -> {
-                                       startEditing();
-                               });
-                       }
-               }
-
-               if (isEditing()) {
-                       Composite block = new Composite(placeholder, SWT.NONE);
-                       block.setLayout(CmsSwtUtils.noSpaceGridLayout(3));
-
-                       createHighlight(block);
-
-                       Text txt = new Text(block, SWT.SINGLE | SWT.BORDER);
-                       txt.setLayoutData(CmsSwtUtils.fillWidth());
-//                     txt.setMessage("[new]");
-
-                       CmsSwtUtils.style(txt, style == null ? FormStyle.propertyText.style() : style);
-
-                       ToolBar toolBar = new ToolBar(block, SWT.HORIZONTAL);
-                       ToolItem cancelItem = new ToolItem(toolBar, SWT.FLAT);
-                       styleCancel(cancelItem);
-                       cancelItem.addSelectionListener((Selected) (e) -> {
-                               stopEditing();
-                       });
-
-                       ContextOverlay contextOverlay = new ContextOverlay(txt, SWT.NONE) {
-                               private static final long serialVersionUID = -7980078594405384874L;
-
-                               @Override
-                               protected void onHide() {
-                                       stopEditing();
-                               }
-                       };
-                       contextOverlay.setLayout(new GridLayout());
-                       // filter
-                       txt.addModifyListener((e) -> {
-                               String filter = txt.getText().toLowerCase();
-                               if ("".equals(filter.trim()))
-                                       filter = null;
-                               refresh(contextOverlay, filter, txt);
-                       });
-                       txt.addFocusListener(new FocusListener() {
-                               private static final long serialVersionUID = -6024501573409619949L;
-
-                               @Override
-                               public void focusLost(FocusEvent event) {
-//                                     if (!contextOverlay.isDisposed() && contextOverlay.isShellVisible())
-//                                             getDisplay().asyncExec(() -> stopEditing());
-                               }
-
-                               @Override
-                               public void focusGained(FocusEvent event) {
-                                       // txt.setText("");
-                                       if (!contextOverlay.isDisposed() && !contextOverlay.isShellVisible())
-                                               refresh(contextOverlay, null, txt);
-                               }
-                       });
-                       layout(new Control[] { txt });
-                       // getDisplay().asyncExec(() -> txt.setFocus());
-               }
-               return placeholder;
-       }
-
-       @Override
-       protected void refresh(ContextOverlay contextArea, String filter, Text txt) {
-               CmsSwtUtils.clear(contextArea);
-               List<? extends Term> terms = termsManager.listAllTerms(typology.getId());
-               List<Term> currentValue = getValue();
-               terms: for (Term term : terms) {
-                       if (currentValue != null && currentValue.contains(term))
-                               continue terms;
-                       String display = getTermLabel(term);
-                       if (filter != null && !display.toLowerCase().contains(filter))
-                               continue terms;
-                       Label termL = new Label(contextArea, SWT.WRAP);
-                       termL.setText(display);
-                       processTermListLabel(term, termL);
-                       if (isTermSelectable(term))
-                               termL.addMouseListener((MouseDown) (e) -> {
-                                       List<Term> newValue = new ArrayList<>();
-                                       List<Term> curr = getValue();
-                                       if (currentValue != null)
-                                               newValue.addAll(curr);
-                                       newValue.add(term);
-                                       setValue(newValue);
-                                       contextArea.hide();
-                                       stopEditing();
-                               });
-               }
-               contextArea.show();
-       }
-
-       protected List<Term> getValue() {
-               String property = typology.getId();
-               List<String> curr = Jcr.getMultiple(getNode(), property);
-               List<Term> res = new ArrayList<>();
-               if (curr != null)
-                       terms: for (String str : curr) {
-                               Term term = termsManager.getTerm(str);
-                               if (term == null) {
-                                       log.warn("Ignoring term " + str + " for " + getNode() + ", as it was not found.");
-                                       continue terms;
-                               }
-                               res.add(term);
-                       }
-               return res;
-       }
-
-       protected void setValue(List<Term> value) {
-               String property = typology.getId();
-               List<String> ids = new ArrayList<>();
-               for (Term term : value) {
-                       ids.add(term.getId());
-               }
-               Jcr.set(getNode(), property, ids);
-               Jcr.save(getNode());
-       }
-
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/forms/SingleTermPart.java b/org.argeo.app.ui/src/org/argeo/app/ui/forms/SingleTermPart.java
deleted file mode 100644 (file)
index 4a5aa8d..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-package org.argeo.app.ui.forms;
-
-import java.util.List;
-
-import javax.jcr.Item;
-
-import org.argeo.app.api.Term;
-import org.argeo.app.api.TermsManager;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.swt.MouseDoubleClick;
-import org.argeo.cms.swt.MouseDown;
-import org.argeo.cms.swt.Selected;
-import org.argeo.cms.ui.forms.FormStyle;
-import org.argeo.cms.ui.viewers.EditablePart;
-import org.argeo.cms.ui.widgets.ContextOverlay;
-import org.argeo.jcr.Jcr;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.ToolItem;
-
-/** {@link EditablePart} for terms. */
-public class SingleTermPart extends AbstractTermsPart {
-       private static final long serialVersionUID = -4961135649177920808L;
-
-       public SingleTermPart(Composite parent, int style, Item item, TermsManager termsManager, String typology) {
-               super(parent, style, item, termsManager, typology);
-       }
-
-       @Override
-       protected Control createControl(Composite box, String style) {
-               if (isEditing()) {
-                       Composite block = new Composite(box, SWT.NONE);
-                       block.setLayout(CmsSwtUtils.noSpaceGridLayout(3));
-
-                       createHighlight(block);
-
-                       Text txt = new Text(block, SWT.SINGLE | SWT.BORDER);
-                       CmsSwtUtils.style(txt, style == null ? FormStyle.propertyText.style() : style);
-
-                       ToolBar toolBar = new ToolBar(block, SWT.HORIZONTAL);
-                       ToolItem deleteItem = new ToolItem(toolBar, SWT.PUSH);
-                       styleDelete(deleteItem);
-                       deleteItem.addSelectionListener((Selected) (e) -> {
-                               setValue(null);
-                               stopEditing();
-                       });
-                       ToolItem cancelItem = new ToolItem(toolBar, SWT.PUSH);
-                       styleCancel(cancelItem);
-                       cancelItem.addSelectionListener((Selected) (e) -> {
-                               stopEditing();
-                       });
-
-                       ContextOverlay contextOverlay = new ContextOverlay(txt, SWT.NONE) {
-                               private static final long serialVersionUID = -7980078594405384874L;
-
-                               @Override
-                               protected void onHide() {
-                                       stopEditing();
-                               }
-                       };
-                       contextOverlay.setLayout(new GridLayout());
-                       // filter
-                       txt.addModifyListener((e) -> {
-                               String filter = txt.getText().toLowerCase();
-                               if ("".equals(filter.trim()))
-                                       filter = null;
-                               refresh(contextOverlay, filter, txt);
-                       });
-                       txt.addFocusListener(new FocusListener() {
-                               private static final long serialVersionUID = -6024501573409619949L;
-
-                               @Override
-                               public void focusLost(FocusEvent event) {
-//                                     if (!contextOverlay.isDisposed() && contextOverlay.isShellVisible())
-//                                             getDisplay().asyncExec(() -> stopEditing());
-                               }
-
-                               @Override
-                               public void focusGained(FocusEvent event) {
-                                       // txt.setText("");
-                                       if (!contextOverlay.isDisposed() && !contextOverlay.isShellVisible())
-                                               refresh(contextOverlay, null, txt);
-                               }
-                       });
-                       layout(new Control[] { block });
-                       getDisplay().asyncExec(() -> txt.setFocus());
-                       return block;
-               } else {
-                       Composite block = new Composite(box, SWT.NONE);
-                       block.setLayout(CmsSwtUtils.noSpaceGridLayout(2));
-                       Term currentValue = getValue();
-                       if (currentValue != null) {
-                               Label lbl = new Label(block, SWT.SINGLE);
-                               String display = getTermLabel(currentValue);
-                               lbl.setText(display);
-                               CmsSwtUtils.style(lbl, style == null ? FormStyle.propertyText.style() : style);
-                               processTermListLabel(currentValue, lbl);
-                               if (isEditable()) {
-                                       lbl.addMouseListener((MouseDoubleClick) (e) -> {
-                                               startEditing();
-                                       });
-                               }
-                       } else {
-                               if (isEditable()) {
-                                       ToolBar toolBar = new ToolBar(block, SWT.HORIZONTAL);
-                                       ToolItem addItem = new ToolItem(toolBar, SWT.FLAT);
-                                       styleAdd(addItem);
-                                       addItem.addSelectionListener((Selected) (e) -> {
-                                               startEditing();
-                                       });
-                               }
-                       }
-                       return block;
-               }
-       }
-
-       @Override
-       protected void refresh(ContextOverlay contextArea, String filter, Text txt) {
-               CmsSwtUtils.clear(contextArea);
-               List<? extends Term> terms = termsManager.listAllTerms(typology.getId());
-               terms: for (Term term : terms) {
-                       String display = getTermLabel(term);
-                       if (filter != null && !display.toLowerCase().contains(filter))
-                               continue terms;
-                       Label termL = new Label(contextArea, SWT.WRAP);
-                       termL.setText(display);
-                       processTermListLabel(term, termL);
-                       if (isTermSelectable(term))
-                               termL.addMouseListener((MouseDown) (e) -> {
-                                       setValue(term);
-                                       contextArea.hide();
-                                       stopEditing();
-                               });
-               }
-               contextArea.show();
-               // txt.setFocus();
-       }
-
-       protected Term getValue() {
-               String property = typology.getId();
-               String id = Jcr.get(getNode(), property);
-               Term term = termsManager.getTerm(id);
-
-               return term;
-       }
-
-       protected void setValue(Term value) {
-               String property = typology.getId();
-               Jcr.set(getNode(), property, value != null ? value.getId() : null);
-               Jcr.save(getNode());
-       }
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/library/ContentEntryArea.java b/org.argeo.app.ui/src/org/argeo/app/ui/library/ContentEntryArea.java
deleted file mode 100644 (file)
index af31ac5..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-package org.argeo.app.ui.library;
-
-import java.util.SortedMap;
-import java.util.TreeMap;
-
-import javax.jcr.Node;
-import javax.jcr.NodeIterator;
-import javax.jcr.RepositoryException;
-import javax.jcr.Session;
-import javax.jcr.nodetype.NodeType;
-import javax.jcr.query.Query;
-
-import org.argeo.api.cms.CmsTheme;
-import org.argeo.app.api.EntityType;
-import org.argeo.app.ui.SuiteEvent;
-import org.argeo.app.ui.SuiteIcon;
-import org.argeo.app.ui.widgets.TreeOrSearchArea;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.ui.CmsUiProvider;
-import org.argeo.jcr.Jcr;
-import org.argeo.jcr.JcrException;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreeViewerColumn;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-public class ContentEntryArea implements CmsUiProvider {
-
-       @Override
-       public Control createUi(Composite parent, Node context) throws RepositoryException {
-               CmsTheme theme = CmsSwtUtils.getCmsTheme(parent);
-
-               parent.setLayout(new GridLayout());
-               Ui ui = new Ui(parent, SWT.NONE);
-               ui.setLayoutData(CmsSwtUtils.fillAll());
-
-               TreeViewerColumn nameCol = new TreeViewerColumn(ui.getTreeViewer(), SWT.NONE);
-               nameCol.getColumn().setWidth(400);
-               nameCol.setLabelProvider(new ColumnLabelProvider() {
-
-                       @Override
-                       public String getText(Object element) {
-                               Node node = (Node) element;
-                               return Jcr.getTitle(node);
-                       }
-
-                       @Override
-                       public Image getImage(Object element) {
-                               Node node = (Node) element;
-                               Image icon;
-                               if (Jcr.isNodeType(node, NodeType.NT_FOLDER)) {
-                                       icon = SuiteIcon.folder.getSmallIcon(theme);
-                               } else if (Jcr.isNodeType(node, NodeType.NT_FILE)) {
-                                       // TODO check recognized document types
-                                       icon = SuiteIcon.document.getSmallIcon(theme);
-                               } else if (Jcr.isNodeType(node, EntityType.document.get())) {
-                                       icon = SuiteIcon.document.getSmallIcon(theme);
-                               } else {
-                                       if (!isLeaf(node))
-                                               icon = SuiteIcon.folder.getSmallIcon(theme);
-                                       else
-                                               icon = null;
-                               }
-                               return icon;
-                       }
-
-               });
-
-               ui.getTreeViewer().addDoubleClickListener(new IDoubleClickListener() {
-
-                       @Override
-                       public void doubleClick(DoubleClickEvent event) {
-                               Node user = (Node) ui.getTreeViewer().getStructuredSelection().getFirstElement();
-                               if (user != null) {
-                                       CmsSwtUtils.getCmsView(parent).sendEvent(SuiteEvent.openNewPart.topic(),
-                                                       SuiteEvent.eventProperties(user));
-                               }
-
-                       }
-               });
-               ui.getTreeViewer().addSelectionChangedListener(new ISelectionChangedListener() {
-                       public void selectionChanged(SelectionChangedEvent event) {
-                               Node user = (Node) ui.getTreeViewer().getStructuredSelection().getFirstElement();
-                               if (user != null) {
-                                       CmsSwtUtils.getCmsView(parent).sendEvent(SuiteEvent.refreshPart.topic(),
-                                                       SuiteEvent.eventProperties(user));
-                               }
-                       }
-               });
-
-               ui.getTreeViewer().setContentProvider(new SpacesContentProvider());
-               ui.getTreeViewer().setInput(context.getSession());
-               return ui;
-       }
-
-       protected boolean isLeaf(Node node) {
-               return Jcr.isNodeType(node, EntityType.entity.get()) || Jcr.isNodeType(node, EntityType.document.get())
-                               || Jcr.isNodeType(node, NodeType.NT_FILE);
-       }
-
-       class Ui extends TreeOrSearchArea {
-
-               public Ui(Composite parent, int style) {
-                       super(parent, style);
-               }
-
-       }
-
-       class SpacesContentProvider implements ITreeContentProvider {
-
-               @Override
-               public Object[] getElements(Object inputElement) {
-                       Session session = (Session) inputElement;
-                       try {
-                               Query query = session.getWorkspace().getQueryManager()
-                                               .createQuery("SELECT * FROM [" + EntityType.space.get() + "]", Query.JCR_SQL2);
-                               NodeIterator spacesIt = query.execute().getNodes();
-                               SortedMap<String, Node> map = new TreeMap<>();
-                               while (spacesIt.hasNext()) {
-                                       Node space = spacesIt.nextNode();
-                                       String path = space.getPath();
-                                       map.put(path, space);
-                               }
-                               return map.values().toArray();
-                       } catch (RepositoryException e) {
-                               throw new JcrException(e);
-                       }
-               }
-
-               @Override
-               public Object[] getChildren(Object parentElement) {
-                       Node parent = (Node) parentElement;
-                       if (isLeaf(parent))
-                               return null;
-                       return Jcr.getNodes(parent).toArray();
-               }
-
-               @Override
-               public Object getParent(Object element) {
-                       Node node = (Node) element;
-                       return Jcr.getParent(node);
-               }
-
-               @Override
-               public boolean hasChildren(Object element) {
-                       Node node = (Node) element;
-                       return !isLeaf(node);
-               }
-
-               @Override
-               public void dispose() {
-               }
-
-               @Override
-               public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-               }
-
-       }
-
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsContextMenu.java b/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsContextMenu.java
deleted file mode 100644 (file)
index 82a21c1..0000000
+++ /dev/null
@@ -1,177 +0,0 @@
-package org.argeo.app.ui.library;
-
-import static org.argeo.app.ui.library.DocumentsUiService.ACTION_ID_BOOKMARK_FOLDER;
-import static org.argeo.app.ui.library.DocumentsUiService.ACTION_ID_CREATE_FOLDER;
-import static org.argeo.app.ui.library.DocumentsUiService.ACTION_ID_DELETE;
-import static org.argeo.app.ui.library.DocumentsUiService.ACTION_ID_DOWNLOAD_FOLDER;
-import static org.argeo.app.ui.library.DocumentsUiService.ACTION_ID_RENAME;
-import static org.argeo.app.ui.library.DocumentsUiService.ACTION_ID_SHARE_FOLDER;
-import static org.argeo.app.ui.library.DocumentsUiService.ACTION_ID_UPLOAD_FILE;
-
-import java.nio.file.Files;
-import java.nio.file.Path;
-
-import org.argeo.app.ui.widgets.AbstractConnectContextMenu;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Control;
-
-/** Generic popup context menu to manage NIO Path in a Viewer. */
-public class DocumentsContextMenu extends AbstractConnectContextMenu {
-       // Local context
-       private final DocumentsFolderComposite browser;
-       private final DocumentsUiService uiService;
-//     private final Repository repository;
-
-       private final static String[] DEFAULT_ACTIONS = { ACTION_ID_CREATE_FOLDER, ACTION_ID_BOOKMARK_FOLDER,
-                       ACTION_ID_SHARE_FOLDER, ACTION_ID_DOWNLOAD_FOLDER, ACTION_ID_UPLOAD_FILE, ACTION_ID_RENAME,
-                       ACTION_ID_DELETE };
-
-       private Path currFolderPath;
-
-       public DocumentsContextMenu(DocumentsFolderComposite browser,
-                       DocumentsUiService documentsUiService) {
-               super(browser.getDisplay(), DEFAULT_ACTIONS);
-               this.browser = browser;
-               this.uiService = documentsUiService;
-//             this.repository = repository;
-
-               createControl();
-       }
-
-       public void setCurrFolderPath(Path currFolderPath) {
-               this.currFolderPath = currFolderPath;
-       }
-
-       protected boolean aboutToShow(Control source, Point location, IStructuredSelection selection) {
-               boolean emptySel = true;
-               boolean multiSel = false;
-               boolean isFolder = true;
-               if (selection != null && !selection.isEmpty()) {
-                       emptySel = false;
-                       multiSel = selection.size() > 1;
-                       if (!multiSel && selection.getFirstElement() instanceof Path) {
-                               isFolder = Files.isDirectory((Path) selection.getFirstElement());
-                       }
-               }
-               if (emptySel) {
-                       setVisible(true, ACTION_ID_CREATE_FOLDER, ACTION_ID_UPLOAD_FILE, ACTION_ID_BOOKMARK_FOLDER);
-                       setVisible(false, ACTION_ID_SHARE_FOLDER, ACTION_ID_DOWNLOAD_FOLDER, ACTION_ID_RENAME, ACTION_ID_DELETE
-                               );
-               } else if (multiSel) {
-                       setVisible(true, ACTION_ID_CREATE_FOLDER, ACTION_ID_UPLOAD_FILE, ACTION_ID_DELETE,
-                                       ACTION_ID_BOOKMARK_FOLDER);
-                       setVisible(false, ACTION_ID_SHARE_FOLDER, ACTION_ID_DOWNLOAD_FOLDER, ACTION_ID_RENAME);
-               } else if (isFolder) {
-                       setVisible(true, ACTION_ID_CREATE_FOLDER, ACTION_ID_UPLOAD_FILE, ACTION_ID_RENAME, ACTION_ID_DELETE,
-                                       ACTION_ID_BOOKMARK_FOLDER);
-                       setVisible(false, 
-                                       // to be implemented
-                                       ACTION_ID_SHARE_FOLDER, ACTION_ID_DOWNLOAD_FOLDER);
-               } else {
-                       setVisible(true, ACTION_ID_CREATE_FOLDER, ACTION_ID_UPLOAD_FILE, ACTION_ID_RENAME,
-                                       ACTION_ID_DELETE);
-                       setVisible(false, ACTION_ID_SHARE_FOLDER, ACTION_ID_DOWNLOAD_FOLDER, ACTION_ID_BOOKMARK_FOLDER);
-               }
-               return true;
-       }
-
-       public void show(Control source, Point location, IStructuredSelection selection, Path currFolderPath) {
-               // TODO find a better way to retrieve the parent path (cannot be deduced
-               // from table content because it will fail on an empty folder)
-               this.currFolderPath = currFolderPath;
-               super.show(source, location, selection);
-
-       }
-
-       @Override
-       protected boolean performAction(String actionId) {
-               switch (actionId) {
-               case ACTION_ID_CREATE_FOLDER:
-                       createFolder();
-                       break;
-               case ACTION_ID_BOOKMARK_FOLDER:
-                       bookmarkFolder();
-                       break;
-               case ACTION_ID_RENAME:
-                       renameItem();
-                       break;
-               case ACTION_ID_DELETE:
-                       deleteItems();
-                       break;
-//             case ACTION_ID_OPEN:
-//                     openFile();
-//                     break;
-               case ACTION_ID_UPLOAD_FILE:
-                       uploadFiles();
-                       break;
-               default:
-                       throw new IllegalArgumentException("Unimplemented action " + actionId);
-                       // case ACTION_ID_SHARE_FOLDER:
-                       // return "Share Folder";
-                       // case ACTION_ID_DOWNLOAD_FOLDER:
-                       // return "Download as zip archive";
-               }
-               browser.setFocus();
-               return false;
-       }
-
-       @Override
-       protected String getLabel(String actionId) {
-               return uiService.getLabel(actionId);
-       }
-
-       private void openFile() {
-               IStructuredSelection selection = ((IStructuredSelection) browser.getViewer().getSelection());
-               if (selection.isEmpty() || selection.size() > 1)
-                       // Should never happen
-                       return;
-               Path toOpenPath = ((Path) selection.getFirstElement());
-               uiService.openFile(toOpenPath);
-       }
-
-       private void deleteItems() {
-               IStructuredSelection selection = ((IStructuredSelection) browser.getViewer().getSelection());
-               if (selection.isEmpty())
-                       return;
-               else if (uiService.deleteItems(getParentShell(), selection))
-                       browser.refresh();
-       }
-
-       private void renameItem() {
-               IStructuredSelection selection = ((IStructuredSelection) browser.getViewer().getSelection());
-               if (selection.isEmpty() || selection.size() > 1)
-                       // Should never happen
-                       return;
-               Path toRenamePath = ((Path) selection.getFirstElement());
-               if (uiService.renameItem(getParentShell(), currFolderPath, toRenamePath))
-                       browser.refresh();
-       }
-
-       private void createFolder() {
-               if (uiService.createFolder(getParentShell(), currFolderPath))
-                       browser.refresh();
-       }
-
-       private void bookmarkFolder() {
-               Path toBookmarkPath = null;
-               IStructuredSelection selection = ((IStructuredSelection) browser.getViewer().getSelection());
-               if (selection.isEmpty())
-                       toBookmarkPath = currFolderPath;
-               else if (selection.size() > 1)
-                       toBookmarkPath = currFolderPath;
-               else if (selection.size() == 1) {
-                       Path currSelected = ((Path) selection.getFirstElement());
-                       if (Files.isDirectory(currSelected))
-                               toBookmarkPath = currSelected;
-                       else
-                               return;
-               }
-               //uiService.bookmarkFolder(toBookmarkPath, repository, null);
-       }
-
-       private void uploadFiles() {
-               if (uiService.uploadFiles(getParentShell(), currFolderPath))
-                       browser.refresh();
-       }
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsFileComposite.java b/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsFileComposite.java
deleted file mode 100644 (file)
index d4b70bb..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-package org.argeo.app.ui.library;
-
-import java.io.IOException;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.spi.FileSystemProvider;
-
-import javax.jcr.Node;
-
-import org.argeo.api.cms.CmsLog;
-import org.argeo.cms.fs.CmsFsUtils;
-import org.argeo.cms.ui.util.CmsUiUtils;
-import org.argeo.eclipse.ui.EclipseUiUtils;
-import org.argeo.eclipse.ui.fs.FsUiUtils;
-import org.argeo.eclipse.ui.specific.UiContext;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.browser.Browser;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-
-/**
- * Default Documents file composite: a sashForm with a browser in the middle and
- * meta data at right hand side.
- */
-public class DocumentsFileComposite extends Composite {
-       private static final long serialVersionUID = -7567632342889241793L;
-
-       private final static CmsLog log = CmsLog.getLog(DocumentsFileComposite.class);
-
-       private final Node currentBaseContext;
-
-       // UI Parts for the browser
-       private Composite rightPannelCmp;
-
-       public DocumentsFileComposite(Composite parent, int style, Node context, FileSystemProvider fsp) {
-               super(parent, style);
-               this.currentBaseContext = context;
-               this.setLayout(EclipseUiUtils.noSpaceGridLayout());
-               SashForm form = new SashForm(this, SWT.HORIZONTAL);
-
-               Composite centerCmp = new Composite(form, SWT.BORDER | SWT.NO_FOCUS);
-               createDisplay(centerCmp);
-
-               rightPannelCmp = new Composite(form, SWT.NO_FOCUS);
-
-               Path path = CmsFsUtils.getPath(fsp, context);
-               setOverviewInput(path);
-               form.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-               form.setWeights(new int[] { 55, 20 });
-       }
-
-       private void createDisplay(final Composite parent) {
-               parent.setLayout(EclipseUiUtils.noSpaceGridLayout());
-               Browser browser = new Browser(parent, SWT.NONE);
-               // browser.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true,
-               // true));
-               browser.setLayoutData(EclipseUiUtils.fillAll());
-               // FIXME make it more robust
-               String url = CmsUiUtils.getDataUrl(currentBaseContext, UiContext.getHttpRequest());
-               // FIXME issue with the redirection to https
-               if (url.startsWith("http://") && !url.startsWith("http://localhost"))
-                       url = "https://" + url.substring("http://".length(), url.length());
-               if (log.isTraceEnabled())
-                       log.debug("Trying to display " + url);
-               browser.setUrl(url);
-               browser.layout(true, true);
-       }
-
-       /**
-        * Recreates the content of the box that displays information about the current
-        * selected Path.
-        */
-       private void setOverviewInput(Path path) {
-               try {
-                       EclipseUiUtils.clear(rightPannelCmp);
-                       rightPannelCmp.setLayout(new GridLayout());
-                       if (path != null) {
-                               // if (isImg(context)) {
-                               // EditableImage image = new Img(parent, RIGHT, context,
-                               // imageWidth);
-                               // image.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER,
-                               // true, false,
-                               // 2, 1));
-                               // }
-
-                               Label contextL = new Label(rightPannelCmp, SWT.NONE);
-                               contextL.setText(path.getFileName().toString());
-                               contextL.setFont(EclipseUiUtils.getBoldFont(rightPannelCmp));
-                               addProperty(rightPannelCmp, "Last modified", Files.getLastModifiedTime(path).toString());
-                               // addProperty(rightPannelCmp, "Owner",
-                               // Files.getOwner(path).getName());
-                               if (Files.isDirectory(path)) {
-                                       addProperty(rightPannelCmp, "Type", "Folder");
-                               } else {
-                                       String mimeType = Files.probeContentType(path);
-                                       if (EclipseUiUtils.isEmpty(mimeType))
-                                               mimeType = "<i>Unknown</i>";
-                                       addProperty(rightPannelCmp, "Type", mimeType);
-                                       addProperty(rightPannelCmp, "Size", FsUiUtils.humanReadableByteCount(Files.size(path), false));
-                               }
-                       }
-                       rightPannelCmp.layout(true, true);
-               } catch (IOException e) {
-                       throw new IllegalStateException("Cannot display details for " + path.toString(), e);
-               }
-       }
-
-       // Simplify UI implementation
-       private void addProperty(Composite parent, String propName, String value) {
-               Label propLbl = new Label(parent, SWT.NONE);
-               // propLbl.setText(ConnectUtils.replaceAmpersand(propName + ": " + value));
-               propLbl.setText(value);
-               // CmsUiUtils.markup(propLbl);
-       }
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsFolderComposite.java b/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsFolderComposite.java
deleted file mode 100644 (file)
index 58ceed6..0000000
+++ /dev/null
@@ -1,454 +0,0 @@
-package org.argeo.app.ui.library;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.attribute.FileTime;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import javax.jcr.Node;
-
-import org.argeo.api.cms.CmsLog;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.ui.fs.FileDrop;
-import org.argeo.cms.ui.fs.FsStyles;
-import org.argeo.eclipse.ui.ColumnDefinition;
-import org.argeo.eclipse.ui.EclipseUiUtils;
-import org.argeo.eclipse.ui.fs.FileIconNameLabelProvider;
-import org.argeo.eclipse.ui.fs.FsTableViewer;
-import org.argeo.eclipse.ui.fs.FsUiConstants;
-import org.argeo.eclipse.ui.fs.FsUiUtils;
-import org.argeo.eclipse.ui.fs.NioFileLabelProvider;
-import org.argeo.eclipse.ui.fs.ParentDir;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.KeyListener;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.layout.RowData;
-import org.eclipse.swt.layout.RowLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Default Documents folder composite: a sashForm layout with a simple table in
- * the middle and an overview at right hand side.
- */
-public class DocumentsFolderComposite extends Composite {
-       private final static CmsLog log = CmsLog.getLog(DocumentsFolderComposite.class);
-       private static final long serialVersionUID = -40347919096946585L;
-
-       private final Node currentBaseContext;
-
-       private final DocumentsUiService documentUiService = new DocumentsUiService();
-
-       // UI Parts for the browser
-       private Composite filterCmp;
-       private Composite breadCrumbCmp;
-       private Text filterTxt;
-       private FsTableViewer directoryDisplayViewer;
-       private Composite rightPanelCmp;
-
-       private DocumentsContextMenu contextMenu;
-       private DateFormat dateFormat = new SimpleDateFormat("YYYY-MM-dd HH:mm");
-
-       // Local context
-       private Path initialPath;
-       private Path currentFolder;
-
-       public DocumentsFolderComposite(Composite parent, int style, Node context) {
-               super(parent, style);
-               this.currentBaseContext = context;
-
-               this.setLayout(EclipseUiUtils.noSpaceGridLayout());
-
-               SashForm form = new SashForm(this, SWT.HORIZONTAL);
-
-               Composite centerCmp = new Composite(form, SWT.BORDER | SWT.NO_FOCUS);
-               createDisplay(centerCmp);
-
-               rightPanelCmp = new Composite(form, SWT.NO_FOCUS);
-
-               form.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
-               form.setWeights(new int[] { 55, 20 });
-       }
-
-       public void populate(Path path) {
-               initialPath = path;
-               directoryDisplayViewer.setInitialPath(initialPath);
-               setInput(path);
-       }
-
-       void refresh() {
-               modifyFilter(false);
-       }
-
-       private void createDisplay(final Composite parent) {
-               parent.setLayout(EclipseUiUtils.noSpaceGridLayout());
-
-               // top filter
-               filterCmp = new Composite(parent, SWT.NO_FOCUS);
-               filterCmp.setLayoutData(EclipseUiUtils.fillWidth());
-               RowLayout rl = new RowLayout(SWT.HORIZONTAL);
-               rl.wrap = true;
-               rl.center = true;
-               filterCmp.setLayout(rl);
-               // addFilterPanel(filterCmp);
-
-               // Main display
-               directoryDisplayViewer = new FsTableViewer(parent, SWT.MULTI);
-               List<ColumnDefinition> colDefs = new ArrayList<>();
-               colDefs.add(new ColumnDefinition(new FileIconNameLabelProvider(), " Name", 250));
-               colDefs.add(new ColumnDefinition(new NioFileLabelProvider(FsUiConstants.PROPERTY_SIZE), "Size", 100));
-//             colDefs.add(new ColumnDefinition(new NioFileLabelProvider(FsUiConstants.PROPERTY_TYPE), "Type", 150));
-               colDefs.add(new ColumnDefinition(new NioFileLabelProvider(FsUiConstants.PROPERTY_LAST_MODIFIED),
-                               "Last modified", 400));
-               final Table table = directoryDisplayViewer.configureDefaultTable(colDefs);
-               table.setLayoutData(EclipseUiUtils.fillAll());
-
-               directoryDisplayViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-
-                       @Override
-                       public void selectionChanged(SelectionChangedEvent event) {
-                               IStructuredSelection selection = (IStructuredSelection) directoryDisplayViewer.getSelection();
-                               Path selected = null;
-                               if (selection.isEmpty())
-                                       setSelected(null);
-                               else {
-                                       Object o = selection.getFirstElement();
-                                       if (o instanceof Path)
-                                               selected = (Path) o;
-                                       else if (o instanceof ParentDir)
-                                               selected = ((ParentDir) o).getPath();
-                               }
-                               if (selected != null) {
-                                       // TODO manage multiple selection
-                                       setSelected(selected);
-                               }
-                       }
-               });
-
-               directoryDisplayViewer.addDoubleClickListener(new IDoubleClickListener() {
-                       @Override
-                       public void doubleClick(DoubleClickEvent event) {
-                               IStructuredSelection selection = (IStructuredSelection) directoryDisplayViewer.getSelection();
-                               Path selected = null;
-                               if (!selection.isEmpty()) {
-                                       Object o = selection.getFirstElement();
-                                       if (o instanceof Path)
-                                               selected = (Path) o;
-                                       else if (o instanceof ParentDir)
-                                               selected = ((ParentDir) o).getPath();
-                               }
-                               if (selected != null) {
-                                       if (Files.isDirectory(selected))
-                                               setInput(selected);
-                                       else
-                                               externalNavigateTo(selected);
-                               }
-                       }
-               });
-
-               // The context menu
-               contextMenu = new DocumentsContextMenu(this,  documentUiService);
-
-               table.addMouseListener(new MouseAdapter() {
-                       private static final long serialVersionUID = 6737579410648595940L;
-
-                       @Override
-                       public void mouseDown(MouseEvent e) {
-                               if (e.button == 3) {
-                                       // contextMenu.setCurrFolderPath(currDisplayedFolder);
-                                       contextMenu.show(table, new Point(e.x, e.y),
-                                                       (IStructuredSelection) directoryDisplayViewer.getSelection(), currentFolder);
-                               }
-                       }
-               });
-
-               FileDrop fileDrop = new FileDrop() {
-
-                       @Override
-                       protected void processFileUpload(InputStream in, String fileName, String contetnType) throws IOException {
-                               Path file = currentFolder.resolve(fileName);
-                               Files.copy(in, file);
-                               refresh();
-                       }
-               };
-               fileDrop.createDropTarget(directoryDisplayViewer.getTable());
-       }
-
-       /**
-        * Overwrite to enable single sourcing between workbench and CMS navigation
-        */
-       protected void externalNavigateTo(Path path) {
-
-       }
-
-       private void addPathElementBtn(Path path) {
-               Button elemBtn = new Button(breadCrumbCmp, SWT.PUSH);
-               String nameStr;
-               if (path.toString().equals("/"))
-                       nameStr = "[jcr:root]";
-               else
-                       nameStr = path.getFileName().toString();
-//             elemBtn.setText(nameStr + " >> ");
-               elemBtn.setText(nameStr);
-               CmsSwtUtils.style(elemBtn, FsStyles.BREAD_CRUMB_BTN);
-               elemBtn.addSelectionListener(new SelectionAdapter() {
-                       private static final long serialVersionUID = -4103695476023480651L;
-
-                       @Override
-                       public void widgetSelected(SelectionEvent e) {
-                               setInput(path);
-                       }
-               });
-       }
-
-       public void setInput(Path path) {
-               if (path.equals(currentFolder))
-                       return;
-               // below initial path
-               if (!initialPath.equals(path) && initialPath.startsWith(path))
-                       return;
-               currentFolder = path;
-
-               Path diff = initialPath.relativize(currentFolder);
-
-               for (Control child : filterCmp.getChildren())
-                       if (!child.equals(filterTxt))
-                               child.dispose();
-
-               // Bread crumbs
-               breadCrumbCmp = new Composite(filterCmp, SWT.NO_FOCUS);
-               CmsSwtUtils.style(breadCrumbCmp, FsStyles.BREAD_CRUMB_BTN);
-               RowLayout breadCrumbLayout = new RowLayout();
-               breadCrumbLayout.spacing = 0;
-               breadCrumbLayout.marginTop = 0;
-               breadCrumbLayout.marginBottom = 0;
-               breadCrumbLayout.marginRight = 0;
-               breadCrumbLayout.marginLeft = 0;
-               breadCrumbCmp.setLayout(breadCrumbLayout);
-               addPathElementBtn(initialPath);
-               Path currTarget = initialPath;
-               if (!diff.toString().equals(""))
-                       for (Path pathElem : diff) {
-                               currTarget = currTarget.resolve(pathElem);
-                               addPathElementBtn(currTarget);
-                       }
-
-               if (filterTxt != null) {
-                       filterTxt.setText("");
-                       filterTxt.moveBelow(null);
-               } else {
-                       modifyFilter(false);
-               }
-               setSelected(null);
-               filterCmp.getParent().layout(true, true);
-       }
-
-       private void setSelected(Path path) {
-               if (path == null)
-                       setOverviewInput(currentFolder);
-               else
-                       setOverviewInput(path);
-       }
-
-       public Viewer getViewer() {
-               return directoryDisplayViewer;
-       }
-
-       /**
-        * Recreates the content of the box that displays information about the current
-        * selected Path.
-        */
-       private void setOverviewInput(Path path) {
-               try {
-                       EclipseUiUtils.clear(rightPanelCmp);
-                       rightPanelCmp.setLayout(new GridLayout());
-                       if (path != null) {
-                               // if (isImg(context)) {
-                               // EditableImage image = new Img(parent, RIGHT, context,
-                               // imageWidth);
-                               // image.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER,
-                               // true, false,
-                               // 2, 1));
-                               // }
-
-                               Label contextL = new Label(rightPanelCmp, SWT.NONE);
-                               contextL.setText(path.getFileName().toString());
-                               contextL.setFont(EclipseUiUtils.getBoldFont(rightPanelCmp));
-                               FileTime lastModified = Files.getLastModifiedTime(path);
-                               if (lastModified.toMillis() != 0)
-                                       try {
-                                               String lastModifiedStr = dateFormat.format(new Date(lastModified.toMillis()));
-                                               addProperty(rightPanelCmp, "Last modified", lastModifiedStr);
-                                       } catch (Exception e) {
-                                               log.error("Workarounded issue while getting last update date for " + path, e);
-                                               addProperty(rightPanelCmp, "Last modified", "-");
-                                       }
-                               // addProperty(rightPannelCmp, "Owner",
-                               // Files.getOwner(path).getName());
-                               if (Files.isDirectory(path)) {
-                                       addProperty(rightPanelCmp, "Type", "Folder");
-                               } else {
-                                       String mimeType = Files.probeContentType(path);
-                                       if (EclipseUiUtils.isEmpty(mimeType))
-                                               mimeType = "<i>Unknown</i>";
-                                       addProperty(rightPanelCmp, "Type", mimeType);
-                                       addProperty(rightPanelCmp, "Size", FsUiUtils.humanReadableByteCount(Files.size(path), false));
-                               }
-
-                               // read all attributes
-//                             Map<String, Object> attrs = Files.readAttributes(path, "*");
-//                             for (String attr : attrs.keySet()) {
-//                                     Object value = attrs.get(attr);
-//                                     String str;
-//                                     if (value instanceof Calendar) {
-//                                             str = dateFormat.format(((Calendar) value).getTime());
-//                                     } else {
-//                                             str = value.toString();
-//                                     }
-//                                     addProperty(rightPanelCmp, attr, str);
-//
-//                             }
-                       }
-                       rightPanelCmp.layout(true, true);
-               } catch (IOException e) {
-                       throw new IllegalStateException("Cannot display details for " + path.toString(), e);
-               }
-       }
-
-       private void addFilterPanel(Composite parent) {
-               // parent.setLayout(EclipseUiUtils.noSpaceGridLayout(new GridLayout(2,
-               // false)));
-
-               filterTxt = new Text(parent, SWT.SEARCH | SWT.ICON_CANCEL);
-               filterTxt.setMessage("Search current folder");
-               filterTxt.setLayoutData(new RowData(250, SWT.DEFAULT));
-               filterTxt.addModifyListener(new ModifyListener() {
-                       private static final long serialVersionUID = 1L;
-
-                       public void modifyText(ModifyEvent event) {
-                               modifyFilter(false);
-                       }
-               });
-               filterTxt.addKeyListener(new KeyListener() {
-                       private static final long serialVersionUID = 2533535233583035527L;
-
-                       @Override
-                       public void keyReleased(KeyEvent e) {
-                       }
-
-                       @Override
-                       public void keyPressed(KeyEvent e) {
-                               // boolean shiftPressed = (e.stateMask & SWT.SHIFT) != 0;
-                               // // boolean altPressed = (e.stateMask & SWT.ALT) != 0;
-                               // FilterEntitiesVirtualTable currTable = null;
-                               // if (currEdited != null) {
-                               // FilterEntitiesVirtualTable table =
-                               // browserCols.get(currEdited);
-                               // if (table != null && !table.isDisposed())
-                               // currTable = table;
-                               // }
-                               //
-                               // if (e.keyCode == SWT.ARROW_DOWN)
-                               // currTable.setFocus();
-                               // else if (e.keyCode == SWT.BS) {
-                               // if (filterTxt.getText().equals("")
-                               // && !(currEdited.getNameCount() == 1 ||
-                               // currEdited.equals(initialPath))) {
-                               // Path oldEdited = currEdited;
-                               // Path parentPath = currEdited.getParent();
-                               // setEdited(parentPath);
-                               // if (browserCols.containsKey(parentPath))
-                               // browserCols.get(parentPath).setSelected(oldEdited);
-                               // filterTxt.setFocus();
-                               // e.doit = false;
-                               // }
-                               // } else if (e.keyCode == SWT.TAB && !shiftPressed) {
-                               // Path uniqueChild = getOnlyChild(currEdited,
-                               // filterTxt.getText());
-                               // if (uniqueChild != null) {
-                               // // Highlight the unique chosen child
-                               // currTable.setSelected(uniqueChild);
-                               // setEdited(uniqueChild);
-                               // }
-                               // filterTxt.setFocus();
-                               // e.doit = false;
-                               // }
-                       }
-               });
-       }
-
-       // private Path getOnlyChild(Path parent, String filter) {
-       // try (DirectoryStream<Path> stream =
-       // Files.newDirectoryStream(currDisplayedFolder, filter + "*")) {
-       // Path uniqueChild = null;
-       // boolean moreThanOne = false;
-       // loop: for (Path entry : stream) {
-       // if (uniqueChild == null) {
-       // uniqueChild = entry;
-       // } else {
-       // moreThanOne = true;
-       // break loop;
-       // }
-       // }
-       // if (!moreThanOne)
-       // return uniqueChild;
-       // return null;
-       // } catch (IOException ioe) {
-       // throw new DocumentsException(
-       // "Unable to determine unique child existence and get it under " + parent +
-       // " with filter " + filter,
-       // ioe);
-       // }
-       // }
-
-       private void modifyFilter(boolean fromOutside) {
-               if (!fromOutside)
-                       if (currentFolder != null) {
-                               String filter;
-                               if (filterTxt != null)
-                                       filter = filterTxt.getText() + "*";
-                               else
-                                       filter = "*";
-                               directoryDisplayViewer.setInput(currentFolder, filter);
-                       }
-       }
-
-       // Simplify UI implementation
-       private void addProperty(Composite parent, String propName, String value) {
-               Label propLbl = new Label(parent, SWT.NONE);
-               //propLbl.setText(ConnectUtils.replaceAmpersand(propName + ": " + value));
-               propLbl.setText(value);
-               //CmsUiUtils.markup(propLbl);
-       }
-
-       public Path getCurrentFolder() {
-               return currentFolder;
-       }
-
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsFolderUiProvider.java b/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsFolderUiProvider.java
deleted file mode 100644 (file)
index 781b862..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.argeo.app.ui.library;
-
-import java.nio.file.Path;
-import java.nio.file.spi.FileSystemProvider;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-
-import org.argeo.api.cms.CmsView;
-import org.argeo.app.ui.SuiteEvent;
-import org.argeo.cms.fs.CmsFsUtils;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.ui.CmsUiProvider;
-import org.argeo.jcr.Jcr;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-/** UI provider of a document folder. */
-public class DocumentsFolderUiProvider implements CmsUiProvider {
-       private FileSystemProvider nodeFileSystemProvider;
-
-       @Override
-       public Control createUi(Composite parent, Node context) throws RepositoryException {
-               CmsView cmsView = CmsSwtUtils.getCmsView(parent);
-               DocumentsFolderComposite dfc = new DocumentsFolderComposite(parent, SWT.NONE, context) {
-
-                       @Override
-                       protected void externalNavigateTo(Path path) {
-                               Node folderNode = cmsView.doAs(() -> CmsFsUtils.getNode(Jcr.getSession(context).getRepository(), path));
-                               parent.addDisposeListener((e1) -> Jcr.logout(folderNode));
-                               cmsView.sendEvent(SuiteEvent.openNewPart.topic(), SuiteEvent.eventProperties(folderNode));
-                       }
-               };
-               dfc.setLayoutData(CmsSwtUtils.fillAll());
-               dfc.populate(cmsView.doAs(() -> CmsFsUtils.getPath(nodeFileSystemProvider, context)));
-               return dfc;
-       }
-
-       public void setNodeFileSystemProvider(FileSystemProvider nodeFileSystemProvider) {
-               this.nodeFileSystemProvider = nodeFileSystemProvider;
-       }
-
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsTreeUiProvider.java b/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsTreeUiProvider.java
deleted file mode 100644 (file)
index 1c82396..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-package org.argeo.app.ui.library;
-
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.spi.FileSystemProvider;
-
-import javax.jcr.Node;
-import javax.jcr.Repository;
-import javax.jcr.RepositoryException;
-
-import org.argeo.api.cms.CmsView;
-import org.argeo.app.ui.SuiteEvent;
-import org.argeo.api.cms.CmsConstants;
-import org.argeo.cms.fs.CmsFsUtils;
-import org.argeo.cms.jcr.CmsJcrUtils;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.ui.CmsUiProvider;
-import org.argeo.eclipse.ui.fs.FsTreeViewer;
-import org.argeo.jcr.Jcr;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-/** Tree view of a user root folders. */
-public class DocumentsTreeUiProvider implements CmsUiProvider {
-       private FileSystemProvider nodeFileSystemProvider;
-       private Repository repository;
-
-       @Override
-       public Control createUi(Composite parent, Node context) throws RepositoryException {
-               parent.setLayout(new GridLayout());
-               FsTreeViewer fsTreeViewer = new FsTreeViewer(parent, SWT.NONE);
-               fsTreeViewer.configureDefaultSingleColumnTable(500);
-               CmsView cmsView = CmsSwtUtils.getCmsView(parent);
-               Node homeNode = CmsJcrUtils.getUserHome(cmsView.doAs(() -> Jcr.login(repository, CmsConstants.HOME_WORKSPACE)));
-               parent.addDisposeListener((e1) -> Jcr.logout(homeNode));
-               Path homePath = CmsFsUtils.getPath(nodeFileSystemProvider, homeNode);
-               fsTreeViewer.addSelectionChangedListener((e) -> {
-                       IStructuredSelection selection = (IStructuredSelection) fsTreeViewer.getSelection();
-                       if (selection.isEmpty())
-                               return;
-                       else {
-                               Path newSelected = (Path) selection.getFirstElement();
-                               if (Files.isDirectory(newSelected)) {
-                                       Node folderNode = cmsView.doAs(() -> CmsFsUtils.getNode(repository, newSelected));
-                                       parent.addDisposeListener((e1) -> Jcr.logout(folderNode));
-                                       cmsView.sendEvent(SuiteEvent.refreshPart.topic(), SuiteEvent.eventProperties(folderNode));
-                               }
-                       }
-               });
-               fsTreeViewer.addDoubleClickListener((e) -> {
-                       IStructuredSelection selection = (IStructuredSelection) fsTreeViewer.getSelection();
-                       if (selection.isEmpty())
-                               return;
-                       else {
-                               Path newSelected = (Path) selection.getFirstElement();
-                               if (Files.isDirectory(newSelected)) {
-                                       Node folderNode = cmsView.doAs(() -> CmsFsUtils.getNode(repository, newSelected));
-                                       parent.addDisposeListener((e1) -> Jcr.logout(folderNode));
-                                       cmsView.sendEvent(SuiteEvent.openNewPart.topic(), SuiteEvent.eventProperties(folderNode));
-                               }
-                       }
-               });
-               fsTreeViewer.setPathsInput(homePath);
-               fsTreeViewer.getControl().setLayoutData(CmsSwtUtils.fillAll());
-               fsTreeViewer.getControl().getParent().layout(true, true);
-               return fsTreeViewer.getControl();
-       }
-
-       public void setNodeFileSystemProvider(FileSystemProvider nodeFileSystemProvider) {
-               this.nodeFileSystemProvider = nodeFileSystemProvider;
-       }
-
-       public void setRepository(Repository repository) {
-               this.repository = repository;
-       }
-
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsUiService.java b/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsUiService.java
deleted file mode 100644 (file)
index 6cbe4ae..0000000
+++ /dev/null
@@ -1,308 +0,0 @@
-package org.argeo.app.ui.library;
-
-import static org.argeo.cms.swt.dialogs.CmsMessageDialog.openConfirm;
-import static org.argeo.cms.swt.dialogs.CmsMessageDialog.openError;
-import static org.argeo.cms.swt.dialogs.SingleValueDialog.ask;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.lang.reflect.Method;
-import java.net.URI;
-import java.nio.file.DirectoryNotEmptyException;
-import java.nio.file.FileVisitResult;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.nio.file.SimpleFileVisitor;
-import java.nio.file.attribute.BasicFileAttributes;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.argeo.api.cms.CmsLog;
-import org.argeo.cms.swt.dialogs.CmsFeedback;
-import org.argeo.eclipse.ui.EclipseUiUtils;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Shell;
-
-public class DocumentsUiService {
-       private final static CmsLog log = CmsLog.getLog(DocumentsUiService.class);
-
-       // Default known actions
-       public final static String ACTION_ID_CREATE_FOLDER = "createFolder";
-       public final static String ACTION_ID_BOOKMARK_FOLDER = "bookmarkFolder";
-       public final static String ACTION_ID_SHARE_FOLDER = "shareFolder";
-       public final static String ACTION_ID_DOWNLOAD_FOLDER = "downloadFolder";
-       public final static String ACTION_ID_RENAME = "rename";
-       public final static String ACTION_ID_DELETE = "delete";
-       public final static String ACTION_ID_UPLOAD_FILE = "uploadFiles";
-       // public final static String ACTION_ID_OPEN = "open";
-       public final static String ACTION_ID_DELETE_BOOKMARK = "deleteBookmark";
-       public final static String ACTION_ID_RENAME_BOOKMARK = "renameBookmark";
-
-       public String getLabel(String actionId) {
-               switch (actionId) {
-               case ACTION_ID_CREATE_FOLDER:
-                       return "Create Folder";
-               case ACTION_ID_BOOKMARK_FOLDER:
-                       return "Bookmark Folder";
-               case ACTION_ID_SHARE_FOLDER:
-                       return "Share Folder";
-               case ACTION_ID_DOWNLOAD_FOLDER:
-                       return "Download as zip archive";
-               case ACTION_ID_RENAME:
-                       return "Rename";
-               case ACTION_ID_DELETE:
-                       return "Delete";
-               case ACTION_ID_UPLOAD_FILE:
-                       return "Upload Files";
-//             case ACTION_ID_OPEN:
-//                     return "Open";
-               case ACTION_ID_DELETE_BOOKMARK:
-                       return "Delete bookmark";
-               case ACTION_ID_RENAME_BOOKMARK:
-                       return "Rename bookmark";
-               default:
-                       throw new IllegalArgumentException("Unknown action ID " + actionId);
-               }
-       }
-
-       public void openFile(Path toOpenPath) {
-               try {
-                       String name = toOpenPath.getFileName().toString();
-                       File tmpFile = File.createTempFile("tmp", name);
-                       tmpFile.deleteOnExit();
-                       try (OutputStream os = new FileOutputStream(tmpFile)) {
-                               Files.copy(toOpenPath, os);
-                       } catch (IOException e) {
-                               throw new IllegalStateException("Cannot open copy " + name + " to tmpFile.", e);
-                       }
-                       String uri = Paths.get(tmpFile.getAbsolutePath()).toUri().toString();
-                       Map<String, String> params = new HashMap<String, String>();
-//                     params.put(OpenFile.PARAM_FILE_NAME, name);
-//                     params.put(OpenFile.PARAM_FILE_URI, uri);
-                       // FIXME open file without a command
-                       // CommandUtils.callCommand(OpenFile.ID, params);
-               } catch (IOException e1) {
-                       throw new IllegalStateException("Cannot create tmp copy of " + toOpenPath, e1);
-               }
-       }
-
-       public boolean deleteItems(Shell shell, IStructuredSelection selection) {
-               if (selection.isEmpty())
-                       return false;
-
-               StringBuilder builder = new StringBuilder();
-               @SuppressWarnings("unchecked")
-               Iterator<Object> iterator = selection.iterator();
-               List<Path> paths = new ArrayList<>();
-
-               while (iterator.hasNext()) {
-                       Path path = (Path) iterator.next();
-                       builder.append(path.getFileName() + ", ");
-                       paths.add(path);
-               }
-               String msg = "You are about to delete following elements: " + builder.substring(0, builder.length() - 2)
-                               + ". Are you sure?";
-               if (openConfirm(msg)) {
-                       for (Path path : paths) {
-                               try {
-                                       // recursively delete directory and its content
-                                       Files.walkFileTree(path, new SimpleFileVisitor<Path>() {
-                                               @Override
-                                               public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
-                                                       Files.delete(file);
-                                                       return FileVisitResult.CONTINUE;
-                                               }
-
-                                               @Override
-                                               public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {
-                                                       Files.delete(dir);
-                                                       return FileVisitResult.CONTINUE;
-                                               }
-                                       });
-                               } catch (DirectoryNotEmptyException e) {
-                                       String errMsg = path.getFileName() + " cannot be deleted: directory is not empty.";
-                                       openError( errMsg);
-                                       throw new IllegalArgumentException("Cannot delete path " + path, e);
-                               } catch (IOException e) {
-                                       String errMsg = e.toString();
-                                       openError(errMsg);
-                                       throw new IllegalArgumentException("Cannot delete path " + path, e);
-                               }
-                       }
-                       return true;
-               }
-               return false;
-       }
-
-       public boolean renameItem(Shell shell, Path parentFolderPath, Path toRenamePath) {
-               String msg = "Enter a new name:";
-               String name = ask( msg, toRenamePath.getFileName().toString());
-               // TODO enhance check of name validity
-               if (EclipseUiUtils.notEmpty(name)) {
-                       try {
-                               Path child = parentFolderPath.resolve(name);
-                               if (Files.exists(child)) {
-                                       String errMsg = "An object named " + name + " already exists at " + parentFolderPath.toString()
-                                                       + ", please provide another name";
-                                       openError( errMsg);
-                                       throw new IllegalArgumentException(errMsg);
-                               } else {
-                                       Files.move(toRenamePath, child);
-                                       return true;
-                               }
-                       } catch (IOException e) {
-                               throw new IllegalStateException("Cannot rename " + name + " at " + parentFolderPath.toString(), e);
-                       }
-               }
-               return false;
-       }
-
-       public boolean createFolder(Shell shell, Path currFolderPath) {
-               String msg = "Enter a name:";
-               String name = ask( msg);
-               // TODO enhance check of name validity
-               if (EclipseUiUtils.notEmpty(name)) {
-                       name = name.trim();
-                       try {
-                               Path child = currFolderPath.resolve(name);
-                               if (Files.exists(child)) {
-                                       String errMsg = "A folder named " + name + " already exists at " + currFolderPath.toString()
-                                                       + ", cannot create";
-                                       openError(errMsg);
-                                       throw new IllegalArgumentException(errMsg);
-                               } else {
-                                       Files.createDirectories(child);
-                                       return true;
-                               }
-                       } catch (IOException e) {
-                               throw new IllegalStateException("Cannot create folder " + name + " at " + currFolderPath.toString(), e);
-                       }
-               }
-               return false;
-       }
-
-//     public void bookmarkFolder(Path toBookmarkPath, Repository repository, DocumentsService documentsService) {
-//             String msg = "Provide a name:";
-//             String name = SingleQuestion.ask("Create bookmark", msg, toBookmarkPath.getFileName().toString());
-//             if (EclipseUiUtils.notEmpty(name))
-//                     documentsService.createFolderBookmark(toBookmarkPath, name, repository);
-//     }
-
-       public boolean uploadFiles(Shell shell, Path currFolderPath) {
-//             shell = Display.getCurrent().getActiveShell();// ignore argument
-               try {
-                       FileDialog dialog = new FileDialog(shell, SWT.MULTI);
-                       dialog.setText("Choose one or more files to upload");
-
-                       if (EclipseUiUtils.notEmpty(dialog.open())) {
-                               String[] names = dialog.getFileNames();
-                               // Workaround small differences between RAP and RCP
-                               // 1. returned names are absolute path on RAP and
-                               // relative in RCP
-                               // 2. in RCP we must use getFilterPath that does not
-                               // exists on RAP
-                               Method filterMethod = null;
-                               Path parPath = null;
-                               try {
-                                       filterMethod = dialog.getClass().getDeclaredMethod("getFilterPath");
-                                       String filterPath = (String) filterMethod.invoke(dialog);
-                                       parPath = Paths.get(filterPath);
-                               } catch (NoSuchMethodException nsme) { // RAP
-                               }
-                               if (names.length == 0)
-                                       return false;
-                               else {
-                                       loop: for (String name : names) {
-                                               Path tmpPath = Paths.get(name);
-                                               if (parPath != null)
-                                                       tmpPath = parPath.resolve(tmpPath);
-                                               if (Files.exists(tmpPath)) {
-                                                       URI uri = tmpPath.toUri();
-                                                       String uriStr = uri.toString();
-
-                                                       if (Files.isDirectory(tmpPath)) {
-                                                               openError(
-                                                                               "Upload of directories in the system is not yet implemented");
-                                                               continue loop;
-                                                       }
-                                                       Path targetPath = currFolderPath.resolve(tmpPath.getFileName().toString());
-                                                       try (InputStream in = new FileInputStream(tmpPath.toFile())) {
-                                                               Files.copy(in, targetPath);
-                                                               Files.delete(tmpPath);
-                                                       }
-                                                       if (log.isDebugEnabled())
-                                                               log.debug("copied uploaded file " + uriStr + " to " + targetPath.toString());
-                                               } else {
-                                                       String msg = "Cannot copy tmp file from " + tmpPath.toString();
-                                                       if (parPath != null)
-                                                               msg += "\nPlease remember that file upload fails when choosing files from the \"Recently Used\" bookmarks on some OS";
-                                                       openError( msg);
-                                                       continue loop;
-                                               }
-                                       }
-                                       return true;
-                               }
-                       }
-               } catch (Exception e) {
-                       CmsFeedback.show("Cannot import files to " + currFolderPath,e);
-               }
-               return false;
-       }
-
-//     public boolean deleteBookmark(Shell shell, IStructuredSelection selection, Node bookmarkParent) {
-//             if (selection.isEmpty())
-//                     return false;
-//
-//             StringBuilder builder = new StringBuilder();
-//             @SuppressWarnings("unchecked")
-//             Iterator<Object> iterator = selection.iterator();
-//             List<Node> nodes = new ArrayList<>();
-//
-//             while (iterator.hasNext()) {
-//                     Node node = (Node) iterator.next();
-//                     builder.append(Jcr.get(node, Property.JCR_TITLE) + ", ");
-//                     nodes.add(node);
-//             }
-//             String msg = "You are about to delete following bookmark: " + builder.substring(0, builder.length() - 2)
-//                             + ". Are you sure?";
-//             if (MessageDialog.openConfirm(shell, "Confirm deletion", msg)) {
-//                     Session session = Jcr.session(bookmarkParent);
-//                     try {
-//                             if (session.hasPendingChanges())
-//                                     throw new DocumentsException("Cannot remove bookmarks, session is not clean");
-//                             for (Node path : nodes)
-//                                     path.remove();
-//                             bookmarkParent.getSession().save();
-//                             return true;
-//                     } catch (RepositoryException e) {
-//                             JcrUtils.discardQuietly(session);
-//                             throw new DocumentsException("Cannot delete bookmarks " + builder.toString(), e);
-//                     }
-//             }
-//             return false;
-//     }
-
-//     public boolean renameBookmark(IStructuredSelection selection) {
-//             if (selection.isEmpty() || selection.size() > 1)
-//                     return false;
-//             Node toRename = (Node) selection.getFirstElement();
-//             String msg = "Please provide a new name.";
-//             String name = SingleQuestion.ask("Rename bookmark", msg, ConnectJcrUtils.get(toRename, Property.JCR_TITLE));
-//             if (EclipseUiUtils.notEmpty(name)
-//                             && ConnectJcrUtils.setJcrProperty(toRename, Property.JCR_TITLE, PropertyType.STRING, name)) {
-//                     ConnectJcrUtils.saveIfNecessary(toRename);
-//                     return true;
-//             }
-//             return false;
-//     }
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/openlayers/OLMap.java b/org.argeo.app.ui/src/org/argeo/app/ui/openlayers/OLMap.java
deleted file mode 100644 (file)
index 1301325..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.argeo.app.ui.openlayers;
-
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-
-public class OLMap extends Composite {
-       private Label div;
-
-       public OLMap(Composite parent, int style) {
-               super(parent, style);
-               setLayout(CmsSwtUtils.noSpaceGridLayout());
-               div = new Label(this, SWT.NONE);
-               CmsSwtUtils.markup(div);
-               CmsSwtUtils.disableMarkupValidation(div);
-               div.setText("<div id='map'></div>");
-               div.setLayoutData(CmsSwtUtils.fillAll());
-       }
-
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/openlayers/OpenLayersMap.java b/org.argeo.app.ui/src/org/argeo/app/ui/openlayers/OpenLayersMap.java
deleted file mode 100644 (file)
index bf2ac2c..0000000
+++ /dev/null
@@ -1,305 +0,0 @@
-package org.argeo.app.ui.openlayers;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-
-import org.apache.commons.io.IOUtils;
-import org.argeo.api.cms.CmsView;
-import org.argeo.app.api.EntityNames;
-import org.argeo.app.api.EntityType;
-import org.argeo.app.ui.SuiteEvent;
-import org.argeo.api.cms.CmsLog;
-import org.argeo.api.cms.CmsConstants;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.browser.Browser;
-import org.eclipse.swt.browser.BrowserFunction;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-
-/** Display a map. */
-public class OpenLayersMap extends Composite {
-       private static final long serialVersionUID = 1055893020490283622L;
-
-       private final static CmsLog log = CmsLog.getLog(OpenLayersMap.class);
-
-       private Browser browser;
-       private boolean renderCompleted = false;
-
-       private Double centerLng = null, centerLat = null;
-       private Integer zoom = null;
-       private String vectorSource = null;
-       private String gpxSource = null;
-
-       private String vectorSourceStyle;
-
-       private List<String> geoJsonSources = new ArrayList<>();
-       private Map<String, String> vectorSources = new HashMap<>();
-       private Map<String, String> layerStyles = new HashMap<>();
-
-       private CmsView cmsView;
-
-       public OpenLayersMap(Composite parent, int style, URL mapHtml) {
-               super(parent, style);
-               cmsView = CmsSwtUtils.getCmsView(parent);
-               setLayout(new GridLayout());
-
-               browser = new Browser(this, SWT.BORDER);
-               browser.setLayoutData(CmsSwtUtils.fillAll());
-               String html;
-               try (InputStream in = mapHtml.openStream()) {
-                       html = IOUtils.toString(in, StandardCharsets.UTF_8);
-               } catch (IOException e) {
-                       throw new RuntimeException(e);
-               }
-               new RenderCompleted(browser, "renderCompleted");
-               new OnFeatureSelect(browser, "onFeatureSelect");
-               new OnFeatureUnselect(browser, "onFeatureUnselect");
-               new OnFeatureClick(browser, "onFeatureClick");
-               browser.setText(html);
-       }
-
-       public void setCenter(Double lng, Double lat) {
-               if (isRenderCompleted())
-                       browser.evaluate("map.getView().setCenter(ol.proj.fromLonLat([" + lng + ", " + lat + "]))");
-               this.centerLat = lat;
-               this.centerLng = lng;
-       }
-
-       public synchronized void setRenderCompleted(boolean renderCompleted) {
-               this.renderCompleted = renderCompleted;
-               notifyAll();
-       }
-
-       public synchronized boolean isRenderCompleted() {
-               return renderCompleted;
-       }
-
-       @Override
-       public synchronized void dispose() {
-               long timeout = 500;
-               long begin = System.currentTimeMillis();
-               while (!isRenderCompleted() && ((System.currentTimeMillis() - begin) < timeout)) {
-                       try {
-                               wait(50);
-                       } catch (InterruptedException e) {
-                               // silent
-                       }
-               }
-               super.dispose();
-       }
-
-       public void setZoom(int zoom) {
-               if (isRenderCompleted())
-                       browser.evaluate("map.getView().setZoom(" + zoom + ")");
-               this.zoom = zoom;
-       }
-
-       protected String asVectorSource(List<Node> geoPoints) throws RepositoryException {
-               boolean first = true;
-               StringBuffer sb = new StringBuffer("new ol.source.Vector({ features: [");
-               for (int i = 0; i < geoPoints.size(); i++) {
-                       Node node = geoPoints.get(i);
-                       if (node.isNodeType(EntityType.geopoint.get())) {
-                               if (first)
-                                       first = false;
-                               else
-                                       sb.append(",");
-                               Double lng = node.getProperty(EntityNames.GEO_LONG).getDouble();
-                               Double lat = node.getProperty(EntityNames.GEO_LAT).getDouble();
-                               sb.append("new ol.Feature({ geometry:");
-                               sb.append("new ol.geom.Point(ol.proj.fromLonLat([");
-                               sb.append(lng).append(',').append(lat);
-                               sb.append("]))");
-                               sb.append(",path:\"").append(node.getPath()).append("\"");
-                               sb.append(",name:\"").append(node.getName()).append("\"");
-                               String entityType = null;
-                               if (node.isNodeType(EntityType.local.get())) {
-                                       entityType = node.getProperty(EntityNames.ENTITY_TYPE).getString();
-                                       sb.append(", type:'").append(entityType).append("'");
-                               }
-                               enrichFeature(node, sb);
-                               sb.append("})");
-                       }
-               }
-               sb.append("]");
-               sb.append(" })");
-               return sb.toString();
-       }
-
-       protected void enrichFeature(Node node, StringBuffer sb) throws RepositoryException {
-
-       }
-
-       public void addPoints(List<Node> geoPoints) throws RepositoryException {
-               this.vectorSource = asVectorSource(geoPoints);
-               if (log.isTraceEnabled())
-                       log.trace("Vector source: " + vectorSource);
-               renderVectorSource();
-       }
-
-       public void addPoints(String layerName, List<Node> geoPoints, String style) throws RepositoryException {
-               this.vectorSources.put(layerName, asVectorSource(geoPoints));
-               if (style != null) {
-                       layerStyles.put(layerName, style);
-               }
-               renderVectorSources();
-       }
-
-       protected void renderVectorSource() {
-               if (vectorSource == null)
-                       return;
-               if (isRenderCompleted()) {
-//                     String style = ", style: new ol.style.Style({  image: new ol.style.Icon({ src: '/pkg/org.djapps.on.openheritage.ui/map_oc.png' }) })";
-                       String style = vectorSourceStyle != null ? ", style: " + vectorSourceStyle : "";
-//                     String style = "";
-                       String toEvaluate = "map.addLayer(new ol.layer.Vector({ source: " + vectorSource + style + "}));";
-//                     System.out.println(toEvaluate);
-                       browser.execute(toEvaluate);
-               }
-       }
-
-       protected void renderVectorSources() {
-               if (vectorSources.isEmpty())
-                       return;
-               if (isRenderCompleted()) {
-                       StringBuilder toExecute = new StringBuilder();
-                       for (String name : vectorSources.keySet()) {
-                               String style = layerStyles.containsKey(name) ? ", style: " + layerStyles.get(name) : "";
-                               String toEvaluate = "map.addLayer(new ol.layer.Vector({ source: " + vectorSources.get(name) + style
-                                               + ",name: '" + name + "'}));";
-                               toExecute.append(toEvaluate);
-                       }
-                       System.out.println(toExecute);
-                       browser.execute(toExecute.toString());
-               }
-       }
-
-       public void addPoint(Double lng, Double lat) {
-               this.vectorSource = "new ol.source.Vector({ features: [ new ol.Feature({ geometry:"
-                               + " new ol.geom.Point(ol.proj.fromLonLat([" + lng + ", " + lat + "])) }) ] })";
-//             if (renderCompleted) {
-//                     browser.evaluate(
-//                                     "map.addLayer(new ol.layer.Vector({ source: new ol.source.Vector({ features: [ new ol.Feature({ geometry:"
-//                                                     + " new ol.geom.Point(ol.proj.fromLonLat([" + lng + ", " + lat + "])) }) ] }) }));");
-//             }
-               renderVectorSource();
-       }
-
-       public void addGpx(String path) {
-               this.gpxSource = "new ol.source.Vector({ url: '" + path + "', format: new ol.format.GPX() })";
-               renderGpxSource();
-       }
-
-       protected void renderGpxSource() {
-               if (gpxSource == null)
-                       return;
-               if (isRenderCompleted())
-                       browser.evaluate("map.addLayer(new ol.layer.Vector({ source: " + gpxSource + "}));");
-       }
-
-       public void addGeoJson(String path) {
-               String geoJsonSource = "new ol.source.Vector({ url: '" + path + "', format: new ol.format.GeoJSON() })";
-               geoJsonSources.add(geoJsonSource);
-               renderGeoJsonSources();
-       }
-
-       protected void renderGeoJsonSources() {
-               if (geoJsonSources.isEmpty())
-                       return;
-               if (isRenderCompleted()) {
-                       for (String geoJson : geoJsonSources) {
-                               browser.evaluate("map.addLayer(new ol.layer.Vector({ source: " + geoJson + "}));");
-                       }
-               }
-       }
-
-       public void setVectorSourceStyle(String vectorSourceStyle) {
-               this.vectorSourceStyle = vectorSourceStyle;
-       }
-
-       private class RenderCompleted extends BrowserFunction {
-
-               RenderCompleted(Browser browser, String name) {
-                       super(browser, name);
-               }
-
-               @Override
-               public Object function(Object[] arguments) {
-                       try {
-                               if (!isRenderCompleted()) {
-                                       setRenderCompleted(true);
-                                       if (zoom != null)
-                                               setZoom(zoom);
-                                       if (centerLat != null && centerLng != null) {
-                                               setCenter(centerLng, centerLat);
-                                       }
-                                       if (!geoJsonSources.isEmpty())
-                                               renderGeoJsonSources();
-                                       if (gpxSource != null)
-                                               renderGpxSource();
-                                       if (vectorSource != null)
-                                               renderVectorSource();
-                                       if (!vectorSources.isEmpty())
-                                               renderVectorSources();
-                               }
-                               return null;
-                       } catch (Exception e) {
-                               log.error("Cannot render map", e);
-                               return null;
-                       }
-               }
-       }
-
-       private class OnFeatureSelect extends BrowserFunction {
-
-               OnFeatureSelect(Browser browser, String name) {
-                       super(browser, name);
-               }
-
-               @Override
-               public Object function(Object[] arguments) {
-                       if (arguments.length == 0)
-                               return null;
-                       String path = arguments[0].toString();
-                       Map<String, Object> properties = new HashMap<>();
-                       properties.put(SuiteEvent.NODE_PATH, path);
-                       properties.put(SuiteEvent.WORKSPACE, CmsConstants.SYS_WORKSPACE);
-                       cmsView.sendEvent(SuiteEvent.refreshPart.topic(), properties);
-                       return null;
-               }
-       }
-
-       private class OnFeatureUnselect extends BrowserFunction {
-
-               OnFeatureUnselect(Browser browser, String name) {
-                       super(browser, name);
-               }
-
-               @Override
-               public Object function(Object[] arguments) {
-                       return null;
-               }
-       }
-
-       private class OnFeatureClick extends BrowserFunction {
-
-               OnFeatureClick(Browser browser, String name) {
-                       super(browser, name);
-               }
-
-               @Override
-               public Object function(Object[] arguments) {
-                       return null;
-               }
-       }
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/openlayers/OverviewMap.java b/org.argeo.app.ui/src/org/argeo/app/ui/openlayers/OverviewMap.java
deleted file mode 100644 (file)
index dbb3119..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-package org.argeo.app.ui.openlayers;
-
-import java.util.List;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-import javax.jcr.observation.Event;
-import javax.jcr.observation.EventIterator;
-import javax.jcr.observation.EventListener;
-import javax.jcr.query.Query;
-
-import org.argeo.app.api.EntityType;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.ui.CmsUiProvider;
-import org.argeo.jcr.JcrException;
-import org.argeo.jcr.JcrUtils;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-/** Displays an overview map. */
-public class OverviewMap implements CmsUiProvider {
-
-       @Override
-       public Control createUi(Composite parent, Node context) throws RepositoryException {
-               parent.setLayout(new GridLayout());
-               refreshUi(parent, context);
-
-               try {
-                       String[] nodeTypes = { EntityType.geopoint.get() };
-                       context.getSession().getWorkspace().getObservationManager().addEventListener(new EventListener() {
-
-                               @Override
-                               public void onEvent(EventIterator events) {
-                                       if (!parent.isDisposed())
-                                               parent.getDisplay().asyncExec(() -> {
-                                                       try {
-                                                               refreshUi(parent, context);
-                                                       } catch (RepositoryException e) {
-                                                               throw new JcrException(e);
-                                                       }
-                                               });
-                               }
-                       }, Event.PROPERTY_CHANGED | Event.NODE_ADDED | Event.NODE_REMOVED | Event.PROPERTY_ADDED, "/", true, null,
-                                       nodeTypes, false);
-               } catch (RepositoryException e) {
-                       throw new IllegalStateException("Cannot add JCR observer", e);
-               }
-
-               return parent;
-       }
-
-       protected void refreshUi(Composite parent, Node context) throws RepositoryException {
-               CmsSwtUtils.clear(parent);
-               Query query = context.getSession().getWorkspace().getQueryManager()
-                               .createQuery("SELECT * FROM [" + EntityType.geopoint.get() + "]", Query.JCR_SQL2);
-               List<Node> geoPoints = JcrUtils.nodeIteratorToList(query.execute().getNodes());
-               OpenLayersMap map = new OpenLayersMap(parent, SWT.NONE, getClass().getResource("map-osm.html"));
-               map.setLayoutData(CmsSwtUtils.fillAll());
-
-               // apafMap.setZoom(7);
-               // apafMap.setCenter(-2.472, 8.010);
-               map.addPoints(geoPoints);
-       }
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/openlayers/map-osm.html b/org.argeo.app.ui/src/org/argeo/app/ui/openlayers/map-osm.html
deleted file mode 100644 (file)
index 157d708..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-<html lang="en">
-<head>
-<link rel="stylesheet"
-       href="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.4.3/css/ol.css"
-       type="text/css">
-<style>
-</style>
-<script
-       src="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.4.3/build/ol.js"></script>
-</head>
-<body>
-       <div id="map" class="map"></div>
-       <script type="text/javascript">
-       // default OSM
-       var source_OSM = new ol.source.OSM();
-       
-       var map = new ol.Map({
-                       target : 'map',
-                       layers : [ new ol.layer.Tile({
-                               source : source_OSM
-                       }) ],
-                       view : new ol.View({
-                               center : ol.proj.fromLonLat([ 34, 34 ]),
-                               zoom : 4
-                       })
-               });
-               map.on('rendercomplete', e => {
-                       console.log('Render completed.');
-                       renderCompleted();
-               });
-               var select = new ol.interaction.Select();
-               map.addInteraction(select);
-           select.on('select',function (e) {
-               if(e.selected.length>0){
-                               console.log('Feature selected: '+e.selected[0].get('path'));
-                       onFeatureSelect(e.selected[0].get('path'));
-               }
-           });
-       </script>
-</body>
-</html>
\ No newline at end of file
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/openlayers/map.js b/org.argeo.app.ui/src/org/argeo/app/ui/openlayers/map.js
deleted file mode 100644 (file)
index 68489fb..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-var map = new ol.Map({
-       target : 'map',
-       layers : [ new ol.layer.Tile({
-               source : new ol.source.OSM()
-       }) ],
-       view : new ol.View({
-               center : ol.proj.fromLonLat([ 34, 34 ]),
-               zoom : 4
-       })
-});
-               
\ No newline at end of file
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/people/PeopleEntryArea.java b/org.argeo.app.ui/src/org/argeo/app/ui/people/PeopleEntryArea.java
deleted file mode 100644 (file)
index 7e9fa6a..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-package org.argeo.app.ui.people;
-
-import java.util.Set;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-
-import org.argeo.api.cms.CmsTheme;
-import org.argeo.app.api.SuiteRole;
-import org.argeo.app.ui.SuiteEvent;
-import org.argeo.app.ui.SuiteIcon;
-import org.argeo.app.ui.dialogs.NewUserWizard;
-import org.argeo.cms.CmsUserManager;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.swt.Selected;
-import org.argeo.cms.swt.dialogs.CmsWizardDialog;
-import org.argeo.cms.ui.CmsUiProvider;
-import org.argeo.util.naming.LdapAttrs;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TableViewerColumn;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.ToolItem;
-import org.osgi.service.useradmin.User;
-
-/** Entry to the admin area. */
-public class PeopleEntryArea implements CmsUiProvider {
-
-       private CmsUserManager cmsUserManager;
-
-       @Override
-       public Control createUi(Composite parent, Node context) throws RepositoryException {
-               CmsTheme theme = CmsSwtUtils.getCmsTheme(parent);
-               parent.setLayout(new GridLayout());
-               TableViewer usersViewer = new TableViewer(parent);
-               usersViewer.setContentProvider(new UsersContentProvider());
-
-               TableViewerColumn idCol = new TableViewerColumn(usersViewer, SWT.NONE);
-               idCol.getColumn().setWidth(70);
-               idCol.setLabelProvider(new ColumnLabelProvider() {
-
-                       @Override
-                       public String getText(Object element) {
-
-                               return getUserProperty(element, LdapAttrs.uid.name());
-                       }
-               });
-
-               TableViewerColumn givenNameCol = new TableViewerColumn(usersViewer, SWT.NONE);
-               givenNameCol.getColumn().setWidth(150);
-               givenNameCol.setLabelProvider(new ColumnLabelProvider() {
-
-                       @Override
-                       public String getText(Object element) {
-
-                               return getUserProperty(element, LdapAttrs.givenName.name());
-                       }
-               });
-
-               TableViewerColumn snCol = new TableViewerColumn(usersViewer, SWT.NONE);
-               snCol.getColumn().setWidth(150);
-               snCol.setLabelProvider(new ColumnLabelProvider() {
-
-                       @Override
-                       public String getText(Object element) {
-
-                               return getUserProperty(element, LdapAttrs.sn.name());
-                       }
-               });
-
-               TableViewerColumn mailCol = new TableViewerColumn(usersViewer, SWT.NONE);
-               mailCol.getColumn().setWidth(400);
-               mailCol.setLabelProvider(new ColumnLabelProvider() {
-
-                       @Override
-                       public String getText(Object element) {
-
-                               return getUserProperty(element, LdapAttrs.mail.name());
-                       }
-               });
-
-               Composite bottom = new Composite(parent, SWT.NONE);
-               bottom.setLayoutData(CmsSwtUtils.fillWidth());
-               bottom.setLayout(CmsSwtUtils.noSpaceGridLayout());
-               ToolBar bottomToolBar = new ToolBar(bottom, SWT.NONE);
-               bottomToolBar.setLayoutData(new GridData(SWT.END, SWT.FILL, true, false));
-               ToolItem deleteItem = new ToolItem(bottomToolBar, SWT.FLAT);
-               deleteItem.setEnabled(false);
-//             CmsUiUtils.style(deleteItem, SuiteStyle.recentItems);
-               deleteItem.setImage(SuiteIcon.delete.getSmallIcon(theme));
-               ToolItem addItem = new ToolItem(bottomToolBar, SWT.FLAT);
-               addItem.setImage(SuiteIcon.add.getSmallIcon(theme));
-               usersViewer.addDoubleClickListener(new IDoubleClickListener() {
-
-                       @Override
-                       public void doubleClick(DoubleClickEvent event) {
-                               User user = (User) usersViewer.getStructuredSelection().getFirstElement();
-                               if (user != null) {
-//                                     Node userNode = getOrCreateUserNode(user, context);
-                                       CmsSwtUtils.getCmsView(parent).sendEvent(SuiteEvent.openNewPart.topic(),
-                                                       SuiteEvent.eventProperties(user));
-                               }
-
-                       }
-               });
-               usersViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-                       public void selectionChanged(SelectionChangedEvent event) {
-                               User user = (User) usersViewer.getStructuredSelection().getFirstElement();
-                               if (user != null) {
-//                                     Node userNode = getOrCreateUserNode(user, context);
-                                       CmsSwtUtils.getCmsView(parent).sendEvent(SuiteEvent.refreshPart.topic(),
-                                                       SuiteEvent.eventProperties(user));
-                                       deleteItem.setEnabled(true);
-                               } else {
-                                       deleteItem.setEnabled(false);
-                               }
-                       }
-               });
-
-               addItem.addSelectionListener((Selected) (e) -> {
-                       // SuiteUtils.getOrCreateUserNode(adminSession, userDn);
-                       Wizard wizard = new NewUserWizard(null);
-                       CmsWizardDialog dialog = new CmsWizardDialog(parent.getShell(), wizard);
-                       // WizardDialog dialog = new WizardDialog(shell, wizard);
-                       if (dialog.open() == Window.OK) {
-                               // TODO create
-                       }
-               });
-
-               usersViewer.getTable().setLayoutData(CmsSwtUtils.fillAll());
-               usersViewer.setInput(cmsUserManager);
-
-               return usersViewer.getTable();
-       }
-
-//     private Node getOrCreateUserNode(User user, Node context) {
-//             return JcrUtils.mkdirs(Jcr.getSession(context),
-//                             "/" + EntityType.user.name() + "/" + getUserProperty(user, LdapAttrs.uid.name()),
-//                             EntityType.user.get());
-//     }
-
-       private String getUserProperty(Object element, String key) {
-               Object value = ((User) element).getProperties().get(key);
-               return value != null ? value.toString() : null;
-       }
-
-       class UsersContentProvider implements IStructuredContentProvider {
-
-               @Override
-               public Object[] getElements(Object inputElement) {
-                       CmsUserManager cum = (CmsUserManager) inputElement;
-                       Set<User> users = cum.listUsersInGroup(SuiteRole.coworker.dn(), null);
-                       return users.toArray();
-               }
-
-               @Override
-               public void dispose() {
-               }
-
-               @Override
-               public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-               }
-
-       }
-
-       public void setCmsUserManager(CmsUserManager cmsUserManager) {
-               this.cmsUserManager = cmsUserManager;
-       }
-
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/people/PersonUiProvider.java b/org.argeo.app.ui/src/org/argeo/app/ui/people/PersonUiProvider.java
deleted file mode 100644 (file)
index 24b0893..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-package org.argeo.app.ui.people;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-
-import org.argeo.app.ui.SuiteMsg;
-import org.argeo.app.ui.SuiteUiUtils;
-import org.argeo.cms.CmsUserManager;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.ui.CmsUiProvider;
-import org.argeo.cms.ui.viewers.Section;
-import org.argeo.util.naming.LdapAttrs;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Text;
-import org.osgi.service.useradmin.User;
-
-/** Edit a suite user. */
-public class PersonUiProvider implements CmsUiProvider {
-       private String[] availableRoles;
-       private CmsUserManager cmsUserManager;
-
-       @Override
-       public Control createUi(Composite parent, Node context) throws RepositoryException {
-               Section main = new Section(parent, SWT.NONE, context);
-               main.setLayoutData(CmsSwtUtils.fillAll());
-
-               String uid = context.getName();
-               User user = cmsUserManager.getUserFromLocalId(uid);
-
-//             Text givenName = new Text(main, SWT.SINGLE);
-//             givenName.setText(getUserProperty(user, LdapAttrs.givenName.name()));
-               Text givenName = SuiteUiUtils.addFormInput(main, SuiteMsg.firstName.lead(),
-                               getUserProperty(user, LdapAttrs.givenName.name()));
-
-               Text sn = SuiteUiUtils.addFormInput(main, SuiteMsg.lastName.lead(), getUserProperty(user, LdapAttrs.sn.name()));
-               // sn.setText(getUserProperty(user, LdapAttrs.sn.name()));
-
-               Text email = SuiteUiUtils.addFormInput(main, SuiteMsg.email.lead(),
-                               getUserProperty(user, LdapAttrs.mail.name()));
-               // email.setText(getUserProperty(user, LdapAttrs.mail.name()));
-
-               Text uidT = SuiteUiUtils.addFormLine(main, "uid", getUserProperty(user, LdapAttrs.uid.name()));
-               uidT.setText(uid);
-
-//             Label dnL = new Label(main, SWT.NONE);
-//             dnL.setText(user.getName());
-
-               // roles
-               // Section rolesSection = new Section(main, SWT.NONE, context);
-               Group rolesSection = new Group(main, SWT.NONE);
-               rolesSection.setText("Roles");
-               rolesSection.setLayoutData(CmsSwtUtils.fillWidth());
-               rolesSection.setLayout(new GridLayout());
-               // new Label(rolesSection, SWT.NONE).setText("Roles:");
-               List<String> roles = Arrays.asList(cmsUserManager.getUserRoles(user.getName()));
-               for (String role : availableRoles) {
-                       // new Label(rolesSection, SWT.NONE).setText(role);
-                       Button radio = new Button(rolesSection, SWT.CHECK);
-                       radio.setText(role);
-                       if (roles.contains(role))
-                               radio.setSelection(true);
-               }
-
-               return main;
-       }
-
-       public void setCmsUserManager(CmsUserManager cmsUserManager) {
-               this.cmsUserManager = cmsUserManager;
-       }
-
-       private String getUserProperty(Object element, String key) {
-               Object value = ((User) element).getProperties().get(key);
-               return value != null ? value.toString() : null;
-       }
-
-       public void init(Map<String, Object> properties) {
-               availableRoles = (String[]) properties.get("availableRoles");
-       }
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/people/SuiteUserUiProvider.java b/org.argeo.app.ui/src/org/argeo/app/ui/people/SuiteUserUiProvider.java
deleted file mode 100644 (file)
index 6cec22d..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-package org.argeo.app.ui.people;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Map;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-
-import org.argeo.app.ui.SuiteMsg;
-import org.argeo.app.ui.SuiteUiUtils;
-import org.argeo.cms.CmsUserManager;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.ui.CmsUiProvider;
-import org.argeo.cms.ui.viewers.Section;
-import org.argeo.util.naming.LdapAttrs;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Text;
-import org.osgi.service.useradmin.User;
-
-/** Edit a suite user. */
-public class SuiteUserUiProvider implements CmsUiProvider {
-       private String[] availableRoles;
-       private CmsUserManager cmsUserManager;
-
-       @Override
-       public Control createUi(Composite parent, Node context) throws RepositoryException {
-               Section main = new Section(parent, SWT.NONE, context);
-               main.setLayoutData(CmsSwtUtils.fillAll());
-
-               String uid = context.getName();
-               User user = cmsUserManager.getUserFromLocalId(uid);
-
-//             Text givenName = new Text(main, SWT.SINGLE);
-//             givenName.setText(getUserProperty(user, LdapAttrs.givenName.name()));
-               Text givenName = SuiteUiUtils.addFormInput(main, SuiteMsg.firstName.lead(),
-                               getUserProperty(user, LdapAttrs.givenName.name()));
-
-               Text sn = SuiteUiUtils.addFormInput(main, SuiteMsg.lastName.lead(), getUserProperty(user, LdapAttrs.sn.name()));
-               // sn.setText(getUserProperty(user, LdapAttrs.sn.name()));
-
-               Text email = SuiteUiUtils.addFormInput(main, SuiteMsg.email.lead(),
-                               getUserProperty(user, LdapAttrs.mail.name()));
-               // email.setText(getUserProperty(user, LdapAttrs.mail.name()));
-
-               Text uidT = SuiteUiUtils.addFormLine(main, "uid", getUserProperty(user, LdapAttrs.uid.name()));
-               uidT.setText(uid);
-
-//             Label dnL = new Label(main, SWT.NONE);
-//             dnL.setText(user.getName());
-
-               // roles
-               // Section rolesSection = new Section(main, SWT.NONE, context);
-               Group rolesSection = new Group(main, SWT.NONE);
-               rolesSection.setText("Roles");
-               rolesSection.setLayoutData(CmsSwtUtils.fillWidth());
-               rolesSection.setLayout(new GridLayout());
-               // new Label(rolesSection, SWT.NONE).setText("Roles:");
-               List<String> roles = Arrays.asList(cmsUserManager.getUserRoles(user.getName()));
-               for (String role : availableRoles) {
-                       // new Label(rolesSection, SWT.NONE).setText(role);
-                       Button radio = new Button(rolesSection, SWT.CHECK);
-                       radio.setText(role);
-                       if (roles.contains(role))
-                               radio.setSelection(true);
-               }
-
-               return main;
-       }
-
-       public void setCmsUserManager(CmsUserManager cmsUserManager) {
-               this.cmsUserManager = cmsUserManager;
-       }
-
-       private String getUserProperty(Object element, String key) {
-               Object value = ((User) element).getProperties().get(key);
-               return value != null ? value.toString() : null;
-       }
-
-       public void init(Map<String, Object> properties) {
-               availableRoles = (String[]) properties.get("availableRoles");
-       }
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/people/SuiteUsersEntryArea.java b/org.argeo.app.ui/src/org/argeo/app/ui/people/SuiteUsersEntryArea.java
deleted file mode 100644 (file)
index c6a49b6..0000000
+++ /dev/null
@@ -1,183 +0,0 @@
-package org.argeo.app.ui.people;
-
-import java.util.Set;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-
-import org.argeo.api.cms.CmsTheme;
-import org.argeo.app.api.SuiteRole;
-import org.argeo.app.ui.SuiteEvent;
-import org.argeo.app.ui.SuiteIcon;
-import org.argeo.app.ui.dialogs.NewUserWizard;
-import org.argeo.cms.CmsUserManager;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.swt.Selected;
-import org.argeo.cms.swt.dialogs.CmsWizardDialog;
-import org.argeo.cms.ui.CmsUiProvider;
-import org.argeo.util.naming.LdapAttrs;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TableViewerColumn;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.ToolItem;
-import org.osgi.service.useradmin.User;
-
-/** Entry to the admin area. */
-public class SuiteUsersEntryArea implements CmsUiProvider {
-
-       private CmsUserManager cmsUserManager;
-
-       @Override
-       public Control createUi(Composite parent, Node context) throws RepositoryException {
-               CmsTheme theme = CmsSwtUtils.getCmsTheme(parent);
-               parent.setLayout(new GridLayout());
-               TableViewer usersViewer = new TableViewer(parent);
-               usersViewer.setContentProvider(new UsersContentProvider());
-
-               TableViewerColumn idCol = new TableViewerColumn(usersViewer, SWT.NONE);
-               idCol.getColumn().setWidth(70);
-               idCol.setLabelProvider(new ColumnLabelProvider() {
-
-                       @Override
-                       public String getText(Object element) {
-
-                               return getUserProperty(element, LdapAttrs.uid.name());
-                       }
-               });
-
-               TableViewerColumn givenNameCol = new TableViewerColumn(usersViewer, SWT.NONE);
-               givenNameCol.getColumn().setWidth(150);
-               givenNameCol.setLabelProvider(new ColumnLabelProvider() {
-
-                       @Override
-                       public String getText(Object element) {
-
-                               return getUserProperty(element, LdapAttrs.givenName.name());
-                       }
-               });
-
-               TableViewerColumn snCol = new TableViewerColumn(usersViewer, SWT.NONE);
-               snCol.getColumn().setWidth(150);
-               snCol.setLabelProvider(new ColumnLabelProvider() {
-
-                       @Override
-                       public String getText(Object element) {
-
-                               return getUserProperty(element, LdapAttrs.sn.name());
-                       }
-               });
-
-               TableViewerColumn mailCol = new TableViewerColumn(usersViewer, SWT.NONE);
-               mailCol.getColumn().setWidth(400);
-               mailCol.setLabelProvider(new ColumnLabelProvider() {
-
-                       @Override
-                       public String getText(Object element) {
-
-                               return getUserProperty(element, LdapAttrs.mail.name());
-                       }
-               });
-
-               Composite bottom = new Composite(parent, SWT.NONE);
-               bottom.setLayoutData(CmsSwtUtils.fillWidth());
-               bottom.setLayout(CmsSwtUtils.noSpaceGridLayout());
-               ToolBar bottomToolBar = new ToolBar(bottom, SWT.NONE);
-               bottomToolBar.setLayoutData(new GridData(SWT.END, SWT.FILL, true, false));
-               ToolItem deleteItem = new ToolItem(bottomToolBar, SWT.FLAT);
-               deleteItem.setEnabled(false);
-//             CmsUiUtils.style(deleteItem, SuiteStyle.recentItems);
-               deleteItem.setImage(SuiteIcon.delete.getSmallIcon(theme));
-               ToolItem addItem = new ToolItem(bottomToolBar, SWT.FLAT);
-               addItem.setImage(SuiteIcon.add.getSmallIcon(theme));
-               usersViewer.addDoubleClickListener(new IDoubleClickListener() {
-
-                       @Override
-                       public void doubleClick(DoubleClickEvent event) {
-                               User user = (User) usersViewer.getStructuredSelection().getFirstElement();
-                               if (user != null) {
-//                                     Node userNode = getOrCreateUserNode(user, context);
-                                       CmsSwtUtils.getCmsView(parent).sendEvent(SuiteEvent.openNewPart.topic(),
-                                                       SuiteEvent.eventProperties(user));
-                               }
-
-                       }
-               });
-               usersViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-                       public void selectionChanged(SelectionChangedEvent event) {
-                               User user = (User) usersViewer.getStructuredSelection().getFirstElement();
-                               if (user != null) {
-//                                     Node userNode = getOrCreateUserNode(user, context);
-                                       CmsSwtUtils.getCmsView(parent).sendEvent(SuiteEvent.refreshPart.topic(),
-                                                       SuiteEvent.eventProperties(user));
-                                       deleteItem.setEnabled(true);
-                               } else {
-                                       deleteItem.setEnabled(false);
-                               }
-                       }
-               });
-
-               addItem.addSelectionListener((Selected) (e) -> {
-                       // SuiteUtils.getOrCreateUserNode(adminSession, userDn);
-                       Wizard wizard = new NewUserWizard(null);
-                       CmsWizardDialog dialog = new CmsWizardDialog(parent.getShell(), wizard);
-                       // WizardDialog dialog = new WizardDialog(shell, wizard);
-                       if (dialog.open() == Window.OK) {
-                               // TODO create
-                       }
-               });
-
-               usersViewer.getTable().setLayoutData(CmsSwtUtils.fillAll());
-               usersViewer.setInput(cmsUserManager);
-
-               return usersViewer.getTable();
-       }
-
-//     private Node getOrCreateUserNode(User user, Node context) {
-//             return JcrUtils.mkdirs(Jcr.getSession(context),
-//                             "/" + EntityType.user.name() + "/" + getUserProperty(user, LdapAttrs.uid.name()),
-//                             EntityType.user.get());
-//     }
-
-       private String getUserProperty(Object element, String key) {
-               Object value = ((User) element).getProperties().get(key);
-               return value != null ? value.toString() : null;
-       }
-
-       class UsersContentProvider implements IStructuredContentProvider {
-
-               @Override
-               public Object[] getElements(Object inputElement) {
-                       CmsUserManager cum = (CmsUserManager) inputElement;
-                       Set<User> users = cum.listUsersInGroup(SuiteRole.coworker.dn(), null);
-                       return users.toArray();
-               }
-
-               @Override
-               public void dispose() {
-               }
-
-               @Override
-               public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
-               }
-
-       }
-
-       public void setCmsUserManager(CmsUserManager cmsUserManager) {
-               this.cmsUserManager = cmsUserManager;
-       }
-
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/publish/DocumentUiProvider.java b/org.argeo.app.ui/src/org/argeo/app/ui/publish/DocumentUiProvider.java
deleted file mode 100644 (file)
index 3829583..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-package org.argeo.app.ui.publish;
-
-import javax.jcr.Node;
-import javax.jcr.RepositoryException;
-import javax.jcr.nodetype.NodeType;
-
-import org.argeo.api.cms.CmsEditable;
-import org.argeo.api.cms.CmsView;
-import org.argeo.app.docbook.DbkType;
-import org.argeo.app.ui.docbook.AbstractDbkViewer;
-import org.argeo.app.ui.docbook.DocumentTextEditor;
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.ui.CmsUiProvider;
-import org.argeo.cms.ui.util.CmsLink;
-import org.argeo.cms.ui.util.CmsUiUtils;
-import org.argeo.cms.ui.viewers.JcrVersionCmsEditable;
-import org.argeo.cms.ui.widgets.ScrolledPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.browser.Browser;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-public class DocumentUiProvider implements CmsUiProvider {
-
-       @Override
-       public Control createUi(Composite parent, Node context) throws RepositoryException {
-               CmsView cmsView = CmsSwtUtils.getCmsView(parent);
-               CmsEditable cmsEditable = new JcrVersionCmsEditable(context);
-               if (context.hasNode(DbkType.article.get())) {
-                       Node textNode = context.getNode(DbkType.article.get());
-                       // Title
-                       parent.setLayout(CmsSwtUtils.noSpaceGridLayout());
-
-                       CmsLink toHtml = new CmsLink("To HTML", "/html/dbk" + context.getPath()+"/index.html");
-                       toHtml.createUiPart(parent, context);
-
-                       ScrolledPage page = new ScrolledPage(parent, SWT.NONE);
-                       page.setLayoutData(CmsSwtUtils.fillAll());
-                       page.setLayout(CmsSwtUtils.noSpaceGridLayout());
-
-                       cmsView.runAs(() -> {
-                               AbstractDbkViewer dbkEditor = new DocumentTextEditor(page, SWT.NONE, textNode, cmsEditable);
-                               dbkEditor.refresh();
-                       });
-                       return page;
-
-               } else if (context.isNodeType(NodeType.NT_FILE)) {
-                       String fileName = context.getName();
-                       if (fileName.endsWith(".pdf")) {
-                               Browser browser = new Browser(parent, SWT.NONE);
-                               String dataPath = CmsUiUtils.getDataPath(context);
-                               browser.setUrl(dataPath);
-                               browser.setLayoutData(CmsSwtUtils.fillAll());
-                               return browser;
-                       }
-               }
-               return null;
-       }
-
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/publish/PublishingApp.java b/org.argeo.app.ui/src/org/argeo/app/ui/publish/PublishingApp.java
deleted file mode 100644 (file)
index d57706c..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-package org.argeo.app.ui.publish;
-
-import static org.argeo.app.ui.SuiteApp.DEFAULT_THEME_ID_PROPERTY;
-import static org.argeo.app.ui.SuiteApp.DEFAULT_UI_NAME_PROPERTY;
-
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import javax.jcr.Node;
-import javax.jcr.Repository;
-import javax.jcr.Session;
-
-import org.argeo.api.cms.CmsApp;
-import org.argeo.api.cms.CmsUi;
-import org.argeo.app.ui.SuiteApp;
-import org.argeo.api.cms.CmsLog;
-import org.argeo.cms.AbstractCmsApp;
-import org.argeo.cms.ui.CmsUiProvider;
-import org.argeo.jcr.Jcr;
-import org.argeo.util.LangUtils;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.osgi.framework.Constants;
-import org.osgi.service.event.Event;
-import org.osgi.service.event.EventHandler;
-
-/**
- * A {@link CmsApp} dedicated to publishing, typically a public or internal web
- * site.
- */
-public class PublishingApp extends AbstractCmsApp implements EventHandler {
-       private final static CmsLog log = CmsLog.getLog(PublishingApp.class);
-
-       private String pid;
-       private String defaultThemeId;
-       private String defaultUiName = "";
-
-       private String publicBasePath = null;
-
-       private CmsUiProvider landingPage;
-       private CmsUiProvider defaultProvider = new DocumentUiProvider();
-
-       private Repository repository;
-
-       public void init(Map<String, String> properties) {
-               if (properties.containsKey(DEFAULT_UI_NAME_PROPERTY))
-                       defaultUiName = LangUtils.get(properties, DEFAULT_UI_NAME_PROPERTY);
-               if (properties.containsKey(DEFAULT_THEME_ID_PROPERTY))
-                       defaultThemeId = LangUtils.get(properties, DEFAULT_THEME_ID_PROPERTY);
-               publicBasePath = LangUtils.get(properties, SuiteApp.PUBLIC_BASE_PATH_PROPERTY);
-               pid = properties.get(Constants.SERVICE_PID);
-
-               if (log.isDebugEnabled())
-                       log.info("Publishing App " + pid + " started");
-       }
-
-       public void destroy(Map<String, String> properties) {
-               if (log.isDebugEnabled())
-                       log.info("Publishing App " + pid + " stopped");
-
-       }
-
-       @Override
-       public Set<String> getUiNames() {
-               Set<String> uiNames = new HashSet<>();
-               uiNames.add(defaultUiName);
-               return uiNames;
-       }
-
-       @Override
-       public CmsUi initUi(Object uiParent) {
-               Composite parent = (Composite) uiParent;
-//             Session adminSession = NodeUtils.openDataAdminSession(getRepository(), null);
-               Session session = Jcr.login(getRepository(), null);
-               parent.setLayout(new GridLayout());
-               Node indexNode = Jcr.getNode(session, publicBasePath + "/index");
-//             try {
-//                     indexNode = JcrUtils.getOrAdd(Jcr.getRootNode(adminSession), DocumentPage.WWW, DbkType.article.get());
-//                     adminSession.save();
-//             } catch (RepositoryException e) {
-//                     throw new IllegalStateException(e);
-//             }
-
-               Control page;
-               if (landingPage != null) {
-                       page = landingPage.createUiPart(parent, indexNode);
-               } else {
-                       page = defaultProvider.createUiPart(parent, indexNode);
-               }
-               return (CmsUi) page;
-       }
-
-       @Override
-       public void refreshUi(CmsUi cmsUi, String state) {
-               Composite parent = (Composite) cmsUi;
-               parent.setLayout(new GridLayout());
-               if (landingPage != null)
-                       landingPage.createUiPart(parent, null);
-               else
-                       defaultProvider.createUiPart(parent, null);
-       }
-
-       @Override
-       public void setState(CmsUi cmsUi, String state) {
-
-       }
-
-       @Override
-       protected String getThemeId(String uiName) {
-               return defaultThemeId;
-       }
-
-       public void setLandingPage(CmsUiProvider landingPage) {
-               this.landingPage = landingPage;
-       }
-
-       @Override
-       public void handleEvent(Event event) {
-               // TODO listen to some events
-
-       }
-
-       public Repository getRepository() {
-               return repository;
-       }
-
-       public void setRepository(Repository repository) {
-               this.repository = repository;
-       }
-
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/publish/PublishingStyle.java b/org.argeo.app.ui/src/org/argeo/app/ui/publish/PublishingStyle.java
deleted file mode 100644 (file)
index c2c8231..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.argeo.app.ui.publish;
-
-import org.argeo.api.cms.CmsStyle;
-
-/** Publishing styles. */
-public enum PublishingStyle implements CmsStyle {
-       // general
-       page, coverTitle, coverSubTitle, coverTagline, bannerLine1, bannerLine2,
-       // meta data
-       tag, menu,
-       // text style
-       title, subTitle, chapo, para, sectionTitle, subSectionTitle,
-       // links
-       internalLink,
-       // composite style
-       framed, line;
-
-       @Override
-       public String getClassPrefix() {
-               return "argeo-publishing";
-       }
-
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/widgets/AbstractConnectContextMenu.java b/org.argeo.app.ui/src/org/argeo/app/ui/widgets/AbstractConnectContextMenu.java
deleted file mode 100644 (file)
index 7824691..0000000
+++ /dev/null
@@ -1,133 +0,0 @@
-package org.argeo.app.ui.widgets;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.eclipse.ui.EclipseUiUtils;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.ShellEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Generic popup context menu for TableViewer to enable single sourcing between
- * CMS and Workbench
- */
-public abstract class AbstractConnectContextMenu {
-
-       private Shell parentShell;
-       private Shell shell;
-       // Local context
-
-       private final static String KEY_ACTION_ID = "actionId";
-       private final String[] defaultActions;
-       private Map<String, Button> actionButtons = new HashMap<String, Button>();
-
-       public AbstractConnectContextMenu(Display display, String[] defaultActions) {
-               parentShell = display.getActiveShell();
-               shell = new Shell(parentShell, SWT.NO_TRIM | SWT.BORDER | SWT.ON_TOP);
-               this.defaultActions = defaultActions;
-       }
-
-       protected void createControl() {
-               shell.setLayout(EclipseUiUtils.noSpaceGridLayout());
-               Composite boxCmp = new Composite(shell, SWT.NO_FOCUS | SWT.BORDER);
-               boxCmp.setLayout(EclipseUiUtils.noSpaceGridLayout());
-//             CmsUiUtils.style(boxCmp, ConnectUiStyles.CONTEXT_MENU_BOX);
-               createContextMenu(boxCmp);
-               shell.addShellListener(new ActionsShellListener());
-       }
-
-       protected void createContextMenu(Composite boxCmp) {
-               ActionsSelListener asl = new ActionsSelListener();
-               for (String actionId : defaultActions) {
-                       Button btn = new Button(boxCmp, SWT.FLAT | SWT.LEAD);
-                       btn.setText(getLabel(actionId));
-                       btn.setLayoutData(EclipseUiUtils.fillWidth());
-                       CmsSwtUtils.markup(btn);
-//                     CmsUiUtils.style(btn, actionId + ConnectUiStyles.BUTTON_SUFFIX);
-                       btn.setData(KEY_ACTION_ID, actionId);
-                       btn.addSelectionListener(asl);
-                       actionButtons.put(actionId, btn);
-               }
-       }
-
-       protected void setVisible(boolean visible, String... buttonIds) {
-               for (String id : buttonIds) {
-                       Button button = actionButtons.get(id);
-                       button.setVisible(visible);
-                       GridData gd = (GridData) button.getLayoutData();
-                       gd.heightHint = visible ? SWT.DEFAULT : 0;
-               }
-       }
-
-       public void show(Control source, Point location, IStructuredSelection selection) {
-               if (shell.isDisposed()) {
-                       shell = new Shell(Display.getCurrent(), SWT.NO_TRIM | SWT.BORDER | SWT.ON_TOP);
-                       createControl();
-               }
-               if (shell.isVisible())
-                       shell.setVisible(false);
-
-               if (aboutToShow(source, location, selection)) {
-                       shell.pack();
-                       shell.layout();
-                       if (source instanceof Control)
-                               shell.setLocation(((Control) source).toDisplay(location.x, location.y));
-                       shell.open();
-               }
-       }
-
-       protected Shell getParentShell() {
-               return parentShell;
-       }
-
-       class StyleButton extends Label {
-               private static final long serialVersionUID = 7731102609123946115L;
-
-               public StyleButton(Composite parent, int swtStyle) {
-                       super(parent, swtStyle);
-               }
-       }
-
-       class ActionsSelListener extends SelectionAdapter {
-               private static final long serialVersionUID = -1041871937815812149L;
-
-               @Override
-               public void widgetSelected(SelectionEvent e) {
-                       Object eventSource = e.getSource();
-                       if (eventSource instanceof Button) {
-                               Button pressedBtn = (Button) eventSource;
-                               performAction((String) pressedBtn.getData(KEY_ACTION_ID));
-                               shell.close();
-                       }
-               }
-       }
-
-       class ActionsShellListener extends org.eclipse.swt.events.ShellAdapter {
-               private static final long serialVersionUID = -5092341449523150827L;
-
-               @Override
-               public void shellDeactivated(ShellEvent e) {
-                       setVisible(false);
-                       shell.setVisible(false);
-                       //shell.close();
-               }
-       }
-
-       protected abstract boolean performAction(String actionId);
-
-       protected abstract boolean aboutToShow(Control source, Point location, IStructuredSelection selection);
-
-       protected abstract String getLabel(String actionId);
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/widgets/ConnectAbstractDropDown.java b/org.argeo.app.ui/src/org/argeo/app/ui/widgets/ConnectAbstractDropDown.java
deleted file mode 100644 (file)
index d1f1a29..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-package org.argeo.app.ui.widgets;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.eclipse.ui.EclipseUiUtils;
-import org.eclipse.rap.rwt.widgets.DropDown;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.FocusListener;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Widget;
-
-/**
- * Enable easy addition of a {@code DropDown} widget to a text with listeners
- * configured
- */
-public abstract class ConnectAbstractDropDown {
-
-       private final Text text;
-       private final DropDown dropDown;
-       private boolean modifyFromList = false;
-
-       // Current displayed text
-       private String userText = "";
-       // Current displayed list items
-       private String[] values;
-
-       // Fine tuning
-       boolean readOnly;
-       boolean refreshOnFocus;
-
-       /** Implementing classes should call refreshValues() after initialisation */
-       public ConnectAbstractDropDown(Text text) {
-               this(text, SWT.NONE, false);
-       }
-
-       /**
-        * Implementing classes should call refreshValues() after initialisation
-        * 
-        * @param text
-        * @param style
-        *            only SWT.READ_ONLY is understood, check if the entered text is
-        *            part of the legal choices.
-        */
-       public ConnectAbstractDropDown(Text text, int style) {
-               this(text, style, false);
-       }
-
-       /**
-        * Implementers should call refreshValues() once init has been done.
-        * 
-        * @param text
-        * @param style
-        *            only SWT.READ_ONLY is understood, check if the entered text is
-        *            part of the legal choices.
-        * @param refreshOnFocus
-        *            if true, the possible values are computed each time the focus is
-        *            gained. It enables, among other to fine tune the getFilteredValues
-        *            method depending on the current context
-        */
-       public ConnectAbstractDropDown(Text text, int style, boolean refreshOnFocus) {
-               this.text = text;
-               dropDown = new DropDown(text);
-               Object obj = dropDown;
-               if (obj instanceof Widget)
-                       CmsSwtUtils.markup((Widget) obj);
-               readOnly = (style & SWT.READ_ONLY) != 0;
-               this.refreshOnFocus = refreshOnFocus;
-               addListeners();
-       }
-
-       /**
-        * Overwrite to force the refresh of the possible values on focus gained event
-        */
-       protected boolean refreshOnFocus() {
-               return refreshOnFocus;
-       }
-
-       public String getText() {
-               return text.getText();
-       }
-
-       public void init() {
-               refreshValues();
-       }
-
-       public void reset(String value) {
-               modifyFromList = true;
-               if (EclipseUiUtils.notEmpty(value))
-                       text.setText(value);
-               else
-                       text.setText("");
-               refreshValues();
-               modifyFromList = false;
-       }
-
-       /** Overwrite to provide specific filtering */
-       protected abstract List<String> getFilteredValues(String filter);
-
-       protected void refreshValues() {
-               List<String> filteredValues = getFilteredValues(text.getText());
-               values = filteredValues.toArray(new String[filteredValues.size()]);
-               dropDown.setItems(values);
-       }
-
-       protected void addListeners() {
-               addModifyListener();
-               addSelectionListener();
-               addDefaultSelectionListener();
-               addFocusListener();
-       }
-
-       protected void addFocusListener() {
-               text.addFocusListener(new FocusListener() {
-                       private static final long serialVersionUID = -7179112097626535946L;
-
-                       public void focusGained(FocusEvent event) {
-                               if (refreshOnFocus) {
-                                       modifyFromList = true;
-                                       refreshValues();
-                                       modifyFromList = false;
-                               }
-                               dropDown.setVisible(true);
-                       }
-
-                       public void focusLost(FocusEvent event) {
-                               dropDown.setVisible(false);
-                               if (readOnly && values != null && !Arrays.asList(values).contains(userText)) {
-                                       modifyFromList = true;
-                                       text.setText("");
-                                       refreshValues();
-                                       modifyFromList = false;
-                               }
-                       }
-               });
-       }
-
-       private void addSelectionListener() {
-               Object obj = dropDown;
-               if (obj instanceof Widget)
-                       ((Widget) obj).addListener(SWT.Selection, new Listener() {
-                               private static final long serialVersionUID = -2357157809365135142L;
-
-                               public void handleEvent(Event event) {
-                                       if (event.index != -1) {
-                                               modifyFromList = true;
-                                               text.setText(values[event.index]);
-                                               modifyFromList = false;
-                                               text.selectAll();
-                                       } else {
-                                               text.setText(userText);
-                                               text.setSelection(userText.length(), userText.length());
-                                               text.setFocus();
-                                       }
-                               }
-                       });
-       }
-
-       private void addDefaultSelectionListener() {
-               Object obj = dropDown;
-               if (obj instanceof Widget)
-                       ((Widget) obj).addListener(SWT.DefaultSelection, new Listener() {
-                               private static final long serialVersionUID = -5958008322630466068L;
-
-                               public void handleEvent(Event event) {
-                                       if (event.index != -1) {
-                                               text.setText(values[event.index]);
-                                               text.setSelection(event.text.length());
-                                               dropDown.setVisible(false);
-                                       }
-                               }
-                       });
-       }
-
-       private void addModifyListener() {
-               text.addListener(SWT.Modify, new Listener() {
-                       private static final long serialVersionUID = -4373972835244263346L;
-
-                       public void handleEvent(Event event) {
-                               if (!modifyFromList) {
-                                       userText = text.getText();
-                                       refreshValues();
-                                       if (values.length == 1)
-                                               dropDown.setSelectionIndex(0);
-                                       dropDown.setVisible(true);
-                               }
-                       }
-               });
-       }
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/widgets/DelayedText.java b/org.argeo.app.ui/src/org/argeo/app/ui/widgets/DelayedText.java
deleted file mode 100644 (file)
index ecf6639..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-package org.argeo.app.ui.widgets;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledFuture;
-import java.util.concurrent.TimeUnit;
-import java.util.function.Consumer;
-
-import org.eclipse.rap.rwt.service.ServerPushSession;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * A text input which notifies changes after a delay, typically in order to
- * apply a filter.
- */
-public class DelayedText {
-       private final static ScheduledExecutorService scheduler;
-       static {
-               // create only one scheduler, in order not to exhaust threads
-               scheduler = Executors.newScheduledThreadPool(0, (r) -> {
-                       Thread thread = new Thread(r, "Delayed text scheduler");
-                       // we mark threads as deamons so that the shutdown hook is triggered
-                       thread.setDaemon(true);
-                       return thread;
-               });
-               Runtime.getRuntime().addShutdownHook(new Thread(() -> {
-                       scheduler.shutdown();
-               }, "Shutdown delayed text scheduler"));
-       }
-       private final static int DEFAULT_DELAY = 800;
-
-       private final long delay;
-       private final InternalModifyListener modifyListener;
-       private final Text text;
-       protected List<Consumer<String>> toDos = new ArrayList<>();
-       private ServerPushSession pushSession;
-
-       private ScheduledFuture<String> lastTask;
-
-       public DelayedText(Composite parent, int style) {
-               this(parent, style, DEFAULT_DELAY);
-       }
-
-       public DelayedText(Composite parent, int style, long delayInMs) {
-               this.delay = delayInMs;
-               this.modifyListener = new InternalModifyListener();
-               pushSession = new ServerPushSession();
-               pushSession.start();
-               text = new Text(parent, style);
-               text.addModifyListener(modifyListener);
-       }
-
-       protected void notifyText(String txt) {
-               // text.getDisplay().syncExec(()-> pushSession.start());
-               for (Consumer<String> toDo : toDos) {
-                       text.getDisplay().syncExec(() -> toDo.accept(txt));
-               }
-               // text.getDisplay().syncExec(()->pushSession.stop());
-       }
-
-       public Text getText() {
-               return text;
-       }
-
-       public void addListener(Consumer<String> toDo) {
-               toDos.add(toDo);
-       }
-
-       private class InternalModifyListener implements ModifyListener {
-               private static final long serialVersionUID = -6178431173400385005L;
-
-               public void modifyText(ModifyEvent e) {
-                       String txt = text.getText();
-                       ScheduledFuture<String> task = scheduler.schedule(() -> {
-                               notifyText(txt);
-                               return txt;
-                       }, delay, TimeUnit.MILLISECONDS);
-                       // cancel previous task
-                       if (lastTask != null && !lastTask.isDone()) {
-                               lastTask.cancel(false);
-                       }
-                       lastTask = task;
-               }
-       };
-
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/widgets/TabbedArea.java b/org.argeo.app.ui/src/org/argeo/app/ui/widgets/TabbedArea.java
deleted file mode 100644 (file)
index c214207..0000000
+++ /dev/null
@@ -1,256 +0,0 @@
-package org.argeo.app.ui.widgets;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.jcr.Node;
-
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.argeo.cms.swt.Selected;
-import org.argeo.cms.ui.CmsUiProvider;
-import org.argeo.cms.ui.viewers.Section;
-import org.argeo.jcr.Jcr;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StackLayout;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.ToolItem;
-
-/** Manages {@link Section} in a tab-like structure. */
-public class TabbedArea extends Composite {
-       private static final long serialVersionUID = 8659669229482033444L;
-
-       private Composite headers;
-       private Composite body;
-
-       private List<Section> sections = new ArrayList<>();
-
-       private Node previousNode;
-       private CmsUiProvider previousUiProvider;
-       private CmsUiProvider currentUiProvider;
-
-       private String tabStyle;
-       private String tabSelectedStyle;
-       private String bodyStyle;
-       private Image closeIcon;
-
-       private StackLayout stackLayout;
-
-       private boolean singleTab = false;
-
-       public TabbedArea(Composite parent, int style) {
-               super(parent, SWT.NONE);
-               CmsSwtUtils.style(parent, bodyStyle);
-
-               setLayout(CmsSwtUtils.noSpaceGridLayout());
-
-               // TODO manage tabs at bottom or sides
-               headers = new Composite(this, SWT.NONE);
-               headers.setLayoutData(CmsSwtUtils.fillWidth());
-               body = new Composite(this, SWT.NONE);
-               body.setLayoutData(CmsSwtUtils.fillAll());
-               // body.setLayout(new FormLayout());
-               stackLayout = new StackLayout();
-               body.setLayout(stackLayout);
-               emptyState();
-       }
-
-       protected void refreshTabHeaders() {
-               int tabCount = sections.size() > 0 ? sections.size() : 1;
-               for (Control tab : headers.getChildren())
-                       tab.dispose();
-
-               headers.setLayout(CmsSwtUtils.noSpaceGridLayout(new GridLayout(tabCount, true)));
-
-               if (sections.size() == 0) {
-                       Composite emptyHeader = new Composite(headers, SWT.NONE);
-                       emptyHeader.setLayoutData(CmsSwtUtils.fillAll());
-                       emptyHeader.setLayout(new GridLayout());
-                       Label lbl = new Label(emptyHeader, SWT.NONE);
-                       lbl.setText("");
-                       lbl.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false));
-
-               }
-
-               Section currentSection = getCurrentSection();
-               for (Section section : sections) {
-                       boolean selected = section == currentSection;
-                       Composite sectionHeader = section.createHeader(headers);
-                       CmsSwtUtils.style(sectionHeader, selected ? tabSelectedStyle : tabStyle);
-                       int headerColumns = singleTab ? 1 : 2;
-                       sectionHeader.setLayout(new GridLayout(headerColumns, false));
-                       sectionHeader.setLayout(CmsSwtUtils.noSpaceGridLayout(headerColumns));
-                       Button title = new Button(sectionHeader, SWT.FLAT);
-                       CmsSwtUtils.style(title, selected ? tabSelectedStyle : tabStyle);
-                       title.setLayoutData(CmsSwtUtils.fillWidth());
-                       title.addSelectionListener((Selected) (e) -> showTab(tabIndex(section.getNode())));
-                       Node node = section.getNode();
-                       String titleStr = Jcr.getTitle(node);
-                       // TODO internationalize
-                       title.setText(titleStr);
-                       if (!singleTab) {
-                               ToolBar toolBar = new ToolBar(sectionHeader, SWT.NONE);
-                               ToolItem closeItem = new ToolItem(toolBar, SWT.FLAT);
-                               if (closeIcon != null)
-                                       closeItem.setImage(closeIcon);
-                               else
-                                       closeItem.setText("X");
-                               CmsSwtUtils.style(closeItem, selected ? tabSelectedStyle : tabStyle);
-                               closeItem.addSelectionListener((Selected) (e) -> closeTab(section));
-                       }
-               }
-
-       }
-
-       public void view(CmsUiProvider uiProvider, Node context) {
-               if (body.isDisposed())
-                       return;
-               int index = tabIndex(context);
-               if (index >= 0) {
-                       showTab(index);
-                       previousNode = context;
-                       previousUiProvider = uiProvider;
-                       return;
-               }
-               Section section = (Section) body.getChildren()[0];
-               previousNode = section.getNode();
-               if (previousNode == null) {// empty state
-                       previousNode = context;
-                       previousUiProvider = uiProvider;
-               } else {
-                       previousUiProvider = currentUiProvider;
-               }
-               currentUiProvider = uiProvider;
-               section.setNode(context);
-               // section.setLayoutData(CmsUiUtils.coverAll());
-               build(section, uiProvider, context);
-               if (sections.size() == 0)
-                       sections.add(section);
-               refreshTabHeaders();
-               index = tabIndex(context);
-               showTab(index);
-               layout(true, true);
-       }
-
-       public void open(CmsUiProvider uiProvider, Node context) {
-               if (singleTab)
-                       throw new UnsupportedOperationException("Open is not supported in single tab mode.");
-
-               if (previousNode != null && Jcr.getIdentifier(previousNode).equals(Jcr.getIdentifier(context))) {
-                       // does nothing
-                       return;
-               }
-               if (sections.size() == 0)
-                       CmsSwtUtils.clear(body);
-               Section currentSection = getCurrentSection();
-               int currentIndex = sections.indexOf(currentSection);
-               Section previousSection = new Section(body, SWT.NONE, context);
-               build(previousSection, previousUiProvider, previousNode);
-               // previousSection.setLayoutData(CmsUiUtils.coverAll());
-               int index = currentIndex + 1;
-               sections.add(index, previousSection);
-               showTab(index);
-               refreshTabHeaders();
-               layout(true, true);
-       }
-
-       public void showTab(int index) {
-               Section sectionToShow = sections.get(index);
-               // sectionToShow.moveAbove(null);
-               stackLayout.topControl = sectionToShow;
-               refreshTabHeaders();
-               layout(true, true);
-       }
-
-       protected void build(Section section, CmsUiProvider uiProvider, Node context) {
-               for (Control child : section.getChildren())
-                       child.dispose();
-               CmsSwtUtils.style(section, bodyStyle);
-               section.setNode(context);
-               uiProvider.createUiPart(section, context);
-
-       }
-
-       private int tabIndex(Node node) {
-               for (int i = 0; i < sections.size(); i++) {
-                       Section section = sections.get(i);
-                       if (Jcr.getIdentifier(section.getNode()).equals(Jcr.getIdentifier(node)))
-                               return i;
-               }
-               return -1;
-       }
-
-       public void closeTab(Section section) {
-               int currentIndex = sections.indexOf(section);
-               int nextIndex = currentIndex == 0 ? 0 : currentIndex - 1;
-               sections.remove(section);
-               section.dispose();
-               if (sections.size() == 0) {
-                       emptyState();
-                       refreshTabHeaders();
-                       layout(true, true);
-                       return;
-               }
-               refreshTabHeaders();
-               showTab(nextIndex);
-       }
-       
-       public void closeAllTabs() {
-               for(Section section:sections) {
-                       section.dispose();                      
-               }
-               sections.clear();
-               emptyState();
-               refreshTabHeaders();
-               layout(true, true);
-       }
-
-       protected void emptyState() {
-               new Section(body, SWT.NONE, null);
-               refreshTabHeaders();
-       }
-
-       public Composite getCurrent() {
-               return getCurrentSection();
-       }
-
-       protected Section getCurrentSection() {
-               return (Section) stackLayout.topControl;
-       }
-
-       public Node getCurrentContext() {
-               Section section = getCurrentSection();
-               if (section != null) {
-                       return section.getNode();
-               } else {
-                       return null;
-               }
-       }
-
-       public void setTabStyle(String tabStyle) {
-               this.tabStyle = tabStyle;
-       }
-
-       public void setTabSelectedStyle(String tabSelectedStyle) {
-               this.tabSelectedStyle = tabSelectedStyle;
-       }
-
-       public void setBodyStyle(String bodyStyle) {
-               this.bodyStyle = bodyStyle;
-       }
-
-       public void setCloseIcon(Image closeIcon) {
-               this.closeIcon = closeIcon;
-       }
-
-       public void setSingleTab(boolean singleTab) {
-               this.singleTab = singleTab;
-       }
-
-}
diff --git a/org.argeo.app.ui/src/org/argeo/app/ui/widgets/TreeOrSearchArea.java b/org.argeo.app.ui/src/org/argeo/app/ui/widgets/TreeOrSearchArea.java
deleted file mode 100644 (file)
index 2b8f54e..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-package org.argeo.app.ui.widgets;
-
-import org.argeo.cms.swt.CmsSwtUtils;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StackLayout;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Displays a tree by default, which becomes a list if the search text field is
- * used.
- */
-public class TreeOrSearchArea extends Composite {
-       private static final long serialVersionUID = -1302546480076719532L;
-
-       private Text searchT;
-       private StackLayout bodyLayout;
-
-       private TreeViewer treeViewer;
-       private TreeViewer searchResultsViewer;
-
-       public TreeOrSearchArea(Composite parent, int style) {
-               super(parent, style);
-               createUi(this);
-       }
-
-       protected void createUi(Composite parent) {
-               parent.setLayout(new GridLayout());
-               Composite searchC = new Composite(parent, SWT.NONE);
-               searchC.setLayout(new GridLayout());
-               searchC.setLayoutData(CmsSwtUtils.fillWidth());
-               createSearchUi(searchC);
-
-               Composite bodyC = new Composite(parent, SWT.NONE);
-               bodyC.setLayoutData(CmsSwtUtils.fillAll());
-               bodyLayout = new StackLayout();
-               bodyC.setLayout(bodyLayout);
-               Composite treeC = new Composite(bodyC, SWT.NONE);
-               createTreeUi(treeC);
-               Composite searchResultsC = new Composite(bodyC, SWT.NONE);
-               createSearchResultsUi(searchResultsC);
-
-               bodyLayout.topControl = treeC;
-       }
-
-       protected void createSearchUi(Composite parent) {
-               parent.setLayout(CmsSwtUtils.noSpaceGridLayout());
-               searchT = new Text(parent, SWT.MULTI | SWT.BORDER);
-               searchT.setLayoutData(CmsSwtUtils.fillWidth());
-       }
-
-       protected void createTreeUi(Composite parent) {
-               parent.setLayout(CmsSwtUtils.noSpaceGridLayout());
-               treeViewer = new TreeViewer(parent);
-               treeViewer.getTree().setLayoutData(CmsSwtUtils.fillAll());
-       }
-
-       protected void createSearchResultsUi(Composite parent) {
-               parent.setLayout(CmsSwtUtils.noSpaceGridLayout());
-               searchResultsViewer = new TreeViewer(parent);
-               searchResultsViewer.getTree().setLayoutData(CmsSwtUtils.fillAll());
-       }
-
-       public TreeViewer getTreeViewer() {
-               return treeViewer;
-       }
-
-       public TreeViewer getSearchResultsViewer() {
-               return searchResultsViewer;
-       }
-
-}
index 5029b67ae930b82e822407b64d740173fe2d34c0..a1d5c8e4bbee31d104fc1151cac4a8e19f5ef1fa 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 5029b67ae930b82e822407b64d740173fe2d34c0
+Subproject commit a1d5c8e4bbee31d104fc1151cac4a8e19f5ef1fa
diff --git a/sdk/argeo-suite-rap.properties b/sdk/argeo-suite-rap.properties
deleted file mode 100644 (file)
index 2b8edd3..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-argeo.osgi.start.2.node=\
-org.eclipse.equinox.http.servlet,\
-org.eclipse.equinox.metatype,\
-org.eclipse.equinox.cm,\
-org.eclipse.rap.rwt.osgi,\
-org.argeo.init
-
-argeo.osgi.start.2.suite=\
-org.apache.tika.parsers
-
-argeo.osgi.start.3.node=\
-org.argeo.cms,\
-org.argeo.cms.jcr,\
-org.argeo.cms.servlet,\
-
-argeo.osgi.start.5.suite=\
-org.argeo.app.core,\
-org.argeo.app.ui,\
-org.argeo.app.theme.default,\
-org.argeo.app.ui.rap
-
-argeo.osgi.start.6.suite=\
-org.argeo.app.servlet.publish,\
-org.argeo.app.servlet.odk
-
-
-# Local
-argeo.node.repo.type=h2
-org.osgi.service.http.port=7070
-#org.osgi.service.http.port.secure=7073
-
-#argeo.node.useradmin.uris=ldap://cn=Directory%20Manager:argeoargeo@localhost:10389/dc=example,dc=com
-
-argeo.node.init=../../init
-
-argeo.i18n.locales=en,fr
-argeo.i18n.defaultLocale=en
-
-#tika.config=/home/mbaudier/dev/git/gpl/argeo-suite/sdk/exec/argeo-office-e4-rap/data/indexes/node/tika-config.xml
-
-# Logging
-log.org.argeo=DEBUG
-
-# DON'T CHANGE BELOW
-org.eclipse.equinox.http.jetty.autostart=false
-org.osgi.framework.bootdelegation=com.sun.jndi.ldap,\
-com.sun.jndi.ldap.sasl,\
-com.sun.security.jgss,\
-com.sun.jndi.dns,\
-com.sun.nio.file,\
-com.sun.nio.sctp
index 48fa22145b0e4901fde6038f4ab533f418b2fe76..ea6457ee6ee06d32b056bddff1ca2dde5c5be4fd 100644 (file)
@@ -10,6 +10,7 @@ org.apache.tika.parsers
 argeo.osgi.start.3.node=\
 org.argeo.cms,\
 org.argeo.cms.jcr,\
+org.argeo.cms.servlet,\
 org.argeo.cms.ui.rcp
 
 argeo.osgi.start.5.suite=\
@@ -24,7 +25,7 @@ org.argeo.app.servlet.odk
 
 # Local
 argeo.node.repo.type=h2
-org.osgi.service.http.port=7070
+org.osgi.service.http.port=0
 #org.osgi.service.http.port.secure=7073
 
 #argeo.node.useradmin.uris=ldap://cn=Directory%20Manager:argeoargeo@localhost:10389/dc=example,dc=com
diff --git a/sdk/argeo-suite.properties b/sdk/argeo-suite.properties
new file mode 100644 (file)
index 0000000..5de69f5
--- /dev/null
@@ -0,0 +1,47 @@
+argeo.osgi.start.2=\
+org.eclipse.equinox.http.servlet,\
+org.apache.felix.scr,\
+org.eclipse.rap.rwt.osgi,\
+org.apache.tika.parsers,\
+org.argeo.init
+
+argeo.osgi.start.3=\
+org.argeo.cms,\
+org.argeo.cms.swt.rap,\
+org.argeo.cms.swt.rcp,\
+org.argeo.cms.ee,\
+org.argeo.cms.lib.sshd,\
+org.argeo.cms.lib.equinox,\
+org.argeo.cms.lib.jetty,\
+
+argeo.osgi.start.4=\
+org.argeo.cms.jcr
+
+argeo.osgi.start.5=\
+org.argeo.app.profile.acr.fs,\
+org.argeo.app.core,\
+org.argeo.app.ui,\
+org.argeo.app.theme.default,\
+org.argeo.app.servlet.publish,\
+org.argeo.app.servlet.odk
+
+
+# Local
+argeo.node.repo.type=h2
+argeo.http.port=7070
+
+argeo.directory=dc=example,dc=com
+
+# Logging
+log.org.argeo=DEBUG
+
+# DON'T CHANGE BELOW
+org.eclipse.equinox.http.jetty.autostart=false
+org.osgi.framework.system.packages.extra=\
+com.sun.net.httpserver,\
+com.sun.jndi.ldap,\
+com.sun.jndi.ldap.sasl,\
+com.sun.jndi.dns,\
+com.sun.security.jgss,\
+com.sun.nio.file,\
+com.sun.nio.sctp
\ No newline at end of file
diff --git a/sdk/branches/testing.bnd b/sdk/branches/testing.bnd
new file mode 100644 (file)
index 0000000..22ef9a8
--- /dev/null
@@ -0,0 +1,4 @@
+major=2
+minor=1
+micro=25
+qualifier=.next
\ No newline at end of file
diff --git a/sdk/branches/unstable.bnd b/sdk/branches/unstable.bnd
new file mode 100644 (file)
index 0000000..b8e5aef
--- /dev/null
@@ -0,0 +1,4 @@
+major=2
+minor=3
+micro=12
+qualifier=.next
\ No newline at end of file
diff --git a/sdk/deploy/.gitignore b/sdk/deploy/.gitignore
new file mode 100644 (file)
index 0000000..f5135fa
--- /dev/null
@@ -0,0 +1 @@
+!bin
\ No newline at end of file
diff --git a/sdk/deploy/argeo-desktop/etc/argeo.user.d/desktop/config.ini b/sdk/deploy/argeo-desktop/etc/argeo.user.d/desktop/config.ini
new file mode 100644 (file)
index 0000000..b8dab60
--- /dev/null
@@ -0,0 +1,36 @@
+osgi.clean=true
+
+argeo.osgi.start.2=\
+org.eclipse.equinox.http.servlet,\
+org.eclipse.equinox.console,\
+org.apache.felix.scr,\
+org.eclipse.core.runtime,\
+org.eclipse.e4.ui.css.swt,\
+
+argeo.osgi.start.3=\
+org.argeo.cms,\
+org.argeo.cms.swt.rcp,\
+org.argeo.cms.ee,\
+org.argeo.cms.lib.sshd,\
+org.argeo.cms.lib.equinox,\
+org.argeo.cms.lib.jetty,\
+
+argeo.osgi.start.4=\
+org.argeo.cms.jcr
+
+argeo.osgi.start.5=\
+org.argeo.app.profile.acr.fs,\
+org.argeo.app.core,\
+org.argeo.app.ui,\
+org.argeo.app.theme.default,\
+org.argeo.app.servlet.publish,\
+org.argeo.app.servlet.odk
+
+
+# Local
+argeo.node.repo.type=h2
+argeo.http.port=0
+
+argeo.osgi.sources=\
+a2+reference:///?swt=rcp,\
+a2+reference:///usr/lib/a2/?swt=rcp
diff --git a/sdk/deploy/argeo-desktop/etc/argeo.user.d/desktop/jvm.args b/sdk/deploy/argeo-desktop/etc/argeo.user.d/desktop/jvm.args
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/sdk/deploy/argeo-desktop/etc/argeo.user.d/desktop/system.properties b/sdk/deploy/argeo-desktop/etc/argeo.user.d/desktop/system.properties
new file mode 100644 (file)
index 0000000..62fe6da
--- /dev/null
@@ -0,0 +1 @@
+log.org.argeo=INFO
\ No newline at end of file
diff --git a/sdk/deploy/argeo-desktop/usr/share/applications/argeo.desktop b/sdk/deploy/argeo-desktop/usr/share/applications/argeo.desktop
new file mode 100644 (file)
index 0000000..b0666ce
--- /dev/null
@@ -0,0 +1,5 @@
+[Desktop Entry]
+Name=Argeo
+Exec=/usr/bin/argeo-desktop-open argeo/app
+#Icon=
+Type=Application
diff --git a/sdk/deploy/argeo-server/etc/argeo.d/server/config.ini b/sdk/deploy/argeo-server/etc/argeo.d/server/config.ini
new file mode 100644 (file)
index 0000000..8d9f12c
--- /dev/null
@@ -0,0 +1,44 @@
+osgi.clean=true
+
+argeo.osgi.start.2=\
+org.eclipse.equinox.http.servlet,\
+org.eclipse.equinox.console,\
+org.apache.felix.scr,\
+org.eclipse.rap.rwt.osgi,\
+
+argeo.osgi.start.3=\
+org.argeo.cms,\
+org.argeo.cms.swt.rap,\
+org.argeo.cms.ee,\
+org.argeo.cms.lib.sshd,\
+org.argeo.cms.lib.equinox,\
+org.argeo.cms.lib.jetty,\
+
+argeo.osgi.start.4=\
+org.argeo.cms.jcr
+
+argeo.osgi.start.5=\
+org.argeo.app.profile.acr.fs,\
+org.argeo.app.core,\
+org.argeo.app.ui,\
+org.argeo.app.theme.default,\
+org.argeo.app.servlet.publish,\
+org.argeo.app.servlet.odk
+
+# Local
+argeo.http.port=8080
+#argeo.https.port=8443
+
+argeo.directory=dc=example,dc=com.ldif
+#argeo.directory=ldap://cn=Directory%20Manager:password@localhost/dc=example,dc=com
+#argeo.directory=ipa:///
+
+argeo.node.repo.type=h2
+
+#argeo.node.repo.type=postgresql_ds
+#argeo.node.repo.dburl=jdbc:postgresql://localhost/argeo
+#argeo.node.repo.dbuser=
+#argeo.node.repo.dbpassword=
+
+argeo.osgi.sources=\
+a2+reference:///?swt=rap
diff --git a/sdk/deploy/argeo-server/etc/argeo.d/server/jvm.args b/sdk/deploy/argeo-server/etc/argeo.d/server/jvm.args
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/sdk/deploy/argeo-server/etc/argeo.d/server/system.properties b/sdk/deploy/argeo-server/etc/argeo.d/server/system.properties
new file mode 100644 (file)
index 0000000..62fe6da
--- /dev/null
@@ -0,0 +1 @@
+log.org.argeo=INFO
\ No newline at end of file
diff --git a/sdk/init/node/dc=example,dc=com.ldif b/sdk/init/node/dc=example,dc=com.ldif
deleted file mode 100644 (file)
index 5371306..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-dn: uid=coworker,ou=People,dc=example,dc=com
-objectClass: inetOrgPerson
-objectClass: organizationalPerson
-objectClass: person
-objectClass: top
-givenName: John
-sn: Coworker
-userPassword:: e1NIQX1pZVNWNTVRYytlUU9hWURSU2hhL0Fqek5USkU9
-mail: coworker@localhost
-uid: coworker
-cn: John Coworker
-description: A regular coworker
-
-dn: uid=manager,ou=People,dc=example,dc=com
-objectClass: inetOrgPerson
-objectClass: organizationalPerson
-objectClass: person
-objectClass: top
-givenName: Mary
-sn: Manager
-userPassword:: e1NIQX1pZVNWNTVRYytlUU9hWURSU2hhL0Fqek5USkU9
-mail: manager@localhost
-uid: manager
-cn: Mary Manager
-description: A manager
-
-dn: uid=root,ou=People,dc=example,dc=com
-objectClass: inetOrgPerson
-objectClass: person
-objectClass: organizationalPerson
-objectClass: top
-givenName: Super
-sn: User
-userPassword:: e1NIQX1pZVNWNTVRYytlUU9hWURSU2hhL0Fqek5USkU9
-mail: root@localhost
-uid: root
-cn: Super User
-description: Superuser
-
diff --git a/sdk/init/node/ou=roles,ou=node.ldif b/sdk/init/node/ou=roles,ou=node.ldif
deleted file mode 100644 (file)
index 3c70185..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-dn: cn=admin,ou=roles,ou=node
-objectClass: groupOfNames
-objectClass: top
-cn: admin
-member: uid=root,ou=People,dc=example,dc=com
-
-dn: cn=org.argeo.suite.coworker,ou=roles,ou=node
-objectClass: groupOfNames
-objectClass: top
-cn: org.argeo.suite.coworker
-member: cn=org.argeo.suite.manager,ou=roles,ou=node
-member: uid=coworker,ou=People,dc=example,dc=com
-
-dn: cn=org.argeo.suite.manager,ou=roles,ou=node
-objectClass: groupOfNames
-objectClass: top
-cn: org.argeo.suite.manager
-member: uid=manager,ou=People,dc=example,dc=com
-member: uid=root,ou=People,dc=example,dc=com
-
-dn: cn=userAdmin,ou=roles,ou=node
-objectClass: groupOfNames
-objectClass: top
-cn: userAdmin
-member: cn=admin,ou=roles,ou=node
-
diff --git a/sdk/init/private/dc=example,dc=com.ldif b/sdk/init/private/dc=example,dc=com.ldif
new file mode 100644 (file)
index 0000000..5371306
--- /dev/null
@@ -0,0 +1,39 @@
+dn: uid=coworker,ou=People,dc=example,dc=com
+objectClass: inetOrgPerson
+objectClass: organizationalPerson
+objectClass: person
+objectClass: top
+givenName: John
+sn: Coworker
+userPassword:: e1NIQX1pZVNWNTVRYytlUU9hWURSU2hhL0Fqek5USkU9
+mail: coworker@localhost
+uid: coworker
+cn: John Coworker
+description: A regular coworker
+
+dn: uid=manager,ou=People,dc=example,dc=com
+objectClass: inetOrgPerson
+objectClass: organizationalPerson
+objectClass: person
+objectClass: top
+givenName: Mary
+sn: Manager
+userPassword:: e1NIQX1pZVNWNTVRYytlUU9hWURSU2hhL0Fqek5USkU9
+mail: manager@localhost
+uid: manager
+cn: Mary Manager
+description: A manager
+
+dn: uid=root,ou=People,dc=example,dc=com
+objectClass: inetOrgPerson
+objectClass: person
+objectClass: organizationalPerson
+objectClass: top
+givenName: Super
+sn: User
+userPassword:: e1NIQX1pZVNWNTVRYytlUU9hWURSU2hhL0Fqek5USkU9
+mail: root@localhost
+uid: root
+cn: Super User
+description: Superuser
+
diff --git a/sdk/init/private/ou=roles,ou=node.ldif b/sdk/init/private/ou=roles,ou=node.ldif
new file mode 100644 (file)
index 0000000..3c70185
--- /dev/null
@@ -0,0 +1,26 @@
+dn: cn=admin,ou=roles,ou=node
+objectClass: groupOfNames
+objectClass: top
+cn: admin
+member: uid=root,ou=People,dc=example,dc=com
+
+dn: cn=org.argeo.suite.coworker,ou=roles,ou=node
+objectClass: groupOfNames
+objectClass: top
+cn: org.argeo.suite.coworker
+member: cn=org.argeo.suite.manager,ou=roles,ou=node
+member: uid=coworker,ou=People,dc=example,dc=com
+
+dn: cn=org.argeo.suite.manager,ou=roles,ou=node
+objectClass: groupOfNames
+objectClass: top
+cn: org.argeo.suite.manager
+member: uid=manager,ou=People,dc=example,dc=com
+member: uid=root,ou=People,dc=example,dc=com
+
+dn: cn=userAdmin,ou=roles,ou=node
+objectClass: groupOfNames
+objectClass: top
+cn: userAdmin
+member: cn=admin,ou=roles,ou=node
+
index b6f30363cf53921b1c9da171c11a93a1f4a74295..5031f01b19cfe979b6819e5c3cf3552416f729ce 100644 (file)
@@ -3,16 +3,8 @@
 <target name="(output) CMS RAP">
        <locations>
                <location path="${project_loc:argeo-suite}/../output/a2/org.argeo.cms" type="Directory"/>
-               <location path="${project_loc:argeo-suite}/../output/a2/org.argeo.cms.eclipse.rap" type="Directory"/>
-               <location path="${project_loc:argeo-suite}/../output/a2/org.argeo.tp.apache" type="Directory"/>
-               <location path="${project_loc:argeo-suite}/../output/a2/org.argeo.tp.eclipse.equinox" type="Directory"/>
-               <location path="${project_loc:argeo-suite}/../output/a2/org.argeo.tp.eclipse.rap" type="Directory"/>
-               <location path="${project_loc:argeo-suite}/../output/a2/org.argeo.tp.jetty" type="Directory"/>
-               <location path="${project_loc:argeo-suite}/../output/a2/org.argeo.tp.sdk" type="Directory"/>
-               <location path="${project_loc:argeo-suite}/../output/a2/org.argeo.tp.jcr" type="Directory"/>
-               <location path="${project_loc:argeo-suite}/../output/a2/org.argeo.tp" type="Directory"/>
-               <location path="${project_loc:argeo-suite}/../output/a2/org.argeo.tp.formats" type="Directory"/>
-               <location path="${project_loc:argeo-suite}/../output/a2/org.argeo.tp.poi" type="Directory"/>
-               <location path="${project_loc:argeo-suite}/../output/a2/org.argeo.tp.gis" type="Directory"/>
+               <location path="${project_loc:argeo-suite}/../output/a2/swt/org.argeo.cms" type="Directory"/>
+               <location path="${project_loc:argeo-suite}/../output/a2/swt/rap/org.argeo.cms" type="Directory"/>
+               <location type="Target" uri="file:${project_loc:argeo-tp}/sdk/output-argeo-tp-rwt.target"/>
        </locations>
 </target>
\ No newline at end of file
index 9e818714e9a327e8bddfc3ff993e272f0143e7b4..7eec71a29d7454ef326d49d6ef73d8955888ae45 100644 (file)
@@ -3,16 +3,8 @@
 <target name="(output) CMS RCP">
        <locations>
                <location path="${project_loc:argeo-suite}/../output/a2/org.argeo.cms" type="Directory"/>
-               <location path="${project_loc:argeo-suite}/../output/a2/org.argeo.cms.eclipse.rcp" type="Directory"/>
-               <location path="${project_loc:argeo-suite}/../output/a2/org.argeo.tp.apache" type="Directory"/>
-               <location path="${project_loc:argeo-suite}/../output/a2/org.argeo.tp.eclipse.equinox" type="Directory"/>
-               <location path="${project_loc:argeo-suite}/../output/a2/org.argeo.tp.eclipse.rcp" type="Directory"/>
-               <location path="${project_loc:argeo-suite}/../output/a2/org.argeo.tp.jetty" type="Directory"/>
-               <location path="${project_loc:argeo-suite}/../output/a2/org.argeo.tp.sdk" type="Directory"/>
-               <location path="${project_loc:argeo-suite}/../output/a2/org.argeo.tp.jcr" type="Directory"/>
-               <location path="${project_loc:argeo-suite}/../output/a2/org.argeo.tp" type="Directory"/>
-               <location path="${project_loc:argeo-suite}/../output/a2/org.argeo.tp.formats" type="Directory"/>
-               <location path="${project_loc:argeo-suite}/../output/a2/org.argeo.tp.poi" type="Directory"/>
-               <location path="${project_loc:argeo-suite}/../output/a2/org.argeo.tp.gis" type="Directory"/>
+               <location path="${project_loc:argeo-suite}/../output/a2/swt/org.argeo.cms" type="Directory"/>
+               <location path="${project_loc:argeo-suite}/../output/a2/swt/rcp/org.argeo.cms" type="Directory"/>
+               <location type="Target" uri="file:${project_loc:argeo-tp}/sdk/output-argeo-tp-swt.target"/>
        </locations>
 </target>
\ No newline at end of file
diff --git a/sdk/output-suite-rcp.target b/sdk/output-suite-rcp.target
new file mode 100644 (file)
index 0000000..7d766c9
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<?pde version="3.8"?>
+<target name="(output) Suite RCP">
+       <locations>
+               <location path="${project_loc:argeo-suite}/../output/a2/org.argeo.cms.jcr" type="Directory"/>
+               <location path="${project_loc:argeo-suite}/../output/a2/swt/org.argeo.cms.jcr" type="Directory"/>
+               <location path="${project_loc:argeo-suite}/../output/a2/org.argeo.suite" type="Directory"/>
+               <location path="${project_loc:argeo-suite}/../output/a2/swt/org.argeo.suite" type="Directory"/>
+               <location type="Target" uri="file:${project_loc:argeo-tp}/sdk/output-argeo-tp-backend.target"/>
+               <location type="Target" uri="file:${project_loc:argeo-suite}/sdk/output-cms-rcp.target"/>
+       </locations>
+</target>
\ No newline at end of file
diff --git a/swt/org.argeo.app.swt/.classpath b/swt/org.argeo.app.swt/.classpath
new file mode 100644 (file)
index 0000000..81fe078
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
+       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+       <classpathentry kind="src" path="src"/>
+       <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/swt/org.argeo.app.swt/.project b/swt/org.argeo.app.swt/.project
new file mode 100644 (file)
index 0000000..11c6368
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.argeo.app.swt</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.ManifestBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.SchemaBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+       </natures>
+</projectDescription>
diff --git a/swt/org.argeo.app.swt/bnd.bnd b/swt/org.argeo.app.swt/bnd.bnd
new file mode 100644 (file)
index 0000000..fac182d
--- /dev/null
@@ -0,0 +1,6 @@
+Import-Package:\
+org.eclipse.swt,\
+org.argeo.api.cms.ux,\
+org.argeo.cms.ux.acr,\
+org.argeo.app.api,\
+*
\ No newline at end of file
diff --git a/swt/org.argeo.app.swt/build.properties b/swt/org.argeo.app.swt/build.properties
new file mode 100644 (file)
index 0000000..34d2e4d
--- /dev/null
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .
diff --git a/swt/org.argeo.app.swt/src/org/argeo/app/swt/docbook/DbkImageManager.java b/swt/org.argeo.app.swt/src/org/argeo/app/swt/docbook/DbkImageManager.java
new file mode 100644 (file)
index 0000000..5fe67e1
--- /dev/null
@@ -0,0 +1,130 @@
+package org.argeo.app.swt.docbook;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+
+import org.argeo.api.acr.Content;
+import org.argeo.api.acr.DName;
+import org.argeo.api.acr.spi.ProvidedContent;
+import org.argeo.api.cms.ux.Cms2DSize;
+import org.argeo.api.cms.ux.CmsImageManager;
+import org.argeo.app.api.EntityNames;
+import org.argeo.app.api.EntityType;
+import org.argeo.app.docbook.DbkAttr;
+import org.argeo.app.docbook.DbkType;
+import org.argeo.cms.acr.SvgAttrs;
+import org.argeo.cms.swt.acr.AcrSwtImageManager;
+import org.eclipse.swt.graphics.ImageData;
+
+/** Add DocBook images support to {@link CmsImageManager}. */
+public class DbkImageManager extends AcrSwtImageManager {
+       private Content baseFolder = null;
+
+       public DbkImageManager(Content baseFolder) {
+               this.baseFolder = baseFolder;
+       }
+
+       Content getImageDataNode(Content mediaObjectNode) {
+               return mediaObjectNode.child(DbkType.imageobject).child(DbkType.imagedata);
+       }
+
+//     @Override
+//     public Binary getImageBinary(Node node) {
+//             Node fileNode = null;
+//             if (DbkUtils.isDbk(node, DbkType.mediaobject)) {
+//                     Node imageDataNode = getImageDataNode(node);
+//                     fileNode = getFileNode(imageDataNode);
+//             }
+//             try {
+//                     if (node.isNodeType(NT_FILE)) {
+//                             fileNode = node;
+//                     }
+//                     if (fileNode != null) {
+//                             return node.getNode(JCR_CONTENT).getProperty(JCR_DATA).getBinary();
+//                     } else {
+//                             return null;
+//                     }
+//             } catch (RepositoryException e) {
+//                     throw new JcrException(e);
+//             }
+//     }
+
+       public Cms2DSize getImageSize(Content mediaObjectNode) {
+               Content imageDataNode = getImageDataNode(mediaObjectNode);
+               Content fileNode = getFileNode(imageDataNode);
+               if (fileNode == null)
+                       return new Cms2DSize(0, 0);
+               Cms2DSize intrinsicSize;
+               if (fileNode.containsKey(SvgAttrs.width) && fileNode.containsKey(SvgAttrs.height)) {
+                       int width = fileNode.get(SvgAttrs.width, Integer.class).orElseThrow();
+                       int height = fileNode.get(SvgAttrs.height, Integer.class).orElseThrow();
+                       intrinsicSize = new Cms2DSize(width, height);
+               } else {
+                       try (InputStream in = fileNode.open(InputStream.class)) {
+                               ImageData id = new ImageData(in);
+                               intrinsicSize = updateSize(fileNode, id);
+                       } catch (IOException e) {
+                               throw new RuntimeException("Cannot load file " + fileNode, e);
+                       }
+               }
+               // TODO interpret image data infos
+               return intrinsicSize;
+       }
+
+       protected Cms2DSize updateSize(Content fileNode, ImageData id) {
+               fileNode.addContentClasses(EntityType.box.qName());
+               fileNode.put(SvgAttrs.width, id.width);
+               fileNode.put(SvgAttrs.height, id.height);
+               return new Cms2DSize(id.width, id.height);
+       }
+
+//     @Override
+//     protected void processNewImageFile(Content mediaObjectNode, Content fileNode, ImageData id) throws IOException {
+//             Node imageDataNode = getImageDataNode(mediaObjectNode);
+//             updateSize(fileNode, id);
+//             String filePath = fileNode.getPath();
+//             String relPath = filePath.substring(baseFolder.getPath().length() + 1);
+//             imageDataNode.setProperty(DbkAttr.fileref.name(), relPath);
+//     }
+
+       @Override
+       public String getImageUrl(Content mediaObjectNode) {
+               Content imageDataNode = getImageDataNode(mediaObjectNode);
+               // TODO factorise
+               String fileref = imageDataNode.get(DbkAttr.fileref, String.class).orElse(null);
+               if (fileref == null)
+                       return null;
+               URI fileUri;
+               try {
+                       // FIXME it messes up with the '/'
+                       fileUri = new URI(URLEncoder.encode(fileref, StandardCharsets.UTF_8.toString()));
+               } catch (URISyntaxException | UnsupportedEncodingException e) {
+                       throw new IllegalArgumentException("File ref in " + imageDataNode + " is badly formatted", e);
+               }
+               if (fileUri.getScheme() != null)
+                       return fileUri.toString();
+               // local
+               Content fileNode = getFileNode(imageDataNode);
+               String url = getDataPathForUrl(fileNode);
+               return url;
+       }
+
+       protected Content getFileNode(Content imageDataNode) {
+               // FIXME make URL use case more robust
+               String fileref = imageDataNode.get(DbkAttr.fileref, String.class).orElse(null);
+               if (fileref == null)
+                       return null;
+               return ((ProvidedContent) baseFolder).getContent(fileref);
+       }
+
+       protected Content getMediaFolder() {
+               // TODO check edition status
+               Content mediaFolder = baseFolder.anyOrAddChild(EntityNames.MEDIA, DName.collection.qName());
+               return mediaFolder;
+       }
+}
diff --git a/swt/org.argeo.app.swt/src/org/argeo/app/swt/docbook/DbkImg.java b/swt/org.argeo.app.swt/src/org/argeo/app/swt/docbook/DbkImg.java
new file mode 100644 (file)
index 0000000..9984209
--- /dev/null
@@ -0,0 +1,65 @@
+package org.argeo.app.swt.docbook;
+
+import org.argeo.api.acr.Content;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.swt.acr.Img;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+/** DocBook specific image area. */
+public class DbkImg extends Img {
+       private static final long serialVersionUID = -6150996708899219074L;
+
+       public DbkImg(Composite parent, int swtStyle, Content imgNode, DbkImageManager imageManager) {
+               super(parent, swtStyle, imgNode, imageManager);
+               // FIXME deal with style and initialisation
+               setStyle((String) null);
+       }
+
+       @Override
+       protected Content getUploadFolder() {
+               Content mediaFolder = ((DbkImageManager) getImageManager()).getMediaFolder();
+               return mediaFolder;
+       }
+
+       @Override
+       protected String getUploadName() {
+               return null;
+       }
+
+       @Override
+       protected void setContainerLayoutData(Composite composite) {
+               composite.setLayoutData(CmsSwtUtils.grabWidth(SWT.CENTER, SWT.DEFAULT));
+       }
+
+       @Override
+       protected void setControlLayoutData(Control control) {
+               control.setLayoutData(CmsSwtUtils.grabWidth(SWT.CENTER, SWT.DEFAULT));
+       }
+
+//     @Override
+//     protected FileUploadHandler prepareUpload(FileUploadReceiver receiver) {
+//             FileUploadHandler fileUploadHandler = super.prepareUpload(receiver);
+//             fileUploadHandler.addUploadListener(new FileUploadListener() {
+//
+//                     @Override
+//                     public void uploadProgress(FileUploadEvent event) {
+//                             // TODO Auto-generated method stub
+//
+//                     }
+//
+//                     @Override
+//                     public void uploadFinished(FileUploadEvent event) {
+//                     }
+//
+//                     @Override
+//                     public void uploadFailed(FileUploadEvent event) {
+//                             // TODO Auto-generated method stub
+//
+//                     }
+//             });
+//             return fileUploadHandler;
+//     }
+
+}
diff --git a/swt/org.argeo.app.swt/src/org/argeo/app/swt/docbook/DbkSectionTitle.java b/swt/org.argeo.app.swt/src/org/argeo/app/swt/docbook/DbkSectionTitle.java
new file mode 100644 (file)
index 0000000..58dd263
--- /dev/null
@@ -0,0 +1,30 @@
+package org.argeo.app.swt.docbook;
+
+import org.argeo.api.acr.Content;
+import org.argeo.cms.swt.SwtEditablePart;
+import org.argeo.cms.swt.widgets.EditableText;
+import org.argeo.cms.ux.acr.ContentPart;
+import org.eclipse.swt.widgets.Composite;
+
+/** The title of a section, based on an XML text node. */
+public class DbkSectionTitle extends EditableText implements SwtEditablePart, ContentPart {
+       private static final long serialVersionUID = -1787983154946583171L;
+
+       private final TextSection section;
+
+       public DbkSectionTitle(Composite parent, int swtStyle, Content titleNode) {
+               super(parent, swtStyle);
+               section = (TextSection) TextSection.findSection(this);
+               setData(titleNode);
+       }
+
+       public TextSection getSection() {
+               return section;
+       }
+
+       @Override
+       public Content getContent() {
+               return (Content) getData();
+       }
+
+}
diff --git a/swt/org.argeo.app.swt/src/org/argeo/app/swt/docbook/DbkTextInterpreter.java b/swt/org.argeo.app.swt/src/org/argeo/app/swt/docbook/DbkTextInterpreter.java
new file mode 100644 (file)
index 0000000..1eff7a4
--- /dev/null
@@ -0,0 +1,283 @@
+package org.argeo.app.swt.docbook;
+
+import static org.argeo.app.docbook.DbkAcrUtils.isDbk;
+import static org.argeo.app.docbook.DbkType.para;
+import static org.argeo.app.docbook.DbkType.title;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.util.List;
+
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMResult;
+import javax.xml.transform.stream.StreamResult;
+
+import org.apache.commons.io.IOUtils;
+import org.argeo.api.acr.Content;
+import org.argeo.app.docbook.DbkType;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+
+/** Based on HTML with a few Wiki-like shortcuts. */
+public class DbkTextInterpreter implements TextInterpreter {
+
+       private TransformerFactory transformerFactory = TransformerFactory.newDefaultInstance();
+
+       private String linkCssClass = DbkType.link.name();
+
+       @Override
+       public void write(Content node, String content) {
+               if (isDbk(node, para) || isDbk(node, title)) {
+                       String raw = convertToStorage(node, content);
+                       validateBeforeStoring(raw);
+
+                       String jcrUuid = null;// node.getIdentifier();
+//                                     if (node.hasProperty(Property.JCR_UUID))
+//                                             jcrUuid = node.getProperty(Property.JCR_UUID).getString();
+//                                     else {
+//                                             // TODO use time based
+//                                             jcrUuid = UUID.randomUUID().toString();
+//                                             node.setProperty(Property.JCR_UUID, jcrUuid);
+//                                             node.getSession().save();
+//                                     }
+
+                       StringBuilder namespaces = new StringBuilder();
+                       namespaces.append(" xmlns:dbk=\"http://docbook.org/ns/docbook\"");
+                       namespaces.append(" xmlns:jcr=\"http://www.jcp.org/jcr/1.0\"");
+                       namespaces.append(" xmlns:xlink=\"http://www.w3.org/1999/xlink\"");
+                       raw = "<" + node.getName() + " jcr:uuid=\"" + jcrUuid + "\"" + namespaces + ">" + raw + "</"
+                                       + node.getName() + ">";
+//                                     System.out.println(raw);
+//                                     try (InputStream in = new ByteArrayInputStream(raw.getBytes(StandardCharsets.UTF_8))) {
+//                                             node.getSession().importXML(node.getParent().getPath(), in,
+//                                                             ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING);
+//                                             // node.getSession().save();
+//                                     } catch (IOException e) {
+//                                             throw new IllegalArgumentException("Cannot parse raw content of " + node, e);
+//                                     }
+
+//                                     try {
+//                                             DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
+//                                             Document document;
+//                                             try (Reader in = new StringReader(raw)) {
+//                                                     document = documentBuilder.parse(new InputSource(in));
+//                                             }
+//                                             NodeList nl = document.getChildNodes();
+//                                             for (int i = 0; i < nl.getLength(); i++) {
+//                                                     org.w3c.dom.Node n = nl.item(i);
+//                                                     if (node instanceof Text) {
+//
+//                                                     }
+//                                             }
+//                                     } catch (ParserConfigurationException | SAXException | IOException e) {
+//                                             throw new IllegalArgumentException("Cannot parse raw content of " + node, e);
+//                                     }
+
+//                                     Node jcrText;
+//                                     if (!node.hasNode(Jcr.JCR_XMLTEXT))
+//                                             jcrText = node.addNode(Jcr.JCR_XMLTEXT, JcrxType.JCRX_XMLTEXT);
+//                                     else
+//                                             jcrText = node.getNode(Jcr.JCR_XMLTEXT);
+//                                     jcrText.setProperty(Jcr.JCR_XMLCHARACTERS, raw);
+               } else {
+                       throw new IllegalArgumentException("Don't know how to interpret " + node);
+               }
+       }
+
+       @Override
+       public String read(Content item) {
+               String raw = raw(item);
+               return convertFromStorage(item, raw);
+       }
+
+       @Override
+       public String raw(Content node) {
+               if (isDbk(node, para) || isDbk(node, title)) {
+                       try (StringWriter stringWriter = new StringWriter()) {
+                               Source source = node.adapt(Source.class);
+                               Result result = new StreamResult(stringWriter);
+                               transformerFactory.newTransformer().transform(source, result);
+                               return stringWriter.toString();
+                       } catch (TransformerException | IOException e) {
+                               throw new RuntimeException("Could not convert " + node + " to XML", e);
+                       }
+
+//                                     StringBuilder sb = new StringBuilder();
+//                                     readXml(node, sb);
+//                                     NodeIterator nit = node.getNodes();
+//                                     while (nit.hasNext()) {
+//                                             Node child = nit.nextNode();
+//                                             if (child.getName().equals(Jcr.JCR_XMLTEXT)) {
+//                                                     Node jcrText = node.getNode(Jcr.JCR_XMLTEXT);
+//                                                     String txt = jcrText.getProperty(Jcr.JCR_XMLCHARACTERS).getString();
+//                                                     // TODO make it more robust
+//                                                     // txt = txt.replace("\n", "").replace("\t", "");
+//                                                     txt = txt.replace("\t", "  ");
+//                                                     sb.append(txt);
+//                                             } else {
+//                                                     try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
+//                                                             child.getSession().exportDocumentView(child.getPath(), out, true, false);
+//                                                             sb.append(new String(out.toByteArray(), StandardCharsets.UTF_8));
+//                                                     } catch (IOException e) {
+//                                                             throw new IllegalStateException("Cannot export " + child, e);
+//                                                     }
+//                                             }
+//                                     }
+//                                     return sb.toString();
+               } else {
+                       throw new IllegalArgumentException("Don't know how to interpret " + node);
+               }
+       }
+
+//     private void readXml(Content node, StringBuilder sb){
+//             
+//             NodeIterator nit = node.getNodes();
+//             while (nit.hasNext()) {
+//                     Node child = nit.nextNode();
+//                     if (child.getName().equals(Jcr.JCR_XMLTEXT)) {
+//                             String txt = child.getProperty(Jcr.JCR_XMLCHARACTERS).getString();
+//                             // TODO make it more robust
+//                             // txt = txt.replace("\n", "").replace("\t", "");
+//                             txt = txt.replace("\t", "  ");
+//                             sb.append(txt);
+//                     } else {
+//                             sb.append('<').append(child.getName());
+//                             PropertyIterator pit = child.getProperties();
+//                             properties: while (pit.hasNext()) {
+//                                     Property p = pit.nextProperty();
+//                                     if (p.getName().startsWith("jcr:"))
+//                                             continue properties;
+//                                     sb.append(' ').append(p.getName()).append("=\"").append(p.getString()).append('\"');
+//                             }
+//                             sb.append('>');
+//                             readXml(child, sb);
+////                           try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
+////                                   child.getSession().exportDocumentView(child.getPath(), out, true, false);
+////                                   sb.append(new String(out.toByteArray(), StandardCharsets.UTF_8));
+////                           } catch (IOException e) {
+////                                   throw new IllegalStateException("Cannot export " + child, e);
+////                           }
+//                             sb.append("</").append(child.getName()).append('>');
+//                     }
+//             }
+//     }
+
+       private void readAsSimpleHtml(Content node, StringBuilder sb) {
+               DOMResult result = new DOMResult();
+               try {
+                       Source source = node.adapt(Source.class);
+                       transformerFactory.newTransformer().transform(source, result);
+               } catch (TransformerException e) {
+                       throw new RuntimeException("Could not convert " + node + " to XML", e);
+               }
+
+               NodeList nl = result.getNode().getChildNodes();
+               for (int i = 0; i < nl.getLength(); i++) {
+                       Node n = nl.item(i);
+//                     if (n instanceof Text) {
+//                             Text text = (Text) n;
+//                             sb.append(text.getTextContent());
+//                     } else 
+                               if (n instanceof Element) {
+                               Element elem = (Element) n;
+                               sb.append(elem.getTextContent());
+                       }
+               }
+
+//             NodeIterator nit = node.getNodes();
+//             while (nit.hasNext()) {
+//                     Node child = nit.nextNode();
+//                     if (child.getName().equals(Jcr.JCR_XMLTEXT)) {
+//                             String txt = child.getProperty(Jcr.JCR_XMLCHARACTERS).getString();
+//                             // TODO make it more robust
+//                             // txt = txt.replace("\n", "").replace("\t", "");
+//                             txt = txt.replace("\t", "  ");
+//                             String html = textToSimpleHtml(txt);
+//                             sb.append(html);
+//                     } else if (child.getName().equals(DbkType.link.get())) {
+//                             if (child.hasProperty(DbkAttr.XLINK_HREF)) {
+//                                     String href = child.getProperty(DbkAttr.XLINK_HREF).getString();
+//                                     // TODO deal with other forbidden XML characters?
+//                                     href = href.replace("&", "&amp;");
+//                                     sb.append("<a class='" + linkCssClass + "' href='").append(href).append("'>");
+//                                     readAsSimpleHtml(child, sb);
+//                                     sb.append("</a>");
+//                             }
+//                     } else {
+//                             // ignore
+//                     }
+//             }
+       }
+
+       private String textToSimpleHtml(String raw) {
+               // FIXME the saved data should be corrected instead.
+               if (raw.indexOf('&') >= 0) {
+                       raw = raw.replace("&", "&amp;");
+               }
+               if (raw.indexOf('<') >= 0) {
+                       raw = raw.replace("<", "&lt;");
+               }
+               if (raw.indexOf('>') >= 0) {
+                       raw = raw.replace(">", "&gt;");
+               }
+               if (raw.indexOf('\"') >= 0) {
+                       raw = raw.replace("\"", "&quot;");
+               }
+               if (raw.indexOf('\'') >= 0) {
+                       raw = raw.replace("\'", "&apos;");
+               }
+//             raw = "<span style='text-align:justify'>" + raw + "</span>";
+               if (raw.length() == 0)
+                       return raw;
+               try (StringReader reader = new StringReader(raw)) {
+                       List<String> lines = IOUtils.readLines(reader);
+                       if (lines.size() == 1)
+                               return lines.get(0);
+                       StringBuilder sb = new StringBuilder(raw.length() + lines.size() * BR_LENGTH);
+                       for (int i = 0; i < lines.size(); i++) {
+                               if (i != 0)
+                                       sb.append("<br/>");
+                               sb.append(lines.get(i));
+                       }
+                       return sb.toString();
+               } catch (IOException e) {
+                       throw new RuntimeException(e);
+               }
+       }
+
+       final static int BR_LENGTH = "<br/>".length();
+
+       public String readSimpleHtml(Content item) {
+               StringBuilder sb = new StringBuilder();
+//                     sb.append("<div style='text-align: justify;'>");
+               readAsSimpleHtml(item, sb);
+//                     sb.append("</div>");
+//                     System.out.println(sb);
+               return sb.toString();
+       }
+
+       // EXTENSIBILITY
+       /**
+        * To be overridden, in order to make sure that only valid strings are being
+        * stored.
+        */
+       protected void validateBeforeStoring(String raw) {
+       }
+
+       /** To be overridden, in order to support additional formatting. */
+       protected String convertToStorage(Content item, String content) {
+               return content;
+
+       }
+
+       /** To be overridden, in order to support additional formatting. */
+       protected String convertFromStorage(Content item, String content) {
+               return content;
+       }
+}
diff --git a/swt/org.argeo.app.swt/src/org/argeo/app/swt/docbook/DbkVideo.java b/swt/org.argeo.app.swt/src/org/argeo/app/swt/docbook/DbkVideo.java
new file mode 100644 (file)
index 0000000..8055634
--- /dev/null
@@ -0,0 +1,211 @@
+package org.argeo.app.swt.docbook;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.List;
+import java.util.Map;
+
+import org.argeo.api.acr.Content;
+import org.argeo.api.acr.ldap.NamingUtils;
+import org.argeo.api.acr.spi.ProvidedContent;
+import org.argeo.app.docbook.DbkAcrUtils;
+import org.argeo.app.docbook.DbkAttr;
+import org.argeo.app.docbook.DbkType;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.swt.Selected;
+import org.argeo.cms.swt.acr.SwtSection;
+import org.argeo.cms.swt.acr.SwtSectionPart;
+import org.argeo.cms.swt.widgets.StyledControl;
+import org.argeo.cms.ux.acr.ContentPart;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Text;
+
+public class DbkVideo extends StyledControl implements SwtSectionPart, ContentPart {
+       private static final long serialVersionUID = -8753232181570351880L;
+       private SwtSection section;
+
+       private int width = 640;
+       private int height = 360;
+
+       private boolean editable;
+
+       public DbkVideo(Composite parent, int style, Content node) {
+               this(SwtSection.findSection(parent), parent, style, node);
+       }
+
+       DbkVideo(SwtSection section, Composite parent, int style, Content node) {
+               super(parent, style);
+               editable = !(SWT.READ_ONLY == (style & SWT.READ_ONLY));
+               this.section = section;
+               setStyle(DbkType.videoobject.name());
+               setData(node);
+       }
+
+       @Override
+       protected Control createControl(Composite box, String style) {
+               Content mediaobject = getNode();
+               Composite wrapper = new Composite(box, SWT.NONE);
+               wrapper.setLayout(CmsSwtUtils.noSpaceGridLayout());
+
+               Composite browserC = new Composite(wrapper, SWT.NONE);
+               browserC.setLayout(CmsSwtUtils.noSpaceGridLayout());
+               GridData gd = new GridData(SWT.CENTER, SWT.FILL, true, true);
+               gd.widthHint = getWidth();
+               gd.heightHint = getHeight();
+               browserC.setLayoutData(gd);
+//             wrapper.setLayoutData(CmsUiUtils.fillAll());
+               Browser browser = new Browser(browserC, SWT.NONE);
+
+               if (editable) {
+                       Composite editor = new Composite(wrapper, SWT.BORDER);
+                       editor.setLayout(new GridLayout(3, false));
+                       editor.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+                       String fileref = DbkAcrUtils.getMediaFileref(mediaobject);
+                       Text text = new Text(editor, SWT.SINGLE);
+                       if (fileref != null)
+                               text.setText(fileref);
+                       else
+                               text.setMessage("Embed URL of the video");
+                       text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+                       Button updateB = new Button(editor, SWT.FLAT);
+                       updateB.setText("Update");
+                       updateB.addSelectionListener(new Selected() {
+
+                               @Override
+                               public void widgetSelected(SelectionEvent e) {
+                                       Content videodata = mediaobject.child(DbkType.videoobject).child(DbkType.videodata);
+                                       String txt = text.getText();
+                                       URI uri;
+                                       try {
+                                               uri = new URI(txt);
+                                       } catch (URISyntaxException e1) {
+                                               text.setText("");
+                                               text.setMessage("Invalid URL");
+                                               return;
+                                       }
+
+                                       // Transform watch URL in embed
+                                       // YouTube
+                                       String videoId = null;
+                                       if ("www.youtube.com".equals(uri.getHost()) || "youtube.com".equals(uri.getHost())
+                                                       || "youtu.be".equals(uri.getHost())) {
+                                               if ("www.youtube.com".equals(uri.getHost()) || "youtube.com".equals(uri.getHost())) {
+                                                       if ("/watch".equals(uri.getPath())) {
+                                                               Map<String, List<String>> map = NamingUtils.queryToMap(uri);
+                                                               videoId = map.get("v").get(0);
+                                                       }
+                                               } else if ("youtu.be".equals(uri.getHost())) {
+                                                       videoId = uri.getPath().substring(1);
+                                               }
+                                               if (videoId != null) {
+                                                       try {
+                                                               uri = new URI("https://www.youtube.com/embed/" + videoId);
+                                                               text.setText(uri.toString());
+                                                       } catch (URISyntaxException e1) {
+                                                               throw new IllegalStateException(e1);
+                                                       }
+                                               }
+                                       }
+
+                                       // Vimeo
+                                       if ("vimeo.com".equals(uri.getHost())) {
+                                               videoId = uri.getPath().substring(1);
+                                               if (videoId != null) {
+                                                       try {
+                                                               uri = new URI("https://player.vimeo.com/video/" + videoId);
+                                                               text.setText(uri.toString());
+                                                       } catch (URISyntaxException e1) {
+                                                               throw new IllegalStateException(e1);
+                                                       }
+                                               }
+                                       }
+
+                                       videodata.put(DbkAttr.fileref, uri.toString());
+                                       // TODO better integrate it in the edition lifecycle
+//                                     videodata.getSession().save();
+                                       load(browser);
+
+                               }
+                       });
+
+                       Button deleteB = new Button(editor, SWT.FLAT);
+                       deleteB.setText("Delete");
+                       deleteB.addSelectionListener(new Selected() {
+
+                               @Override
+                               public void widgetSelected(SelectionEvent e) {
+                                       mediaobject.remove();
+//                                     mediaobject.getSession().save();
+                                       dispose();
+                                       getSection().getParent().layout(true, true);
+
+                               }
+                       });
+               }
+
+               // TODO caption
+               return browser;
+       }
+
+       public void load(Control control) {
+               if (control instanceof Browser) {
+                       Browser browser = (Browser) control;
+//                     getNode().getSession();
+                       String fileref = DbkAcrUtils.getMediaFileref(getContent());
+                       if (fileref != null) {
+                               // TODO manage self-hosted videos
+                               // TODO for YouTube videos, check whether the URL starts with
+                               // https://www.youtube.com/embed/ and not https://www.youtube.com/watch?v=
+                               StringBuilder html = new StringBuilder();
+                               html.append(
+                                               "<iframe frameborder=\"0\" allow=\"autoplay; fullscreen; picture-in-picture\" allowfullscreen=\"true\"");
+                               // TODO make size configurable
+                               html.append("width=\"").append(width).append("\" height=\"").append(height).append("\" ");
+                               html.append("src=\"").append(fileref).append("\" ");
+                               html.append("/>");
+                               browser.setText(html.toString());
+                       }
+               }
+       }
+
+       @Override
+       protected void setContainerLayoutData(Composite composite) {
+               composite.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, true));
+       }
+
+       @Override
+       protected void setControlLayoutData(Control control) {
+               control.setLayoutData(CmsSwtUtils.fillAll());
+       }
+
+       @Override
+       public Content getContent() {
+               return (Content) getData();
+       }
+
+       @Override
+       public String getPartId() {
+               return ((ProvidedContent) getContent()).getSessionLocalId();
+       }
+
+       @Override
+       public SwtSection getSection() {
+               return section;
+       }
+
+       public int getWidth() {
+               return width;
+       }
+
+       public int getHeight() {
+               return height;
+       }
+
+}
diff --git a/swt/org.argeo.app.swt/src/org/argeo/app/swt/docbook/DocBookViewer.java b/swt/org.argeo.app.swt/src/org/argeo/app/swt/docbook/DocBookViewer.java
new file mode 100644 (file)
index 0000000..9956ade
--- /dev/null
@@ -0,0 +1,256 @@
+package org.argeo.app.swt.docbook;
+
+import static org.argeo.app.docbook.DbkAcrUtils.isDbk;
+import static org.argeo.app.docbook.DbkType.para;
+
+import java.util.Optional;
+
+import org.argeo.api.acr.Content;
+import org.argeo.api.cms.ux.Cms2DSize;
+import org.argeo.api.cms.ux.CmsEditable;
+import org.argeo.app.docbook.DbkAttr;
+import org.argeo.app.docbook.DbkType;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.swt.SwtEditablePart;
+import org.argeo.cms.swt.acr.AbstractPageViewer;
+import org.argeo.cms.swt.acr.SwtSection;
+import org.argeo.cms.swt.acr.SwtSectionPart;
+import org.argeo.cms.swt.widgets.EditableText;
+import org.argeo.cms.swt.widgets.StyledControl;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+public class DocBookViewer extends AbstractPageViewer {
+
+       private TextInterpreter textInterpreter = new DbkTextInterpreter();
+       private DbkImageManager imageManager;
+
+       private TextSection mainSection;
+
+       private boolean showMainTitle = true;
+
+       private Integer maxMediaWidth = null;
+       private String defaultSectionStyle;
+
+       public DocBookViewer(Composite parent, int style, Content item, CmsEditable cmsEditable) {
+               super(parent, style, cmsEditable);
+               imageManager = new DbkImageManager(item);
+
+               for (Content child : item) {
+                       if (child.hasContentClass(DbkType.article)) {
+                               if (mainSection != null)
+                                       throw new IllegalStateException("Main section already created");
+                               mainSection = new TextSection(parent, 0, child);
+                               mainSection.setLayoutData(CmsSwtUtils.fillAll());
+                       }
+               }
+       }
+
+       @Override
+       protected void refresh(Control control) {
+               if (!(control instanceof SwtSection))
+                       return;
+               long begin = System.currentTimeMillis();
+               SwtSection section = (SwtSection) control;
+               if (section instanceof TextSection) {
+                       CmsSwtUtils.clear(mainSection);
+                       refreshTextSection(mainSection);
+
+               }
+               long duration = System.currentTimeMillis() - begin;
+//             System.out.println(duration + " ms - " + DbkUtils.getTitle(section.getNode()));
+
+       }
+
+       protected void refreshTextSection(TextSection section) {
+               Content sectionContent = section.getContent();
+               // Style
+               Optional<String> roleAttr = sectionContent.get(DbkAttr.role, String.class);
+               String style = roleAttr.orElse(section.getDefaultTextStyle());
+               if (style != null)
+                       CmsSwtUtils.style(section, style);
+
+               // Title
+               Optional<Content> titleContent = sectionContent.soleChild(DbkType.title.qName());
+
+               if (titleContent.isPresent()) {
+                       boolean showTitle = getMainSection() == section ? showMainTitle : true;
+                       if (showTitle) {
+                               if (section.getHeader() == null)
+                                       section.createHeader();
+                               DbkSectionTitle title = newSectionTitle(section, titleContent.get());
+                               title.setLayoutData(CmsSwtUtils.fillWidth());
+                               updateContent(title);
+                       }
+               }
+
+               boolean processingSubSections = false;
+               for (Content child : section.getContent()) {
+                       if (child.hasContentClass(DbkType.section)) {
+                               processingSubSections = true;
+                               TextSection childSection = new TextSection(section, 0, child);
+                               childSection.setLayoutData(CmsSwtUtils.fillWidth());
+                               refreshTextSection(childSection);
+                       } else {
+                               if (processingSubSections)
+                                       throw new IllegalStateException(child + " is below a subsection");
+                               SwtSectionPart sectionPart = null;
+                               if (child.hasContentClass(DbkType.para)) {
+                                       sectionPart = newParagraph(section, child);
+                               } else if (child.hasContentClass(DbkType.mediaobject)) {
+                                       if (child.hasChild(DbkType.imageobject)) {
+                                               sectionPart = newImg(section, child);
+                                       } else if (child.hasChild(DbkType.videoobject)) {
+                                               sectionPart = newVideo(section, child);
+                                       } else {
+                                               throw new IllegalArgumentException("Unsupported media object " + child);
+                                       }
+                               } else if (isDbk(child, DbkType.title)) {
+                                       // already managed
+                                       // TODO check that it is first?
+                               } else {
+                                       throw new IllegalArgumentException("Unsupported type for " + child);
+                               }
+                               if (sectionPart != null && sectionPart instanceof Control)
+                                       ((Control) sectionPart).setLayoutData(CmsSwtUtils.fillWidth());
+                       }
+               }
+       }
+
+       protected void updateContent(SwtEditablePart part) {
+               if (part instanceof SwtSectionPart) {
+                       SwtSectionPart sectionPart = (SwtSectionPart) part;
+                       Content partContent = sectionPart.getContent();
+
+                       if (part instanceof StyledControl && (sectionPart.getSection() instanceof TextSection)) {
+                               TextSection section = (TextSection) sectionPart.getSection();
+                               StyledControl styledControl = (StyledControl) part;
+                               if (isDbk(partContent, para)) {
+                                       Optional<String> roleAttr = partContent.get(DbkAttr.role.qName(), String.class);
+                                       String style = roleAttr.orElse(section.getDefaultTextStyle());
+                                       styledControl.setStyle(style);
+                               }
+                       }
+                       // use control AFTER setting style, since it may have been reset
+
+                       if (part instanceof EditableText) {
+                               EditableText paragraph = (EditableText) part;
+                               if (paragraph == getEdited())
+                                       paragraph.setText(textInterpreter.raw(partContent));
+                               else
+                                       paragraph.setText(textInterpreter.readSimpleHtml(partContent));
+                               // paragraph.setText(textInterpreter.readSimpleHtml(partContent));
+
+                       } else if (part instanceof DbkImg) {
+                               DbkImg editableImage = (DbkImg) part;
+//                             imageManager.load(partContent, part.getControl(), editableImage.getPreferredImageSize());
+                       } else if (part instanceof DbkVideo) {
+                               DbkVideo video = (DbkVideo) part;
+                               video.load(part.getControl());
+                       }
+               } else if (part instanceof DbkSectionTitle) {
+                       DbkSectionTitle title = (DbkSectionTitle) part;
+                       title.setStyle(title.getSection().getTitleStyle());
+                       // use control AFTER setting style
+                       if (title == getEdited())
+                               title.setText(textInterpreter.read(title.getContent()));
+                       else
+                               title.setText(textInterpreter.readSimpleHtml(title.getContent()));
+               }
+       }
+
+       protected Paragraph newParagraph(TextSection parent, Content node) {
+               Paragraph paragraph = new Paragraph(parent, parent.getStyle(), node);
+               updateContent(paragraph);
+               paragraph.setLayoutData(CmsSwtUtils.fillWidth());
+               paragraph.setMouseListener(getMouseListener());
+               paragraph.setFocusListener(getFocusListener());
+               return paragraph;
+       }
+
+       protected DbkSectionTitle newSectionTitle(TextSection parent, Content titleNode) {
+               int style = parent.getStyle();
+               Composite titleParent = newSectionHeader(parent);
+               if (parent.isTitleReadOnly())
+                       style = style | SWT.READ_ONLY;
+               DbkSectionTitle title = new DbkSectionTitle(titleParent, style, titleNode);
+               updateContent(title);
+               title.setMouseListener(getMouseListener());
+               title.setFocusListener(getFocusListener());
+               return title;
+       }
+
+       protected DbkImg newImg(TextSection parent, Content node) {
+               DbkImg img = new DbkImg(parent, parent.getStyle(), node, imageManager);
+               GridData imgGd;
+               if (maxMediaWidth != null) {
+                       imgGd = new GridData(SWT.CENTER, SWT.FILL, false, false);
+                       imgGd.widthHint = maxMediaWidth;
+                       img.setPreferredSize(new Cms2DSize(maxMediaWidth, 0));
+               } else {
+                       imgGd = CmsSwtUtils.grabWidth(SWT.CENTER, SWT.DEFAULT);
+               }
+               img.setLayoutData(imgGd);
+               updateContent(img);
+               img.setMouseListener(getMouseListener());
+               img.setFocusListener(getFocusListener());
+               return img;
+       }
+
+       protected DbkVideo newVideo(TextSection parent, Content node) {
+               DbkVideo video = new DbkVideo(parent, getCmsEditable().canEdit() ? SWT.NONE : SWT.READ_ONLY, node);
+               GridData gd;
+               if (maxMediaWidth != null) {
+                       gd = new GridData(SWT.CENTER, SWT.FILL, false, false);
+                       // TODO, manage size
+//                             gd.widthHint = maxMediaWidth;
+//                             gd.heightHint = (int) (gd.heightHint * 0.5625);
+               } else {
+                       gd = new GridData(SWT.CENTER, SWT.FILL, false, false);
+//                             gd.widthHint = video.getWidth();
+//                             gd.heightHint = video.getHeight();
+               }
+               video.setLayoutData(gd);
+               updateContent(video);
+               return video;
+       }
+
+       /**
+        * To be overridden in order to provide additional processing at the section
+        * level.
+        * 
+        * @return the parent to use for the {@link DbkSectionTitle}, by default
+        *         {@link Section#getHeader()}
+        */
+       protected Composite newSectionHeader(TextSection section) {
+               return section.getHeader();
+       }
+
+       public TextSection getMainSection() {
+               return mainSection;
+       }
+
+       public void setShowMainTitle(boolean showMainTitle) {
+               this.showMainTitle = showMainTitle;
+       }
+
+       public String getDefaultSectionStyle() {
+               return defaultSectionStyle;
+       }
+
+       public void setDefaultSectionStyle(String defaultSectionStyle) {
+               this.defaultSectionStyle = defaultSectionStyle;
+       }
+
+       public void setMaxMediaWidth(Integer maxMediaWidth) {
+               this.maxMediaWidth = maxMediaWidth;
+       }
+
+       @Override
+       public Control getControl() {
+               return mainSection;
+       }
+
+}
diff --git a/swt/org.argeo.app.swt/src/org/argeo/app/swt/docbook/Paragraph.java b/swt/org.argeo.app.swt/src/org/argeo/app/swt/docbook/Paragraph.java
new file mode 100644 (file)
index 0000000..60bfc77
--- /dev/null
@@ -0,0 +1,50 @@
+package org.argeo.app.swt.docbook;
+
+import org.argeo.api.acr.Content;
+import org.argeo.api.acr.spi.ProvidedContent;
+import org.argeo.app.docbook.DbkType;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.swt.acr.SwtSectionPart;
+import org.argeo.cms.swt.widgets.EditableText;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+/** An editable paragraph. */
+public class Paragraph extends EditableText implements SwtSectionPart {
+       private static final long serialVersionUID = 3746457776229542887L;
+
+       private final TextSection section;
+
+       public Paragraph(TextSection section, int style, Content node) {
+               super(section, style);
+               this.section = section;
+               setData(node);
+               CmsSwtUtils.style(this, DbkType.para.name());
+       }
+
+       public TextSection getSection() {
+               return section;
+       }
+
+       @Override
+       protected Label createLabel(Composite box, String style) {
+               Label lbl = super.createLabel(box, style);
+               CmsSwtUtils.disableMarkupValidation(lbl);
+               return lbl;
+       }
+
+       @Override
+       public String getPartId() {
+               return ((ProvidedContent) getContent()).getSessionLocalId();
+       }
+
+       @Override
+       public Content getContent() {
+               return (Content) getData();
+       }
+
+       @Override
+       public String toString() {
+               return "Paragraph #" + getPartId();
+       }
+}
diff --git a/swt/org.argeo.app.swt/src/org/argeo/app/swt/docbook/TextInterpreter.java b/swt/org.argeo.app.swt/src/org/argeo/app/swt/docbook/TextInterpreter.java
new file mode 100644 (file)
index 0000000..0470a6d
--- /dev/null
@@ -0,0 +1,14 @@
+package org.argeo.app.swt.docbook;
+
+import org.argeo.api.acr.Content;
+
+/** Convert from/to data layer to/from presentation layer. */
+public interface TextInterpreter {
+       String raw(Content content);
+
+       String read(Content content);
+
+       String readSimpleHtml(Content content);
+
+       void write(Content content, String txt);
+}
diff --git a/swt/org.argeo.app.swt/src/org/argeo/app/swt/docbook/TextSection.java b/swt/org.argeo.app.swt/src/org/argeo/app/swt/docbook/TextSection.java
new file mode 100644 (file)
index 0000000..e062ad2
--- /dev/null
@@ -0,0 +1,78 @@
+package org.argeo.app.swt.docbook;
+
+import org.argeo.api.acr.Content;
+import org.argeo.app.docbook.DbkType;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.swt.acr.SwtSection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+
+/** An editable section. */
+public class TextSection extends SwtSection {
+       private static final long serialVersionUID = -8625209546243220689L;
+       private String defaultTextStyle = DbkType.para.name();
+       private String titleStyle;
+
+       private final boolean flat;
+
+       private boolean titleReadOnly = false;
+
+       private final int level;
+
+       public TextSection(Composite parent, int style, Content node) {
+               this(parent, findSection(parent), style, node);
+       }
+
+       public TextSection(TextSection section, int style, Content node) {
+               this(section, section.getParentSection(), style, node);
+       }
+
+       private TextSection(Composite parent, SwtSection parentSection, int style, Content node) {
+               super(parent, parentSection, style, node);
+               flat = SWT.FLAT == (style & SWT.FLAT);
+               if (parentSection instanceof TextSection) {
+                       level = ((TextSection) parentSection).getLevel() + 1;
+               } else {
+                       level = 0;
+               }
+               CmsSwtUtils.style(this, DbkType.section.name());
+       }
+
+       public String getDefaultTextStyle() {
+               return defaultTextStyle;
+       }
+
+       public boolean isFlat() {
+               return flat;
+       }
+
+       /** The level of this section, similar to h1, h2, etc. in HTML. */
+       public int getLevel() {
+               return level;
+       }
+
+       public String getTitleStyle() {
+               if (titleStyle != null)
+                       return titleStyle;
+               // TODO make base H styles configurable
+//             Integer relativeDepth = getRelativeDepth();
+//             System.out.println("Level: " + getLevel());
+               return "h" + (getLevel() + 1);
+       }
+
+       public void setDefaultTextStyle(String defaultTextStyle) {
+               this.defaultTextStyle = defaultTextStyle;
+       }
+
+       public void setTitleStyle(String titleStyle) {
+               this.titleStyle = titleStyle;
+       }
+
+       public boolean isTitleReadOnly() {
+               return titleReadOnly;
+       }
+
+       public void setTitleReadOnly(boolean titleReadOnly) {
+               this.titleReadOnly = titleReadOnly;
+       }
+}
diff --git a/swt/org.argeo.app.ui/.classpath b/swt/org.argeo.app.ui/.classpath
new file mode 100644 (file)
index 0000000..81fe078
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
+       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+       <classpathentry kind="src" path="src"/>
+       <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/swt/org.argeo.app.ui/.gitignore b/swt/org.argeo.app.ui/.gitignore
new file mode 100644 (file)
index 0000000..09e3bc9
--- /dev/null
@@ -0,0 +1,2 @@
+/bin/
+/target/
diff --git a/swt/org.argeo.app.ui/.project b/swt/org.argeo.app.ui/.project
new file mode 100644 (file)
index 0000000..a7893bd
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.argeo.app.ui</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.ManifestBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.SchemaBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.ds.core.builder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+       </natures>
+</projectDescription>
diff --git a/swt/org.argeo.app.ui/META-INF/.gitignore b/swt/org.argeo.app.ui/META-INF/.gitignore
new file mode 100644 (file)
index 0000000..4854a41
--- /dev/null
@@ -0,0 +1 @@
+/MANIFEST.MF
diff --git a/swt/org.argeo.app.ui/OSGI-INF/adminLeadPane.xml b/swt/org.argeo.app.ui/OSGI-INF/adminLeadPane.xml
new file mode 100644 (file)
index 0000000..8d69ead
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init" deactivate="destroy" immediate="false" name="Admin Lead Pane">
+   <implementation class="org.argeo.app.ui.DefaultLeadPane"/>
+   <service>
+      <provide interface="org.argeo.cms.swt.acr.SwtUiProvider"/>
+   </service>
+   <properties entry="config/adminLeadPane.properties"/>
+   <property name="service.ranking" type="Integer" value="-1000"/>
+   <property name="defaultLayers" type="String">argeo.suite.ui.termsLayer
+   </property>
+   <reference bind="addLayer" cardinality="1..n" interface="org.argeo.app.ui.SuiteLayer" name="SuiteLayer" policy="dynamic" unbind="removeLayer"/>
+</scr:component>
diff --git a/swt/org.argeo.app.ui/OSGI-INF/cmsApp.xml b/swt/org.argeo.app.ui/OSGI-INF/cmsApp.xml
new file mode 100644 (file)
index 0000000..f9de1dd
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init" deactivate="destroy" name="Argeo Suite App">
+   <implementation class="org.argeo.app.ui.SuiteApp"/>
+   <service>
+      <provide interface="org.argeo.api.cms.CmsApp"/>
+   </service>
+   <properties entry="config/cmsApp.properties"/>
+   <reference bind="addUiProvider" cardinality="0..n" interface="org.argeo.cms.swt.acr.SwtUiProvider" policy="dynamic" unbind="removeUiProvider"/>
+   <reference bind="addTheme" cardinality="1..n" interface="org.argeo.api.cms.ux.CmsTheme" name="CmsTheme" policy="dynamic" unbind="removeTheme"/>
+   <reference bind="addLayer" cardinality="1..n" interface="org.argeo.app.ui.SuiteLayer" name="SuiteLayer" policy="dynamic" unbind="removeLayer"/>
+   <reference bind="setCmsUserManager" cardinality="1..1" interface="org.argeo.api.cms.directory.CmsUserManager" name="CmsUserManager" policy="static"/>
+   <reference bind="setCmsContext" cardinality="1..1" interface="org.argeo.api.cms.CmsContext" name="CmsContext" policy="static"/>
+   <reference bind="setContentRepository" cardinality="1..1" interface="org.argeo.api.acr.ContentRepository" name="ContentRepository" policy="static"/>
+   <reference bind="setJcrContentProvider" cardinality="1..1" interface="org.argeo.cms.jcr.acr.JcrContentProvider" name="JcrContentProvider" policy="static"/>
+</scr:component>
diff --git a/swt/org.argeo.app.ui/OSGI-INF/contentEntryArea.xml b/swt/org.argeo.app.ui/OSGI-INF/contentEntryArea.xml
new file mode 100644 (file)
index 0000000..d8579b0
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
+   <implementation class="org.argeo.app.ui.library.ContentEntryArea"/>
+   <service>
+      <provide interface="org.argeo.cms.swt.acr.SwtUiProvider"/>
+   </service>
+   <property name="service.ranking" type="Integer" value="-1000"/>
+   <properties entry="config/contentEntryArea.properties"/>
+</scr:component>
diff --git a/swt/org.argeo.app.ui/OSGI-INF/contentLayer.xml b/swt/org.argeo.app.ui/OSGI-INF/contentLayer.xml
new file mode 100644 (file)
index 0000000..7e56e47
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="Content Layer">
+   <implementation class="org.argeo.app.ui.DefaultEditionLayer"/>
+   <service>
+      <provide interface="org.argeo.app.ui.SuiteLayer"/>
+   </service>
+   <reference bind="setEntryArea" cardinality="1..1" interface="org.argeo.cms.swt.acr.SwtUiProvider" policy="dynamic" target="(service.pid=argeo.library.ui.contentEntryArea)"/>
+   <property name="service.ranking" type="Integer" value="-1000"/>
+   <properties entry="config/contentLayer.properties"/>
+</scr:component>
diff --git a/swt/org.argeo.app.ui/OSGI-INF/dashboard.xml b/swt/org.argeo.app.ui/OSGI-INF/dashboard.xml
new file mode 100644 (file)
index 0000000..8ee65b3
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="Default Dashboard">
+   <implementation class="org.argeo.app.ui.DefaultDashboard"/>
+   <service>
+      <provide interface="org.argeo.cms.swt.acr.SwtUiProvider"/>
+   </service>
+   <property name="service.ranking" type="Integer" value="-1000"/>
+   <properties entry="config/dashboard.properties"/>
+</scr:component>
diff --git a/swt/org.argeo.app.ui/OSGI-INF/dashboardLayer.xml b/swt/org.argeo.app.ui/OSGI-INF/dashboardLayer.xml
new file mode 100644 (file)
index 0000000..c8c6ac9
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="Dashboard Layer">
+   <implementation class="org.argeo.app.ui.DefaultEditionLayer"/>
+   <service>
+      <provide interface="org.argeo.app.ui.SuiteLayer"/>
+   </service>
+   <property name="service.ranking" type="Integer" value="-1000"/>
+   <properties entry="config/dashboardLayer.properties"/>
+</scr:component>
diff --git a/swt/org.argeo.app.ui/OSGI-INF/documentUiProvider.xml b/swt/org.argeo.app.ui/OSGI-INF/documentUiProvider.xml
new file mode 100644 (file)
index 0000000..97cb529
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
+   <implementation class="org.argeo.app.ui.publish.DocumentUiProvider"/>
+   <service>
+      <provide interface="org.argeo.cms.swt.acr.SwtUiProvider"/>
+   </service>
+   <property name="service.ranking" type="Integer" value="-1000"/>
+   <properties entry="config/documentUiProvider.properties"/>
+</scr:component>
diff --git a/swt/org.argeo.app.ui/OSGI-INF/documentsFolder.xml b/swt/org.argeo.app.ui/OSGI-INF/documentsFolder.xml
new file mode 100644 (file)
index 0000000..f1dc0fd
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="Documents Folder">
+   <implementation class="org.argeo.app.ui.library.DocumentsFolderUiProvider"/>
+   <service>
+      <provide interface="org.argeo.cms.swt.acr.SwtUiProvider"/>
+   </service>
+   <property name="service.ranking" type="Integer" value="-1000"/>
+   <properties entry="config/documentsFolder.properties"/>
+   <reference bind="setNodeFileSystemProvider" cardinality="1..1" interface="java.nio.file.spi.FileSystemProvider" name="FileSystemProvider" policy="dynamic" target="(service.pid=org.argeo.api.fsProvider)"/>
+</scr:component>
diff --git a/swt/org.argeo.app.ui/OSGI-INF/eventRecorder.xml b/swt/org.argeo.app.ui/OSGI-INF/eventRecorder.xml
new file mode 100644 (file)
index 0000000..ab1a6ae
--- /dev/null
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init" deactivate="destroy" name="Event Recorder">
+   <implementation class="org.argeo.app.ui.EventRecorder"/>
+   <service>
+      <provide interface="org.osgi.service.event.EventHandler"/>
+   </service>
+   <properties entry="config/eventRecorder.properties"/>
+</scr:component>
diff --git a/swt/org.argeo.app.ui/OSGI-INF/footer.xml b/swt/org.argeo.app.ui/OSGI-INF/footer.xml
new file mode 100644 (file)
index 0000000..8d20231
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init" deactivate="destroy" immediate="false" name="Default Suite Footer">
+   <implementation class="org.argeo.app.ui.DefaultFooter"/>
+   <service>
+      <provide interface="org.argeo.cms.swt.acr.SwtUiProvider"/>
+   </service>
+   <property name="service.ranking" type="Integer" value="-1000"/>
+   <properties entry="config/footer.properties"/>
+</scr:component>
diff --git a/swt/org.argeo.app.ui/OSGI-INF/fsEntryArea.xml b/swt/org.argeo.app.ui/OSGI-INF/fsEntryArea.xml
new file mode 100644 (file)
index 0000000..beb8cf2
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
+   <implementation class="org.argeo.app.ui.library.DocumentsTreeUiProvider"/>
+   <service>
+      <provide interface="org.argeo.cms.swt.acr.SwtUiProvider"/>
+   </service>
+   <property name="service.ranking" type="Integer" value="-1000"/>
+   <properties entry="config/fsEntryArea.properties"/>
+   <reference bind="setNodeFileSystemProvider" cardinality="1..1" interface="java.nio.file.spi.FileSystemProvider" name="FileSystemProvider" policy="dynamic" target="(service.pid=org.argeo.api.fsProvider)"/>
+   <reference bind="setRepository" cardinality="1..1" interface="javax.jcr.Repository" name="Repository" policy="static" target="(cn=ego)"/>
+</scr:component>
diff --git a/swt/org.argeo.app.ui/OSGI-INF/groupUiProvider.xml b/swt/org.argeo.app.ui/OSGI-INF/groupUiProvider.xml
new file mode 100644 (file)
index 0000000..64eb06f
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
+   <implementation class="org.argeo.app.ui.people.GroupUiProvider"/>
+   <service>
+      <provide interface="org.argeo.cms.swt.acr.SwtUiProvider"/>
+   </service>
+   <property name="service.ranking" type="Integer" value="-1000"/>
+   <properties entry="config/groupUiProvider.properties"/>
+   <reference bind="setCmsUserManager" cardinality="1..1" interface="org.argeo.api.cms.directory.CmsUserManager" name="CmsUserManager" policy="static"/>
+</scr:component>
diff --git a/swt/org.argeo.app.ui/OSGI-INF/header.xml b/swt/org.argeo.app.ui/OSGI-INF/header.xml
new file mode 100644 (file)
index 0000000..cb792e5
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init" deactivate="destroy" immediate="false" name="Default Suite Header">
+   <implementation class="org.argeo.app.ui.DefaultHeader"/>
+   <service>
+      <provide interface="org.argeo.cms.swt.acr.SwtUiProvider"/>
+   </service>
+   <property name="service.ranking" type="Integer" value="-1000"/>
+   <properties entry="config/header.properties"/>
+</scr:component>
diff --git a/swt/org.argeo.app.ui/OSGI-INF/hierarchyUnitUiProvider.xml b/swt/org.argeo.app.ui/OSGI-INF/hierarchyUnitUiProvider.xml
new file mode 100644 (file)
index 0000000..1a8b347
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
+   <implementation class="org.argeo.app.ui.people.HierarchyUnitUiProvider"/>
+   <service>
+      <provide interface="org.argeo.cms.swt.acr.SwtUiProvider"/>
+   </service>
+   <property name="service.ranking" type="Integer" value="-1000"/>
+   <properties entry="config/hierarchyUnitUiProvider.properties"/>
+   <reference bind="setCmsUserManager" cardinality="1..1" interface="org.argeo.api.cms.directory.CmsUserManager" name="CmsUserManager" policy="static"/>
+</scr:component>
diff --git a/swt/org.argeo.app.ui/OSGI-INF/l10n/bundle.properties b/swt/org.argeo.app.ui/OSGI-INF/l10n/bundle.properties
new file mode 100644 (file)
index 0000000..d4bf08a
--- /dev/null
@@ -0,0 +1,123 @@
+dashboard=dashboard
+#people=contacts
+documents=documents
+locations=locations
+recentItems=recent items
+
+appTitle=Argeo Suite
+
+#
+# PEOPLE
+# org.argeo.people.ui.PeopleMsg
+#
+person=person
+user=user
+org=organisation
+group=group
+
+# NewPersonWizard
+firstName=First Name
+lastName=Last Name
+salutation=Salutation
+email=Email
+personWizardWindowTitle=New person
+personWizardPageTitle=Create a contact
+personWizardFeedback=Contact was created
+
+# NewOrgWizard
+legalName=Legal name
+legalForm=Legal form
+vatId=VAT ID
+orgWizardWindowTitle=New organisation
+orgWizardPageTitle=Create an organisation
+orgWizardFeedback=Organisation was created
+
+# Roles
+userAdminRole=Can create users and modify them
+groupAdminRole=Can create groups and organisations and modify them
+publisherRole=Can validate and publish content
+coworkerRole=Is an active user of the organisation
+
+# Group
+chooseAMember=Choose a member
+
+# ContextAddressComposite
+chooseAnOrganisation=Choose an organisation
+street=Street
+streetComplement=Street complement
+zipCode=Zip code
+city=City
+state=State
+country=Country
+geopoint=Geopoint
+
+# FilteredOrderableEntityTable
+filterHelp=Type filter criterion separated by a space
+
+# BankAccountComposite
+accountHolder=Account holder
+bankName=Bank name
+currency=Currency
+accountNumber=Account number
+bankNumber=Bank number
+BIC=BIC
+IBAN=IBAN
+
+# EditJobDialog
+position=Role
+chosenItem=Chose item
+department=Department
+isPrimary=Is primary
+searchAndChooseEntity=Search and choose a corresponding entity
+
+# ContactListCTab (e4)
+notes=Notes
+addAContact=Add a contact
+contactValue=Contact value
+linkedCompany=Linked company
+
+# OrgAdminInfoCTab (e4)
+paymentAccount=Payment account
+
+# OrgEditor (e4)
+orgDetails=Details
+orgActivityLog=Activity log
+team=Team
+orgAdmin=Admin.
+
+# PersonEditor (e4)
+personDetails=Contact details
+personActivityLog=Activity log
+personOrgs=Organisations
+personSecurity=Security
+
+# PersonSecurityCTab (e4)
+resetPassword=Reset password
+
+# Generic
+label=Label
+aCustomLabel=A custom label
+description=Description
+value=Value
+name=Name
+primary=Primary
+add=Add
+save=Save
+pickUp=Pick up
+
+# Tags
+confirmNewTag=Tag #{0} is not yet registered. Are you sure you want to create it?
+cannotCreateTag=Tag #{0} is not yet registered and you don't have enough rights to create it.
+
+# People
+people=people
+
+# Library
+content=content
+
+# Geo
+map=map
+
+# Feedback messages
+allFieldsMustBeSet=All fields must be set
+
diff --git a/swt/org.argeo.app.ui/OSGI-INF/l10n/bundle_de.properties b/swt/org.argeo.app.ui/OSGI-INF/l10n/bundle_de.properties
new file mode 100644 (file)
index 0000000..0af19c2
--- /dev/null
@@ -0,0 +1,98 @@
+dashboard=dashboard
+people=Kontakte
+documents=Dokumente
+locations=Orte
+recentItems=neulich
+
+appTitle=Argeo Suite
+
+#
+# PEOPLE
+# org.argeo.people.ui.PeopleMsg
+#
+person=Person
+organisation=Organisation
+
+# NewPersonWizard
+firstName=Vorname
+lastName=Nachname
+salutation=Salutation
+email=E-Mail
+personWizardWindowTitle=Neue Person
+personWizardPageTitle=Kontakt erstellen
+
+# NewOrgWizard
+legalName=Name
+legalForm=Geschäftsform
+vatId=Ust ID
+orgWizardWindowTitle=Neue Organisation
+orgWizardPageTitle=Organisation erstellen
+
+
+# ContextAddressComposite
+chooseAnOrganisation=Organisation wählen
+street=Strasse
+streetComplement=Strasse Zusatz
+zipCode=PLZ
+city=Stadt
+state=Bundesland
+country=Land
+geopoint=Geopoint
+
+# FilteredOrderableEntityTable
+filterHelp=Type filter criterion separated by a space
+
+# BankAccountComposite
+accountHolder=Kontoinhaber 
+bankName=Name der Bank
+currency=Währung
+accountNumber=Kontonummer
+bankNumber=BLZ
+BIC=BIC
+IBAN=IBAN
+
+# EditJobDialog
+position=Rolle
+chosenItem=Auswahl
+department=Abteilung
+isPrimary=Ist Primär
+searchAndChooseEntity=Suche und wähle ein zugehöriges Objekt
+
+# ContactListCTab (e4)
+notes=Bemerkungen
+addAContact=Kontakt hinzufügen
+contactValue=Kontakt value
+linkedCompany=zugehörige Firma
+
+# OrgAdminInfoCTab (e4)
+paymentAccount=Geschäftskonto
+
+# OrgEditor (e4)
+orgDetails=Details
+orgActivityLog=Aktivitäten Log
+team=Team
+orgAdmin=Admin.
+
+# PersonEditor (e4)
+personDetails=Kontakt Daten
+personActivityLog=Aktivitäten Log
+personOrgs=Organisationen
+personSecurity=Sicherheit
+
+# PersonSecurityCTab (e4)
+resetPassword=Passwort zurücksetzen
+
+# Generic
+label=Beschriftung
+aCustomLabel=Eine spezifische Beschriftung
+description=Beschreibung
+value=Wert
+name=Name
+primary=Haupt-
+add=Hinzufügen
+save=Speichern
+pickUp=Aussuchen
+
+# Tags
+confirmNewTag=Das Hashtag '{0}' existiert noch nicht. WollenSie es hinzufügen?
+cannotCreateTag=Das Hashtag '{0}' existiert nicht uns Sie haben nicht die Rechte, um es hinzufügen.
diff --git a/swt/org.argeo.app.ui/OSGI-INF/l10n/bundle_fr.properties b/swt/org.argeo.app.ui/OSGI-INF/l10n/bundle_fr.properties
new file mode 100644 (file)
index 0000000..0015269
--- /dev/null
@@ -0,0 +1,117 @@
+dashboard=dashboard
+people=contacts
+documents=documents
+locations=lieux
+recentItems=récent
+
+appTitle=Argeo Suite
+
+#
+# GENERIC
+#
+
+#
+# PEOPLE
+# org.argeo.people.ui.PeopleMsg
+#
+person=personne
+user=utilisateur
+org=organisation
+group=groupe
+
+# NewPersonWizard
+firstName=Prénom
+lastName=Nom
+salutation=Salutation
+email=Email
+personWizardWindowTitle=Nouvelle personne
+personWizardPageTitle=Créer un contact
+personWizardFeedback=Le contact a Ã©té créé
+
+# NewOrgWizard
+legalName=Nom
+legalForm=Forme légale
+vatId=ID TVA
+orgWizardWindowTitle=Nouvelle organisation
+orgWizardPageTitle=Créer une organisation
+orgWizardFeedback=L'organisation a Ã©té crée
+
+# Roles
+userAdminRole=Peut créer des utilisateurs et les modifier
+groupAdminRole=Peut créer des groupes et des organisations et les modifier
+publisherRole=Peut publier et valider du contenu
+coworkerRole=Est un membre en activité de l'organisation
+
+# Group
+chooseAMember=Choisir un membre
+
+# ContextAddressComposite
+chooseAnOrganisation=Choisir une organisation
+street=Rue
+streetComplement=Complément rue
+zipCode=Code postal
+city=Ville
+state=État
+country=Pays
+geopoint=Géocoordonnées
+
+# FilteredOrderableEntityTable
+filterHelp=Sasir les critères de filtrage séparés par des espaces 
+
+# BankAccountComposite
+accountHolder=Propriétaire du compte
+bankName=Nom de la banque
+currency=Devise
+accountNumber=Numéro de compte
+bankNumber=Numéro de banque
+BIC=BIC
+IBAN=IBAN
+
+# EditJobDialog
+position=Rôle
+chosenItem=Choisir une Ã©lément
+department=Service
+isPrimary=Principal
+searchAndChooseEntity=Cherhcer et choisir l'entitée correspondante
+
+# ContactListCTab (e4)
+notes=Notes
+addAContact=Ajouter un contact
+contactValue=Valeur
+linkedCompany=Entreprise liée
+
+# OrgAdminInfoCTab (e4)
+paymentAccount=Compte de paiement
+
+# OrgEditor (e4)
+orgDetails=Détails
+orgActivityLog=Activités
+team=Équipe
+orgAdmin=Admin.
+
+# PersonEditor (e4)
+personDetails=Détails du contact
+personActivityLog=Activités
+personOrgs=Organisations
+personSecurity=Accès
+
+# PersonSecurityCTab (e4)
+resetPassword=Force le mot de passe
+
+# Generic
+label=Étiquette
+aCustomLabel=Une Ã©tiquette spécifique
+description=Description
+value=Valeur
+name=Nom
+primary=Principal
+add=Ajouter
+save=Sauver
+pickUp=Choisir
+
+# Tags
+confirmNewTag=Le tag #{0} n'existe pas encore. Voulez-vous le créer?
+cannotCreateTag=Le tag #{0} n'existe pas encore et vous n'avez pas les droits pour le créer.
+
+# Feedback messages
+allFieldsMustBeSet=Toutes les données doivent Ãªtre renseignées
diff --git a/swt/org.argeo.app.ui/OSGI-INF/leadPane.xml b/swt/org.argeo.app.ui/OSGI-INF/leadPane.xml
new file mode 100644 (file)
index 0000000..7583aa1
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init" deactivate="destroy" immediate="false" name="Default Lead Pane">
+   <implementation class="org.argeo.app.ui.DefaultLeadPane"/>
+   <service>
+      <provide interface="org.argeo.cms.swt.acr.SwtUiProvider"/>
+   </service>
+   <property name="service.ranking" type="Integer" value="-1000"/>
+   <properties entry="config/leadPane.properties"/>
+   <property name="defaultLayers" type="String">argeo.suite.ui.dashboardLayer
+argeo.library.ui.contentLayer
+argeo.people.ui.peopleLayer
+argeo.geo.ui.mapLayer
+   </property>
+   <reference bind="addLayer" cardinality="1..n" interface="org.argeo.app.ui.SuiteLayer" name="SuiteLayer" policy="dynamic" unbind="removeLayer"/>
+</scr:component>
diff --git a/swt/org.argeo.app.ui/OSGI-INF/loginScreen.xml b/swt/org.argeo.app.ui/OSGI-INF/loginScreen.xml
new file mode 100644 (file)
index 0000000..eab7592
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="Default Login Screen">
+   <implementation class="org.argeo.app.ui.DefaultLoginScreen"/>
+   <properties entry="config/loginScreen.properties"/>
+   <service>
+      <provide interface="org.argeo.cms.swt.acr.SwtUiProvider"/>
+   </service>
+   <property name="service.ranking" type="Integer" value="-1000"/>
+   <reference bind="setCmsContext" cardinality="1..1" interface="org.argeo.api.cms.CmsContext" name="CmsContext" policy="static"/>
+</scr:component>
diff --git a/swt/org.argeo.app.ui/OSGI-INF/mapLayer.xml b/swt/org.argeo.app.ui/OSGI-INF/mapLayer.xml
new file mode 100644 (file)
index 0000000..1e72041
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init" deactivate="destroy" name="Map Layer">
+   <implementation class="org.argeo.app.ui.DefaultEditionLayer"/>
+   <properties entry="config/mapLayer.properties"/>
+   <service>
+      <provide interface="org.argeo.app.ui.SuiteLayer"/>
+   </service>
+   <property name="service.ranking" type="Integer" value="-1000"/>
+   <reference bind="setWorkArea" cardinality="1..1" interface="org.argeo.cms.swt.acr.SwtUiProvider" name="CmsUiProvider" policy="dynamic" target="(service.pid=argeo.geo.ui.overviewMap)"/>
+</scr:component>
diff --git a/swt/org.argeo.app.ui/OSGI-INF/overviewMap.xml b/swt/org.argeo.app.ui/OSGI-INF/overviewMap.xml
new file mode 100644 (file)
index 0000000..f459a58
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
+   <implementation class="org.argeo.app.ui.openlayers.OverviewMap"/>
+   <properties entry="config/overviewMap.properties"/>
+   <service>
+      <provide interface="org.argeo.cms.swt.acr.SwtUiProvider"/>
+   </service>
+   <property name="service.ranking" type="Integer" value="-1000"/>
+   <reference bind="setJcrContentProvider" cardinality="1..1" interface="org.argeo.cms.jcr.acr.JcrContentProvider" name="JcrContentProvider" policy="static"/>
+</scr:component>
diff --git a/swt/org.argeo.app.ui/OSGI-INF/peopleEntryArea.xml b/swt/org.argeo.app.ui/OSGI-INF/peopleEntryArea.xml
new file mode 100644 (file)
index 0000000..d3d5b29
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
+   <implementation class="org.argeo.app.ui.people.PeopleEntryArea"/>
+   <service>
+      <provide interface="org.argeo.cms.swt.acr.SwtUiProvider"/>
+   </service>
+   <properties entry="config/peopleEntryArea.properties"/>
+   <property name="service.ranking" type="Integer" value="-1000"/>
+   <reference bind="setCmsUserManager" cardinality="1..1" interface="org.argeo.api.cms.directory.CmsUserManager" name="CmsUserManager" policy="static"/>
+   <reference bind="setContentRepository" cardinality="1..1" interface="org.argeo.api.acr.ContentRepository" name="ContentRepository" policy="static"/>
+</scr:component>
diff --git a/swt/org.argeo.app.ui/OSGI-INF/peopleLayer.xml b/swt/org.argeo.app.ui/OSGI-INF/peopleLayer.xml
new file mode 100644 (file)
index 0000000..95bc27d
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init" deactivate="destroy" name="People Layer">
+   <implementation class="org.argeo.app.ui.DefaultEditionLayer"/>
+   <properties entry="config/peopleLayer.properties"/>
+   <service>
+      <provide interface="org.argeo.app.ui.SuiteLayer"/>
+   </service>
+   <property name="service.ranking" type="Integer" value="-1000"/>
+   <reference bind="setEntryArea" cardinality="1..1" interface="org.argeo.cms.swt.acr.SwtUiProvider" name="CmsUiProvider" policy="dynamic" target="(service.pid=argeo.people.ui.peopleEntryArea)"/>
+</scr:component>
diff --git a/swt/org.argeo.app.ui/OSGI-INF/personUiProvider.xml b/swt/org.argeo.app.ui/OSGI-INF/personUiProvider.xml
new file mode 100644 (file)
index 0000000..950301f
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init">
+   <implementation class="org.argeo.app.ui.people.PersonUiProvider"/>
+   <service>
+      <provide interface="org.argeo.cms.swt.acr.SwtUiProvider"/>
+   </service>
+   <property name="service.ranking" type="Integer" value="-1000"/>
+   <property name="availableRoles" type="String">
+   </property>
+   <properties entry="config/personUiProvider.properties"/>
+   <reference bind="setCmsUserManager" cardinality="1..1" interface="org.argeo.api.cms.directory.CmsUserManager" name="CmsUserManager" policy="static"/>
+</scr:component>
diff --git a/swt/org.argeo.app.ui/OSGI-INF/publishEntryArea.xml b/swt/org.argeo.app.ui/OSGI-INF/publishEntryArea.xml
new file mode 100644 (file)
index 0000000..0c10d34
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
+   <implementation class="org.argeo.app.ui.publish.PublishEntryArea"/>
+   <service>
+      <provide interface="org.argeo.cms.swt.acr.SwtUiProvider"/>
+   </service>
+   <property name="service.ranking" type="Integer" value="-1000"/>
+   <properties entry="config/publishEntryArea.properties"/>
+</scr:component>
\ No newline at end of file
diff --git a/swt/org.argeo.app.ui/OSGI-INF/publishUiProvider.xml b/swt/org.argeo.app.ui/OSGI-INF/publishUiProvider.xml
new file mode 100644 (file)
index 0000000..148da14
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
+   <implementation class="org.argeo.app.ui.publish.PublishUiProvider"/>
+   <service>
+      <provide interface="org.argeo.cms.swt.acr.SwtUiProvider"/>
+   </service>
+   <property name="service.ranking" type="Integer" value="-1000"/>
+   <properties entry="config/publishUiProvider.properties"/>
+</scr:component>
diff --git a/swt/org.argeo.app.ui/OSGI-INF/recentItems.xml b/swt/org.argeo.app.ui/OSGI-INF/recentItems.xml
new file mode 100644 (file)
index 0000000..8656e84
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init" name="Default Recent Items">
+   <implementation class="org.argeo.app.ui.RecentItems"/>
+   <service>
+      <provide interface="org.argeo.cms.swt.acr.SwtUiProvider"/>
+   </service>
+   <property name="service.ranking" type="Integer" value="-1000"/>
+   <properties entry="config/recentItems.properties"/>
+</scr:component>
diff --git a/swt/org.argeo.app.ui/OSGI-INF/termsEntryArea.xml b/swt/org.argeo.app.ui/OSGI-INF/termsEntryArea.xml
new file mode 100644 (file)
index 0000000..6387f1a
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="Terms Entry Area">
+   <implementation class="org.argeo.app.ui.TermsEntryArea"/>
+   <service>
+      <provide interface="org.argeo.cms.swt.acr.SwtUiProvider"/>
+   </service>
+   <property name="service.ranking" type="Integer" value="-1000"/>
+   <properties entry="config/termsEntryArea.properties"/>
+</scr:component>
diff --git a/swt/org.argeo.app.ui/OSGI-INF/termsLayer.xml b/swt/org.argeo.app.ui/OSGI-INF/termsLayer.xml
new file mode 100644 (file)
index 0000000..a3ffef3
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="Terms Layer">
+   <implementation class="org.argeo.app.ui.DefaultEditionLayer"/>
+   <service>
+      <provide interface="org.argeo.app.ui.SuiteLayer"/>
+   </service>
+   <property name="service.ranking" type="Integer" value="-1000"/>
+   <properties entry="config/termsLayer.properties"/>
+   <reference bind="setEntryArea" cardinality="1..1" interface="org.argeo.cms.swt.acr.SwtUiProvider" name="CmsUiProvider" policy="dynamic" target="(service.pid=argeo.suite.ui.termsEntryArea)"/>
+</scr:component>
diff --git a/swt/org.argeo.app.ui/OSGI-INF/wwwLayer.xml b/swt/org.argeo.app.ui/OSGI-INF/wwwLayer.xml
new file mode 100644 (file)
index 0000000..dc316bd
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" activate="init" deactivate="destroy">
+   <implementation class="org.argeo.app.ui.DefaultEditionLayer"/>
+   <properties entry="config/wwwLayer.properties"/>
+   <service>
+      <provide interface="org.argeo.app.ui.SuiteLayer"/>
+   </service>
+   <property name="service.ranking" type="Integer" value="-1000"/>
+   <reference bind="setWorkArea" cardinality="1..1" interface="org.argeo.cms.swt.acr.SwtUiProvider" name="CmsUiProvider" policy="dynamic" target="(service.pid=argeo.publishing.ui.documentUiProvider)"/>
+</scr:component>
diff --git a/swt/org.argeo.app.ui/bnd.bnd b/swt/org.argeo.app.ui/bnd.bnd
new file mode 100644 (file)
index 0000000..4a74f2d
--- /dev/null
@@ -0,0 +1,42 @@
+Service-Component:\
+OSGI-INF/cmsApp.xml,\
+OSGI-INF/eventRecorder.xml,\
+OSGI-INF/header.xml,\
+OSGI-INF/footer.xml,\
+OSGI-INF/leadPane.xml,\
+OSGI-INF/loginScreen.xml,\
+OSGI-INF/recentItems.xml,\
+OSGI-INF/adminLeadPane.xml,\
+OSGI-INF/termsEntryArea.xml,\
+OSGI-INF/termsLayer.xml,\
+OSGI-INF/dashboard.xml,\
+OSGI-INF/dashboardLayer.xml,\
+OSGI-INF/peopleEntryArea.xml,\
+OSGI-INF/peopleLayer.xml,\
+OSGI-INF/personUiProvider.xml,\
+OSGI-INF/groupUiProvider.xml,\
+OSGI-INF/hierarchyUnitUiProvider.xml,\
+OSGI-INF/contentEntryArea.xml,\
+OSGI-INF/contentLayer.xml,\
+OSGI-INF/documentsFolder.xml,\
+OSGI-INF/fsEntryArea.xml,\
+OSGI-INF/mapLayer.xml,\
+OSGI-INF/overviewMap.xml,\
+OSGI-INF/wwwLayer.xml,\
+OSGI-INF/documentUiProvider.xml,\
+OSGI-INF/publishEntryArea.xml,\
+OSGI-INF/publishUiProvider.xml,\
+
+
+
+Import-Package:\
+org.argeo.cms.osgi,\
+org.argeo.cms.ui.widgets,\
+org.eclipse.swt,\
+org.osgi.framework,\
+org.eclipse.core.commands.common,\
+org.eclipse.jface.window,\
+org.eclipse.jface.dialogs,\
+org.eclipse.rap.rwt,\
+javax.servlet.*;version="[3,5)",\
+*
diff --git a/swt/org.argeo.app.ui/build.properties b/swt/org.argeo.app.ui/build.properties
new file mode 100644 (file)
index 0000000..d829967
--- /dev/null
@@ -0,0 +1,10 @@
+output.. = bin/
+bin.includes = META-INF/,\
+               .,\
+               OSGI-INF/,\
+               config/,\
+               OSGI-INF/loginScreen.xml,\
+               OSGI-INF/dashboard.xml,\
+               OSGI-INF/recentItems.xml,\
+               OSGI-INF/dashboardLayer.xml
+source.. = src/
diff --git a/swt/org.argeo.app.ui/config/adminLeadPane.properties b/swt/org.argeo.app.ui/config/adminLeadPane.properties
new file mode 100644 (file)
index 0000000..90b9b04
--- /dev/null
@@ -0,0 +1 @@
+service.pid=argeo.suite.ui.adminLeadPane
diff --git a/swt/org.argeo.app.ui/config/cmsApp.properties b/swt/org.argeo.app.ui/config/cmsApp.properties
new file mode 100644 (file)
index 0000000..6735f81
--- /dev/null
@@ -0,0 +1,5 @@
+service.pid=argeo.suite.ui.app
+
+event.topics=argeo/suite/*
+
+argeo.cms.app.contextName=argeo
\ No newline at end of file
diff --git a/swt/org.argeo.app.ui/config/contentEntryArea.properties b/swt/org.argeo.app.ui/config/contentEntryArea.properties
new file mode 100644 (file)
index 0000000..855fe97
--- /dev/null
@@ -0,0 +1 @@
+service.pid=argeo.library.ui.contentEntryArea
diff --git a/swt/org.argeo.app.ui/config/contentLayer.properties b/swt/org.argeo.app.ui/config/contentLayer.properties
new file mode 100644 (file)
index 0000000..c1ca8e3
--- /dev/null
@@ -0,0 +1,6 @@
+service.pid=argeo.library.ui.contentLayer
+
+title=%content
+icon=documents
+
+entity.type=nt:folder,nt:file,entity:space,entity:document
diff --git a/swt/org.argeo.app.ui/config/dashboard.properties b/swt/org.argeo.app.ui/config/dashboard.properties
new file mode 100644 (file)
index 0000000..1832543
--- /dev/null
@@ -0,0 +1 @@
+service.pid=argeo.suite.ui.dashboard
diff --git a/swt/org.argeo.app.ui/config/dashboardLayer.properties b/swt/org.argeo.app.ui/config/dashboardLayer.properties
new file mode 100644 (file)
index 0000000..79abe4c
--- /dev/null
@@ -0,0 +1,4 @@
+service.pid=argeo.suite.ui.dashboardLayer
+
+title=Dashboard
+icon=dashboard
\ No newline at end of file
diff --git a/swt/org.argeo.app.ui/config/documentUiProvider.properties b/swt/org.argeo.app.ui/config/documentUiProvider.properties
new file mode 100644 (file)
index 0000000..339a444
--- /dev/null
@@ -0,0 +1,3 @@
+service.pid=argeo.publishing.ui.documentUiProvider
+
+entity.type=nt:file
\ No newline at end of file
diff --git a/swt/org.argeo.app.ui/config/documentsFolder.properties b/swt/org.argeo.app.ui/config/documentsFolder.properties
new file mode 100644 (file)
index 0000000..349e930
--- /dev/null
@@ -0,0 +1 @@
+entity.type=nt:folder
\ No newline at end of file
diff --git a/swt/org.argeo.app.ui/config/eventRecorder.properties b/swt/org.argeo.app.ui/config/eventRecorder.properties
new file mode 100644 (file)
index 0000000..6503863
--- /dev/null
@@ -0,0 +1,3 @@
+service.pid=argeo.suite.ui.eventRecorder
+
+event.topics=argeo/suite/*
\ No newline at end of file
diff --git a/swt/org.argeo.app.ui/config/footer.properties b/swt/org.argeo.app.ui/config/footer.properties
new file mode 100644 (file)
index 0000000..12aca56
--- /dev/null
@@ -0,0 +1 @@
+service.pid=argeo.suite.ui.footer
diff --git a/swt/org.argeo.app.ui/config/fsEntryArea.properties b/swt/org.argeo.app.ui/config/fsEntryArea.properties
new file mode 100644 (file)
index 0000000..0bceaf0
--- /dev/null
@@ -0,0 +1 @@
+service.pid=argeo.library.ui.fsEntryArea
diff --git a/swt/org.argeo.app.ui/config/groupUiProvider.properties b/swt/org.argeo.app.ui/config/groupUiProvider.properties
new file mode 100644 (file)
index 0000000..d3c2fb3
--- /dev/null
@@ -0,0 +1,3 @@
+service.pid=argeo.people.ui.groupUiProvider
+
+entity.type=ldap:groupOfNames
\ No newline at end of file
diff --git a/swt/org.argeo.app.ui/config/header.properties b/swt/org.argeo.app.ui/config/header.properties
new file mode 100644 (file)
index 0000000..034d5f5
--- /dev/null
@@ -0,0 +1,4 @@
+service.pid=argeo.suite.ui.header
+argeo.suite.ui=true
+
+argeo.suite.ui.header.title=%appTitle
\ No newline at end of file
diff --git a/swt/org.argeo.app.ui/config/hierarchyUnitUiProvider.properties b/swt/org.argeo.app.ui/config/hierarchyUnitUiProvider.properties
new file mode 100644 (file)
index 0000000..2611a39
--- /dev/null
@@ -0,0 +1,3 @@
+service.pid=argeo.people.ui.hierarchyUnitUiProvider
+
+entity.type=ldap:organizationalUnit,ldap:nsContainer,ldap:dcObject
\ No newline at end of file
diff --git a/swt/org.argeo.app.ui/config/leadPane.properties b/swt/org.argeo.app.ui/config/leadPane.properties
new file mode 100644 (file)
index 0000000..0d7b193
--- /dev/null
@@ -0,0 +1 @@
+service.pid=argeo.suite.ui.leadPane
diff --git a/swt/org.argeo.app.ui/config/loginScreen.properties b/swt/org.argeo.app.ui/config/loginScreen.properties
new file mode 100644 (file)
index 0000000..332614d
--- /dev/null
@@ -0,0 +1 @@
+service.pid=argeo.suite.ui.loginScreen
diff --git a/swt/org.argeo.app.ui/config/mapLayer.properties b/swt/org.argeo.app.ui/config/mapLayer.properties
new file mode 100644 (file)
index 0000000..37bf3c7
--- /dev/null
@@ -0,0 +1,6 @@
+service.pid=argeo.geo.ui.mapLayer
+
+title=%map
+icon=map
+
+entity.type=entity:geopoint
diff --git a/swt/org.argeo.app.ui/config/overviewMap.properties b/swt/org.argeo.app.ui/config/overviewMap.properties
new file mode 100644 (file)
index 0000000..d842c98
--- /dev/null
@@ -0,0 +1 @@
+service.pid=argeo.geo.ui.overviewMap
diff --git a/swt/org.argeo.app.ui/config/peopleEntryArea.properties b/swt/org.argeo.app.ui/config/peopleEntryArea.properties
new file mode 100644 (file)
index 0000000..37b28f9
--- /dev/null
@@ -0,0 +1 @@
+service.pid=argeo.people.ui.peopleEntryArea
diff --git a/swt/org.argeo.app.ui/config/peopleLayer.properties b/swt/org.argeo.app.ui/config/peopleLayer.properties
new file mode 100644 (file)
index 0000000..9224d1b
--- /dev/null
@@ -0,0 +1,7 @@
+service.pid=argeo.people.ui.peopleLayer
+
+icon=people
+weights=4000,6000
+title=%people
+
+entity.type=ldap:inetOrgPerson,ldap:groupOfNames,ldap:organizationalUnit,ldap:nsContainer,ldap:dcObject
\ No newline at end of file
diff --git a/swt/org.argeo.app.ui/config/personUiProvider.properties b/swt/org.argeo.app.ui/config/personUiProvider.properties
new file mode 100644 (file)
index 0000000..27963d1
--- /dev/null
@@ -0,0 +1,3 @@
+service.pid=argeo.people.ui.personUiProvider
+
+entity.type=ldap:inetOrgPerson,ldap:posixAccount
\ No newline at end of file
diff --git a/swt/org.argeo.app.ui/config/publishEntryArea.properties b/swt/org.argeo.app.ui/config/publishEntryArea.properties
new file mode 100644 (file)
index 0000000..f391774
--- /dev/null
@@ -0,0 +1 @@
+service.pid=argeo.publish.ui.publishEntryArea
diff --git a/swt/org.argeo.app.ui/config/publishUiProvider.properties b/swt/org.argeo.app.ui/config/publishUiProvider.properties
new file mode 100644 (file)
index 0000000..7555eda
--- /dev/null
@@ -0,0 +1,3 @@
+service.pid=argeo.publishing.ui.publishUiProvider
+
+entity.type=entity:document
\ No newline at end of file
diff --git a/swt/org.argeo.app.ui/config/recentItems.properties b/swt/org.argeo.app.ui/config/recentItems.properties
new file mode 100644 (file)
index 0000000..7321c55
--- /dev/null
@@ -0,0 +1 @@
+service.pid=argeo.suite.ui.recentItems
diff --git a/swt/org.argeo.app.ui/config/termsEntryArea.properties b/swt/org.argeo.app.ui/config/termsEntryArea.properties
new file mode 100644 (file)
index 0000000..cd31517
--- /dev/null
@@ -0,0 +1 @@
+service.pid=argeo.suite.ui.termsEntryArea
diff --git a/swt/org.argeo.app.ui/config/termsLayer.properties b/swt/org.argeo.app.ui/config/termsLayer.properties
new file mode 100644 (file)
index 0000000..2c0532e
--- /dev/null
@@ -0,0 +1,5 @@
+service.pid=argeo.suite.ui.termsLayer
+title=Terms
+icon=dashboard
+
+entity.type=entity:terms,entity:term
\ No newline at end of file
diff --git a/swt/org.argeo.app.ui/config/wwwLayer.properties b/swt/org.argeo.app.ui/config/wwwLayer.properties
new file mode 100644 (file)
index 0000000..d29fa5b
--- /dev/null
@@ -0,0 +1,4 @@
+service.pid=argeo.publishing.ui.wwwLayer
+
+title=Web
+icon=map
\ No newline at end of file
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/DefaultDashboard.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/DefaultDashboard.java
new file mode 100644 (file)
index 0000000..aebacfa
--- /dev/null
@@ -0,0 +1,30 @@
+package org.argeo.app.ui;
+
+import org.argeo.api.acr.Content;
+import org.argeo.api.cms.ux.CmsView;
+import org.argeo.cms.CurrentUser;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.ui.CmsUiProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+
+/** Provides a dashboard. */
+public class DefaultDashboard implements CmsUiProvider {
+
+       @Override
+       public Control createUiPart(Composite parent, Content context) {
+               parent.setLayout(new GridLayout());
+               CmsView cmsView = CmsSwtUtils.getCmsView(parent);
+               if (cmsView.isAnonymous())
+                       throw new IllegalStateException("No user is not logged in");
+
+               Label lbl = new Label(parent, SWT.NONE);
+               lbl.setText("Welcome " + CurrentUser.getDisplayName() + "!");
+
+               return lbl;
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/DefaultEditionLayer.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/DefaultEditionLayer.java
new file mode 100644 (file)
index 0000000..dfccbe2
--- /dev/null
@@ -0,0 +1,315 @@
+package org.argeo.app.ui;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.argeo.api.acr.Content;
+import org.argeo.cms.Localized;
+import org.argeo.cms.swt.CmsSwtTheme;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.swt.acr.SwtTabbedArea;
+import org.argeo.cms.swt.acr.SwtUiProvider;
+import org.argeo.cms.util.LangUtils;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.wiring.BundleWiring;
+
+/** An app layer based on an entry area and an editor area. */
+public class DefaultEditionLayer implements SuiteLayer {
+       private String id;
+       private SwtUiProvider entryArea;
+       private SwtUiProvider defaultView;
+       private SwtUiProvider workArea;
+       private List<String> weights = new ArrayList<>();
+       private boolean startMaximized = false;
+       private boolean fixedEntryArea = false;
+       private boolean singleTab = false;
+       private Localized title = null;
+       private Localized singleTabTitle = null;
+
+       @Override
+       public Control createUiPart(Composite parent, Content context) {
+               // TODO Factorize more, or split into more specialised classes?
+               if (entryArea != null) {
+                       if (fixedEntryArea) {
+                               FixedEditionArea editionArea = new FixedEditionArea(parent, parent.getStyle());
+                               Control entryAreaC = entryArea.createUiPart(editionArea.getEntryArea(), context);
+                               CmsSwtUtils.style(entryAreaC, SuiteStyle.entryArea);
+                               if (this.defaultView != null) {
+                                       editionArea.getTabbedArea().view(defaultView, context);
+                               }
+                               return editionArea;
+                       } else {
+                               SashFormEditionArea editionArea = new SashFormEditionArea(parent, parent.getStyle());
+                               entryArea.createUiPart(editionArea.getEntryArea(), context);
+                               if (this.defaultView != null) {
+                                       editionArea.getTabbedArea().view(defaultView, context);
+                               }
+                               return editionArea;
+                       }
+               } else {
+                       if (this.workArea != null) {
+                               Composite area = new Composite(parent, SWT.NONE);
+                               this.workArea.createUiPart(area, context);
+                               return area;
+                       }
+                       CmsSwtTheme theme = CmsSwtUtils.getCmsTheme(parent);
+                       SwtTabbedArea tabbedArea = createTabbedArea(parent, theme);
+                       return tabbedArea;
+               }
+       }
+
+       @Override
+       public void view(SwtUiProvider uiProvider, Composite workAreaC, Content context) {
+               if (workArea != null) {
+                       CmsSwtUtils.clear(workAreaC);
+                       workArea.createUiPart(workAreaC, context);
+                       workAreaC.layout(true, true);
+                       return;
+               }
+
+               // tabbed area
+               SwtTabbedArea tabbedArea = findTabbedArea(workAreaC);
+               if (tabbedArea == null)
+                       throw new IllegalArgumentException("Unsupported work area " + workAreaC.getClass().getName());
+               if (uiProvider == null) {
+                       // reset
+                       tabbedArea.closeAllTabs();
+                       if (this.defaultView != null) {
+                               tabbedArea.view(defaultView, context);
+                       }
+               } else {
+                       tabbedArea.view(uiProvider, context);
+               }
+       }
+
+       @Override
+       public Content getCurrentContext(Composite workArea) {
+               SwtTabbedArea tabbedArea = findTabbedArea(workArea);
+               if (tabbedArea == null)
+                       return null;
+               return tabbedArea.getCurrentContext();
+       }
+
+       private SwtTabbedArea findTabbedArea(Composite workArea) {
+               SwtTabbedArea tabbedArea = null;
+               if (workArea instanceof SashFormEditionArea) {
+                       tabbedArea = ((SashFormEditionArea) workArea).getTabbedArea();
+               } else if (workArea instanceof FixedEditionArea) {
+                       tabbedArea = ((FixedEditionArea) workArea).getTabbedArea();
+               } else if (workArea instanceof SwtTabbedArea) {
+                       tabbedArea = (SwtTabbedArea) workArea;
+               }
+               return tabbedArea;
+       }
+
+       @Override
+       public void open(SwtUiProvider uiProvider, Composite workArea, Content context) {
+               SwtTabbedArea tabbedArea = ((SashFormEditionArea) workArea).getTabbedArea();
+               tabbedArea.open(uiProvider, context);
+       }
+
+       @Override
+       public Localized getTitle() {
+               return title;
+       }
+
+       @Override
+       public String getId() {
+               return id;
+       }
+
+       public void init(BundleContext bundleContext, Map<String, Object> properties) {
+               String pid = (String) properties.get(Constants.SERVICE_PID);
+               id = pid;
+
+               weights = LangUtils.toStringList(properties.get(Property.weights.name()));
+               startMaximized = properties.containsKey(Property.startMaximized.name())
+                               && "true".equals(properties.get(Property.startMaximized.name()));
+               fixedEntryArea = properties.containsKey(Property.fixedEntryArea.name())
+                               && "true".equals(properties.get(Property.fixedEntryArea.name()));
+               if (fixedEntryArea && weights.size() != 0) {
+                       throw new IllegalArgumentException("Property " + Property.weights.name() + " should not be set if property "
+                                       + Property.fixedEntryArea.name() + " is set.");
+               }
+               singleTab = properties.containsKey(Property.singleTab.name())
+                               && "true".equals(properties.get(Property.singleTab.name()));
+
+               String titleStr = (String) properties.get(SuiteLayer.Property.title.name());
+               if (titleStr != null) {
+                       if (titleStr.startsWith("%")) {
+                               title = new Localized() {
+
+                                       @Override
+                                       public String name() {
+                                               return titleStr;
+                                       }
+
+                                       @Override
+                                       public ClassLoader getL10nClassLoader() {
+                                               return bundleContext != null
+                                                               ? bundleContext.getBundle().adapt(BundleWiring.class).getClassLoader()
+                                                               : getClass().getClassLoader();
+                                       }
+                               };
+                       } else {
+                               title = new Localized.Untranslated(titleStr);
+                       }
+               }
+
+               String singleTabTitleStr = (String) properties.get(SuiteLayer.Property.singleTabTitle.name());
+               if (singleTabTitleStr != null) {
+                       if (singleTabTitleStr.startsWith("%")) {
+                               singleTabTitle = new Localized() {
+
+                                       @Override
+                                       public String name() {
+                                               return singleTabTitleStr;
+                                       }
+
+                                       @Override
+                                       public ClassLoader getL10nClassLoader() {
+                                               return bundleContext != null
+                                                               ? bundleContext.getBundle().adapt(BundleWiring.class).getClassLoader()
+                                                               : getClass().getClassLoader();
+                                       }
+                               };
+                       } else {
+                               singleTabTitle = new Localized.Untranslated(singleTabTitleStr);
+                       }
+               }
+
+       }
+
+       public void destroy(BundleContext bundleContext, Map<String, String> properties) {
+
+       }
+
+       public void setEntryArea(SwtUiProvider entryArea) {
+               this.entryArea = entryArea;
+       }
+
+       public void setWorkArea(SwtUiProvider workArea) {
+               this.workArea = workArea;
+       }
+
+       public void setDefaultView(SwtUiProvider defaultView) {
+               this.defaultView = defaultView;
+       }
+
+       SwtTabbedArea createTabbedArea(Composite parent, CmsSwtTheme theme) {
+               SwtTabbedArea tabbedArea = new SwtTabbedArea(parent, SWT.NONE);
+               tabbedArea.setSingleTab(singleTab);
+               if (singleTabTitle != null)
+                       tabbedArea.setSingleTabTitle(singleTabTitle.lead());
+               tabbedArea.setBodyStyle(SuiteStyle.mainTabBody.style());
+               tabbedArea.setTabStyle(SuiteStyle.mainTab.style());
+               tabbedArea.setTabSelectedStyle(SuiteStyle.mainTabSelected.style());
+               tabbedArea.setCloseIcon(theme.getSmallIcon(SuiteIcon.close));
+               tabbedArea.setLayoutData(CmsSwtUtils.fillAll());
+               return tabbedArea;
+       }
+
+//     /** A work area based on an entry area and and a tabbed area. */
+       class SashFormEditionArea extends SashForm {
+               private static final long serialVersionUID = 2219125778722702618L;
+               private SwtTabbedArea tabbedArea;
+               private Composite entryC;
+
+               SashFormEditionArea(Composite parent, int style) {
+                       super(parent, SWT.HORIZONTAL);
+                       CmsSwtTheme theme = CmsSwtUtils.getCmsTheme(parent);
+
+                       Composite editorC;
+                       if (SWT.RIGHT_TO_LEFT == (style & SWT.RIGHT_TO_LEFT)) {// arabic, hebrew, etc.
+                               editorC = new Composite(this, SWT.BORDER);
+                               entryC = new Composite(this, SWT.BORDER);
+                       } else {
+                               entryC = new Composite(this, SWT.NONE);
+                               editorC = new Composite(this, SWT.NONE);
+                       }
+
+                       // sash form specific
+                       if (weights.size() != 0) {
+                               int[] actualWeight = new int[weights.size()];
+                               for (int i = 0; i < weights.size(); i++) {
+                                       actualWeight[i] = Integer.parseInt(weights.get(i));
+                               }
+                               setWeights(actualWeight);
+                       } else {
+                               int[] actualWeights = new int[] { 3000, 7000 };
+                               setWeights(actualWeights);
+                       }
+                       if (startMaximized)
+                               setMaximizedControl(editorC);
+
+                       GridLayout editorAreaLayout = CmsSwtUtils.noSpaceGridLayout();
+//                     editorAreaLayout.verticalSpacing = 0;
+//                     editorAreaLayout.marginBottom = 0;
+//                     editorAreaLayout.marginHeight = 0;
+//                     editorAreaLayout.marginLeft = 0;
+//                     editorAreaLayout.marginRight = 0;
+                       editorC.setLayout(editorAreaLayout);
+
+                       tabbedArea = createTabbedArea(editorC, theme);
+               }
+
+               SwtTabbedArea getTabbedArea() {
+                       return tabbedArea;
+               }
+
+               Composite getEntryArea() {
+                       return entryC;
+               }
+
+       }
+
+       class FixedEditionArea extends Composite {
+               private static final long serialVersionUID = -5525672639277322465L;
+               private SwtTabbedArea tabbedArea;
+               private Composite entryC;
+
+               public FixedEditionArea(Composite parent, int style) {
+                       super(parent, style);
+                       CmsSwtTheme theme = CmsSwtUtils.getCmsTheme(parent);
+
+                       setLayout(CmsSwtUtils.noSpaceGridLayout(2));
+
+                       Composite editorC;
+                       if (SWT.RIGHT_TO_LEFT == (style & SWT.RIGHT_TO_LEFT)) {// arabic, hebrew, etc.
+                               editorC = new Composite(this, SWT.NONE);
+                               entryC = new Composite(this, SWT.NONE);
+                       } else {
+                               entryC = new Composite(this, SWT.NONE);
+                               editorC = new Composite(this, SWT.NONE);
+                       }
+                       entryC.setLayoutData(CmsSwtUtils.fillHeight());
+
+                       GridLayout editorAreaLayout = CmsSwtUtils.noSpaceGridLayout();
+//                     editorAreaLayout.verticalSpacing = 0;
+//                     editorAreaLayout.marginBottom = 0;
+//                     editorAreaLayout.marginHeight = 0;
+//                     editorAreaLayout.marginLeft = 0;
+//                     editorAreaLayout.marginRight = 0;
+                       editorC.setLayout(editorAreaLayout);
+                       editorC.setLayoutData(CmsSwtUtils.fillAll());
+
+                       tabbedArea = createTabbedArea(editorC, theme);
+               }
+
+               SwtTabbedArea getTabbedArea() {
+                       return tabbedArea;
+               }
+
+               Composite getEntryArea() {
+                       return entryC;
+               }
+       }
+
+}
\ No newline at end of file
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/DefaultFooter.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/DefaultFooter.java
new file mode 100644 (file)
index 0000000..5e54368
--- /dev/null
@@ -0,0 +1,38 @@
+package org.argeo.app.ui;
+
+import java.util.Map;
+
+import org.argeo.api.acr.Content;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.ui.CmsUiProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.osgi.framework.BundleContext;
+
+/** Footer of a standard Argeo Suite application. */
+public class DefaultFooter implements CmsUiProvider {
+       @Override
+       public Control createUiPart(Composite parent, Content context) {
+               parent.setLayout(CmsSwtUtils.noSpaceGridLayout());
+               Composite content = new Composite(parent, SWT.NONE);
+               content.setLayoutData(new GridData(0, 0));
+               Control contentControl = createContent(content, context);
+
+               // TODO support and guarantee
+
+               return contentControl;
+       }
+
+       protected Control createContent(Composite parent, Content context) {
+               return parent;
+       }
+
+       public void init(BundleContext bundleContext, Map<String, String> properties) {
+       }
+
+       public void destroy(BundleContext bundleContext, Map<String, String> properties) {
+
+       }
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/DefaultHeader.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/DefaultHeader.java
new file mode 100644 (file)
index 0000000..9231f4a
--- /dev/null
@@ -0,0 +1,126 @@
+package org.argeo.app.ui;
+
+import java.util.Map;
+
+import org.argeo.api.acr.Content;
+import org.argeo.api.cms.ux.CmsView;
+import org.argeo.cms.CurrentUser;
+import org.argeo.cms.Localized;
+import org.argeo.cms.swt.CmsSwtTheme;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.ui.CmsUiProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.wiring.BundleWiring;
+
+/** Header of a standard Argeo Suite application. */
+public class DefaultHeader implements CmsUiProvider {
+       public final static String TITLE_PROPERTY = "argeo.suite.ui.header.title";
+       private Localized title = null;
+
+       @Override
+       public Control createUiPart(Composite parent, Content context) {
+               CmsView cmsView = CmsSwtUtils.getCmsView(parent);
+               CmsSwtTheme theme = CmsSwtUtils.getCmsTheme(parent);
+
+               parent.setLayout(CmsSwtUtils.noSpaceGridLayout(new GridLayout(3, true)));
+
+               // TODO right to left
+               Composite lead = new Composite(parent, SWT.NONE);
+               CmsSwtUtils.style(lead, SuiteStyle.header);
+               lead.setLayoutData(new GridData(SWT.LEAD, SWT.CENTER, true, false));
+               lead.setLayout(new GridLayout());
+               Label lbl = new Label(lead, SWT.NONE);
+//             String title = properties.get(TITLE_PROPERTY);
+//             // TODO expose the localized
+//             lbl.setText(LocaleUtils.isLocaleKey(title) ? LocaleUtils.local(title, getClass().getClassLoader()).toString()
+//                             : title);
+               lbl.setText(title.lead());
+               CmsSwtUtils.style(lbl, SuiteStyle.headerTitle);
+               lbl.setLayoutData(CmsSwtUtils.fillWidth());
+
+               Composite middle = new Composite(parent, SWT.NONE);
+               CmsSwtUtils.style(middle, SuiteStyle.header);
+               middle.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false));
+               middle.setLayout(new GridLayout());
+
+               Composite end = new Composite(parent, SWT.NONE);
+               CmsSwtUtils.style(end, SuiteStyle.header);
+               end.setLayoutData(new GridData(SWT.END, SWT.CENTER, true, false));
+
+               if (!cmsView.isAnonymous()) {
+                       end.setLayout(new GridLayout(2, false));
+                       Label userL = new Label(end, SWT.NONE);
+                       CmsSwtUtils.style(userL, SuiteStyle.header);
+                       userL.setText(CurrentUser.getDisplayName());
+//                     Button logoutB = new Button(end, SWT.FLAT);
+//                     logoutB.setImage(theme.getSmallIcon(SuiteIcon.logout));
+//                     logoutB.addSelectionListener(new SelectionAdapter() {
+//                             private static final long serialVersionUID = 7116760083964201233L;
+//
+//                             @Override
+//                             public void widgetSelected(SelectionEvent e) {
+//                                     cmsView.logout();
+//                             }
+//
+//                     });
+                       Label logOutL = new Label(end, 0);
+                       logOutL.setImage(theme.getSmallIcon(SuiteIcon.openUserMenu));
+                       logOutL.addMouseListener(new MouseAdapter() {
+                               private static final long serialVersionUID = 6908266850511460799L;
+
+                               @Override
+                               public void mouseDown(MouseEvent e) {
+                                       cmsView.logout();
+                               }
+
+                       });
+               } else {
+                       end.setLayout(new GridLayout(1, false));
+                       // required in order to avoid wrong height after logout
+                       new Label(end, SWT.NONE).setText("");
+
+               }
+               return lbl;
+       }
+
+       public void init(BundleContext bundleContext, Map<String, String> properties) {
+               String titleStr = (String) properties.get(TITLE_PROPERTY);
+               if (titleStr != null) {
+                       if (titleStr.startsWith("%")) {
+                               title = new Localized() {
+
+                                       @Override
+                                       public String name() {
+                                               return titleStr;
+                                       }
+
+                                       @Override
+                                       public ClassLoader getL10nClassLoader() {
+                                               return bundleContext != null
+                                                               ? bundleContext.getBundle().adapt(BundleWiring.class).getClassLoader()
+                                                               : getClass().getClassLoader();
+                                       }
+                               };
+                       } else {
+                               title = new Localized.Untranslated(titleStr);
+                       }
+               }
+       }
+
+       public void destroy(BundleContext bundleContext, Map<String, String> properties) {
+
+       }
+
+       public Localized getTitle() {
+               return title;
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/DefaultLeadPane.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/DefaultLeadPane.java
new file mode 100644 (file)
index 0000000..0f3fb2e
--- /dev/null
@@ -0,0 +1,195 @@
+package org.argeo.app.ui;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+
+import org.argeo.api.acr.Content;
+import org.argeo.api.cms.CmsLog;
+import org.argeo.api.cms.ux.CmsView;
+import org.argeo.app.api.RankedObject;
+import org.argeo.app.core.SuiteUtils;
+import org.argeo.cms.CurrentUser;
+import org.argeo.cms.Localized;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.ui.CmsUiProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.wiring.BundleWiring;
+
+/** Side pane listing various perspectives. */
+public class DefaultLeadPane implements CmsUiProvider {
+       private final static CmsLog log = CmsLog.getLog(DefaultLeadPane.class);
+
+       public static enum Property {
+               defaultLayers, adminLayers;
+       }
+
+       private Map<String, RankedObject<SuiteLayer>> layers = Collections.synchronizedSortedMap(new TreeMap<>());
+       private List<String> defaultLayers;
+       private List<String> adminLayers = new ArrayList<>();
+
+       private ClassLoader l10nClassLoader;
+
+       @Override
+       public Control createUiPart(Composite parent, Content node) {
+               CmsView cmsView = CmsSwtUtils.getCmsView(parent);
+               parent.setLayout(CmsSwtUtils.noSpaceGridLayout());
+               Composite appLayersC = new Composite(parent, SWT.NONE);
+               CmsSwtUtils.style(appLayersC, SuiteStyle.leadPane);
+               GridLayout layout = new GridLayout();
+               layout.verticalSpacing = 10;
+               layout.marginTop = 10;
+               layout.marginLeft = 10;
+               layout.marginRight = 10;
+               appLayersC.setLayout(layout);
+               appLayersC.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false));
+
+               Composite adminLayersC;
+               if (!adminLayers.isEmpty()) {
+                       adminLayersC = new Composite(parent, SWT.NONE);
+                       CmsSwtUtils.style(adminLayersC, SuiteStyle.leadPane);
+                       GridLayout adminLayout = new GridLayout();
+                       adminLayout.verticalSpacing = 10;
+                       adminLayout.marginBottom = 10;
+                       adminLayout.marginLeft = 10;
+                       adminLayout.marginRight = 10;
+                       adminLayersC.setLayout(adminLayout);
+                       adminLayersC.setLayoutData(new GridData(SWT.FILL, SWT.BOTTOM, false, true));
+               } else {
+                       adminLayersC = null;
+               }
+
+//             boolean isAdmin = cmsView.doAs(() -> CurrentUser.isInRole(NodeConstants.ROLE_USER_ADMIN));
+               // Set<String> userRoles = cmsView.doAs(() -> CurrentUser.roles());
+               Button first = null;
+               layers: for (String layerDef : defaultLayers) {
+                       layerDef = layerDef.trim();
+                       if ("".equals(layerDef))
+                               continue layers;// skip empty lines
+                       String[] semiColArr = layerDef.split(";");
+                       String layerId = semiColArr[0];
+                       Set<String> layerRoles = SuiteUtils.extractRoles(semiColArr);
+                       if (layers.containsKey(layerId)) {
+                               if (!layerRoles.isEmpty()) {
+                                       boolean authorized = false;
+                                       authorized = cmsView.doAs(() -> {
+                                               for (String layerRole : layerRoles) {
+                                                       if (CurrentUser.implies(layerRole, null)) {
+                                                               return true;
+                                                       }
+                                               }
+                                               return false;
+                                       });
+                                       if (!authorized)
+                                               continue layers;// skip unauthorized layer
+//                                     Set<String> intersection = new HashSet<String>(layerRoles);
+//                                     intersection.retainAll(userRoles);
+//                                     if (intersection.isEmpty())
+//                                             continue layers;// skip unauthorized layer
+                               }
+                               RankedObject<SuiteLayer> layerObj = layers.get(layerId);
+
+                               Localized title = null;
+                               if (!adminLayers.contains(layerId)) {
+                                       String titleStr = (String) layerObj.getProperties().get(SuiteLayer.Property.title.name());
+                                       if (titleStr != null) {
+                                               if (titleStr.startsWith("%")) {
+                                                       // LocaleUtils.local(titleStr, getClass().getClassLoader());
+                                                       title = () -> titleStr;
+                                               } else {
+                                                       title = new Localized.Untranslated(titleStr);
+                                               }
+                                       }
+                               }
+
+                               String iconName = (String) layerObj.getProperties().get(SuiteLayer.Property.icon.name());
+                               SuiteIcon icon = null;
+                               if (iconName != null)
+                                       icon = SuiteIcon.valueOf(iconName);
+
+                               Composite buttonParent;
+                               if (adminLayers.contains(layerId))
+                                       buttonParent = adminLayersC;
+                               else
+                                       buttonParent = appLayersC;
+                               Button b = SuiteUiUtils.createLayerButton(buttonParent, layerId, title, icon, l10nClassLoader);
+                               if (first == null)
+                                       first = b;
+                       }
+               }
+               return first;
+       }
+
+       public void init(BundleContext bundleContext, Map<String, Object> properties) {
+               l10nClassLoader = bundleContext != null ? bundleContext.getBundle().adapt(BundleWiring.class).getClassLoader()
+                               : getClass().getClassLoader();
+
+               String[] defaultLayers = (String[]) properties.get(Property.defaultLayers.toString());
+               if (defaultLayers == null)
+                       throw new IllegalArgumentException("Default layers must be set.");
+               this.defaultLayers = Arrays.asList(defaultLayers);
+               if (log.isDebugEnabled())
+                       log.debug("Default layers: " + Arrays.asList(defaultLayers));
+               String[] adminLayers = (String[]) properties.get(Property.adminLayers.toString());
+               if (adminLayers != null) {
+                       this.adminLayers = Arrays.asList(adminLayers);
+                       if (log.isDebugEnabled())
+                               log.debug("Admin layers: " + Arrays.asList(adminLayers));
+               }
+       }
+
+       public void destroy(BundleContext bundleContext, Map<String, String> properties) {
+
+       }
+
+       public void addLayer(SuiteLayer layer, Map<String, Object> properties) {
+               if (properties.containsKey(Constants.SERVICE_PID)) {
+                       String pid = (String) properties.get(Constants.SERVICE_PID);
+                       RankedObject.putIfHigherRank(layers, pid, layer, properties);
+               }
+       }
+
+       public void removeLayer(SuiteLayer layer, Map<String, Object> properties) {
+               if (properties.containsKey(Constants.SERVICE_PID)) {
+                       String pid = (String) properties.get(Constants.SERVICE_PID);
+                       if (layers.containsKey(pid)) {
+                               if (layers.get(pid).equals(new RankedObject<SuiteLayer>(layer, properties))) {
+                                       layers.remove(pid);
+                               }
+                       }
+               }
+       }
+
+//     protected Button createLayerButton(Composite parent, String layer, Localized msg, CmsIcon icon) {
+//             CmsTheme theme = CmsTheme.getCmsTheme(parent);
+//             Button button = new Button(parent, SWT.PUSH);
+//             CmsUiUtils.style(button, SuiteStyle.leadPane);
+//             if (icon != null)
+//                     button.setImage(icon.getBigIcon(theme));
+//             button.setLayoutData(new GridData(SWT.CENTER, SWT.BOTTOM, true, false));
+//             // button.setToolTipText(msg.lead());
+//             if (msg != null) {
+//                     Label lbl = new Label(parent, SWT.CENTER);
+//                     CmsUiUtils.style(lbl, SuiteStyle.leadPane);
+//                     // CmsUiUtils.markup(lbl);
+//                     ClassLoader l10nClassLoader = getClass().getClassLoader();
+//                     String txt = LocaleUtils.lead(msg, l10nClassLoader);
+////                   String txt = msg.lead();
+//                     lbl.setText(txt);
+//                     lbl.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, true, false));
+//             }
+//             CmsUiUtils.sendEventOnSelect(button, SuiteEvent.switchLayer.topic(), SuiteEvent.LAYER, layer);
+//             return button;
+//     }
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/DefaultLoginScreen.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/DefaultLoginScreen.java
new file mode 100644 (file)
index 0000000..1cb1f95
--- /dev/null
@@ -0,0 +1,39 @@
+package org.argeo.app.ui;
+
+import org.argeo.api.acr.Content;
+import org.argeo.api.cms.CmsContext;
+import org.argeo.api.cms.ux.CmsView;
+import org.argeo.cms.CurrentUser;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.swt.auth.CmsLogin;
+import org.argeo.cms.ui.CmsUiProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+/** Provides a login screen. */
+public class DefaultLoginScreen implements CmsUiProvider {
+       private CmsContext cmsContext;
+
+       @Override
+       public Control createUiPart(Composite parent, Content context) {
+               CmsView cmsView = CmsSwtUtils.getCmsView(parent);
+               if (!cmsView.isAnonymous())
+                       throw new IllegalStateException(CurrentUser.getUsername() + " is already logged in");
+
+               parent.setLayout(new GridLayout());
+               Composite loginArea = new Composite(parent, SWT.NONE);
+               loginArea.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, true));
+
+               CmsLogin cmsLogin = new CmsLogin(cmsView, cmsContext);
+               cmsLogin.createUi(loginArea);
+               return cmsLogin.getCredentialsBlock();
+       }
+
+       public void setCmsContext(CmsContext cmsContext) {
+               this.cmsContext = cmsContext;
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/EventRecorder.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/EventRecorder.java
new file mode 100644 (file)
index 0000000..7c31601
--- /dev/null
@@ -0,0 +1,27 @@
+package org.argeo.app.ui;
+
+import java.util.Map;
+
+import org.argeo.api.cms.CmsEventSubscriber;
+import org.argeo.api.cms.CmsLog;
+
+/** Record UI events. */
+public class EventRecorder implements CmsEventSubscriber {
+       private final static CmsLog log = CmsLog.getLog(EventRecorder.class);
+
+       public void init() {
+
+       }
+
+       public void destroy() {
+
+       }
+
+       @Override
+       public void onEvent(String topic, Map<String, Object> properties) {
+               if (log.isTraceEnabled())
+                       log.trace(topic + ": " + properties);
+
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/RecentItems.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/RecentItems.java
new file mode 100644 (file)
index 0000000..03927d4
--- /dev/null
@@ -0,0 +1,364 @@
+package org.argeo.app.ui;
+
+import static org.argeo.eclipse.ui.EclipseUiUtils.notEmpty;
+
+import java.util.List;
+import java.util.Map;
+
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.observation.Event;
+import javax.jcr.observation.EventIterator;
+import javax.jcr.observation.EventListener;
+import javax.jcr.query.Query;
+import javax.jcr.query.QueryResult;
+
+import org.argeo.app.api.EntityType;
+import org.argeo.app.core.XPathUtils;
+import org.argeo.app.ui.widgets.DelayedText;
+import org.argeo.cms.swt.CmsSwtTheme;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.ui.CmsUiProvider;
+import org.argeo.eclipse.ui.EclipseUiUtils;
+import org.argeo.jcr.Jcr;
+import org.argeo.jcr.JcrUtils;
+import org.eclipse.jface.layout.TableColumnLayout;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.ColumnWeightData;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+
+/** List recent items. */
+public class RecentItems implements CmsUiProvider {
+       private final static int SEARCH_TEXT_DELAY = 800;
+       private final static int SEARCH_DEFAULT_LIMIT = 100;
+
+       private CmsSwtTheme theme;
+
+       private String entityType;
+
+       static enum Property {
+               entityTypes;
+       }
+
+       @Override
+       public Control createUi(Composite parent, Node context) throws RepositoryException {
+               theme = CmsSwtUtils.getCmsTheme(parent);
+               parent.setLayout(new GridLayout());
+//             parent.setLayout(CmsUiUtils.noSpaceGridLayout());
+               parent.setLayout(new GridLayout());
+
+//             Composite top = new Composite(parent, SWT.BORDER);
+//             CmsUiUtils.style(top, SuiteStyle.recentItems);
+//             top.setLayoutData(CmsUiUtils.fillWidth());
+//             top.setLayout(CmsUiUtils.noSpaceGridLayout(2));
+//             Label lbl = new Label(top, SWT.FLAT);
+//             lbl.setLayoutData(CmsUiUtils.fillWidth());
+//             lbl.setText(SuiteMsg.recentItems.lead());
+//             CmsUiUtils.style(lbl, SuiteStyle.recentItems);
+//
+//             ToolBar topToolBar = new ToolBar(top, SWT.NONE);
+//             ToolItem addItem = new ToolItem(topToolBar, SWT.FLAT);
+////           CmsUiUtils.style(addItem, SuiteStyle.recentItems);
+//             addItem.setImage(SuiteIcon.add.getSmallIcon(theme));
+
+               if (context == null)
+                       return null;
+               SingleEntityViewer entityViewer = new SingleEntityViewer(parent, SWT.NONE, context.getSession());
+               entityViewer.createUi();
+               entityViewer.getViewer().getTable().setLayoutData(CmsSwtUtils.fillAll());
+
+               Composite bottom = new Composite(parent, SWT.NONE);
+               bottom.setLayoutData(CmsSwtUtils.fillWidth());
+               bottom.setLayout(CmsSwtUtils.noSpaceGridLayout());
+               ToolBar bottomToolBar = new ToolBar(bottom, SWT.NONE);
+               bottomToolBar.setLayoutData(new GridData(SWT.END, SWT.FILL, true, false));
+               ToolItem deleteItem = new ToolItem(bottomToolBar, SWT.FLAT);
+               deleteItem.setEnabled(false);
+//             CmsUiUtils.style(deleteItem, SuiteStyle.recentItems);
+               deleteItem.setImage(theme.getSmallIcon(SuiteIcon.delete));
+               ToolItem addItem = new ToolItem(bottomToolBar, SWT.FLAT);
+               addItem.setImage(theme.getSmallIcon(SuiteIcon.add));
+               entityViewer.getViewer().addDoubleClickListener(new IDoubleClickListener() {
+
+                       @Override
+                       public void doubleClick(DoubleClickEvent event) {
+                               Node node = (Node) entityViewer.getViewer().getStructuredSelection().getFirstElement();
+                               if (node != null)
+                                       CmsSwtUtils.getCmsView(parent).sendEvent(SuiteUxEvent.openNewPart.topic(),
+                                                       SuiteUxEvent.eventProperties(node));
+
+                       }
+               });
+               entityViewer.getViewer().addSelectionChangedListener(new ISelectionChangedListener() {
+                       public void selectionChanged(SelectionChangedEvent event) {
+                               Node node = (Node) entityViewer.getViewer().getStructuredSelection().getFirstElement();
+                               if (node != null) {
+                                       CmsSwtUtils.getCmsView(parent).sendEvent(SuiteUxEvent.refreshPart.topic(),
+                                                       SuiteUxEvent.eventProperties(node));
+                                       deleteItem.setEnabled(true);
+                               } else {
+                                       deleteItem.setEnabled(false);
+                               }
+                       }
+               });
+
+               return entityViewer.filterTxt;
+
+       }
+
+       public void init(Map<String, String> properties) {
+               // TODO manage multiple entities
+               entityType = properties.get(Property.entityTypes.name());
+       }
+
+       class SingleEntityViewer {
+               Composite parent;
+               Text filterTxt;
+               TableViewer viewer;
+               Session session;
+
+               public SingleEntityViewer(Composite parent, int style, Session session) {
+                       this.parent = parent;
+                       this.session = session;
+               }
+
+               public void createUi() {
+                       // MainLayout
+                       addFilterPanel(parent);
+                       viewer = createListPart(parent, new SingleEntityLabelProvider());
+                       refreshFilteredList();
+
+                       try {
+                               String[] nodeTypes = entityType != null && entityType.contains(":") ? new String[] { entityType }
+                                               : null;
+                               session.getWorkspace().getObservationManager().addEventListener(new EventListener() {
+
+                                       @Override
+                                       public void onEvent(EventIterator events) {
+                                               parent.getDisplay().asyncExec(() -> refreshFilteredList());
+                                       }
+                               }, Event.PROPERTY_CHANGED | Event.NODE_ADDED | Event.NODE_REMOVED | Event.PROPERTY_ADDED, "/", true,
+                                               null, nodeTypes, false);
+                       } catch (RepositoryException e) {
+                               throw new IllegalStateException("Cannot add JCR observer", e);
+                       }
+
+               }
+
+               private void addFilterPanel(Composite parent) {
+                       // Use a delayed text: the query won't be done until the user stop
+                       // typing for 800ms
+                       int style = SWT.BORDER | SWT.SEARCH | SWT.ICON_CANCEL;
+                       DelayedText delayedText = new DelayedText(parent, style, SEARCH_TEXT_DELAY);
+                       filterTxt = delayedText.getText();
+                       filterTxt.setLayoutData(EclipseUiUtils.fillWidth());
+
+                       // final ServerPushSession pushSession = new ServerPushSession();
+                       delayedText.addListener((s) -> refreshFilteredList());
+//                     delayedText.addDelayedModifyListener(null, new ModifyListener() {
+//                             private static final long serialVersionUID = 5003010530960334977L;
+//
+//                             public void modifyText(ModifyEvent event) {
+//                                     delayedText.getText().getDisplay().asyncExec(new Runnable() {
+//                                             @Override
+//                                             public void run() {
+//                                                     refreshFilteredList();
+//                                             }
+//                                     });
+//                                     // pushSession.stop();
+//                             }
+//                     });
+
+                       // Jump to the first item of the list using the down arrow
+                       filterTxt.addKeyListener(new KeyListener() {
+                               private static final long serialVersionUID = -4523394262771183968L;
+
+                               @Override
+                               public void keyReleased(KeyEvent e) {
+                               }
+
+                               @Override
+                               public void keyPressed(KeyEvent e) {
+                                       // boolean shiftPressed = (e.stateMask & SWT.SHIFT) != 0;
+                                       // boolean altPressed = (e.stateMask & SWT.ALT) != 0;
+                                       if (e.keyCode == SWT.ARROW_DOWN || e.keyCode == SWT.TAB) {
+//                                     Object first = entityViewer.getElementAt(0);
+//                                     if (first != null) {
+//                                             entityViewer.getTable().setFocus();
+//                                             entityViewer.setSelection(new StructuredSelection(first), true);
+//                                     }
+                                               e.doit = false;
+                                       }
+                               }
+                       });
+
+//                     parent.addDisposeListener((e) -> {
+//                             delayedText.close();
+//                     });
+               }
+
+               protected TableViewer createListPart(Composite parent, ILabelProvider labelProvider) {
+//                     parent.setLayout(new GridLayout());
+//                     parent.setLayout(CmsUiUtils.noSpaceGridLayout());
+
+                       Composite tableComposite = new Composite(parent, SWT.NONE);
+                       GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_VERTICAL
+                                       | GridData.VERTICAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL);
+                       tableComposite.setLayoutData(gd);
+
+                       TableViewer viewer = new TableViewer(tableComposite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+                       viewer.setLabelProvider(labelProvider);
+
+                       TableColumn singleColumn = new TableColumn(viewer.getTable(), SWT.V_SCROLL);
+                       TableColumnLayout tableColumnLayout = new TableColumnLayout();
+                       tableColumnLayout.setColumnData(singleColumn, new ColumnWeightData(85));
+                       tableComposite.setLayout(tableColumnLayout);
+
+                       // Corresponding table & style
+                       Table table = viewer.getTable();
+//                     Listener[] mouseDownListeners = table.getListeners(SWT.MouseDown);
+//                     for (Listener listener :  table.getListeners(SWT.MouseDown))
+//                             table.removeListener(SWT.MouseDown, listener);
+//                     for (Listener listener :  table.getListeners(SWT.MouseUp))
+//                             table.removeListener(SWT.MouseUp, listener);
+//                     for (Listener listener :  table.getListeners(SWT.MouseDoubleClick))
+//                             table.removeListener(SWT.MouseDoubleClick, listener);
+//                     
+//                     table.addMouseListener(new MouseListener() {
+//
+//                             @Override
+//                             public void mouseUp(MouseEvent e) {
+//                                     System.out.println("Mouse up: "+e);
+//                             }
+//
+//                             @Override
+//                             public void mouseDown(MouseEvent e) {
+//                                     System.out.println("Mouse down: "+e);
+//                             }
+//
+//                             @Override
+//                             public void mouseDoubleClick(MouseEvent e) {
+//                                     System.out.println("Mouse double: "+e);
+//
+//                             }
+//                     });
+                       table.setLinesVisible(true);
+                       table.setHeaderVisible(false);
+                       // CmsUiUtils.markup(table);
+                       // CmsUiUtils.setItemHeight(table, 26);
+
+                       viewer.setContentProvider(new BasicNodeListContentProvider());
+                       return viewer;
+               }
+
+//             public boolean setFocus() {
+//                     refreshFilteredList();
+//                     return parent.setFocus();
+//             }
+
+               public void forceRefresh(Object object) {
+                       refreshFilteredList();
+               }
+
+               protected void refreshFilteredList() {
+                       try {
+                               String filter = filterTxt.getText();
+                               // Prevents the query on the full repository
+                               // if (isEmpty(filter)) {
+                               // entityViewer.setInput(null);
+                               // return;
+                               // }
+
+                               // XPATH Query
+                               String xpathQueryStr;
+                               if (entityType != null) {
+                                       int indexColumn = entityType.indexOf(':');
+                                       if (indexColumn > 0) {// JCR node type
+                                               xpathQueryStr = "//element(*, " + entityType + ") order by @jcr:created descending";
+                                       } else {
+                                               xpathQueryStr = entityType.contains(":") ? "//element(*, " + entityType + ")"
+                                                               : "//element(*, " + EntityType.entity.get() + ")[@entity:type='" + entityType + "']";
+                                       }
+                               } else {
+                                       xpathQueryStr = "//element(*, " + EntityType.entity.get() + ")";
+                               }
+//                     String xpathQueryStr = "//element(*, " + ConnectTypes.CONNECT_ENTITY + ")";
+                               String xpathFilter = XPathUtils.getFreeTextConstraint(filter);
+                               if (notEmpty(xpathFilter))
+                                       xpathQueryStr += "[" + xpathFilter + "]";
+
+//                             long begin = System.currentTimeMillis();
+                               // session.refresh(false);
+                               Query xpathQuery = XPathUtils.createQuery(session, xpathQueryStr);
+
+                               xpathQuery.setLimit(SEARCH_DEFAULT_LIMIT);
+                               QueryResult result = xpathQuery.execute();
+
+                               NodeIterator nit = result.getNodes();
+                               viewer.setInput(JcrUtils.nodeIteratorToList(nit));
+//                             if (log.isTraceEnabled()) {
+//                                     long end = System.currentTimeMillis();
+//                                     log.trace("Quick Search - Found: " + nit.getSize() + " in " + (end - begin)
+//                                                     + " ms by executing XPath query (" + xpathQueryStr + ").");
+//                             }
+                       } catch (RepositoryException e) {
+                               throw new IllegalStateException("Unable to list entities", e);
+                       }
+               }
+
+               public TableViewer getViewer() {
+                       return viewer;
+               }
+
+               class SingleEntityLabelProvider extends ColumnLabelProvider {
+                       private static final long serialVersionUID = -2209337675781795677L;
+
+                       @Override
+                       public String getText(Object element) {
+                               return Jcr.getTitle((Node) element);
+                       }
+
+               }
+
+               class BasicNodeListContentProvider implements IStructuredContentProvider {
+                       private static final long serialVersionUID = 1L;
+                       // keep a cache of the Nodes in the content provider to be able to
+                       // manage long request
+                       private List<Node> nodes;
+
+                       public void dispose() {
+                       }
+
+                       /** Expects a list of nodes as a new input */
+                       @SuppressWarnings("unchecked")
+                       public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+                               nodes = (List<Node>) newInput;
+                       }
+
+                       public Object[] getElements(Object arg0) {
+                               return nodes.toArray();
+                       }
+               }
+       }
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteApp.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteApp.java
new file mode 100644 (file)
index 0000000..3dc5007
--- /dev/null
@@ -0,0 +1,655 @@
+package org.argeo.app.ui;
+
+import static org.argeo.api.cms.ux.CmsView.CMS_VIEW_UID_PROPERTY;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.TreeSet;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.nodetype.NodeType;
+import javax.xml.namespace.QName;
+
+import org.argeo.api.acr.Content;
+import org.argeo.api.acr.ContentRepository;
+import org.argeo.api.acr.spi.ProvidedSession;
+import org.argeo.api.cms.CmsConstants;
+import org.argeo.api.cms.CmsEventSubscriber;
+import org.argeo.api.cms.CmsLog;
+import org.argeo.api.cms.CmsSession;
+import org.argeo.api.cms.directory.CmsUserManager;
+import org.argeo.api.cms.ux.CmsTheme;
+import org.argeo.api.cms.ux.CmsUi;
+import org.argeo.api.cms.ux.CmsView;
+import org.argeo.app.api.EntityConstants;
+import org.argeo.app.api.EntityNames;
+import org.argeo.app.api.EntityType;
+import org.argeo.app.api.RankedObject;
+import org.argeo.app.core.SuiteUtils;
+import org.argeo.cms.AbstractCmsApp;
+import org.argeo.cms.LocaleUtils;
+import org.argeo.cms.Localized;
+import org.argeo.cms.acr.ContentUtils;
+import org.argeo.cms.jcr.CmsJcrUtils;
+import org.argeo.cms.jcr.acr.JcrContent;
+import org.argeo.cms.jcr.acr.JcrContentProvider;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.swt.acr.SwtUiProvider;
+import org.argeo.cms.swt.dialogs.CmsFeedback;
+import org.argeo.cms.util.LangUtils;
+import org.argeo.cms.ux.CmsUxUtils;
+import org.argeo.eclipse.ui.specific.UiContext;
+import org.argeo.jcr.JcrException;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.osgi.framework.Constants;
+import org.osgi.service.useradmin.User;
+
+/** The Argeo Suite App. */
+public class SuiteApp extends AbstractCmsApp implements CmsEventSubscriber {
+       private final static CmsLog log = CmsLog.getLog(SuiteApp.class);
+
+       public final static String PUBLIC_BASE_PATH_PROPERTY = "publicBasePath";
+       public final static String DEFAULT_UI_NAME_PROPERTY = "defaultUiName";
+       public final static String DEFAULT_THEME_ID_PROPERTY = "defaultThemeId";
+       public final static String DEFAULT_LAYER_PROPERTY = "defaultLayer";
+       private final static String LOGIN = "login";
+       private final static String HOME_STATE = "~";
+
+       private String publicBasePath = null;
+
+       private String pidPrefix;
+       private String headerPid;
+       private String footerPid;
+       private String leadPanePid;
+       private String adminLeadPanePid;
+       private String loginScreenPid;
+
+       private String defaultUiName = "app";
+       private String adminUiName = "admin";
+
+       // FIXME such default names make refactoring more dangerous
+       @Deprecated
+       private String defaultLayerPid = "argeo.suite.ui.dashboardLayer";
+       @Deprecated
+       private String defaultThemeId = "org.argeo.app.theme.default";
+
+       // TODO use QName as key for byType
+       private Map<String, RankedObject<SwtUiProvider>> uiProvidersByPid = Collections.synchronizedMap(new HashMap<>());
+       private Map<String, RankedObject<SwtUiProvider>> uiProvidersByType = Collections.synchronizedMap(new HashMap<>());
+       private Map<String, RankedObject<SuiteLayer>> layersByPid = Collections.synchronizedSortedMap(new TreeMap<>());
+       private Map<String, RankedObject<SuiteLayer>> layersByType = Collections.synchronizedSortedMap(new TreeMap<>());
+
+       private CmsUserManager cmsUserManager;
+
+       // TODO make more optimal or via CmsSession/CmsView
+       private Map<String, SuiteUi> managedUis = new HashMap<>();
+
+       // ACR
+       private ContentRepository contentRepository;
+       private JcrContentProvider jcrContentProvider;
+
+       // JCR
+//     private Repository repository;
+
+       public void init(Map<String, Object> properties) {
+               for (SuiteUxEvent event : SuiteUxEvent.values()) {
+                       getCmsContext().getCmsEventBus().addEventSubscriber(event.topic(), this);
+               }
+
+               if (log.isDebugEnabled())
+                       log.info("Argeo Suite App started");
+
+               if (properties.containsKey(DEFAULT_UI_NAME_PROPERTY))
+                       defaultUiName = LangUtils.get(properties, DEFAULT_UI_NAME_PROPERTY);
+               if (properties.containsKey(DEFAULT_THEME_ID_PROPERTY))
+                       defaultThemeId = LangUtils.get(properties, DEFAULT_THEME_ID_PROPERTY);
+               if (properties.containsKey(DEFAULT_LAYER_PROPERTY))
+                       defaultLayerPid = LangUtils.get(properties, DEFAULT_LAYER_PROPERTY);
+               publicBasePath = LangUtils.get(properties, PUBLIC_BASE_PATH_PROPERTY);
+
+               if (properties.containsKey(Constants.SERVICE_PID)) {
+                       String servicePid = properties.get(Constants.SERVICE_PID).toString();
+                       if (servicePid.endsWith(".app")) {
+                               pidPrefix = servicePid.substring(0, servicePid.length() - "app".length());
+                       }
+               }
+
+               if (pidPrefix == null)
+                       throw new IllegalArgumentException("PID prefix must be set.");
+
+               headerPid = pidPrefix + "header";
+               footerPid = pidPrefix + "footer";
+               leadPanePid = pidPrefix + "leadPane";
+               adminLeadPanePid = pidPrefix + "adminLeadPane";
+               loginScreenPid = pidPrefix + "loginScreen";
+       }
+
+       public void destroy(Map<String, Object> properties) {
+               for (SuiteUi ui : managedUis.values())
+                       if (!ui.isDisposed()) {
+                               ui.getDisplay().syncExec(() -> ui.dispose());
+                       }
+               if (log.isDebugEnabled())
+                       log.info("Argeo Suite App stopped");
+
+       }
+
+       @Override
+       public Set<String> getUiNames() {
+               HashSet<String> uiNames = new HashSet<>();
+               uiNames.add(defaultUiName);
+               uiNames.add(adminUiName);
+               return uiNames;
+       }
+
+       @Override
+       public CmsUi initUi(Object parent) {
+               Composite uiParent = (Composite) parent;
+               String uiName = uiParent.getData(UI_NAME_PROPERTY) != null ? uiParent.getData(UI_NAME_PROPERTY).toString()
+                               : null;
+               CmsView cmsView = CmsSwtUtils.getCmsView(uiParent);
+               if (cmsView == null)
+                       throw new IllegalStateException("No CMS view is registered.");
+               CmsTheme theme = getTheme(uiName);
+               if (theme != null)
+                       CmsSwtUtils.registerCmsTheme(uiParent.getShell(), theme);
+               SuiteUi argeoSuiteUi = new SuiteUi(uiParent, SWT.INHERIT_DEFAULT);
+               String uid = cmsView.getUid();
+               managedUis.put(uid, argeoSuiteUi);
+               argeoSuiteUi.addDisposeListener((e) -> {
+                       managedUis.remove(uid);
+                       if (log.isDebugEnabled())
+                               log.debug("Suite UI " + uid + " has been disposed.");
+               });
+               return argeoSuiteUi;
+       }
+
+       @Override
+       public String getThemeId(String uiName) {
+               String themeId = System.getProperty("org.argeo.app.theme.default");
+               if (themeId != null)
+                       return themeId;
+               return defaultThemeId;
+       }
+
+       @Override
+       public void refreshUi(CmsUi cmsUi, String state) {
+               try {
+                       Content context = null;
+                       SuiteUi ui = (SuiteUi) cmsUi;
+
+                       String uiName = Objects.toString(ui.getParent().getData(UI_NAME_PROPERTY), null);
+                       if (uiName == null)
+                               throw new IllegalStateException("UI name should not be null");
+                       CmsView cmsView = CmsSwtUtils.getCmsView(ui);
+
+                       ProvidedSession contentSession = (ProvidedSession) CmsUxUtils.getContentSession(contentRepository, cmsView);
+
+                       SwtUiProvider headerUiProvider = findUiProvider(headerPid);
+                       SwtUiProvider footerUiProvider = findUiProvider(footerPid);
+                       SwtUiProvider leadPaneUiProvider;
+                       if (adminUiName.equals(uiName)) {
+                               leadPaneUiProvider = findUiProvider(adminLeadPanePid);
+                       } else {
+                               leadPaneUiProvider = findUiProvider(leadPanePid);
+                       }
+
+                       Localized appTitle = null;
+                       if (headerUiProvider instanceof DefaultHeader) {
+                               appTitle = ((DefaultHeader) headerUiProvider).getTitle();
+                       }
+                       ui.setTitle(appTitle);
+
+                       if (cmsView.isAnonymous() && publicBasePath == null) {// internal app, must login
+                               ui.logout();
+                               ui.setLoginScreen(true);
+                               if (headerUiProvider != null)
+                                       refreshPart(headerUiProvider, ui.getHeader(), context);
+                               ui.refreshBelowHeader(false);
+                               refreshPart(findUiProvider(loginScreenPid), ui.getBelowHeader(), context);
+                               if (footerUiProvider != null)
+                                       refreshPart(footerUiProvider, ui.getFooter(), context);
+                               ui.layout(true, true);
+                               setState(ui, LOGIN);
+                       } else {
+                               if (LOGIN.equals(state))
+                                       state = null;
+                               if (ui.isLoginScreen()) {
+                                       ui.setLoginScreen(false);
+                               }
+                               CmsSession cmsSession = cmsView.getCmsSession();
+                               if (ui.getUserDir() == null) {
+                                       // FIXME NPE on CMSSession when logging in from anonymous
+                                       if (cmsSession == null || cmsView.isAnonymous()) {
+                                               assert publicBasePath != null;
+                                               Content userDir = contentSession
+                                                               .get(ContentUtils.SLASH + CmsConstants.SYS_WORKSPACE + publicBasePath);
+                                               ui.setUserDir(userDir);
+                                       } else {
+                                               Node userDirNode = jcrContentProvider.doInAdminSession((adminSession) -> {
+                                                       Node node = SuiteUtils.getOrCreateCmsSessionNode(adminSession, cmsSession);
+                                                       return node;
+                                               });
+                                               Content userDir = contentSession
+                                                               .get(ContentUtils.SLASH + CmsConstants.SYS_WORKSPACE + userDirNode.getPath());
+                                               ui.setUserDir(userDir);
+//                                             Content userDir = contentSession.getSessionRunDir();
+//                                             ui.setUserDir(userDir);
+                                       }
+                               }
+                               initLocale(cmsSession);
+                               context = stateToNode(ui, state);
+                               if (context == null)
+                                       context = ui.getUserDir();
+
+                               if (headerUiProvider != null)
+                                       refreshPart(headerUiProvider, ui.getHeader(), context);
+                               ui.refreshBelowHeader(true);
+                               for (String key : layersByPid.keySet()) {
+                                       SuiteLayer layer = layersByPid.get(key).get();
+                                       ui.addLayer(key, layer);
+                               }
+
+                               if (leadPaneUiProvider != null)
+                                       refreshPart(leadPaneUiProvider, ui.getLeadPane(), context);
+                               if (footerUiProvider != null)
+                                       refreshPart(footerUiProvider, ui.getFooter(), context);
+                               ui.layout(true, true);
+                               setState(ui, state != null ? state : defaultLayerPid);
+                       }
+               } catch (Exception e) {
+                       CmsFeedback.error("Unexpected exception", e);
+               }
+       }
+
+       private void initLocale(CmsSession cmsSession) {
+               if (cmsSession == null)
+                       return;
+               Locale locale = cmsSession.getLocale();
+               UiContext.setLocale(locale);
+               LocaleUtils.setThreadLocale(locale);
+
+       }
+
+       private void refreshPart(SwtUiProvider uiProvider, Composite part, Content context) {
+               CmsSwtUtils.clear(part);
+               uiProvider.createUiPart(part, context);
+       }
+
+       private SwtUiProvider findUiProvider(String pid) {
+               if (!uiProvidersByPid.containsKey(pid))
+                       return null;
+               return uiProvidersByPid.get(pid).get();
+       }
+
+       private SuiteLayer findLayer(String pid) {
+               if (!layersByPid.containsKey(pid))
+                       return null;
+               return layersByPid.get(pid).get();
+       }
+
+       private <T> T findByType(Map<String, RankedObject<T>> byType, Content content) {
+               if (content == null)
+                       throw new IllegalArgumentException("A node should be provided");
+
+               if (content instanceof JcrContent) {
+                       Node context = ((JcrContent) content).getJcrNode();
+                       try {
+                               // mixins
+                               Set<String> types = new TreeSet<>();
+                               for (NodeType mixinType : context.getMixinNodeTypes()) {
+                                       String mixinTypeName = mixinType.getName();
+                                       if (byType.containsKey(mixinTypeName)) {
+                                               types.add(mixinTypeName);
+                                       }
+                                       for (NodeType superType : mixinType.getDeclaredSupertypes()) {
+                                               if (byType.containsKey(superType.getName())) {
+                                                       types.add(superType.getName());
+                                               }
+                                       }
+                               }
+                               // primary node type
+                               NodeType primaryType = context.getPrimaryNodeType();
+                               String primaryTypeName = primaryType.getName();
+                               if (byType.containsKey(primaryTypeName)) {
+                                       types.add(primaryTypeName);
+                               }
+                               for (NodeType superType : primaryType.getDeclaredSupertypes()) {
+                                       if (byType.containsKey(superType.getName())) {
+                                               types.add(superType.getName());
+                                       }
+                               }
+                               // entity type
+                               if (context.isNodeType(EntityType.entity.get())) {
+                                       if (context.hasProperty(EntityNames.ENTITY_TYPE)) {
+                                               String entityTypeName = context.getProperty(EntityNames.ENTITY_TYPE).getString();
+                                               if (byType.containsKey(entityTypeName)) {
+                                                       types.add(entityTypeName);
+                                               }
+                                       }
+                               }
+
+                               if (CmsJcrUtils.isUserHome(context) && byType.containsKey("nt:folder")) {// home node
+                                       types.add("nt:folder");
+                               }
+
+                               if (types.size() == 0)
+                                       throw new IllegalArgumentException(
+                                                       "No type found for " + context + " (" + listTypes(context) + ")");
+                               String type = types.iterator().next();
+                               if (!byType.containsKey(type))
+                                       throw new IllegalArgumentException("No component found for " + context + " with type " + type);
+                               return byType.get(type).get();
+                       } catch (RepositoryException e) {
+                               throw new IllegalStateException(e);
+                       }
+
+               } else {
+                       List<QName> objectClasses = content.getContentClasses();
+                       Set<String> types = new TreeSet<>();
+                       for (QName cc : objectClasses) {
+                               String type = cc.getPrefix() + ":" + cc.getLocalPart();
+                               if (byType.containsKey(type))
+                                       types.add(type);
+                       }
+                       if (types.size() == 0) {
+                               throw new IllegalArgumentException("No type found for " + content + " (" + objectClasses + ")");
+                       }
+                       String type = types.iterator().next();
+                       if (!byType.containsKey(type))
+                               throw new IllegalArgumentException("No component found for " + content + " with type " + type);
+                       return byType.get(type).get();
+               }
+       }
+
+       private static String listTypes(Node context) {
+               try {
+                       StringBuilder sb = new StringBuilder();
+                       sb.append(context.getPrimaryNodeType().getName());
+                       for (NodeType superType : context.getPrimaryNodeType().getDeclaredSupertypes()) {
+                               sb.append(' ');
+                               sb.append(superType.getName());
+                       }
+
+                       for (NodeType nodeType : context.getMixinNodeTypes()) {
+                               sb.append(' ');
+                               sb.append(nodeType.getName());
+                               if (nodeType.getName().equals(EntityType.local.get()))
+                                       sb.append('/').append(context.getProperty(EntityNames.ENTITY_TYPE).getString());
+                               for (NodeType superType : nodeType.getDeclaredSupertypes()) {
+                                       sb.append(' ');
+                                       sb.append(superType.getName());
+                               }
+                       }
+                       return sb.toString();
+               } catch (RepositoryException e) {
+                       throw new JcrException(e);
+               }
+       }
+
+       @Override
+       public void setState(CmsUi cmsUi, String state) {
+               if (state == null)
+                       return;
+               if (!state.startsWith("/")) {
+                       if (cmsUi instanceof SuiteUi) {
+                               SuiteUi ui = (SuiteUi) cmsUi;
+                               if (LOGIN.equals(state)) {
+                                       String appTitle = "";
+                                       if (ui.getTitle() != null)
+                                               appTitle = ui.getTitle().lead();
+                                       ui.getCmsView().stateChanged(state, appTitle);
+                                       return;
+                               }
+                               Map<String, Object> properties = new HashMap<>();
+                               String layerId = HOME_STATE.equals(state) ? defaultLayerPid : state;
+                               properties.put(SuiteUxEvent.LAYER, layerId);
+                               properties.put(SuiteUxEvent.CONTENT_PATH, HOME_STATE);
+                               ui.getCmsView().sendEvent(SuiteUxEvent.switchLayer.topic(), properties);
+                       }
+                       return;
+               }
+               SuiteUi suiteUi = (SuiteUi) cmsUi;
+               if (suiteUi.isLoginScreen()) {
+                       return;
+               }
+
+               Content node = stateToNode(suiteUi, state);
+               if (node == null) {
+                       suiteUi.getCmsView().navigateTo(HOME_STATE);
+               } else {
+                       suiteUi.getCmsView().sendEvent(SuiteUxEvent.switchLayer.topic(), SuiteUxEvent.eventProperties(node));
+                       suiteUi.getCmsView().sendEvent(SuiteUxEvent.refreshPart.topic(), SuiteUxEvent.eventProperties(node));
+               }
+       }
+
+       // TODO move it to an internal package?
+       static String nodeToState(Content node) {
+               return node.getPath();
+       }
+
+       private Content stateToNode(SuiteUi suiteUi, String state) {
+               if (suiteUi == null)
+                       return null;
+               if (state == null || !state.startsWith("/"))
+                       return null;
+
+               String path = state;
+
+               ProvidedSession contentSession = (ProvidedSession) CmsUxUtils.getContentSession(contentRepository,
+                               suiteUi.getCmsView());
+               return contentSession.get(path);
+       }
+
+       /*
+        * Events management
+        */
+
+       @Override
+       public void onEvent(String topic, Map<String, Object> event) {
+
+               // Specific UI related events
+               SuiteUi ui = getRelatedUi(event);
+               if (ui == null)
+                       return;
+               ui.getCmsView().runAs(() -> {
+                       try {
+                               String appTitle = "";
+                               if (ui.getTitle() != null)
+                                       appTitle = ui.getTitle().lead() + " - ";
+
+                               if (SuiteUiUtils.isTopic(topic, SuiteUxEvent.refreshPart)) {
+                                       Content node = getContentFromEvent(ui, event);
+                                       if (node == null)
+                                               return;
+                                       SwtUiProvider uiProvider = findByType(uiProvidersByType, node);
+                                       SuiteLayer layer = findByType(layersByType, node);
+                                       ui.switchToLayer(layer, node);
+                                       layer.view(uiProvider, ui.getCurrentWorkArea(), node);
+                                       ui.getCmsView().stateChanged(nodeToState(node), appTitle + CmsUxUtils.getTitle(node));
+                               } else if (SuiteUiUtils.isTopic(topic, SuiteUxEvent.openNewPart)) {
+                                       Content node = getContentFromEvent(ui, event);
+                                       if (node == null)
+                                               return;
+                                       SwtUiProvider uiProvider = findByType(uiProvidersByType, node);
+                                       SuiteLayer layer = findByType(layersByType, node);
+                                       ui.switchToLayer(layer, node);
+                                       layer.open(uiProvider, ui.getCurrentWorkArea(), node);
+                                       ui.getCmsView().stateChanged(nodeToState(node), appTitle + CmsUxUtils.getTitle(node));
+                               } else if (SuiteUiUtils.isTopic(topic, SuiteUxEvent.switchLayer)) {
+                                       String layerId = get(event, SuiteUxEvent.LAYER);
+                                       if (layerId != null) {
+                                               SuiteLayer suiteLayer = findLayer(layerId);
+                                               if (suiteLayer == null)
+                                                       throw new IllegalArgumentException("No layer '" + layerId + "' available.");
+                                               Localized layerTitle = suiteLayer.getTitle();
+                                               // FIXME make sure we don't rebuild the work area twice
+                                               Composite workArea = ui.switchToLayer(layerId, ui.getUserDir());
+                                               String title = null;
+                                               if (layerTitle != null)
+                                                       title = layerTitle.lead();
+                                               Content nodeFromState = getContentFromEvent(ui, event);
+                                               if (nodeFromState != null && nodeFromState.getPath().equals(ui.getUserDir().getPath())) {
+                                                       // default layer view is forced
+                                                       String state = defaultLayerPid.equals(layerId) ? "~" : layerId;
+                                                       ui.getCmsView().stateChanged(state, appTitle + title);
+                                                       suiteLayer.view(null, workArea, nodeFromState);
+                                               } else {
+                                                       Content layerCurrentContext = suiteLayer.getCurrentContext(workArea);
+                                                       if (layerCurrentContext != null && !layerCurrentContext.equals(ui.getUserDir())) {
+                                                               // layer was already showing a context so we set the state to it
+                                                               ui.getCmsView().stateChanged(nodeToState(layerCurrentContext),
+                                                                               appTitle + CmsUxUtils.getTitle(layerCurrentContext));
+                                                       } else {
+                                                               // no context was shown
+                                                               ui.getCmsView().stateChanged(layerId, appTitle + title);
+                                                       }
+                                               }
+                                       } else {
+                                               Content node = getContentFromEvent(ui, event);
+                                               if (node != null) {
+                                                       SuiteLayer layer = findByType(layersByType, node);
+                                                       ui.switchToLayer(layer, node);
+                                               }
+                                       }
+                               }
+                       } catch (Exception e) {
+                               CmsFeedback.error("Cannot handle event " + topic + " " + event, e);
+//                             log.error("Cannot handle event " + event, e);
+                       }
+               });
+       }
+
+       protected Content getContentFromEvent(SuiteUi ui, Map<String, Object> event) {
+               ProvidedSession contentSession = (ProvidedSession) CmsUxUtils.getContentSession(contentRepository,
+                               ui.getCmsView());
+
+               String path = get(event, SuiteUxEvent.CONTENT_PATH);
+
+               if (path != null && (path.equals(HOME_STATE) || path.equals("")))
+                       return ui.getUserDir();
+               Content node;
+               if (path == null) {
+                       // look for a user
+                       String username = get(event, SuiteUxEvent.USERNAME);
+                       if (username == null)
+                               return null;
+                       User user = cmsUserManager.getUser(username);
+                       if (user == null)
+                               return null;
+                       node = ContentUtils.roleToContent(cmsUserManager, contentSession, user);
+               } else {
+                       node = contentSession.get(path);
+               }
+               return node;
+       }
+
+       private SuiteUi getRelatedUi(Map<String, Object> eventProperties) {
+               return managedUis.get(get(eventProperties, CMS_VIEW_UID_PROPERTY));
+       }
+
+       public static String get(Map<String, Object> eventProperties, String key) {
+               Object value = eventProperties.get(key);
+               if (value == null)
+                       return null;
+               return value.toString();
+
+       }
+
+       /*
+        * Dependency injection.
+        */
+
+       public void addUiProvider(SwtUiProvider uiProvider, Map<String, Object> properties) {
+               if (properties.containsKey(Constants.SERVICE_PID)) {
+                       String pid = (String) properties.get(Constants.SERVICE_PID);
+                       RankedObject.putIfHigherRank(uiProvidersByPid, pid, uiProvider, properties);
+               }
+               if (properties.containsKey(EntityConstants.TYPE)) {
+                       List<String> types = LangUtils.toStringList(properties.get(EntityConstants.TYPE));
+                       for (String type : types) {
+                               RankedObject.putIfHigherRank(uiProvidersByType, type, uiProvider, properties);
+                       }
+               }
+       }
+
+       public void removeUiProvider(SwtUiProvider uiProvider, Map<String, Object> properties) {
+               if (properties.containsKey(Constants.SERVICE_PID)) {
+                       String pid = (String) properties.get(Constants.SERVICE_PID);
+                       if (uiProvidersByPid.containsKey(pid)) {
+                               if (uiProvidersByPid.get(pid).equals(new RankedObject<SwtUiProvider>(uiProvider, properties))) {
+                                       uiProvidersByPid.remove(pid);
+                               }
+                       }
+               }
+               if (properties.containsKey(EntityConstants.TYPE)) {
+                       List<String> types = LangUtils.toStringList(properties.get(EntityConstants.TYPE));
+                       for (String type : types) {
+                               if (uiProvidersByType.containsKey(type)) {
+                                       if (uiProvidersByType.get(type).equals(new RankedObject<SwtUiProvider>(uiProvider, properties))) {
+                                               uiProvidersByType.remove(type);
+                                       }
+                               }
+                       }
+               }
+       }
+
+       public void addLayer(SuiteLayer layer, Map<String, Object> properties) {
+               if (properties.containsKey(Constants.SERVICE_PID)) {
+                       String pid = (String) properties.get(Constants.SERVICE_PID);
+                       RankedObject.putIfHigherRank(layersByPid, pid, layer, properties);
+               }
+               if (properties.containsKey(EntityConstants.TYPE)) {
+                       List<String> types = LangUtils.toStringList(properties.get(EntityConstants.TYPE));
+                       for (String type : types)
+                               RankedObject.putIfHigherRank(layersByType, type, layer, properties);
+               }
+       }
+
+       public void removeLayer(SuiteLayer layer, Map<String, Object> properties) {
+               if (properties.containsKey(Constants.SERVICE_PID)) {
+                       String pid = (String) properties.get(Constants.SERVICE_PID);
+                       if (layersByPid.containsKey(pid)) {
+                               if (layersByPid.get(pid).equals(new RankedObject<SuiteLayer>(layer, properties))) {
+                                       layersByPid.remove(pid);
+                               }
+                       }
+               }
+               if (properties.containsKey(EntityConstants.TYPE)) {
+                       List<String> types = LangUtils.toStringList(properties.get(EntityConstants.TYPE));
+                       for (String type : types) {
+                               if (layersByType.containsKey(type)) {
+                                       if (layersByType.get(type).equals(new RankedObject<SuiteLayer>(layer, properties))) {
+                                               layersByType.remove(type);
+                                       }
+                               }
+                       }
+               }
+       }
+
+       public void setCmsUserManager(CmsUserManager cmsUserManager) {
+               this.cmsUserManager = cmsUserManager;
+       }
+
+       protected ContentRepository getContentRepository() {
+               return contentRepository;
+       }
+
+       public void setContentRepository(ContentRepository contentRepository) {
+               this.contentRepository = contentRepository;
+       }
+
+       public void setJcrContentProvider(JcrContentProvider jcrContentProvider) {
+               this.jcrContentProvider = jcrContentProvider;
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteIcon.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteIcon.java
new file mode 100644 (file)
index 0000000..fae2852
--- /dev/null
@@ -0,0 +1,22 @@
+package org.argeo.app.ui;
+
+import org.argeo.api.cms.ux.CmsIcon;
+
+/** Icon names used by Argeo Suite. */
+public enum SuiteIcon implements CmsIcon {
+       add, save, close, closeAll, search, delete, logout, dashboard,
+       // people
+       people, group, person, organisation, addressBook, users, organisationContact,
+       // library
+       documents, document, folder,
+       // management
+       report,
+       // admin and settings
+       settings, user,
+       // misc
+       task, tag, location, inbox, map, todo,
+       // actions
+       openUserMenu,
+       //
+       ;
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteLayer.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteLayer.java
new file mode 100644 (file)
index 0000000..6ee8ca0
--- /dev/null
@@ -0,0 +1,27 @@
+package org.argeo.app.ui;
+
+import org.argeo.api.acr.Content;
+import org.argeo.cms.Localized;
+import org.argeo.cms.swt.acr.SwtUiProvider;
+import org.eclipse.swt.widgets.Composite;
+
+/** An UI layer for the main work area. */
+public interface SuiteLayer extends SwtUiProvider {
+       static enum Property {
+               title, icon, weights, startMaximized, singleTab, singleTabTitle, fixedEntryArea;
+       }
+
+       String getId();
+
+       void view(SwtUiProvider uiProvider, Composite workArea, Content context);
+
+       Content getCurrentContext(Composite workArea);
+
+       default void open(SwtUiProvider uiProvider, Composite workArea, Content context) {
+               view(uiProvider, workArea, context);
+       }
+
+       default Localized getTitle() {
+               return null;
+       }
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteMsg.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteMsg.java
new file mode 100644 (file)
index 0000000..4d515d7
--- /dev/null
@@ -0,0 +1,45 @@
+package org.argeo.app.ui;
+
+import org.argeo.cms.Localized;
+
+/** Localized messages. */
+public enum SuiteMsg implements Localized {
+       // Entities
+       user, org, person, group,
+       // UI parts
+       dashboard, people, documents, locations, recentItems,
+       // NewPersonWizard
+       firstName, lastName, salutation, email, personWizardWindowTitle, personWizardPageTitle, personWizardFeedback,
+       // NewOrgWizard
+       orgWizardWindowTitle, orgWizardPageTitle, orgWizardFeedback, legalName, legalForm, vatId,
+       // Roles
+       userAdminRole, groupAdminRole, publisherRole, coworkerRole,
+       // Group
+       chooseAMember,
+       // ContextAddressComposite
+       chooseAnOrganisation, street, streetComplement, zipCode, city, state, country, geopoint,
+       // FilteredOrderableEntityTable
+       filterHelp,
+       // BankAccountComposite
+       accountHolder, bankName, currency, accountNumber, bankNumber, BIC, IBAN,
+       // EditJobDialog
+       position, chosenItem, department, isPrimary, searchAndChooseEntity,
+       // ContactListCTab (e4)
+       notes, addAContact, contactValue, linkedCompany,
+       // OrgAdminInfoCTab (e4)
+       paymentAccount,
+       // OrgEditor (e4)
+       orgDetails, orgActivityLog, team, orgAdmin,
+       // PersonEditor (e4)
+       personDetails, personActivityLog, personOrgs, personSecurity,
+       // PersonSecurityCTab (e4)
+       resetPassword,
+       // Generic
+       label, aCustomLabel, description, value, name, primary, add, save, pickup,
+       // Tag
+       confirmNewTag, cannotCreateTag,
+       // Feedback messages
+       allFieldsMustBeSet,
+       //
+       ;
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteStyle.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteStyle.java
new file mode 100644 (file)
index 0000000..1afff73
--- /dev/null
@@ -0,0 +1,35 @@
+package org.argeo.app.ui;
+
+import org.argeo.api.cms.ux.CmsStyle;
+
+/** Styles used by Argeo Suite work UI. */
+public enum SuiteStyle implements CmsStyle {
+       // header
+       header, headerTitle, headerMenu, headerMenuItem,
+       // footer
+       footer,
+       // recent items
+       recentItems,
+       // lead pane
+       leadPane, leadPaneItem, leadPaneSectionTitle, leadPaneSubSectionTitle,
+       // entry area
+       entryArea,
+       // group composite
+       titleContainer, titleLabel, subTitleLabel, formLine, formColumn, navigationBar, navigationTitle, navigationButton,
+       // forms elements
+       simpleLabel, simpleText, simpleInput,
+       // table
+       titleCell,
+       // layers
+       workArea,
+       // tabbed area
+       mainTabBody, mainTabSelected, mainTab,
+       // buttons
+       inlineButton;
+
+       @Override
+       public String getClassPrefix() {
+               return "argeo-suite";
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteUi.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteUi.java
new file mode 100644 (file)
index 0000000..c332929
--- /dev/null
@@ -0,0 +1,223 @@
+package org.argeo.app.ui;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.argeo.api.acr.Content;
+import org.argeo.api.cms.CmsLog;
+import org.argeo.cms.Localized;
+import org.argeo.cms.swt.CmsSwtUi;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Composite;
+
+/** The view for the default UX of Argeo Suite. */
+class SuiteUi extends CmsSwtUi {
+       private static final long serialVersionUID = 6207018859086689108L;
+       private final static CmsLog log = CmsLog.getLog(SuiteUi.class);
+
+       private Localized title;
+       private Composite header;
+       private Composite footer;
+       private Composite belowHeader;
+       private Composite leadPane;
+       private Composite sidePane;
+       private Composite dynamicArea;
+
+       private Content userDir;
+
+       private Map<String, SuiteLayer> layers = new HashMap<>();
+       private Map<String, Composite> workAreas = new HashMap<>();
+       private String currentLayerId = null;
+
+       private boolean loginScreen = false;
+
+       public SuiteUi(Composite parent, int style) {
+               super(parent, style);
+               this.setLayout(CmsSwtUtils.noSpaceGridLayout());
+
+               header = new Composite(this, SWT.NONE);
+               header.setLayout(CmsSwtUtils.noSpaceGridLayout());
+               CmsSwtUtils.style(header, SuiteStyle.header);
+               header.setLayoutData(CmsSwtUtils.fillWidth());
+
+               belowHeader = new Composite(this, SWT.NONE);
+               belowHeader.setLayoutData(CmsSwtUtils.fillAll());
+
+               footer = new Composite(this, SWT.NONE);
+               footer.setLayout(CmsSwtUtils.noSpaceGridLayout());
+               CmsSwtUtils.style(footer, SuiteStyle.footer);
+               footer.setLayoutData(CmsSwtUtils.fillWidth());
+       }
+
+       public void refreshBelowHeader(boolean initApp) {
+               CmsSwtUtils.clear(belowHeader);
+               int style = getStyle();
+               if (initApp) {
+                       belowHeader.setLayout(CmsSwtUtils.noSpaceGridLayout(3));
+
+                       if (SWT.RIGHT_TO_LEFT == (style & SWT.RIGHT_TO_LEFT)) {// arabic, hebrew, etc.
+                               sidePane = new Composite(belowHeader, SWT.NONE);
+                               sidePane.setLayout(CmsSwtUtils.noSpaceGridLayout());
+                               sidePane.setLayoutData(CmsSwtUtils.fillHeight());
+                               dynamicArea = new Composite(belowHeader, SWT.NONE);
+                               leadPane = new Composite(belowHeader, SWT.NONE);
+                       } else {
+                               leadPane = new Composite(belowHeader, SWT.NONE);
+                               dynamicArea = new Composite(belowHeader, SWT.NONE);
+                               sidePane = new Composite(belowHeader, SWT.NONE);
+                               sidePane.setLayout(CmsSwtUtils.noSpaceGridLayout());
+                               sidePane.setLayoutData(CmsSwtUtils.fillHeight());
+                       }
+                       leadPane.setLayoutData(CmsSwtUtils.fillHeight());
+                       leadPane.setLayout(CmsSwtUtils.noSpaceGridLayout());
+                       CmsSwtUtils.style(leadPane, SuiteStyle.leadPane);
+
+                       dynamicArea.setLayoutData(CmsSwtUtils.fillAll());
+                       dynamicArea.setLayout(new FormLayout());
+
+               } else {
+                       belowHeader.setLayout(CmsSwtUtils.noSpaceGridLayout());
+               }
+       }
+
+       /*
+        * LAYERS
+        */
+
+       Composite getCurrentWorkArea() {
+               if (currentLayerId == null)
+                       throw new IllegalStateException("No current layer");
+               return workAreas.get(currentLayerId);
+       }
+
+       String getCurrentLayerId() {
+               return currentLayerId;
+       }
+
+       private Composite getLayer(String id, Content context) {
+               if (!layers.containsKey(id))
+                       return null;
+               if (!workAreas.containsKey(id))
+                       initLayer(id, layers.get(id), context);
+               return workAreas.get(id);
+       }
+
+       Composite switchToLayer(String layerId, Content context) {
+               Composite current = null;
+               if (currentLayerId != null) {
+                       current = getCurrentWorkArea();
+                       if (currentLayerId.equals(layerId))
+                               return current;
+               }
+               if (context == null) {
+                       if (!getCmsView().isAnonymous())
+                               context = getUserDir();
+               }
+               Composite toShow = getLayer(layerId, context);
+               if (toShow != null) {
+                       currentLayerId = layerId;
+                       if (!isDisposed()) {
+                               if (!toShow.isDisposed()) {
+                                       toShow.moveAbove(null);
+                               } else {
+                                       log.warn("Cannot show work area because it is disposed.");
+                                       toShow = initLayer(layerId, layers.get(layerId), context);
+                                       toShow.moveAbove(null);
+                               }
+                               dynamicArea.layout(true, true);
+                       }
+                       return toShow;
+               } else {
+                       return current;
+               }
+       }
+
+       void switchToLayer(SuiteLayer layer, Content context) {
+               // TODO make it more robust
+               for (String layerId : layers.keySet()) {
+                       SuiteLayer l = layers.get(layerId);
+                       if (layer.getId().equals(l.getId())) {
+                               switchToLayer(layerId, context);
+                               return;
+                       }
+               }
+               throw new IllegalArgumentException("Layer is not registered.");
+       }
+
+       void addLayer(String id, SuiteLayer layer) {
+               layers.put(id, layer);
+       }
+
+       void removeLayer(String id) {
+               layers.remove(id);
+               if (workAreas.containsKey(id)) {
+                       Composite workArea = workAreas.remove(id);
+                       if (!workArea.isDisposed())
+                               workArea.dispose();
+               }
+       }
+
+       protected Composite initLayer(String id, SuiteLayer layer, Content context) {
+               Composite workArea = getCmsView().doAs(() -> (Composite) layer.createUiPart(dynamicArea, context));
+               CmsSwtUtils.style(workArea, SuiteStyle.workArea);
+               workArea.setLayoutData(CmsSwtUtils.coverAll());
+               workAreas.put(id, workArea);
+               return workArea;
+       }
+
+       synchronized void logout() {
+               userDir = null;
+               currentLayerId = null;
+               workAreas.clear();
+       }
+
+       /*
+        * GETTERS / SETTERS
+        */
+
+       Composite getHeader() {
+               return header;
+       }
+
+       Composite getFooter() {
+               return footer;
+       }
+
+       Composite getLeadPane() {
+               return leadPane;
+       }
+
+       Composite getSidePane() {
+               return sidePane;
+       }
+
+       Composite getBelowHeader() {
+               return belowHeader;
+       }
+
+       Content getUserDir() {
+               return userDir;
+       }
+
+       void setUserDir(Content userDir) {
+               this.userDir = userDir;
+       }
+
+       public Localized getTitle() {
+               return title;
+       }
+
+       public void setTitle(Localized title) {
+               this.title = title;
+       }
+
+       public boolean isLoginScreen() {
+               return loginScreen;
+       }
+
+       public void setLoginScreen(boolean loginScreen) {
+               this.loginScreen = loginScreen;
+       }
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteUiUtils.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteUiUtils.java
new file mode 100644 (file)
index 0000000..504e8ed
--- /dev/null
@@ -0,0 +1,466 @@
+package org.argeo.app.ui;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.nio.file.Files;
+import java.nio.file.Paths;
+import java.util.Objects;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.apache.commons.io.IOUtils;
+import org.argeo.api.acr.Content;
+import org.argeo.api.cms.CmsEvent;
+import org.argeo.api.cms.ux.CmsEditable;
+import org.argeo.api.cms.ux.CmsIcon;
+import org.argeo.api.cms.ux.CmsStyle;
+import org.argeo.app.api.EntityNames;
+import org.argeo.app.api.EntityType;
+import org.argeo.cms.LocaleUtils;
+import org.argeo.cms.Localized;
+import org.argeo.cms.jcr.acr.JcrContent;
+import org.argeo.cms.swt.CmsSwtTheme;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.swt.dialogs.LightweightDialog;
+import org.argeo.cms.ui.util.CmsLink;
+import org.argeo.cms.ui.util.CmsUiUtils;
+import org.argeo.eclipse.ui.EclipseUiUtils;
+import org.argeo.jcr.Jcr;
+import org.argeo.jcr.JcrUtils;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+/** UI utilities related to the APAF project. */
+public class SuiteUiUtils {
+
+       /** Singleton. */
+       private SuiteUiUtils() {
+       }
+
+       /** creates a title bar composite with label and optional button */
+       public static void addTitleBar(Composite parent, String title, Boolean isEditable) {
+               Composite titleBar = new Composite(parent, SWT.NONE);
+               titleBar.setLayoutData(CmsSwtUtils.fillWidth());
+               CmsSwtUtils.style(titleBar, SuiteStyle.titleContainer);
+
+               titleBar.setLayout(CmsSwtUtils.noSpaceGridLayout(new GridLayout(2, false)));
+               Label titleLbl = new Label(titleBar, SWT.NONE);
+               titleLbl.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true));
+               CmsSwtUtils.style(titleLbl, SuiteStyle.titleLabel);
+               titleLbl.setText(title);
+
+               if (isEditable) {
+                       Button editBtn = new Button(titleBar, SWT.PUSH);
+                       editBtn.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false));
+                       CmsSwtUtils.style(editBtn, SuiteStyle.inlineButton);
+                       editBtn.setText("Edit");
+               }
+       }
+
+       public static Label addFormLabel(Composite parent, Localized msg) {
+               return addFormLabel(parent, msg.lead());
+       }
+
+       public static Label addFormLabel(Composite parent, String label) {
+               Label lbl = new Label(parent, SWT.WRAP);
+               lbl.setText(label);
+               // lbl.setLayoutData(new GridData(SWT.LEAD, SWT.CENTER, true, true));
+               CmsSwtUtils.style(lbl, SuiteStyle.simpleLabel);
+               return lbl;
+       }
+
+       public static Text addFormTextField(Composite parent, String text, String message) {
+               return addFormTextField(parent, text, message, SWT.NONE);
+       }
+
+       public static Text addFormTextField(Composite parent, String text, String message, int style) {
+               Text txt = new Text(parent, style);
+               if (text != null)
+                       txt.setText(text);
+               if (message != null)
+                       txt.setMessage(message);
+               txt.setLayoutData(new GridData(SWT.LEAD, SWT.CENTER, true, true));
+               CmsSwtUtils.style(txt, SuiteStyle.simpleText);
+               return txt;
+       }
+
+       public static Text addFormInputField(Composite parent, String placeholder) {
+               Text txt = new Text(parent, SWT.BORDER);
+
+               GridData gridData = CmsSwtUtils.fillWidth();
+               txt.setLayoutData(gridData);
+
+               if (placeholder != null)
+                       txt.setText(placeholder);
+
+               CmsSwtUtils.style(txt, SuiteStyle.simpleInput);
+               return txt;
+       }
+
+       /** creates a single horizontal-block composite for key:value display */
+       public static Text addFormLine(Composite parent, String label, String text) {
+               Composite lineComposite = new Composite(parent, SWT.NONE);
+               lineComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+               lineComposite.setLayout(new GridLayout(2, false));
+               CmsSwtUtils.style(lineComposite, SuiteStyle.formLine);
+               addFormLabel(lineComposite, label);
+               Text txt = addFormTextField(lineComposite, text, null);
+               txt.setEditable(false);
+               txt.setLayoutData(CmsSwtUtils.fillWidth());
+               return txt;
+       }
+
+       public static Text addFormLine(Composite parent, String label, Node node, String property,
+                       CmsEditable cmsEditable) {
+               Composite lineComposite = new Composite(parent, SWT.NONE);
+               lineComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+               lineComposite.setLayout(new GridLayout(2, false));
+               CmsSwtUtils.style(lineComposite, SuiteStyle.formLine);
+               addFormLabel(lineComposite, label);
+               String text = Jcr.get(node, property);
+//             int style = cmsEditable.isEditing() ? SWT.WRAP : SWT.WRAP;
+               Text txt = addFormTextField(lineComposite, text, null, SWT.WRAP);
+               if (cmsEditable != null && cmsEditable.isEditing()) {
+                       txt.addModifyListener((e) -> {
+                               Jcr.set(node, property, txt.getText());
+                               Jcr.save(node);
+                       });
+               } else {
+                       txt.setEditable(false);
+               }
+               txt.setLayoutData(CmsSwtUtils.fillWidth());
+               return txt;
+       }
+
+       public static Text addFormInput(Composite parent, String label, String placeholder) {
+               Composite lineComposite = new Composite(parent, SWT.NONE);
+               lineComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+               lineComposite.setLayout(new GridLayout(2, false));
+               CmsSwtUtils.style(lineComposite, SuiteStyle.formLine);
+               addFormLabel(lineComposite, label);
+               Text txt = addFormInputField(lineComposite, placeholder);
+               txt.setLayoutData(CmsSwtUtils.fillWidth());
+               return txt;
+       }
+
+       /**
+        * creates a single horizontal-block composite for key:value display, with
+        * offset value
+        */
+       public static Text addFormLine(Composite parent, String label, String text, Integer offset) {
+               Composite lineComposite = new Composite(parent, SWT.NONE);
+               lineComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+               lineComposite.setLayout(new GridLayout(3, false));
+               CmsSwtUtils.style(lineComposite, SuiteStyle.formLine);
+               Label offsetLbl = new Label(lineComposite, SWT.NONE);
+               GridData gridData = new GridData();
+               gridData.widthHint = offset;
+               offsetLbl.setLayoutData(gridData);
+               addFormLabel(lineComposite, label);
+               Text txt = addFormTextField(lineComposite, text, null);
+               txt.setLayoutData(CmsSwtUtils.fillWidth());
+               return txt;
+       }
+
+       /** creates a single vertical-block composite for key:value display */
+       public static Text addFormColumn(Composite parent, String label, String text) {
+//             Composite columnComposite = new Composite(parent, SWT.NONE);
+//             columnComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+//             columnComposite.setLayout(new GridLayout(1, false));
+               addFormLabel(parent, label);
+               Text txt = addFormTextField(parent, text, null);
+               txt.setEditable(false);
+               txt.setLayoutData(CmsSwtUtils.fillWidth());
+               return txt;
+       }
+
+       public static Text addFormColumn(Composite parent, String label, Node node, String property,
+                       CmsEditable cmsEditable) {
+//             Composite columnComposite = new Composite(parent, SWT.NONE);
+//             columnComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+//             columnComposite.setLayout(new GridLayout(1, false));
+               addFormLabel(parent, label);
+               String text = Jcr.get(node, property);
+//             int style = cmsEditable.isEditing() ? SWT.WRAP : SWT.WRAP;
+               Text txt = addFormTextField(parent, text, null, SWT.WRAP);
+               if (cmsEditable != null && cmsEditable.isEditing()) {
+                       txt.addModifyListener((e) -> {
+                               Jcr.set(node, property, txt.getText());
+                               Jcr.save(node);
+                       });
+               } else {
+                       txt.setEditable(false);
+               }
+               txt.setLayoutData(CmsSwtUtils.fillWidth());
+               return txt;
+       }
+
+       public static Label createBoldLabel(Composite parent, Localized localized) {
+               Label label = new Label(parent, SWT.LEAD);
+               label.setText(localized.lead());
+               label.setFont(EclipseUiUtils.getBoldFont(parent));
+               label.setLayoutData(new GridData(SWT.LEAD, SWT.CENTER, false, false));
+               return label;
+       }
+
+       public static Label addFormPicture(Composite parent, String label, Node fileNode) throws RepositoryException {
+               Composite lineComposite = new Composite(parent, SWT.NONE);
+               lineComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+               lineComposite.setLayout(new GridLayout(2, true));
+               CmsSwtUtils.style(lineComposite, SuiteStyle.formLine);
+               addFormLabel(lineComposite, label);
+
+               return addPicture(lineComposite, fileNode);
+       }
+
+       public static Label addPicture(Composite parent, Node fileNode) throws RepositoryException {
+               return addPicture(parent, fileNode, null);
+       }
+
+       public static Label addPicture(Composite parent, Node fileNode, Integer maxWidth) throws RepositoryException {
+               return addPicture(parent, fileNode, maxWidth, null);
+       }
+
+       public static Label addPicture(Composite parent, Node fileNode, Integer maxWidth, Node link)
+                       throws RepositoryException {
+               Node content = fileNode.getNode(Node.JCR_CONTENT);
+
+               boolean test = false;
+               if (test) {
+                       try (InputStream in = JcrUtils.getFileAsStream(fileNode);
+                                       OutputStream out = Files.newOutputStream(
+                                                       Paths.get(System.getProperty("user.home") + "/tmp/" + fileNode.getName()));) {
+//                             BufferedImage img = ImageIO.read(in);
+//                             System.out.println(fileNode.getName() + ": width=" + img.getWidth() + ", height=" + img.getHeight());
+                               IOUtils.copy(in, out);
+                       } catch (IOException e) {
+                               throw new RuntimeException(e);
+                       }
+
+//                     try (InputStream in = JcrUtils.getFileAsStream(fileNode);) {
+//                             ImageData imageData = new ImageData(in);
+//                             System.out.println(fileNode.getName() + ": width=" + imageData.width + ", height=" + imageData.height);
+//                     } catch (IOException e) {
+//                             throw new RuntimeException(e);
+//                     }
+               }
+               // TODO move it deeper in the middleware.
+               if (!content.isNodeType(EntityType.box.get())) {
+                       if (content.getSession().hasPermission(content.getPath(), Session.ACTION_SET_PROPERTY)) {
+                               try (InputStream in = JcrUtils.getFileAsStream(fileNode)) {
+                                       ImageData imageData = new ImageData(in);
+                                       content.addMixin(EntityType.box.get());
+                                       content.setProperty(EntityNames.SVG_WIDTH, imageData.width);
+                                       content.setProperty(EntityNames.SVG_HEIGHT, imageData.height);
+                                       content.getSession().save();
+                               } catch (IOException e) {
+                                       throw new RuntimeException(e);
+                               }
+                       }
+               }
+
+               // TODO optimise
+               Long width;
+               Long height;
+               if (content.isNodeType(EntityType.box.get())) {
+                       width = content.getProperty(EntityNames.SVG_WIDTH).getLong();
+                       height = content.getProperty(EntityNames.SVG_HEIGHT).getLong();
+               } else {
+                       try (InputStream in = JcrUtils.getFileAsStream(fileNode)) {
+                               ImageData imageData = new ImageData(in);
+                               width = Long.valueOf(imageData.width);
+                               height = Long.valueOf(imageData.height);
+                       } catch (IOException e) {
+                               throw new RuntimeException(e);
+                       }
+               }
+
+               if (maxWidth != null && width > maxWidth) {
+                       Double ratio = maxWidth.doubleValue() / width.doubleValue();
+                       width = maxWidth.longValue();
+                       height = Math.round(ratio * height);
+               }
+               Label img = new Label(parent, SWT.NONE);
+               CmsSwtUtils.markup(img);
+               StringBuffer txt = new StringBuffer();
+               String target = toLink(link);
+               if (target != null)
+                       txt.append("<a href='").append(target).append("'>");
+               txt.append(CmsUiUtils.img(fileNode, width.toString(), height.toString()));
+               if (target != null)
+                       txt.append("</a>");
+               img.setText(txt.toString());
+               if (parent.getLayout() instanceof GridLayout) {
+                       GridData gd = new GridData(SWT.CENTER, SWT.CENTER, false, false);
+                       gd.widthHint = width.intValue();
+                       gd.heightHint = height.intValue();
+                       img.setLayoutData(gd);
+               }
+
+               if (target == null)
+                       img.addMouseListener(new MouseListener() {
+                               private static final long serialVersionUID = -1362242049325206168L;
+
+                               @Override
+                               public void mouseUp(MouseEvent e) {
+                               }
+
+                               @Override
+                               public void mouseDown(MouseEvent e) {
+                               }
+
+                               @Override
+                               public void mouseDoubleClick(MouseEvent e) {
+                                       LightweightDialog dialog = new LightweightDialog(img.getShell()) {
+
+                                               @Override
+                                               protected Control createDialogArea(Composite parent) {
+                                                       parent.setLayout(new GridLayout());
+                                                       ScrolledComposite scroll = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
+                                                       scroll.setLayoutData(CmsSwtUtils.fillAll());
+                                                       scroll.setLayout(CmsSwtUtils.noSpaceGridLayout());
+                                                       scroll.setExpandHorizontal(true);
+                                                       scroll.setExpandVertical(true);
+                                                       // scroll.setAlwaysShowScrollBars(true);
+
+                                                       Composite c = new Composite(scroll, SWT.NONE);
+                                                       scroll.setContent(c);
+                                                       c.setLayout(new GridLayout());
+                                                       c.setLayoutData(CmsSwtUtils.fillAll());
+                                                       Label bigImg = new Label(c, SWT.NONE);
+                                                       CmsSwtUtils.markup(bigImg);
+                                                       bigImg.setText(CmsUiUtils.img(fileNode, Jcr.get(content, EntityNames.SVG_WIDTH),
+                                                                       Jcr.get(content, EntityNames.SVG_HEIGHT)));
+                                                       bigImg.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, true));
+                                                       return bigImg;
+                                               }
+
+                                               @Override
+                                               protected Point getInitialSize() {
+                                                       Point shellSize = img.getShell().getSize();
+                                                       return new Point(shellSize.x - 100, shellSize.y - 100);
+                                               }
+
+                                       };
+                                       dialog.open();
+                               }
+                       });
+               return img;
+       }
+
+       public static String toLink(Content node) {
+               return node != null ? "#" + CmsSwtUtils.cleanPathForUrl(SuiteApp.nodeToState(node)) : null;
+       }
+
+       public static String toLink(Node node) {
+               return node != null ? "#" + CmsSwtUtils.cleanPathForUrl(SuiteApp.nodeToState(JcrContent.nodeToContent(node)))
+                               : null;
+       }
+
+       public static Control addLink(Composite parent, String label, Node node, CmsStyle style)
+                       throws RepositoryException {
+               String target = toLink(node);
+               CmsLink link = new CmsLink(label, target, style);
+               return link.createUi(parent, node);
+       }
+
+       public static Control addExternalLink(Composite parent, String label, String url, String plainCssAnchorClass,
+                       boolean newWindow) throws RepositoryException {
+               Label lbl = new Label(parent, SWT.NONE);
+               CmsSwtUtils.markup(lbl);
+               StringBuilder txt = new StringBuilder();
+               txt.append("<a");
+               if (plainCssAnchorClass != null)
+                       txt.append(" class='" + plainCssAnchorClass + "'");
+               txt.append(" href='").append(url).append("'");
+               if (newWindow) {
+                       txt.append(" target='blank_'");
+               }
+               txt.append(">");
+               txt.append(label);
+               txt.append("</a>");
+               lbl.setText(txt.toString());
+               return lbl;
+       }
+
+//     public static boolean isCoworker(CmsView cmsView) {
+//             boolean coworker = cmsView.doAs(() -> CurrentUser.isInRole(SuiteRole.coworker.dn()));
+//             return coworker;
+//     }
+
+       public static boolean isTopic(String topic, CmsEvent cmsEvent) {
+               Objects.requireNonNull(topic);
+               return topic.equals(cmsEvent.topic());
+       }
+
+       public static Button createLayerButton(Composite parent, String layer, Localized msg, CmsIcon icon,
+                       ClassLoader l10nClassLoader) {
+               CmsSwtTheme theme = CmsSwtUtils.getCmsTheme(parent);
+               Button button = new Button(parent, SWT.PUSH);
+               CmsSwtUtils.style(button, SuiteStyle.leadPane);
+               if (icon != null)
+                       button.setImage(theme.getBigIcon(icon));
+               button.setLayoutData(new GridData(SWT.CENTER, SWT.BOTTOM, true, false));
+               // button.setToolTipText(msg.lead());
+               if (msg != null) {
+                       Label lbl = new Label(parent, SWT.CENTER);
+                       CmsSwtUtils.style(lbl, SuiteStyle.leadPane);
+                       String txt = LocaleUtils.lead(msg, l10nClassLoader);
+//                     String txt = msg.lead();
+                       lbl.setText(txt);
+                       lbl.setLayoutData(new GridData(SWT.CENTER, SWT.TOP, true, false));
+               }
+               CmsSwtUtils.sendEventOnSelect(button, SuiteUxEvent.switchLayer.topic(), SuiteUxEvent.LAYER, layer);
+               return button;
+       }
+
+//     public static String createAndConfigureEntity(Shell shell, Session referenceSession, String mainMixin,
+//                     String... additionnalProps) {
+//
+//             Session tmpSession = null;
+//             Session mainSession = null;
+//             try {
+//                     // FIXME would not work if home is another physical workspace
+//                     tmpSession = referenceSession.getRepository().login(NodeConstants.HOME_WORKSPACE);
+//                     Node draftNode = null;
+//                     for (int i = 0; i < additionnalProps.length - 1; i += 2) {
+//                             draftNode.setProperty(additionnalProps[i], additionnalProps[i + 1]);
+//                     }
+//                     Wizard wizard = null;
+//                     CmsWizardDialog dialog = new CmsWizardDialog(shell, wizard);
+//                     // WizardDialog dialog = new WizardDialog(shell, wizard);
+//                     if (dialog.open() == Window.OK) {
+//                             String parentPath = null;// "/" + appService.getBaseRelPath(mainMixin);
+//                             // FIXME it should be possible to specify the workspace
+//                             mainSession = referenceSession.getRepository().login();
+//                             Node parent = mainSession.getNode(parentPath);
+//                             Node task = null;// appService.publishEntity(parent, mainMixin, draftNode);
+////                           task = appService.saveEntity(task, false);
+//                             referenceSession.refresh(true);
+//                             return task.getPath();
+//                     }
+//                     return null;
+//             } catch (RepositoryException e1) {
+//                     throw new JcrException(
+//                                     "Unable to create " + mainMixin + " entity with session " + referenceSession.toString(), e1);
+//             } finally {
+//                     JcrUtils.logoutQuietly(tmpSession);
+//                     JcrUtils.logoutQuietly(mainSession);
+//             }
+//     }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteUxEvent.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/SuiteUxEvent.java
new file mode 100644 (file)
index 0000000..00aaddc
--- /dev/null
@@ -0,0 +1,46 @@
+package org.argeo.app.ui;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.jcr.Node;
+
+import org.argeo.api.acr.Content;
+import org.argeo.api.cms.CmsEvent;
+import org.argeo.jcr.Jcr;
+import org.osgi.service.useradmin.User;
+
+/** Events specific to Argeo Suite UX. */
+public enum SuiteUxEvent implements CmsEvent {
+       openNewPart, refreshPart, switchLayer;
+
+       public final static String LAYER = "layer";
+       public final static String USERNAME = "username";
+
+       // ACR
+       public final static String CONTENT_PATH = "contentPath";
+
+       public String getTopicBase() {
+               return "argeo.suite.ui";
+       }
+
+       public static Map<String, Object> eventProperties(Content content) {
+               Map<String, Object> properties = new HashMap<>();
+               properties.put(CONTENT_PATH, content.getPath());
+               return properties;
+       }
+
+       @Deprecated
+       public static Map<String, Object> eventProperties(Node node) {
+               Map<String, Object> properties = new HashMap<>();
+               String contentPath = '/' + Jcr.getWorkspaceName(node) + Jcr.getPath(node);
+               properties.put(CONTENT_PATH, contentPath);
+               return properties;
+       }
+
+       public static Map<String, Object> eventProperties(User user) {
+               Map<String, Object> properties = new HashMap<>();
+               properties.put(USERNAME, user.getName());
+               return properties;
+       }
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/TermsEntryArea.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/TermsEntryArea.java
new file mode 100644 (file)
index 0000000..97d8c1f
--- /dev/null
@@ -0,0 +1,24 @@
+package org.argeo.app.ui;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+
+import org.argeo.cms.ui.CmsUiProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+
+/** Entry area for managing th etypologies. */
+public class TermsEntryArea implements CmsUiProvider {
+
+       @Override
+       public Control createUi(Composite parent, Node context) throws RepositoryException {
+               parent.setLayout(new GridLayout());
+               Label lbl = new Label(parent, SWT.NONE);
+               lbl.setText("Typologies");
+               return lbl;
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/dialogs/NewPersonPage.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/dialogs/NewPersonPage.java
new file mode 100644 (file)
index 0000000..380330f
--- /dev/null
@@ -0,0 +1,72 @@
+package org.argeo.app.ui.dialogs;
+
+import org.argeo.app.ui.SuiteMsg;
+import org.argeo.app.ui.SuiteUiUtils;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+
+public class NewPersonPage extends WizardPage {
+       private static final long serialVersionUID = -944349994177526468L;
+       protected Text lastNameTxt;
+       protected Text firstNameTxt;
+       protected Text emailTxt;
+
+       protected NewPersonPage(String pageName) {
+               super(pageName);
+               setTitle(SuiteMsg.personWizardPageTitle.lead());
+       }
+
+       @Override
+       public void createControl(Composite parent) {
+               parent.setLayout(new GridLayout(2, false));
+
+               // FirstName
+               SuiteUiUtils.createBoldLabel(parent, SuiteMsg.firstName);
+               firstNameTxt = new Text(parent, SWT.BORDER);
+               firstNameTxt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+               // LastName
+               SuiteUiUtils.createBoldLabel(parent, SuiteMsg.lastName);
+               lastNameTxt = new Text(parent, SWT.BORDER);
+               lastNameTxt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+               SuiteUiUtils.createBoldLabel(parent, SuiteMsg.email);
+               emailTxt = new Text(parent, SWT.BORDER);
+               emailTxt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+               ModifyListener ml = new ModifyListener() {
+                       private static final long serialVersionUID = -1628130380128946886L;
+
+                       @Override
+                       public void modifyText(ModifyEvent event) {
+                               getContainer().updateButtons();
+                       }
+               };
+
+               firstNameTxt.addModifyListener(ml);
+               lastNameTxt.addModifyListener(ml);
+               emailTxt.addModifyListener(ml);
+
+               // Don't forget this.
+               setControl(firstNameTxt);
+               firstNameTxt.setFocus();
+
+       }
+
+//     public void updateNode(Node node, PeopleService peopleService, ResourcesService resourcesService) {
+//             ConnectJcrUtils.setJcrProperty(node, PeopleNames.PEOPLE_LAST_NAME, PropertyType.STRING, lastNameTxt.getText());
+//             ConnectJcrUtils.setJcrProperty(node, PeopleNames.PEOPLE_FIRST_NAME, PropertyType.STRING,
+//                             firstNameTxt.getText());
+//             ConnectJcrUtils.setJcrProperty(node, PeopleNames.PEOPLE_DISPLAY_NAME, PropertyType.STRING,
+//                             firstNameTxt.getText() + " " + lastNameTxt.getText());
+//             String email = emailTxt.getText();
+//             ConnectJcrUtils.setJcrProperty(node, PeopleNames.PEOPLE_PRIMARY_EMAIL, PropertyType.STRING, email);
+//             PeopleJcrUtils.createEmail(resourcesService, peopleService, node, email, true, null, null);
+//     }
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/dialogs/NewPersonWizard.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/dialogs/NewPersonWizard.java
new file mode 100644 (file)
index 0000000..ee9f5b9
--- /dev/null
@@ -0,0 +1,151 @@
+package org.argeo.app.ui.dialogs;
+
+import static org.argeo.eclipse.ui.EclipseUiUtils.isEmpty;
+
+import javax.jcr.Node;
+
+import org.argeo.app.ui.SuiteMsg;
+import org.argeo.app.ui.SuiteUiUtils;
+import org.argeo.eclipse.ui.EclipseUiUtils;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+
+/** Ask first & last name. Update the passed node on finish */
+public class NewPersonWizard extends Wizard {
+       // private final static Log log = LogFactory.getLog(NewPersonWizard.class);
+
+       // Context
+       private Node person;
+
+       // This page widgets
+       protected Text lastNameTxt;
+       protected Text firstNameTxt;
+       // private Button useDistinctDisplayNameBtn;
+       // private Text displayNameTxt;
+
+       public NewPersonWizard(Node person) {
+               this.person = person;
+       }
+
+       @Override
+       public void addPages() {
+               try {
+                       MainInfoPage page = new MainInfoPage("Main page");
+                       addPage(page);
+               } catch (Exception e) {
+                       throw new RuntimeException("Cannot add page to wizard", e);
+               }
+               setWindowTitle(SuiteMsg.personWizardWindowTitle.lead());
+       }
+
+       /**
+        * Called when the user click on 'Finish' in the wizard. The task is then
+        * created and the corresponding session saved.
+        */
+       @Override
+       public boolean performFinish() {
+               String lastName = lastNameTxt.getText();
+               String firstName = firstNameTxt.getText();
+               // String displayName = displayNameTxt.getText();
+               // boolean useDistinct = useDistinctDisplayNameBtn.getSelection();
+               if (EclipseUiUtils.isEmpty(lastName) && EclipseUiUtils.isEmpty(firstName)) {
+                       MessageDialog.openError(getShell(), "Non-valid information",
+                                       "Please enter at least a name that is not empty.");
+                       return false;
+               } else {
+//                     ConnectJcrUtils.setJcrProperty(person, PEOPLE_LAST_NAME, PropertyType.STRING, lastName);
+//                     ConnectJcrUtils.setJcrProperty(person, PEOPLE_FIRST_NAME, PropertyType.STRING, firstName);
+//                     String fullName = firstName + " " + lastName;
+//                     ConnectJcrUtils.setJcrProperty(person, PEOPLE_DISPLAY_NAME, PropertyType.STRING, fullName);
+                       return true;
+               }
+       }
+
+       @Override
+       public boolean performCancel() {
+               return true;
+       }
+
+       @Override
+       public boolean canFinish() {
+               String lastName = lastNameTxt.getText();
+               String firstName = firstNameTxt.getText();
+               if (isEmpty(lastName) && isEmpty(firstName)) {
+                       return false;
+               } else
+                       return true;
+       }
+
+       protected class MainInfoPage extends WizardPage {
+               private static final long serialVersionUID = 1L;
+
+               public MainInfoPage(String pageName) {
+                       super(pageName);
+                       setTitle(SuiteMsg.personWizardPageTitle.lead());
+                       // setMessage("Please enter a last name and/or a first name.");
+               }
+
+               public void createControl(Composite parent) {
+                       parent.setLayout(new GridLayout(2, false));
+
+                       // FirstName
+                       SuiteUiUtils.createBoldLabel(parent, SuiteMsg.firstName);
+                       firstNameTxt = new Text(parent, SWT.BORDER);
+                       // firstNameTxt.setMessage("a first name");
+                       firstNameTxt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+                       // LastName
+                       SuiteUiUtils.createBoldLabel(parent, SuiteMsg.lastName);
+                       lastNameTxt = new Text(parent, SWT.BORDER);
+                       // lastNameTxt.setMessage("a last name");
+                       lastNameTxt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+                       // Display Name
+                       // useDistinctDisplayNameBtn = new Button(parent, SWT.CHECK);
+                       // useDistinctDisplayNameBtn.setText("Define a disting display name");
+                       // useDistinctDisplayNameBtn.setLayoutData(new GridData(SWT.FILL, SWT.CENTER,
+                       // true, false, 2, 1));
+                       //
+                       // ConnectWorkbenchUtils.createBoldLabel(parent, "Display Name");
+                       // displayNameTxt = new Text(parent, SWT.BORDER);
+                       // displayNameTxt.setMessage("an optional display name");
+                       // displayNameTxt.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true,
+                       // false));
+                       // displayNameTxt.setEnabled(false);
+                       //
+                       // useDistinctDisplayNameBtn.addSelectionListener(new SelectionAdapter() {
+                       // private static final long serialVersionUID = 1L;
+                       //
+                       // @Override
+                       // public void widgetSelected(SelectionEvent e) {
+                       // displayNameTxt.setEnabled(useDistinctDisplayNameBtn.getSelection());
+                       // }
+                       // });
+
+                       ModifyListener ml = new ModifyListener() {
+                               private static final long serialVersionUID = -1628130380128946886L;
+
+                               @Override
+                               public void modifyText(ModifyEvent event) {
+                                       getContainer().updateButtons();
+                               }
+                       };
+
+                       firstNameTxt.addModifyListener(ml);
+                       lastNameTxt.addModifyListener(ml);
+                       // displayNameTxt.addModifyListener(ml);
+
+                       // Don't forget this.
+                       setControl(firstNameTxt);
+                       firstNameTxt.setFocus();
+               }
+       }
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/AbstractDbkViewer.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/AbstractDbkViewer.java
new file mode 100644 (file)
index 0000000..98b9c6c
--- /dev/null
@@ -0,0 +1,1034 @@
+package org.argeo.app.ui.docbook;
+
+import static org.argeo.app.docbook.DbkType.para;
+import static org.argeo.app.docbook.DbkUtils.addDbk;
+import static org.argeo.app.docbook.DbkUtils.isDbk;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Observer;
+
+import javax.jcr.Item;
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+
+import org.argeo.api.cms.CmsLog;
+import org.argeo.api.cms.ux.Cms2DSize;
+import org.argeo.api.cms.ux.CmsEditable;
+import org.argeo.app.docbook.DbkAttr;
+import org.argeo.app.docbook.DbkType;
+import org.argeo.app.docbook.DbkUtils;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.swt.SwtEditablePart;
+import org.argeo.cms.ui.viewers.AbstractPageViewer;
+import org.argeo.cms.ui.viewers.NodePart;
+import org.argeo.cms.ui.viewers.PropertyPart;
+import org.argeo.cms.ui.viewers.Section;
+import org.argeo.cms.ui.viewers.SectionPart;
+import org.argeo.cms.ui.widgets.EditableText;
+import org.argeo.cms.ui.widgets.StyledControl;
+import org.argeo.jcr.Jcr;
+import org.argeo.jcr.JcrException;
+import org.argeo.jcr.JcrUtils;
+import org.eclipse.rap.fileupload.FileDetails;
+import org.eclipse.rap.fileupload.FileUploadEvent;
+import org.eclipse.rap.fileupload.FileUploadHandler;
+import org.eclipse.rap.fileupload.FileUploadListener;
+import org.eclipse.rap.rwt.RWT;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+/** Base class for text viewers and editors. */
+public abstract class AbstractDbkViewer extends AbstractPageViewer implements KeyListener, Observer {
+       private static final long serialVersionUID = -2401274679492339668L;
+       private final static CmsLog log = CmsLog.getLog(AbstractDbkViewer.class);
+
+       private final Section mainSection;
+
+       private TextInterpreter textInterpreter = new DbkTextInterpreter();
+       private DbkImageManager imageManager;
+
+       private FileUploadListener fileUploadListener;
+       private DbkContextMenu styledTools;
+
+       private final boolean flat;
+
+       private boolean showMainTitle = true;
+
+       private Integer maxMediaWidth = null;
+       private String defaultSectionStyle;
+
+       protected AbstractDbkViewer(Section parent, int style, CmsEditable cmsEditable) {
+               super(parent, style, cmsEditable);
+//             CmsView cmsView = CmsView.getCmsView(parent);
+//             imageManager = cmsView.getImageManager();
+               flat = SWT.FLAT == (style & SWT.FLAT);
+
+               if (getCmsEditable().canEdit()) {
+                       fileUploadListener = new FUL();
+                       styledTools = new DbkContextMenu(this, parent.getShell());
+               }
+               this.mainSection = parent;
+               Node baseFolder = Jcr.getParent(mainSection.getNode());
+               imageManager = new DbkImageManager(baseFolder);
+               initModelIfNeeded(mainSection.getNode());
+               // layout(this.mainSection);
+       }
+
+       @Override
+       public Control getControl() {
+               return mainSection;
+       }
+
+       protected void refresh(Control control) throws RepositoryException {
+               if (!(control instanceof Section))
+                       return;
+               long begin = System.currentTimeMillis();
+               Section section = (Section) control;
+               if (section instanceof TextSection) {
+                       CmsSwtUtils.clear(section);
+                       Node node = section.getNode();
+                       TextSection textSection = (TextSection) section;
+                       String style = node.hasProperty(DbkAttr.role.name()) ? node.getProperty(DbkAttr.role.name()).getString()
+                                       : getDefaultSectionStyle();
+                       if (style != null)
+                               CmsSwtUtils.style(textSection, style);
+
+                       // Title
+                       Node titleNode = null;
+                       // We give priority to ./title vs ./info/title, like the DocBook XSL
+                       if (node.hasNode(DbkType.title.get())) {
+                               titleNode = node.getNode(DbkType.title.get());
+                       } else if (node.hasNode(DbkType.info.get() + '/' + DbkType.title.get())) {
+                               titleNode = node.getNode(DbkType.info.get() + '/' + DbkType.title.get());
+                       }
+
+                       if (titleNode != null) {
+                               boolean showTitle = getMainSection() == section ? showMainTitle : true;
+                               if (showTitle) {
+                                       if (section.getHeader() == null)
+                                               section.createHeader();
+                                       DbkSectionTitle title = newSectionTitle(textSection, titleNode);
+                                       title.setLayoutData(CmsSwtUtils.fillWidth());
+                                       updateContent(title);
+                               }
+                       }
+
+                       // content
+                       for (NodeIterator ni = node.getNodes(); ni.hasNext();) {
+                               Node child = ni.nextNode();
+                               SectionPart sectionPart = null;
+                               if (isDbk(child, DbkType.mediaobject)) {
+                                       if (child.hasNode(DbkType.imageobject.get())) {
+                                               sectionPart = newImg(textSection, child);
+                                       } else if (child.hasNode(DbkType.videoobject.get())) {
+                                               sectionPart = newVideo(textSection, child);
+                                       } else {
+                                               throw new IllegalArgumentException("Unsupported media object " + child);
+                                       }
+                               } else if (isDbk(child, DbkType.info)) {
+                                       // TODO enrich UI based on info
+                               } else if (isDbk(child, DbkType.title)) {
+                                       // already managed
+                               } else if (isDbk(child, para)) {
+                                       sectionPart = newParagraph(textSection, child);
+                               } else if (isDbk(child, DbkType.section)) {
+                                       sectionPart = newSectionPart(textSection, child);
+//                                     if (sectionPart == null)
+//                                             throw new IllegalArgumentException("Unsupported node " + child);
+                                       // TODO list node types in exception
+                               } else {
+                                       throw new IllegalArgumentException("Unsupported node type for " + child);
+                               }
+                               if (sectionPart != null && sectionPart instanceof Control)
+                                       ((Control) sectionPart).setLayoutData(CmsSwtUtils.fillWidth());
+                       }
+
+//                     if (!flat)
+                       for (NodeIterator ni = section.getNode().getNodes(DbkType.section.get()); ni.hasNext();) {
+                               Node child = ni.nextNode();
+                               if (isDbk(child, DbkType.section)) {
+                                       TextSection newSection = newTextSection(section, child);
+                                       newSection.setLayoutData(CmsSwtUtils.fillWidth());
+                                       refresh(newSection);
+                               }
+                       }
+               } else {
+                       for (Section s : section.getSubSections().values())
+                               refresh(s);
+               }
+               // section.layout(true, true);
+               long duration = System.currentTimeMillis() - begin;
+//             System.out.println(duration + " ms - " + DbkUtils.getTitle(section.getNode()));
+       }
+
+       /** To be overridden in order to provide additional SectionPart types */
+       protected TextSection newTextSection(Section section, Node node) {
+               return new TextSection(section, SWT.NONE, node);
+       }
+
+       /** To be overridden in order to provide additional SectionPart types */
+       protected SectionPart newSectionPart(TextSection textSection, Node node) {
+               return null;
+       }
+
+       // CRUD
+       protected Paragraph newParagraph(TextSection parent, Node node) throws RepositoryException {
+               Paragraph paragraph = new Paragraph(parent, parent.getStyle(), node);
+               updateContent(paragraph);
+               paragraph.setLayoutData(CmsSwtUtils.fillWidth());
+               paragraph.setMouseListener(getMouseListener());
+               paragraph.setFocusListener(getFocusListener());
+               return paragraph;
+       }
+
+       protected DbkImg newImg(TextSection parent, Node node) {
+               try {
+                       DbkImg img = new DbkImg(parent, parent.getStyle(), node, imageManager);
+                       GridData imgGd;
+                       if (maxMediaWidth != null) {
+                               imgGd = new GridData(SWT.CENTER, SWT.FILL, false, false);
+                               imgGd.widthHint = maxMediaWidth;
+                               img.setPreferredSize(new Cms2DSize(maxMediaWidth, 0));
+                       } else {
+                               imgGd = CmsSwtUtils.grabWidth(SWT.CENTER, SWT.DEFAULT);
+                       }
+                       img.setLayoutData(imgGd);
+                       updateContent(img);
+                       img.setMouseListener(getMouseListener());
+                       img.setFocusListener(getFocusListener());
+                       return img;
+               } catch (RepositoryException e) {
+                       throw new JcrException("Cannot add new image " + node, e);
+               }
+       }
+
+       protected DbkVideo newVideo(TextSection parent, Node node) {
+               try {
+                       DbkVideo video = new DbkVideo(parent, getCmsEditable().canEdit() ? SWT.NONE : SWT.READ_ONLY, node);
+                       GridData gd;
+                       if (maxMediaWidth != null) {
+                               gd = new GridData(SWT.CENTER, SWT.FILL, false, false);
+                               // TODO, manage size
+//                             gd.widthHint = maxMediaWidth;
+//                             gd.heightHint = (int) (gd.heightHint * 0.5625);
+                       } else {
+                               gd = new GridData(SWT.CENTER, SWT.FILL, false, false);
+//                             gd.widthHint = video.getWidth();
+//                             gd.heightHint = video.getHeight();
+                       }
+                       video.setLayoutData(gd);
+                       updateContent(video);
+                       return video;
+               } catch (RepositoryException e) {
+                       throw new JcrException("Cannot add new image " + node, e);
+               }
+       }
+
+       protected DbkSectionTitle newSectionTitle(TextSection parent, Node titleNode) throws RepositoryException {
+               int style = parent.getStyle();
+               Composite titleParent = newSectionHeader(parent);
+               if (parent.isTitleReadOnly())
+                       style = style | SWT.READ_ONLY;
+               DbkSectionTitle title = new DbkSectionTitle(titleParent, style, titleNode);
+               updateContent(title);
+               title.setMouseListener(getMouseListener());
+               title.setFocusListener(getFocusListener());
+               return title;
+       }
+
+       /**
+        * To be overridden in order to provide additional processing at the section
+        * level.
+        * 
+        * @return the parent to use for the {@link DbkSectionTitle}, by default
+        *         {@link Section#getHeader()}
+        */
+       protected Composite newSectionHeader(TextSection section) {
+               return section.getHeader();
+       }
+
+       protected DbkSectionTitle prepareSectionTitle(Section newSection, String titleText) throws RepositoryException {
+               Node sectionNode = newSection.getNode();
+               Node titleNode = DbkUtils.getOrAddDbk(sectionNode, DbkType.title);
+               getTextInterpreter().write(titleNode, titleText);
+               if (newSection.getHeader() == null)
+                       newSection.createHeader();
+               DbkSectionTitle sectionTitle = newSectionTitle((TextSection) newSection, sectionNode);
+               return sectionTitle;
+       }
+
+       protected void updateContent(SwtEditablePart part) throws RepositoryException {
+               if (part instanceof SectionPart) {
+                       SectionPart sectionPart = (SectionPart) part;
+                       Node partNode = sectionPart.getNode();
+
+                       if (part instanceof StyledControl && (sectionPart.getSection() instanceof TextSection)) {
+                               TextSection section = (TextSection) sectionPart.getSection();
+                               StyledControl styledControl = (StyledControl) part;
+                               if (isDbk(partNode, para)) {
+                                       String style = partNode.hasProperty(DbkAttr.role.name())
+                                                       ? partNode.getProperty(DbkAttr.role.name()).getString()
+                                                       : section.getDefaultTextStyle();
+                                       styledControl.setStyle(style);
+                               }
+                       }
+                       // use control AFTER setting style, since it may have been reset
+
+                       if (part instanceof EditableText) {
+                               EditableText paragraph = (EditableText) part;
+                               if (paragraph == getEdited())
+                                       paragraph.setText(textInterpreter.raw(partNode));
+                               else
+                                       paragraph.setText(textInterpreter.readSimpleHtml(partNode));
+                       } else if (part instanceof DbkImg) {
+                               DbkImg editableImage = (DbkImg) part;
+                               // imageManager.load(partNode, part.getControl(),
+                               // editableImage.getPreferredImageSize());
+                       } else if (part instanceof DbkVideo) {
+                               DbkVideo video = (DbkVideo) part;
+                               video.load(part.getControl());
+                       }
+               } else if (part instanceof DbkSectionTitle) {
+                       DbkSectionTitle title = (DbkSectionTitle) part;
+                       title.setStyle(title.getSection().getTitleStyle());
+                       // use control AFTER setting style
+                       if (title == getEdited())
+                               title.setText(textInterpreter.read(title.getNode()));
+                       else
+                               title.setText(textInterpreter.readSimpleHtml(title.getNode()));
+               }
+       }
+
+       // OVERRIDDEN FROM PARENT VIEWER
+       @Override
+       protected void save(SwtEditablePart part) throws RepositoryException {
+               if (part instanceof EditableText) {
+                       EditableText et = (EditableText) part;
+                       if (!et.getEditable())
+                               return;
+                       String text = ((Text) et.getControl()).getText();
+
+                       // String[] lines = text.split("[\r\n]+");
+                       String[] lines = { text };
+                       assert lines.length != 0;
+                       saveLine(part, lines[0]);
+                       if (lines.length > 1) {
+                               ArrayList<Control> toLayout = new ArrayList<Control>();
+                               if (part instanceof Paragraph) {
+                                       Paragraph currentParagraph = (Paragraph) et;
+                                       Section section = currentParagraph.getSection();
+                                       Node sectionNode = section.getNode();
+                                       Node currentParagraphN = currentParagraph.getNode();
+                                       for (int i = 1; i < lines.length; i++) {
+                                               Node newNode = addDbk(sectionNode, para);
+                                               // newNode.addMixin(CmsTypes.CMS_STYLED);
+                                               saveLine(newNode, lines[i]);
+                                               // second node was create as last, if it is not the next
+                                               // one, it
+                                               // means there are some in between and we can take the
+                                               // one at
+                                               // index+1 for the re-order
+                                               if (newNode.getIndex() > currentParagraphN.getIndex() + 1) {
+                                                       sectionNode.orderBefore(p(newNode.getIndex()), p(currentParagraphN.getIndex() + 1));
+                                               }
+                                               Paragraph newParagraph = newParagraph((TextSection) section, newNode);
+                                               newParagraph.moveBelow(currentParagraph);
+                                               toLayout.add(newParagraph);
+
+                                               currentParagraph = newParagraph;
+                                               currentParagraphN = newNode;
+                                       }
+                               }
+                               // TODO or rather return the created paragraphs?
+                               layout(toLayout.toArray(new Control[toLayout.size()]));
+                       }
+                       persistChanges(et.getNode());
+               }
+       }
+
+       protected void saveLine(SwtEditablePart part, String line) {
+               if (part instanceof NodePart) {
+                       saveLine(((NodePart) part).getNode(), line);
+               } else if (part instanceof PropertyPart) {
+                       saveLine(((PropertyPart) part).getProperty(), line);
+               } else {
+                       throw new IllegalArgumentException("Unsupported part " + part);
+               }
+       }
+
+       protected void saveLine(Item item, String line) {
+               line = line.trim();
+               textInterpreter.write(item, line);
+       }
+
+       @Override
+       protected void prepare(SwtEditablePart part, Object caretPosition) {
+               Control control = part.getControl();
+               if (control instanceof Text) {
+                       Text text = (Text) control;
+                       if (caretPosition != null)
+                               if (caretPosition instanceof Integer)
+                                       text.setSelection((Integer) caretPosition);
+                               else if (caretPosition instanceof Point) {
+//                                     layout(text);
+//                                     // TODO find a way to position the caret at the right place
+//                                     Point clickLocation = (Point) caretPosition;
+//                                     Point withinText = text.toControl(clickLocation);
+//                                     Rectangle bounds = text.getBounds();
+//                                     int width = bounds.width;
+//                                     int height = bounds.height;
+//                                     int textLength = text.getText().length();
+//                                     float area = width * height;
+//                                     float proportion = withinText.y * width + withinText.x;
+//                                     int pos = (int) (textLength * (proportion / area));
+//                                     text.setSelection(pos);
+                               }
+                       text.setData(RWT.ACTIVE_KEYS, new String[] { "BACKSPACE", "ESC", "TAB", "SHIFT+TAB", "ALT+ARROW_LEFT",
+                                       "ALT+ARROW_RIGHT", "ALT+ARROW_UP", "ALT+ARROW_DOWN", "RETURN", "CTRL+RETURN", "ENTER", "DELETE" });
+                       text.setData(RWT.CANCEL_KEYS, new String[] { "RETURN", "ALT+ARROW_LEFT", "ALT+ARROW_RIGHT" });
+                       text.addKeyListener(this);
+               } else if (part instanceof DbkImg) {
+                       ((DbkImg) part).setFileUploadListener(fileUploadListener);
+               }
+       }
+
+       // REQUIRED BY CONTEXT MENU
+       void setParagraphStyle(Paragraph paragraph, String style) {
+               try {
+                       Node paragraphNode = paragraph.getNode();
+                       if (style == null) {// default
+                               if (paragraphNode.hasProperty(DbkAttr.role.name()))
+                                       paragraphNode.getProperty(DbkAttr.role.name()).remove();
+                       } else {
+                               paragraphNode.setProperty(DbkAttr.role.name(), style);
+                       }
+                       persistChanges(paragraphNode);
+                       updateContent(paragraph);
+                       layoutPage();
+               } catch (RepositoryException e1) {
+                       throw new JcrException("Cannot set style " + style + " on " + paragraph, e1);
+               }
+       }
+
+       SectionPart insertPart(Section section, Node node) {
+               try {
+                       refresh(section);
+                       layoutPage();
+                       for (Control control : section.getChildren()) {
+                               if (control instanceof SectionPart) {
+                                       SectionPart sectionPart = (SectionPart) control;
+                                       Node partNode = sectionPart.getNode();
+                                       if (partNode.getPath().equals(node.getPath()))
+                                               return sectionPart;
+                               }
+                       }
+                       throw new IllegalStateException("New section part " + node + "not found");
+               } catch (RepositoryException e) {
+                       throw new JcrException("Cannot insert part " + node + " in section " + section.getNode(), e);
+               }
+       }
+
+       void addParagraph(SectionPart partBefore, String txt) {
+               Section section = partBefore.getSection();
+               SectionPart nextSectionPart = section.nextSectionPart(partBefore);
+               Node newNode = addDbk(section.getNode(), para);
+               textInterpreter.write(newNode, txt != null ? txt : "");
+               if (nextSectionPart != null) {
+                       try {
+                               Node nextNode = nextSectionPart.getNode();
+                               section.getNode().orderBefore(Jcr.getIndexedName(newNode), Jcr.getIndexedName(nextNode));
+                       } catch (RepositoryException e) {
+                               throw new JcrException("Cannot order " + newNode + " before " + nextSectionPart.getNode(), e);
+                       }
+               }
+               Jcr.save(newNode);
+               Paragraph paragraph = (Paragraph) insertPart(partBefore.getSection(), newNode);
+               edit(paragraph, 0);
+       }
+
+       void deletePart(SectionPart sectionPart) {
+               try {
+                       Node node = sectionPart.getNode();
+                       Session session = node.getSession();
+                       if (sectionPart instanceof DbkImg) {
+                               if (!isDbk(node, DbkType.mediaobject))
+                                       throw new IllegalArgumentException("Node " + node + " is not a media object.");
+                       }
+                       node.remove();
+                       session.save();
+                       if (sectionPart instanceof Control)
+                               ((Control) sectionPart).dispose();
+                       layoutPage();
+               } catch (RepositoryException e1) {
+                       throw new JcrException("Cannot delete " + sectionPart, e1);
+               }
+       }
+
+       void deleteSection(Section section) {
+               try {
+                       Node node = section.getNode();
+                       Session session = node.getSession();
+                       node.remove();
+                       session.save();
+                       section.dispose();
+                       layoutPage();
+               } catch (RepositoryException e1) {
+                       throw new JcrException("Cannot delete " + section, e1);
+               }
+       }
+
+       String getRawParagraphText(Paragraph paragraph) {
+               return textInterpreter.raw(paragraph.getNode());
+       }
+
+       // COMMANDS
+       protected void splitEdit() {
+               checkEdited();
+               try {
+                       if (getEdited() instanceof Paragraph) {
+                               Paragraph paragraph = (Paragraph) getEdited();
+                               Text text = (Text) paragraph.getControl();
+                               int caretPosition = text.getCaretPosition();
+                               String txt = text.getText();
+                               String first = txt.substring(0, caretPosition);
+                               String second = txt.substring(caretPosition);
+                               Node firstNode = paragraph.getNode();
+                               Node sectionNode = firstNode.getParent();
+
+                               // FIXME set content the DocBook way
+                               // firstNode.setProperty(CMS_CONTENT, first);
+                               Node secondNode = addDbk(sectionNode, para);
+                               // secondNode.addMixin(CmsTypes.CMS_STYLED);
+
+                               // second node was create as last, if it is not the next one, it
+                               // means there are some in between and we can take the one at
+                               // index+1 for the re-order
+                               if (secondNode.getIndex() > firstNode.getIndex() + 1) {
+                                       sectionNode.orderBefore(p(secondNode.getIndex()), p(firstNode.getIndex() + 1));
+                               }
+
+                               // if we die in between, at least we still have the whole text
+                               // in the first node
+                               try {
+                                       textInterpreter.write(secondNode, second);
+                                       textInterpreter.write(firstNode, first);
+                               } catch (Exception e) {
+                                       // so that no additional nodes are created:
+                                       JcrUtils.discardUnderlyingSessionQuietly(firstNode);
+                                       throw e;
+                               }
+
+                               persistChanges(firstNode);
+
+                               Paragraph secondParagraph = paragraphSplitted(paragraph, secondNode);
+                               edit(secondParagraph, 0);
+                       } else if (getEdited() instanceof DbkSectionTitle) {
+                               DbkSectionTitle sectionTitle = (DbkSectionTitle) getEdited();
+                               Text text = (Text) sectionTitle.getControl();
+                               String txt = text.getText();
+                               int caretPosition = text.getCaretPosition();
+                               Section section = sectionTitle.getSection();
+                               Node sectionNode = section.getNode();
+                               Node paragraphNode = addDbk(sectionNode, para);
+                               // paragraphNode.addMixin(CmsTypes.CMS_STYLED);
+
+                               textInterpreter.write(paragraphNode, txt.substring(caretPosition));
+                               textInterpreter.write(sectionNode.getNode(DbkType.title.get()), txt.substring(0, caretPosition));
+                               sectionNode.orderBefore(p(paragraphNode.getIndex()), p(1));
+                               persistChanges(sectionNode);
+
+                               Paragraph paragraph = sectionTitleSplitted(sectionTitle, paragraphNode);
+                               // section.layout();
+                               edit(paragraph, 0);
+                       }
+               } catch (RepositoryException e) {
+                       throw new JcrException("Cannot split " + getEdited(), e);
+               }
+       }
+
+       protected void mergeWithPrevious() {
+               checkEdited();
+               try {
+                       Paragraph paragraph = (Paragraph) getEdited();
+                       Text text = (Text) paragraph.getControl();
+                       String txt = text.getText();
+                       Node paragraphNode = paragraph.getNode();
+                       if (paragraphNode.getIndex() == 1)
+                               return;// do nothing
+                       Node sectionNode = paragraphNode.getParent();
+                       Node previousNode = sectionNode.getNode(p(paragraphNode.getIndex() - 1));
+                       String previousTxt = textInterpreter.read(previousNode);
+                       textInterpreter.write(previousNode, previousTxt + txt);
+                       paragraphNode.remove();
+                       persistChanges(sectionNode);
+
+                       Paragraph previousParagraph = paragraphMergedWithPrevious(paragraph, previousNode);
+                       edit(previousParagraph, previousTxt.length());
+               } catch (RepositoryException e) {
+                       throw new JcrException("Cannot stop editing", e);
+               }
+       }
+
+       protected void mergeWithNext() {
+               checkEdited();
+               try {
+                       Paragraph paragraph = (Paragraph) getEdited();
+                       Text text = (Text) paragraph.getControl();
+                       String txt = text.getText();
+                       Node paragraphNode = paragraph.getNode();
+                       Node sectionNode = paragraphNode.getParent();
+                       NodeIterator paragraphNodes = sectionNode.getNodes(DbkType.para.get());
+                       long size = paragraphNodes.getSize();
+                       if (paragraphNode.getIndex() == size)
+                               return;// do nothing
+                       Node nextNode = sectionNode.getNode(p(paragraphNode.getIndex() + 1));
+                       String nextTxt = textInterpreter.read(nextNode);
+                       textInterpreter.write(paragraphNode, txt + nextTxt);
+
+                       Section section = paragraph.getSection();
+                       Paragraph removed = (Paragraph) section.getSectionPart(nextNode.getIdentifier());
+
+                       nextNode.remove();
+                       persistChanges(sectionNode);
+
+                       paragraphMergedWithNext(paragraph, removed);
+                       edit(paragraph, txt.length());
+               } catch (RepositoryException e) {
+                       throw new JcrException("Cannot stop editing", e);
+               }
+       }
+
+       protected synchronized void upload(SwtEditablePart part) {
+               try {
+                       if (part instanceof SectionPart) {
+                               SectionPart sectionPart = (SectionPart) part;
+                               Node partNode = sectionPart.getNode();
+                               int partIndex = partNode.getIndex();
+                               Section section = sectionPart.getSection();
+                               Node sectionNode = section.getNode();
+
+                               if (part instanceof Paragraph) {
+                                       // FIXME adapt to DocBook
+//                                     Node newNode = sectionNode.addNode(DocBookNames.DBK_MEDIAOBJECT, NodeType.NT_FILE);
+//                                     newNode.addNode(Node.JCR_CONTENT, NodeType.NT_RESOURCE);
+//                                     JcrUtils.copyBytesAsFile(sectionNode, p(newNode.getIndex()), new byte[0]);
+//                                     if (partIndex < newNode.getIndex() - 1) {
+//                                             // was not last
+//                                             sectionNode.orderBefore(p(newNode.getIndex()), p(partIndex - 1));
+//                                     }
+//                                     // sectionNode.orderBefore(p(partNode.getIndex()),
+//                                     // p(newNode.getIndex()));
+//                                     persistChanges(sectionNode);
+//                                     DbkImg img = newImg((TextSection) section, newNode);
+//                                     edit(img, null);
+//                                     layout(img.getControl());
+                               } else if (part instanceof DbkImg) {
+                                       if (getEdited() == part)
+                                               return;
+                                       edit(part, null);
+                                       layoutPage();
+                               }
+                       }
+               } catch (RepositoryException e) {
+                       throw new JcrException("Cannot upload", e);
+               }
+       }
+
+       protected void deepen() {
+               if (flat)
+                       return;
+               checkEdited();
+               try {
+                       if (getEdited() instanceof Paragraph) {
+                               Paragraph paragraph = (Paragraph) getEdited();
+                               Text text = (Text) paragraph.getControl();
+                               String txt = text.getText();
+                               Node paragraphNode = paragraph.getNode();
+                               Section section = paragraph.getSection();
+                               Node sectionNode = section.getNode();
+                               // main title
+                               if (section == mainSection && section instanceof TextSection && paragraphNode.getIndex() == 1
+                                               && !sectionNode.hasNode(DbkType.title.get())) {
+                                       DbkSectionTitle sectionTitle = prepareSectionTitle(section, txt);
+                                       edit(sectionTitle, 0);
+                                       return;
+                               }
+                               Node newSectionNode = addDbk(sectionNode, DbkType.section);
+                               // newSectionNode.addMixin(NodeType.MIX_TITLE);
+                               sectionNode.orderBefore(h(newSectionNode.getIndex()), h(1));
+
+                               int paragraphIndex = paragraphNode.getIndex();
+                               String sectionPath = sectionNode.getPath();
+                               String newSectionPath = newSectionNode.getPath();
+                               while (sectionNode.hasNode(p(paragraphIndex + 1))) {
+                                       Node parag = sectionNode.getNode(p(paragraphIndex + 1));
+                                       sectionNode.getSession().move(sectionPath + '/' + p(paragraphIndex + 1),
+                                                       newSectionPath + '/' + DbkType.para.get());
+                                       SectionPart sp = section.getSectionPart(parag.getIdentifier());
+                                       if (sp instanceof Control)
+                                               ((Control) sp).dispose();
+                               }
+                               // create title
+                               Node titleNode = DbkUtils.addDbk(newSectionNode, DbkType.title);
+                               // newSectionNode.addNode(DocBookType.TITLE, DocBookType.TITLE);
+                               getTextInterpreter().write(titleNode, txt);
+
+                               TextSection newSection = new TextSection(section, section.getStyle(), newSectionNode);
+                               newSection.setLayoutData(CmsSwtUtils.fillWidth());
+                               newSection.moveBelow(paragraph);
+
+                               // dispose
+                               paragraphNode.remove();
+                               paragraph.dispose();
+
+                               refresh(newSection);
+                               newSection.getParent().layout();
+                               layout(newSection);
+                               persistChanges(sectionNode);
+                       } else if (getEdited() instanceof DbkSectionTitle) {
+                               DbkSectionTitle sectionTitle = (DbkSectionTitle) getEdited();
+                               Section section = sectionTitle.getSection();
+                               Section parentSection = section.getParentSection();
+                               if (parentSection == null)
+                                       return;// cannot deepen main section
+                               Node sectionN = section.getNode();
+                               Node parentSectionN = parentSection.getNode();
+                               if (sectionN.getIndex() == 1)
+                                       return;// cannot deepen first section
+                               Node previousSectionN = parentSectionN.getNode(h(sectionN.getIndex() - 1));
+                               NodeIterator subSections = previousSectionN.getNodes(DbkType.section.get());
+                               int subsectionsCount = (int) subSections.getSize();
+                               previousSectionN.getSession().move(sectionN.getPath(),
+                                               previousSectionN.getPath() + "/" + h(subsectionsCount + 1));
+                               section.dispose();
+                               TextSection newSection = new TextSection(section, section.getStyle(), sectionN);
+                               refresh(newSection);
+                               persistChanges(previousSectionN);
+                       }
+               } catch (RepositoryException e) {
+                       throw new JcrException("Cannot deepen " + getEdited(), e);
+               }
+       }
+
+       protected void undeepen() {
+               if (flat)
+                       return;
+               checkEdited();
+               try {
+                       if (getEdited() instanceof Paragraph) {
+                               upload(getEdited());
+                       } else if (getEdited() instanceof DbkSectionTitle) {
+                               DbkSectionTitle sectionTitle = (DbkSectionTitle) getEdited();
+                               Section section = sectionTitle.getSection();
+                               Node sectionNode = section.getNode();
+                               Section parentSection = section.getParentSection();
+                               if (parentSection == null)
+                                       return;// cannot undeepen main section
+
+                               // choose in which section to merge
+                               Section mergedSection;
+                               if (sectionNode.getIndex() == 1)
+                                       mergedSection = section.getParentSection();
+                               else {
+                                       Map<String, Section> parentSubsections = parentSection.getSubSections();
+                                       ArrayList<Section> lst = new ArrayList<Section>(parentSubsections.values());
+                                       mergedSection = lst.get(sectionNode.getIndex() - 1);
+                               }
+                               Node mergedNode = mergedSection.getNode();
+                               boolean mergedHasSubSections = mergedNode.hasNode(DbkType.section.get());
+
+                               // title as paragraph
+                               Node newParagrapheNode = addDbk(mergedNode, para);
+                               // newParagrapheNode.addMixin(CmsTypes.CMS_STYLED);
+                               if (mergedHasSubSections)
+                                       mergedNode.orderBefore(p(newParagrapheNode.getIndex()), h(1));
+                               String txt = getTextInterpreter().read(sectionNode.getNode(DbkType.title.get()));
+                               getTextInterpreter().write(newParagrapheNode, txt);
+                               // move
+                               NodeIterator paragraphs = sectionNode.getNodes(para.get());
+                               while (paragraphs.hasNext()) {
+                                       Node p = paragraphs.nextNode();
+                                       SectionPart sp = section.getSectionPart(p.getIdentifier());
+                                       if (sp instanceof Control)
+                                               ((Control) sp).dispose();
+                                       mergedNode.getSession().move(p.getPath(), mergedNode.getPath() + '/' + para.get());
+                                       if (mergedHasSubSections)
+                                               mergedNode.orderBefore(p(p.getIndex()), h(1));
+                               }
+
+                               Iterator<Section> subsections = section.getSubSections().values().iterator();
+                               // NodeIterator sections = sectionNode.getNodes(CMS_H);
+                               while (subsections.hasNext()) {
+                                       Section subsection = subsections.next();
+                                       Node s = subsection.getNode();
+                                       mergedNode.getSession().move(s.getPath(), mergedNode.getPath() + '/' + DbkType.section.get());
+                                       subsection.dispose();
+                               }
+
+                               // remove section
+                               section.getNode().remove();
+                               section.dispose();
+
+                               refresh(mergedSection);
+                               mergedSection.getParent().layout();
+                               layout(mergedSection);
+                               persistChanges(mergedNode);
+                       }
+               } catch (RepositoryException e) {
+                       throw new JcrException("Cannot undeepen " + getEdited(), e);
+               }
+       }
+
+       // UI CHANGES
+       protected Paragraph paragraphSplitted(Paragraph paragraph, Node newNode) throws RepositoryException {
+               Section section = paragraph.getSection();
+               updateContent(paragraph);
+               Paragraph newParagraph = newParagraph((TextSection) section, newNode);
+               newParagraph.setLayoutData(CmsSwtUtils.fillWidth());
+               newParagraph.moveBelow(paragraph);
+               layout(paragraph.getControl(), newParagraph.getControl());
+               return newParagraph;
+       }
+
+       protected Paragraph sectionTitleSplitted(DbkSectionTitle sectionTitle, Node newNode) throws RepositoryException {
+               updateContent(sectionTitle);
+               Paragraph newParagraph = newParagraph(sectionTitle.getSection(), newNode);
+               // we assume beforeFirst is not null since there was a sectionTitle
+               newParagraph.moveBelow(sectionTitle.getSection().getHeader());
+               layout(sectionTitle.getControl(), newParagraph.getControl());
+               return newParagraph;
+       }
+
+       protected Paragraph paragraphMergedWithPrevious(Paragraph removed, Node remaining) throws RepositoryException {
+               Section section = removed.getSection();
+               removed.dispose();
+
+               Paragraph paragraph = (Paragraph) section.getSectionPart(remaining.getIdentifier());
+               updateContent(paragraph);
+               layout(paragraph.getControl());
+               return paragraph;
+       }
+
+       protected void paragraphMergedWithNext(Paragraph remaining, Paragraph removed) throws RepositoryException {
+               removed.dispose();
+               updateContent(remaining);
+               layout(remaining.getControl());
+       }
+
+       // UTILITIES
+       protected String p(Integer index) {
+               StringBuilder sb = new StringBuilder(6);
+               sb.append(para.get()).append('[').append(index).append(']');
+               return sb.toString();
+       }
+
+       protected String h(Integer index) {
+               StringBuilder sb = new StringBuilder(5);
+               sb.append(DbkType.section.get()).append('[').append(index).append(']');
+               return sb.toString();
+       }
+
+       // GETTERS / SETTERS
+       public Section getMainSection() {
+               return mainSection;
+       }
+
+       public boolean isFlat() {
+               return flat;
+       }
+
+       public TextInterpreter getTextInterpreter() {
+               return textInterpreter;
+       }
+
+       // KEY LISTENER
+       @Override
+       public void keyPressed(KeyEvent ke) {
+               if (log.isTraceEnabled())
+                       log.trace(ke);
+
+               if (getEdited() == null)
+                       return;
+               boolean altPressed = (ke.stateMask & SWT.ALT) != 0;
+               boolean shiftPressed = (ke.stateMask & SWT.SHIFT) != 0;
+               boolean ctrlPressed = (ke.stateMask & SWT.CTRL) != 0;
+
+               try {
+                       // Common
+                       if (ke.keyCode == SWT.ESC) {
+//                             cancelEdit();
+                               saveEdit();
+                       } else if (ke.character == '\r') {
+                               if (!shiftPressed)
+                                       splitEdit();
+                       } else if (ke.character == 'z') {
+                               if (ctrlPressed)
+                                       cancelEdit();
+                       } else if (ke.character == 'S') {
+                               if (ctrlPressed)
+                                       saveEdit();
+                       } else if (ke.character == '\t') {
+                               if (!shiftPressed) {
+                                       deepen();
+                               } else if (shiftPressed) {
+                                       undeepen();
+                               }
+                       } else {
+                               if (getEdited() instanceof Paragraph) {
+                                       Paragraph paragraph = (Paragraph) getEdited();
+                                       Section section = paragraph.getSection();
+                                       if (altPressed && ke.keyCode == SWT.ARROW_RIGHT) {
+                                               edit(section.nextSectionPart(paragraph), 0);
+                                       } else if (altPressed && ke.keyCode == SWT.ARROW_LEFT) {
+                                               edit(section.previousSectionPart(paragraph), 0);
+                                       } else if (ke.character == SWT.BS) {
+                                               Text text = (Text) paragraph.getControl();
+                                               int caretPosition = text.getCaretPosition();
+                                               if (caretPosition == 0) {
+                                                       mergeWithPrevious();
+                                               }
+                                       } else if (ke.character == SWT.DEL) {
+                                               Text text = (Text) paragraph.getControl();
+                                               int caretPosition = text.getCaretPosition();
+                                               int charcount = text.getCharCount();
+                                               if (caretPosition == charcount) {
+                                                       mergeWithNext();
+                                               }
+                                       }
+                               }
+                       }
+               } catch (Exception e) {
+                       ke.doit = false;
+                       notifyEditionException(e);
+               }
+       }
+
+       @Override
+       public void keyReleased(KeyEvent e) {
+       }
+
+       // MOUSE LISTENER
+       @Override
+       protected MouseListener createMouseListener() {
+               return new ML();
+       }
+
+       private class ML extends MouseAdapter {
+               private static final long serialVersionUID = 8526890859876770905L;
+
+               @Override
+               public void mouseDoubleClick(MouseEvent e) {
+                       if (e.button == 1) {
+                               Control source = (Control) e.getSource();
+                               SwtEditablePart composite = findDataParent(source);
+                               Point point = new Point(e.x, e.y);
+                               if (composite instanceof DbkImg) {
+                                       if (getCmsEditable().canEdit()) {
+                                               if (getCmsEditable().isEditing() && !(getEdited() instanceof DbkImg)) {
+                                                       if (source == mainSection)
+                                                               return;
+                                                       SwtEditablePart part = findDataParent(source);
+                                                       upload(part);
+                                               } else {
+                                                       getCmsEditable().startEditing();
+                                               }
+                                       }
+                               } else if (source instanceof Label) {
+                                       Label lbl = (Label) source;
+                                       Rectangle bounds = lbl.getBounds();
+                                       float width = bounds.width;
+                                       float height = bounds.height;
+                                       float textLength = lbl.getText().length();
+                                       float area = width * height;
+                                       float charArea = area / textLength;
+                                       float lines = textLength / width;
+                                       float proportion = point.y * width + point.x;
+                                       int pos = (int) (textLength * (proportion / area));
+                                       // TODO refine it
+                                       edit(composite, (Integer) pos);
+                               } else {
+                                       edit(composite, source.toDisplay(point));
+                               }
+                       }
+               }
+
+               @Override
+               public void mouseDown(MouseEvent e) {
+                       if (getCmsEditable().isEditing()) {
+                               if (e.button == 3) {
+                                       SwtEditablePart composite = findDataParent((Control) e.getSource());
+                                       if (styledTools != null) {
+                                               List<String> styles = getAvailableStyles(composite);
+                                               styledTools.show(composite, new Point(e.x, e.y), styles);
+                                       }
+                               }
+                       }
+               }
+
+               @Override
+               public void mouseUp(MouseEvent e) {
+               }
+       }
+
+       protected List<String> getAvailableStyles(SwtEditablePart editablePart) {
+               return new ArrayList<>();
+       }
+
+       public void setMaxMediaWidth(Integer maxMediaWidth) {
+               this.maxMediaWidth = maxMediaWidth;
+       }
+
+       public void setShowMainTitle(boolean showMainTitle) {
+               this.showMainTitle = showMainTitle;
+       }
+
+       public String getDefaultSectionStyle() {
+               return defaultSectionStyle;
+       }
+
+       public void setDefaultSectionStyle(String defaultSectionStyle) {
+               this.defaultSectionStyle = defaultSectionStyle;
+       }
+
+       // FILE UPLOAD LISTENER
+       private class FUL implements FileUploadListener {
+               public void uploadProgress(FileUploadEvent event) {
+                       // TODO Monitor upload progress
+               }
+
+               public void uploadFailed(FileUploadEvent event) {
+                       throw new RuntimeException("Upload failed " + event, event.getException());
+               }
+
+               public void uploadFinished(FileUploadEvent event) {
+                       for (FileDetails file : event.getFileDetails()) {
+                               if (log.isDebugEnabled())
+                                       log.debug("Received: " + file.getFileName());
+                       }
+                       mainSection.getDisplay().syncExec(new Runnable() {
+                               @Override
+                               public void run() {
+                                       saveEdit();
+                               }
+                       });
+                       FileUploadHandler uploadHandler = (FileUploadHandler) event.getSource();
+                       uploadHandler.dispose();
+               }
+       }
+}
\ No newline at end of file
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/CustomDbkEditor.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/CustomDbkEditor.java
new file mode 100644 (file)
index 0000000..365a5a1
--- /dev/null
@@ -0,0 +1,23 @@
+package org.argeo.app.ui.docbook;
+
+import javax.jcr.Node;
+
+import org.argeo.api.cms.ux.CmsEditable;
+import org.argeo.cms.ui.viewers.Section;
+import org.eclipse.swt.widgets.Composite;
+
+/**
+ * Manages hardcoded sections as an arbitrary hierarchy under the main section,
+ * which contains no text and no title.
+ */
+public class CustomDbkEditor extends AbstractDbkViewer {
+       private static final long serialVersionUID = 656302500183820802L;
+
+       public CustomDbkEditor(Composite parent, int style, Node textNode, CmsEditable cmsEditable) {
+               this(new Section(parent, style, textNode), style, cmsEditable);
+       }
+
+       public CustomDbkEditor(Section parent, int style, CmsEditable cmsEditable) {
+               super(parent, style, cmsEditable);
+       }
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkContextMenu.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkContextMenu.java
new file mode 100644 (file)
index 0000000..1673bd8
--- /dev/null
@@ -0,0 +1,230 @@
+package org.argeo.app.ui.docbook;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.jcr.Node;
+
+import org.argeo.api.cms.ux.CmsEditable;
+import org.argeo.app.docbook.DbkMsg;
+import org.argeo.app.docbook.DbkUtils;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.swt.SwtEditablePart;
+import org.argeo.cms.swt.MouseDown;
+import org.argeo.cms.ui.viewers.NodePart;
+import org.argeo.cms.ui.viewers.Section;
+import org.argeo.cms.ui.viewers.SectionPart;
+import org.argeo.cms.ui.widgets.EditableText;
+import org.argeo.cms.ui.widgets.Img;
+import org.argeo.jcr.Jcr;
+import org.eclipse.rap.rwt.RWT;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.ShellEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+
+/** Dialog to edit a text part. */
+class DbkContextMenu {
+       private final AbstractDbkViewer textViewer;
+
+       private Shell shell;
+
+       DbkContextMenu(AbstractDbkViewer textViewer, Shell parentShell) {
+//             shell = new Shell(display, SWT.NO_TRIM | SWT.BORDER | SWT.ON_TOP);
+               shell = new Shell(parentShell, SWT.BORDER);
+//             super(display, SWT.NO_TRIM | SWT.BORDER | SWT.ON_TOP);
+               this.textViewer = textViewer;
+               shell.setLayout(new GridLayout());
+               // shell.setData(RWT.CUSTOM_VARIANT, TEXT_STYLED_TOOLS_DIALOG);
+
+               shell.addShellListener(new ToolsShellListener());
+       }
+
+       void show(SwtEditablePart editablePart, Point location, List<String> availableStyles) {
+               if (shell.isVisible())
+                       shell.setVisible(false);
+               CmsSwtUtils.clear(shell);
+               Composite parent = shell;
+               CmsEditable cmsEditable = textViewer.getCmsEditable();
+//             if (availableStyles.isEmpty())
+//                     return;
+
+               if (editablePart instanceof Paragraph) {
+                       Paragraph paragraph = (Paragraph) editablePart;
+                       deletePartB(parent, DbkMsg.deleteParagraph.lead(), paragraph);
+                       insertMediaB(parent,  paragraph);
+
+               } else if (editablePart instanceof Img) {
+                       Img img = (Img) editablePart;
+                       deletePartB(parent, DbkMsg.deleteMedia.lead(), img);
+                       insertMediaB(parent, img);
+                       insertParagraphB(parent, DbkMsg.insertParagraph.lead(), img);
+
+               } else if (editablePart instanceof DbkSectionTitle) {
+                       DbkSectionTitle sectionTitle = (DbkSectionTitle) editablePart;
+                       TextSection section = sectionTitle.getSection();
+                       if (!section.isTitleReadOnly()) {
+                               Label deleteB = new Label(shell, SWT.NONE);
+                               deleteB.setText(DbkMsg.deleteSection.lead());
+                               deleteB.addMouseListener((MouseDown) (e) -> {
+                                       textViewer.deleteSection(section);
+                                       hide();
+                               });
+                       }
+                       insertMediaB(parent,  sectionTitle.getSection(), sectionTitle);
+               }
+
+               StyledToolMouseListener stml = new StyledToolMouseListener(editablePart);
+               List<StyleButton> styleButtons = new ArrayList<DbkContextMenu.StyleButton>();
+               if (cmsEditable.isEditing()) {
+                       for (String style : availableStyles) {
+                               StyleButton styleButton = new StyleButton(shell, SWT.WRAP);
+                               if (!"".equals(style))
+                                       styleButton.setStyle(style);
+                               else
+                                       styleButton.setStyle(null);
+                               styleButton.setMouseListener(stml);
+                               styleButtons.add(styleButton);
+                       }
+               } else if (cmsEditable.canEdit()) {
+                       // Edit
+//                     Label editButton = new Label(shell, SWT.NONE);
+//                     editButton.setText("Edit");
+//                     editButton.addMouseListener(stml);
+               }
+
+               if (editablePart instanceof Paragraph) {
+                       final int size = 32;
+                       String text = textViewer.getRawParagraphText((Paragraph) editablePart);
+                       String textToShow = text.length() > size ? text.substring(0, size - 3) + "..." : text;
+                       for (StyleButton styleButton : styleButtons) {
+                               styleButton.setText((styleButton.style == null ? "default" : styleButton.style) + " : " + textToShow);
+                       }
+               }
+
+               shell.pack();
+               shell.layout();
+               if (editablePart instanceof Control) {
+                       int height = shell.getSize().y;
+                       int parentShellHeight = shell.getShell().getSize().y;
+                       if ((location.y + height) < parentShellHeight) {
+                               shell.setLocation(((Control) editablePart).toDisplay(location.x, location.y));
+                       } else {
+                               shell.setLocation(((Control) editablePart).toDisplay(location.x, location.y - parentShellHeight));
+                       }
+               }
+
+               if (shell.getChildren().length != 0)
+                       shell.open();
+       }
+
+       void hide() {
+               shell.setVisible(false);
+       }
+
+       protected void insertMediaB(Composite parent, SectionPart sectionPart) {
+               insertMediaB(parent,  sectionPart.getSection(), sectionPart);
+       }
+
+       protected void insertMediaB(Composite parent, Section section, NodePart nodePart) {
+               Label insertPictureB = new Label(parent, SWT.NONE);
+               insertPictureB.setText(DbkMsg.insertPicture.lead());
+               insertPictureB.addMouseListener((MouseDown) (e) -> {
+                       Node newNode = DbkUtils.insertImageAfter(nodePart.getNode());
+                       Jcr.save(newNode);
+                       textViewer.insertPart(section, newNode);
+                       hide();
+               });
+               Label insertVideoB = new Label(parent, SWT.NONE);
+               insertVideoB.setText(DbkMsg.insertVideo.lead());
+               insertVideoB.addMouseListener((MouseDown) (e) -> {
+                       Node newNode = DbkUtils.insertVideoAfter(nodePart.getNode());
+                       Jcr.save(newNode);
+                       textViewer.insertPart(section, newNode);
+                       hide();
+               });
+
+       }
+
+       protected void insertParagraphB(Composite parent, String msg, SectionPart sectionPart) {
+               Label insertMediaB = new Label(parent, SWT.NONE);
+               insertMediaB.setText(msg);
+               insertMediaB.addMouseListener((MouseDown) (e) -> {
+                       textViewer.addParagraph(sectionPart, null);
+                       hide();
+               });
+       }
+
+       protected void deletePartB(Composite parent, String msg, SectionPart sectionPart) {
+               Label deleteB = new Label(shell, SWT.NONE);
+               deleteB.setText(msg);
+               deleteB.addMouseListener((MouseDown) (e) -> {
+                       textViewer.deletePart(sectionPart);
+                       hide();
+               });
+       }
+
+       class StyleButton extends EditableText {
+               private static final long serialVersionUID = 7731102609123946115L;
+
+               String style;
+
+               public StyleButton(Composite parent, int style) {
+                       super(parent, style);
+               }
+
+               @Override
+               public void setStyle(String style) {
+                       this.style = style;
+                       super.setStyle(style);
+               }
+
+//             private Label label;
+//
+//             public StyleButton(Composite parent, int swtStyle) {
+//                     super(parent, SWT.NONE);
+//                     setLayout(new GridLayout());
+//                     label = new Label(this, swtStyle);
+//             }
+//
+//             public Label getLabel() {
+//                     return label;
+//             }
+
+       }
+
+       class StyledToolMouseListener extends MouseAdapter {
+               private static final long serialVersionUID = 8516297091549329043L;
+               private SwtEditablePart editablePart;
+
+               public StyledToolMouseListener(SwtEditablePart editablePart) {
+                       super();
+                       this.editablePart = editablePart;
+               }
+
+               @Override
+               public void mouseDown(MouseEvent e) {
+                       // TODO make it more robust.
+                       Label sb = (Label) e.getSource();
+                       Object style = sb.getData(RWT.CUSTOM_VARIANT);
+                       textViewer.setParagraphStyle((Paragraph) editablePart, style == null ? null : style.toString());
+                       hide();
+               }
+       }
+
+       class ToolsShellListener extends org.eclipse.swt.events.ShellAdapter {
+               private static final long serialVersionUID = 8432350564023247241L;
+
+               @Override
+               public void shellDeactivated(ShellEvent e) {
+                       hide();
+               }
+
+       }
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkImageManager.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkImageManager.java
new file mode 100644 (file)
index 0000000..1493223
--- /dev/null
@@ -0,0 +1,175 @@
+package org.argeo.app.ui.docbook;
+
+import static javax.jcr.Node.JCR_CONTENT;
+import static javax.jcr.Property.JCR_DATA;
+import static javax.jcr.nodetype.NodeType.NT_FILE;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.UnsupportedEncodingException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URLEncoder;
+import java.nio.charset.StandardCharsets;
+
+import javax.jcr.Binary;
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.nodetype.NodeType;
+
+import org.argeo.api.cms.ux.Cms2DSize;
+import org.argeo.api.cms.ux.CmsImageManager;
+import org.argeo.app.api.EntityNames;
+import org.argeo.app.api.EntityType;
+import org.argeo.app.docbook.DbkAttr;
+import org.argeo.app.docbook.DbkType;
+import org.argeo.app.docbook.DbkUtils;
+import org.argeo.cms.ui.util.CmsUiUtils;
+import org.argeo.cms.ui.util.DefaultImageManager;
+import org.argeo.jcr.JcrException;
+import org.argeo.jcr.JcrUtils;
+import org.eclipse.swt.graphics.ImageData;
+
+/** Add DocBook images support to {@link CmsImageManager}. */
+public class DbkImageManager extends DefaultImageManager {
+       private Node baseFolder = null;
+
+       public DbkImageManager(Node baseFolder) {
+               this.baseFolder = baseFolder;
+       }
+
+       Node getImageDataNode(Node mediaObjectNode) {
+               try {
+                       if (mediaObjectNode.hasNode(DbkType.imageobject.get())) {
+                               Node imageDataNode = mediaObjectNode.getNode(DbkType.imageobject.get())
+                                               .getNode(DbkType.imagedata.get());
+                               return imageDataNode;
+                       } else {
+                               throw new IllegalStateException("No image data found for " + mediaObjectNode);
+                       }
+               } catch (RepositoryException e) {
+                       throw new JcrException(e);
+               }
+       }
+
+       @Override
+       public Binary getImageBinary(Node node) {
+               Node fileNode = null;
+               if (DbkUtils.isDbk(node, DbkType.mediaobject)) {
+                       Node imageDataNode = getImageDataNode(node);
+                       fileNode = getFileNode(imageDataNode);
+               }
+               try {
+                       if (node.isNodeType(NT_FILE)) {
+                               fileNode = node;
+                       }
+                       if (fileNode != null) {
+                               return node.getNode(JCR_CONTENT).getProperty(JCR_DATA).getBinary();
+                       } else {
+                               return null;
+                       }
+               } catch (RepositoryException e) {
+                       throw new JcrException(e);
+               }
+       }
+
+       public Cms2DSize getImageSize(Node mediaObjectNode) {
+               Node imageDataNode = getImageDataNode(mediaObjectNode);
+               Node fileNode = getFileNode(imageDataNode);
+               if (fileNode == null)
+                       return new Cms2DSize(0, 0);
+               try {
+                       Cms2DSize intrinsicSize;
+                       if (fileNode.hasProperty(EntityNames.SVG_WIDTH) && fileNode.hasProperty(EntityNames.SVG_HEIGHT)) {
+                               int width = (int) fileNode.getProperty(EntityNames.SVG_WIDTH).getLong();
+                               int height = (int) fileNode.getProperty(EntityNames.SVG_HEIGHT).getLong();
+                               intrinsicSize = new Cms2DSize(width, height);
+                       } else {
+                               try (InputStream in = JcrUtils.getFileAsStream(fileNode)) {
+                                       ImageData id = new ImageData(in);
+                                       intrinsicSize = updateSize(fileNode, id);
+                               } catch (IOException e) {
+                                       throw new RuntimeException("Cannot load file " + fileNode, e);
+                               }
+                       }
+                       // TODO interpret image data infos
+                       return intrinsicSize;
+               } catch (RepositoryException e) {
+                       throw new JcrException(e);
+               }
+       }
+
+       protected Cms2DSize updateSize(Node fileNode, ImageData id) throws RepositoryException {
+               fileNode.addMixin(EntityType.box.get());
+               fileNode.setProperty(EntityNames.SVG_WIDTH, id.width);
+               fileNode.setProperty(EntityNames.SVG_HEIGHT, id.height);
+               return new Cms2DSize(id.width, id.height);
+       }
+
+       @Override
+       protected void processNewImageFile(Node mediaObjectNode, Node fileNode, ImageData id)
+                       throws RepositoryException, IOException {
+               Node imageDataNode = getImageDataNode(mediaObjectNode);
+               updateSize(fileNode, id);
+               String filePath = fileNode.getPath();
+               String relPath = filePath.substring(baseFolder.getPath().length() + 1);
+               imageDataNode.setProperty(DbkAttr.fileref.name(), relPath);
+       }
+
+       @Override
+       public String getImageUrl(Node mediaObjectNode) {
+               Node imageDataNode = getImageDataNode(mediaObjectNode);
+               // TODO factorise
+               String fileref = null;
+               try {
+                       if (imageDataNode.hasProperty(DbkAttr.fileref.name()))
+                               fileref = imageDataNode.getProperty(DbkAttr.fileref.name()).getString();
+               } catch (RepositoryException e) {
+                       throw new JcrException(e);
+               }
+               if (fileref == null)
+                       return null;
+               URI fileUri;
+               try {
+                       // FIXME it messes up with the '/'
+                       fileUri = new URI(URLEncoder.encode(fileref, StandardCharsets.UTF_8.toString()));
+               } catch (URISyntaxException | UnsupportedEncodingException e) {
+                       throw new IllegalArgumentException("File ref in " + imageDataNode + " is badly formatted", e);
+               }
+               if (fileUri.getScheme() != null)
+                       return fileUri.toString();
+               // local
+               Node fileNode = getFileNode(imageDataNode);
+               String url = CmsUiUtils.getDataPathForUrl(fileNode);
+               return url;
+       }
+
+       protected Node getFileNode(Node imageDataNode) {
+               // FIXME make URL use case more robust
+               try {
+                       String fileref = null;
+                       if (imageDataNode.hasProperty(DbkAttr.fileref.name()))
+                               fileref = imageDataNode.getProperty(DbkAttr.fileref.name()).getString();
+                       if (fileref == null)
+                               return null;
+                       Node fileNode;
+                       if (fileref.startsWith("/"))
+                               fileNode = baseFolder.getSession().getNode(fileref);
+                       else
+                               fileNode = baseFolder.getNode(fileref);
+                       return fileNode;
+               } catch (RepositoryException e) {
+                       throw new JcrException(e);
+               }
+       }
+
+       protected Node getMediaFolder() {
+               try {
+                       // TODO check edition status
+                       Node mediaFolder = JcrUtils.getOrAdd(baseFolder, EntityNames.MEDIA, NodeType.NT_FOLDER);
+                       return mediaFolder;
+               } catch (RepositoryException e) {
+                       throw new JcrException("Cannot get media folder", e);
+               }
+       }
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkImg.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkImg.java
new file mode 100644 (file)
index 0000000..ca9b388
--- /dev/null
@@ -0,0 +1,70 @@
+package org.argeo.app.ui.docbook;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.ui.widgets.Img;
+import org.eclipse.rap.fileupload.FileUploadEvent;
+import org.eclipse.rap.fileupload.FileUploadHandler;
+import org.eclipse.rap.fileupload.FileUploadListener;
+import org.eclipse.rap.fileupload.FileUploadReceiver;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+/** DocBook specific image area. */
+public class DbkImg extends Img {
+       private static final long serialVersionUID = -6150996708899219074L;
+
+       public DbkImg(Composite parent, int swtStyle, Node imgNode, DbkImageManager imageManager)
+                       throws RepositoryException {
+               super(parent, swtStyle, imgNode, imageManager);
+       }
+
+       @Override
+       protected Node getUploadFolder() {
+               Node mediaFolder = ((DbkImageManager) getImageManager()).getMediaFolder();
+               return mediaFolder;
+       }
+
+       @Override
+       protected String getUploadName() {
+               return null;
+       }
+
+       @Override
+       protected void setContainerLayoutData(Composite composite) {
+               composite.setLayoutData(CmsSwtUtils.grabWidth(SWT.CENTER, SWT.DEFAULT));
+       }
+
+       @Override
+       protected void setControlLayoutData(Control control) {
+               control.setLayoutData(CmsSwtUtils.grabWidth(SWT.CENTER, SWT.DEFAULT));
+       }
+
+       @Override
+       protected FileUploadHandler prepareUpload(FileUploadReceiver receiver) {
+               FileUploadHandler fileUploadHandler = super.prepareUpload(receiver);
+               fileUploadHandler.addUploadListener(new FileUploadListener() {
+
+                       @Override
+                       public void uploadProgress(FileUploadEvent event) {
+                               // TODO Auto-generated method stub
+
+                       }
+
+                       @Override
+                       public void uploadFinished(FileUploadEvent event) {
+                       }
+
+                       @Override
+                       public void uploadFailed(FileUploadEvent event) {
+                               // TODO Auto-generated method stub
+
+                       }
+               });
+               return fileUploadHandler;
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkSectionTitle.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkSectionTitle.java
new file mode 100644 (file)
index 0000000..a68a39c
--- /dev/null
@@ -0,0 +1,30 @@
+package org.argeo.app.ui.docbook;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+
+import org.argeo.cms.swt.SwtEditablePart;
+import org.argeo.cms.ui.viewers.NodePart;
+import org.argeo.cms.ui.widgets.EditableText;
+import org.eclipse.swt.widgets.Composite;
+
+/** The title of a section, based on an XML text node. */
+public class DbkSectionTitle extends EditableText implements SwtEditablePart, NodePart {
+       private static final long serialVersionUID = -1787983154946583171L;
+
+       private final TextSection section;
+
+       public DbkSectionTitle(Composite parent, int swtStyle, Node titleNode) throws RepositoryException {
+               super(parent, swtStyle, titleNode);
+               section = (TextSection) TextSection.findSection(this);
+       }
+
+       public TextSection getSection() {
+               return section;
+       }
+
+       @Override
+       public Node getItem() throws RepositoryException {
+               return getNode();
+       }
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkTextInterpreter.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkTextInterpreter.java
new file mode 100644 (file)
index 0000000..ff12348
--- /dev/null
@@ -0,0 +1,283 @@
+package org.argeo.app.ui.docbook;
+
+import static org.argeo.app.docbook.DbkType.para;
+import static org.argeo.app.docbook.DbkType.title;
+import static org.argeo.app.docbook.DbkUtils.isDbk;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringReader;
+import java.nio.charset.StandardCharsets;
+import java.util.List;
+
+import javax.jcr.ImportUUIDBehavior;
+import javax.jcr.Item;
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.Property;
+import javax.jcr.PropertyIterator;
+import javax.jcr.RepositoryException;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import org.apache.commons.io.IOUtils;
+import org.argeo.app.docbook.DbkAttr;
+import org.argeo.app.docbook.DbkType;
+import org.argeo.jcr.Jcr;
+import org.argeo.jcr.JcrException;
+
+/** Based on HTML with a few Wiki-like shortcuts. */
+public class DbkTextInterpreter implements TextInterpreter {
+       private DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
+
+       private String linkCssClass = DbkType.link.name();
+
+       @Override
+       public void write(Item item, String content) {
+               try {
+                       if (item instanceof Node) {
+                               Node node = (Node) item;
+                               if (isDbk(node, para) || isDbk(node, title)) {
+                                       String raw = convertToStorage(node, content);
+                                       validateBeforeStoring(raw);
+
+                                       String jcrUuid = node.getIdentifier();
+//                                     if (node.hasProperty(Property.JCR_UUID))
+//                                             jcrUuid = node.getProperty(Property.JCR_UUID).getString();
+//                                     else {
+//                                             // TODO use time based
+//                                             jcrUuid = UUID.randomUUID().toString();
+//                                             node.setProperty(Property.JCR_UUID, jcrUuid);
+//                                             node.getSession().save();
+//                                     }
+
+                                       StringBuilder namespaces = new StringBuilder();
+                                       namespaces.append(" xmlns:dbk=\"http://docbook.org/ns/docbook\"");
+                                       namespaces.append(" xmlns:jcr=\"http://www.jcp.org/jcr/1.0\"");
+                                       namespaces.append(" xmlns:xlink=\"http://www.w3.org/1999/xlink\"");
+                                       raw = "<" + node.getName() + " jcr:uuid=\"" + jcrUuid + "\"" + namespaces + ">" + raw + "</"
+                                                       + node.getName() + ">";
+//                                     System.out.println(raw);
+                                       try (InputStream in = new ByteArrayInputStream(raw.getBytes(StandardCharsets.UTF_8))) {
+                                               node.getSession().importXML(node.getParent().getPath(), in,
+                                                               ImportUUIDBehavior.IMPORT_UUID_COLLISION_REPLACE_EXISTING);
+                                               // node.getSession().save();
+                                       } catch (IOException e) {
+                                               throw new IllegalArgumentException("Cannot parse raw content of " + node, e);
+                                       }
+
+//                                     try {
+//                                             DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
+//                                             Document document;
+//                                             try (Reader in = new StringReader(raw)) {
+//                                                     document = documentBuilder.parse(new InputSource(in));
+//                                             }
+//                                             NodeList nl = document.getChildNodes();
+//                                             for (int i = 0; i < nl.getLength(); i++) {
+//                                                     org.w3c.dom.Node n = nl.item(i);
+//                                                     if (node instanceof Text) {
+//
+//                                                     }
+//                                             }
+//                                     } catch (ParserConfigurationException | SAXException | IOException e) {
+//                                             throw new IllegalArgumentException("Cannot parse raw content of " + node, e);
+//                                     }
+
+//                                     Node jcrText;
+//                                     if (!node.hasNode(Jcr.JCR_XMLTEXT))
+//                                             jcrText = node.addNode(Jcr.JCR_XMLTEXT, JcrxType.JCRX_XMLTEXT);
+//                                     else
+//                                             jcrText = node.getNode(Jcr.JCR_XMLTEXT);
+//                                     jcrText.setProperty(Jcr.JCR_XMLCHARACTERS, raw);
+                               } else {
+                                       throw new IllegalArgumentException("Don't know how to interpret " + node);
+                               }
+                       } else {// property
+                               Property property = (Property) item;
+                               property.setValue(content);
+                       }
+                       // item.getSession().save();
+               } catch (RepositoryException e) {
+                       throw new JcrException("Cannot set content on " + item, e);
+               }
+       }
+
+       @Override
+       public String read(Item item) {
+               try {
+                       String raw = raw(item);
+                       return convertFromStorage(item, raw);
+               } catch (RepositoryException e) {
+                       throw new JcrException("Cannot get " + item + " for edit", e);
+               }
+       }
+
+       @Override
+       public String raw(Item item) {
+               try {
+                       item.getSession().refresh(true);
+                       if (item instanceof Node) {
+                               Node node = (Node) item;
+                               if (isDbk(node, para) || isDbk(node, title)) {
+                                       StringBuilder sb = new StringBuilder();
+                                       readXml(node, sb);
+//                                     NodeIterator nit = node.getNodes();
+//                                     while (nit.hasNext()) {
+//                                             Node child = nit.nextNode();
+//                                             if (child.getName().equals(Jcr.JCR_XMLTEXT)) {
+//                                                     Node jcrText = node.getNode(Jcr.JCR_XMLTEXT);
+//                                                     String txt = jcrText.getProperty(Jcr.JCR_XMLCHARACTERS).getString();
+//                                                     // TODO make it more robust
+//                                                     // txt = txt.replace("\n", "").replace("\t", "");
+//                                                     txt = txt.replace("\t", "  ");
+//                                                     sb.append(txt);
+//                                             } else {
+//                                                     try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
+//                                                             child.getSession().exportDocumentView(child.getPath(), out, true, false);
+//                                                             sb.append(new String(out.toByteArray(), StandardCharsets.UTF_8));
+//                                                     } catch (IOException e) {
+//                                                             throw new IllegalStateException("Cannot export " + child, e);
+//                                                     }
+//                                             }
+//                                     }
+                                       return sb.toString();
+                               } else {
+                                       throw new IllegalArgumentException("Don't know how to interpret " + node);
+                               }
+                       } else {// property
+                               Property property = (Property) item;
+                               return property.getString();
+                       }
+               } catch (RepositoryException e) {
+                       throw new JcrException("Cannot get " + item + " content", e);
+               }
+       }
+
+       private void readXml(Node node, StringBuilder sb) throws RepositoryException {
+               NodeIterator nit = node.getNodes();
+               while (nit.hasNext()) {
+                       Node child = nit.nextNode();
+                       if (child.getName().equals(Jcr.JCR_XMLTEXT)) {
+                               String txt = child.getProperty(Jcr.JCR_XMLCHARACTERS).getString();
+                               // TODO make it more robust
+                               // txt = txt.replace("\n", "").replace("\t", "");
+                               txt = txt.replace("\t", "  ");
+                               sb.append(txt);
+                       } else {
+                               sb.append('<').append(child.getName());
+                               PropertyIterator pit = child.getProperties();
+                               properties: while (pit.hasNext()) {
+                                       Property p = pit.nextProperty();
+                                       if (p.getName().startsWith("jcr:"))
+                                               continue properties;
+                                       sb.append(' ').append(p.getName()).append("=\"").append(p.getString()).append('\"');
+                               }
+                               sb.append('>');
+                               readXml(child, sb);
+//                             try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
+//                                     child.getSession().exportDocumentView(child.getPath(), out, true, false);
+//                                     sb.append(new String(out.toByteArray(), StandardCharsets.UTF_8));
+//                             } catch (IOException e) {
+//                                     throw new IllegalStateException("Cannot export " + child, e);
+//                             }
+                               sb.append("</").append(child.getName()).append('>');
+                       }
+               }
+       }
+
+       private void readAsSimpleHtml(Node node, StringBuilder sb) throws RepositoryException {
+               NodeIterator nit = node.getNodes();
+               while (nit.hasNext()) {
+                       Node child = nit.nextNode();
+                       if (child.getName().equals(Jcr.JCR_XMLTEXT)) {
+                               String txt = child.getProperty(Jcr.JCR_XMLCHARACTERS).getString();
+                               // TODO make it more robust
+                               // txt = txt.replace("\n", "").replace("\t", "");
+                               txt = txt.replace("\t", "  ");
+                               String html = textToSimpleHtml(txt);
+                               sb.append(html);
+                       } else if (child.getName().equals(DbkType.link.get())) {
+                               if (child.hasProperty(DbkAttr.XLINK_HREF)) {
+                                       String href = child.getProperty(DbkAttr.XLINK_HREF).getString();
+                                       // TODO deal with other forbidden XML characters?
+                                       href = href.replace("&", "&amp;");
+                                       sb.append("<a class='" + linkCssClass + "' href='").append(href).append("'>");
+                                       readAsSimpleHtml(child, sb);
+                                       sb.append("</a>");
+                               }
+                       } else {
+                               // ignore
+                       }
+               }
+       }
+
+       private String textToSimpleHtml(String raw) {
+               // FIXME the saved data should be corrected instead.
+               if (raw.indexOf('&') >= 0) {
+                       raw = raw.replace("&", "&amp;");
+               }
+               if (raw.indexOf('<') >= 0) {
+                       raw = raw.replace("<", "&lt;");
+               }
+               if (raw.indexOf('>') >= 0) {
+                       raw = raw.replace(">", "&gt;");
+               }
+               if (raw.indexOf('\"') >= 0) {
+                       raw = raw.replace("\"", "&quot;");
+               }
+               if (raw.indexOf('\'') >= 0) {
+                       raw = raw.replace("\'", "&apos;");
+               }
+//             raw = "<span style='text-align:justify'>" + raw + "</span>";
+               if (raw.length() == 0)
+                       return raw;
+               try (StringReader reader = new StringReader(raw)) {
+                       List<String> lines = IOUtils.readLines(reader);
+                       if (lines.size() == 1)
+                               return lines.get(0);
+                       StringBuilder sb = new StringBuilder(raw.length() + lines.size() * BR_LENGTH);
+                       for (int i = 0; i < lines.size(); i++) {
+                               if (i != 0)
+                                       sb.append("<br/>");
+                               sb.append(lines.get(i));
+                       }
+                       return sb.toString();
+               } catch (IOException e) {
+                       throw new RuntimeException(e);
+               }
+       }
+
+       final static int BR_LENGTH = "<br/>".length();
+
+       public String readSimpleHtml(Item item) {
+               try {
+                       StringBuilder sb = new StringBuilder();
+//                     sb.append("<div style='text-align: justify;'>");
+                       readAsSimpleHtml((Node) item, sb);
+//                     sb.append("</div>");
+//                     System.out.println(sb);
+                       return sb.toString();
+               } catch (RepositoryException e) {
+                       throw new JcrException("Cannot convert " + item + " to simple HTML", e);
+               }
+       }
+
+       // EXTENSIBILITY
+       /**
+        * To be overridden, in order to make sure that only valid strings are being
+        * stored.
+        */
+       protected void validateBeforeStoring(String raw) {
+       }
+
+       /** To be overridden, in order to support additional formatting. */
+       protected String convertToStorage(Item item, String content) throws RepositoryException {
+               return content;
+
+       }
+
+       /** To be overridden, in order to support additional formatting. */
+       protected String convertFromStorage(Item item, String content) throws RepositoryException {
+               return content;
+       }
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkVideo.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DbkVideo.java
new file mode 100644 (file)
index 0000000..c911700
--- /dev/null
@@ -0,0 +1,227 @@
+package org.argeo.app.ui.docbook;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.List;
+import java.util.Map;
+
+import javax.jcr.Item;
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+
+import org.argeo.api.acr.ldap.NamingUtils;
+import org.argeo.app.docbook.DbkAttr;
+import org.argeo.app.docbook.DbkType;
+import org.argeo.app.docbook.DbkUtils;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.swt.Selected;
+import org.argeo.cms.ui.viewers.NodePart;
+import org.argeo.cms.ui.viewers.Section;
+import org.argeo.cms.ui.viewers.SectionPart;
+import org.argeo.cms.ui.widgets.StyledControl;
+import org.argeo.jcr.Jcr;
+import org.argeo.jcr.JcrException;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Text;
+
+public class DbkVideo extends StyledControl implements SectionPart, NodePart {
+       private static final long serialVersionUID = -8753232181570351880L;
+       private Section section;
+
+       private int width = 640;
+       private int height = 360;
+
+       private boolean editable;
+
+       public DbkVideo(Composite parent, int style, Node node) {
+               this(Section.findSection(parent), parent, style, node);
+       }
+
+       DbkVideo(Section section, Composite parent, int style, Node node) {
+               super(parent, style, node);
+               editable = !(SWT.READ_ONLY == (style & SWT.READ_ONLY));
+               this.section = section;
+               setStyle(DbkType.videoobject.name());
+       }
+
+       @Override
+       protected Control createControl(Composite box, String style) {
+               Node mediaobject = getNode();
+               Composite wrapper = new Composite(box, SWT.NONE);
+               wrapper.setLayout(CmsSwtUtils.noSpaceGridLayout());
+
+               Composite browserC = new Composite(wrapper, SWT.NONE);
+               browserC.setLayout(CmsSwtUtils.noSpaceGridLayout());
+               GridData gd = new GridData(SWT.CENTER, SWT.FILL, true, true);
+               gd.widthHint = getWidth();
+               gd.heightHint = getHeight();
+               browserC.setLayoutData(gd);
+//             wrapper.setLayoutData(CmsUiUtils.fillAll());
+               Browser browser = new Browser(browserC, SWT.NONE);
+
+               if (editable) {
+                       Composite editor = new Composite(wrapper, SWT.BORDER);
+                       editor.setLayout(new GridLayout(3, false));
+                       editor.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+                       String fileref = DbkUtils.getMediaFileref(mediaobject);
+                       Text text = new Text(editor, SWT.SINGLE);
+                       if (fileref != null)
+                               text.setText(fileref);
+                       else
+                               text.setMessage("Embed URL of the video");
+                       text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+                       Button updateB = new Button(editor, SWT.FLAT);
+                       updateB.setText("Update");
+                       updateB.addSelectionListener(new Selected() {
+
+                               @Override
+                               public void widgetSelected(SelectionEvent e) {
+                                       try {
+                                               Node videodata = mediaobject.getNode(DbkType.videoobject.get())
+                                                               .getNode(DbkType.videodata.get());
+                                               String txt = text.getText();
+                                               URI uri;
+                                               try {
+                                                       uri = new URI(txt);
+                                               } catch (URISyntaxException e1) {
+                                                       text.setText("");
+                                                       text.setMessage("Invalid URL");
+                                                       return;
+                                               }
+
+                                               // Transform watch URL in embed
+                                               // YouTube
+                                               String videoId = null;
+                                               if ("www.youtube.com".equals(uri.getHost()) || "youtube.com".equals(uri.getHost())
+                                                               || "youtu.be".equals(uri.getHost())) {
+                                                       if ("www.youtube.com".equals(uri.getHost()) || "youtube.com".equals(uri.getHost())) {
+                                                               if ("/watch".equals(uri.getPath())) {
+                                                                       Map<String, List<String>> map = NamingUtils.queryToMap(uri);
+                                                                       videoId = map.get("v").get(0);
+                                                               }
+                                                       } else if ("youtu.be".equals(uri.getHost())) {
+                                                               videoId = uri.getPath().substring(1);
+                                                       }
+                                                       if (videoId != null) {
+                                                               try {
+                                                                       uri = new URI("https://www.youtube.com/embed/" + videoId);
+                                                                       text.setText(uri.toString());
+                                                               } catch (URISyntaxException e1) {
+                                                                       throw new IllegalStateException(e1);
+                                                               }
+                                                       }
+                                               }
+
+                                               // Vimeo
+                                               if ("vimeo.com".equals(uri.getHost())) {
+                                                       videoId = uri.getPath().substring(1);
+                                                       if (videoId != null) {
+                                                               try {
+                                                                       uri = new URI("https://player.vimeo.com/video/" + videoId);
+                                                                       text.setText(uri.toString());
+                                                               } catch (URISyntaxException e1) {
+                                                                       throw new IllegalStateException(e1);
+                                                               }
+                                                       }
+                                               }
+
+                                               videodata.setProperty(DbkAttr.fileref.name(), uri.toString());
+                                               // TODO better integrate it in the edition lifecycle
+                                               videodata.getSession().save();
+                                               load(browser);
+                                       } catch (RepositoryException e1) {
+                                               throw new JcrException("Cannot update " + mediaobject, e1);
+                                       }
+
+                               }
+                       });
+
+                       Button deleteB = new Button(editor, SWT.FLAT);
+                       deleteB.setText("Delete");
+                       deleteB.addSelectionListener(new Selected() {
+
+                               @Override
+                               public void widgetSelected(SelectionEvent e) {
+                                       try {
+                                               mediaobject.remove();
+                                               mediaobject.getSession().save();
+                                               dispose();
+                                               getSection().getParent().layout(true, true);
+                                       } catch (RepositoryException e1) {
+                                               throw new JcrException("Cannot update " + mediaobject, e1);
+                                       }
+
+                               }
+                       });
+               }
+
+               // TODO caption
+               return browser;
+       }
+
+       public void load(Control control) {
+               try {
+                       if (control instanceof Browser) {
+                               Browser browser = (Browser) control;
+                               getNode().getSession();
+                               String fileref = DbkUtils.getMediaFileref(getNode());
+                               if (fileref != null) {
+                                       // TODO manage self-hosted videos
+                                       // TODO for YouTube videos, check whether the URL starts with
+                                       // https://www.youtube.com/embed/ and not https://www.youtube.com/watch?v=
+                                       StringBuilder html = new StringBuilder();
+                                       html.append(
+                                                       "<iframe frameborder=\"0\" allow=\"autoplay; fullscreen; picture-in-picture\" allowfullscreen=\"true\"");
+                                       // TODO make size configurable
+                                       html.append("width=\"").append(width).append("\" height=\"").append(height).append("\" ");
+                                       html.append("src=\"").append(fileref).append("\" ");
+                                       html.append("/>");
+                                       browser.setText(html.toString());
+                               }
+                       }
+               } catch (RepositoryException e) {
+                       throw new JcrException("Cannot retrieve src for video " + getNode(), e);
+               }
+       }
+
+       @Override
+       protected void setContainerLayoutData(Composite composite) {
+               composite.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, true));
+       }
+
+       @Override
+       protected void setControlLayoutData(Control control) {
+               control.setLayoutData(CmsSwtUtils.fillAll());
+       }
+
+       @Override
+       public Item getItem() throws RepositoryException {
+               return getNode();
+       }
+
+       @Override
+       public String getPartId() {
+               return getNodeId();
+       }
+
+       @Override
+       public Section getSection() {
+               return section;
+       }
+
+       public int getWidth() {
+               return width;
+       }
+
+       public int getHeight() {
+               return height;
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DocumentPage.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DocumentPage.java
new file mode 100644 (file)
index 0000000..d056493
--- /dev/null
@@ -0,0 +1,62 @@
+package org.argeo.app.ui.docbook;
+
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.nodetype.NodeType;
+
+import org.argeo.api.cms.ux.CmsEditable;
+import org.argeo.app.docbook.DbkType;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.swt.widgets.ScrolledPage;
+import org.argeo.cms.ui.CmsUiProvider;
+import org.argeo.cms.ui.util.CmsLink;
+import org.argeo.cms.ui.viewers.JcrVersionCmsEditable;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+/**
+ * Display the text of the context, and provide an editor if the user can edit.
+ */
+public class DocumentPage implements CmsUiProvider {
+       public final static String WWW = "www";
+
+       @Override
+       public Control createUi(Composite parent, Node context) throws RepositoryException {
+
+               ScrolledPage page = new ScrolledPage(parent, SWT.NONE);
+               page.setLayout(CmsSwtUtils.noSpaceGridLayout());
+               GridData textGd = CmsSwtUtils.fillAll();
+               page.setLayoutData(textGd);
+
+               if (context.isNodeType(DbkType.article.get())) {
+                       CmsEditable cmsEditable = new JcrVersionCmsEditable(context);
+                       if (cmsEditable.canEdit())
+                               new TextEditorHeader(cmsEditable, parent, SWT.NONE).setLayoutData(CmsSwtUtils.fillWidth());
+                       if (!cmsEditable.isEditing())
+                               cmsEditable.startEditing();
+                       new DocumentTextEditor(page, SWT.FLAT, context, cmsEditable);
+               } else {
+                       parent.setBackgroundMode(SWT.INHERIT_NONE);
+                       if (context.getSession().hasPermission(context.getPath(), Session.ACTION_ADD_NODE)) {
+//                             new DocumentTextEditor(page, SWT.FLAT, indexNode, cmsEditable);
+//                             textGd.heightHint = 400;
+
+                               for (NodeIterator ni = context.getNodes(); ni.hasNext();) {
+                                       Node textNode = ni.nextNode();
+                                       if (textNode.isNodeType(NodeType.NT_FOLDER))
+                                               new CmsLink(textNode.getName() + "/", textNode.getPath()).createUi(parent, textNode);
+                               }
+                               for (NodeIterator ni = context.getNodes(); ni.hasNext();) {
+                                       Node textNode = ni.nextNode();
+                                       if (textNode.isNodeType(DbkType.article.get()) && !textNode.getName().equals(WWW))
+                                               new CmsLink(textNode.getName(), textNode.getPath()).createUi(parent, textNode);
+                               }
+                       }
+               }
+               return page;
+       }
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DocumentTextEditor.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/DocumentTextEditor.java
new file mode 100644 (file)
index 0000000..7d41117
--- /dev/null
@@ -0,0 +1,37 @@
+package org.argeo.app.ui.docbook;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+
+import org.argeo.api.cms.ux.CmsEditable;
+import org.argeo.app.docbook.DbkType;
+import org.argeo.app.docbook.DbkUtils;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.eclipse.swt.widgets.Composite;
+
+/** Text editor where sections and subsections can be managed by the user. */
+public class DocumentTextEditor extends AbstractDbkViewer {
+       private static final long serialVersionUID = 6049661610883342325L;
+
+       public DocumentTextEditor(Composite parent, int style, Node textNode, CmsEditable cmsEditable) {
+               super(new TextSection(parent, style, textNode), style, cmsEditable);
+//             refresh();
+               getMainSection().setLayoutData(CmsSwtUtils.fillWidth());
+       }
+
+       @Override
+       protected void initModel(Node textNode) throws RepositoryException {
+               if (isFlat()) {
+                       DbkUtils.addParagraph(textNode, "");
+               }
+//             else
+//                     textNode.setProperty(DocBookNames.DBK_TITLE, textNode.getName());
+       }
+
+       @Override
+       protected Boolean isModelInitialized(Node textNode) throws RepositoryException {
+               return textNode.hasNode(DbkType.title.get()) || textNode.hasNode(DbkType.para.get())
+                               || (!isFlat() && textNode.hasNode(DbkType.section.get()));
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/Paragraph.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/Paragraph.java
new file mode 100644 (file)
index 0000000..ef23d96
--- /dev/null
@@ -0,0 +1,51 @@
+package org.argeo.app.ui.docbook;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+
+import org.argeo.app.docbook.DbkType;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.ui.viewers.SectionPart;
+import org.argeo.cms.ui.widgets.EditableText;
+import org.argeo.cms.ui.widgets.TextStyles;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+/** An editable paragraph. */
+public class Paragraph extends EditableText implements SectionPart {
+       private static final long serialVersionUID = 3746457776229542887L;
+
+       private final TextSection section;
+
+       public Paragraph(TextSection section, int style, Node node) throws RepositoryException {
+               super(section, style, node);
+               this.section = section;
+               CmsSwtUtils.style(this, DbkType.para.name());
+       }
+
+       public TextSection getSection() {
+               return section;
+       }
+
+       @Override
+       protected Label createLabel(Composite box, String style) {
+               Label lbl = super.createLabel(box, style);
+               CmsSwtUtils.disableMarkupValidation(lbl);
+               return lbl;
+       }
+
+       @Override
+       public String getPartId() {
+               return getNodeId();
+       }
+
+       @Override
+       public Node getItem() throws RepositoryException {
+               return getNode();
+       }
+
+       @Override
+       public String toString() {
+               return "Paragraph #" + getPartId();
+       }
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/TextEditorHeader.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/TextEditorHeader.java
new file mode 100644 (file)
index 0000000..22fd55a
--- /dev/null
@@ -0,0 +1,91 @@
+package org.argeo.app.ui.docbook;
+
+import java.util.Observable;
+import java.util.Observer;
+
+import org.argeo.api.cms.ux.CmsEditable;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.ui.widgets.TextStyles;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+
+/** Adds editing capabilities to a page editing text */
+public class TextEditorHeader implements SelectionListener, Observer {
+       private static final long serialVersionUID = 4186756396045701253L;
+
+       private final CmsEditable cmsEditable;
+       private Button publish;
+
+       private Composite parent;
+       private Composite display;
+       private Object layoutData;
+
+       public TextEditorHeader(CmsEditable cmsEditable, Composite parent, int style) {
+               this.cmsEditable = cmsEditable;
+               this.parent = parent;
+               if (this.cmsEditable instanceof Observable)
+                       ((Observable) this.cmsEditable).addObserver(this);
+               refresh();
+       }
+
+       protected void refresh() {
+               if (display != null && !display.isDisposed())
+                       display.dispose();
+               display = null;
+               publish = null;
+               if (cmsEditable.isEditing()) {
+                       display = new Composite(parent, SWT.NONE);
+                       // display.setBackgroundMode(SWT.INHERIT_NONE);
+                       display.setLayoutData(layoutData);
+                       display.setLayout(CmsSwtUtils.noSpaceGridLayout());
+                       CmsSwtUtils.style(display, TextStyles.TEXT_EDITOR_HEADER);
+                       publish = new Button(display, SWT.FLAT | SWT.PUSH);
+                       publish.setText(getPublishButtonLabel());
+                       CmsSwtUtils.style(publish, TextStyles.TEXT_EDITOR_HEADER);
+                       publish.addSelectionListener(this);
+                       display.moveAbove(null);
+               }
+               parent.layout();
+       }
+
+       private String getPublishButtonLabel() {
+               if (cmsEditable.isEditing())
+                       return "Publish";
+               else
+                       return "Edit";
+       }
+
+       @Override
+       public void widgetSelected(SelectionEvent e) {
+               if (e.getSource() == publish) {
+                       if (cmsEditable.isEditing()) {
+                               cmsEditable.stopEditing();
+                       } else {
+                               cmsEditable.startEditing();
+                       }
+                       // publish.setText(getPublishButtonLabel());
+               }
+       }
+
+       @Override
+       public void widgetDefaultSelected(SelectionEvent e) {
+       }
+
+       @Override
+       public void update(Observable o, Object arg) {
+               if (o == cmsEditable) {
+                       // publish.setText(getPublishButtonLabel());
+                       refresh();
+               }
+       }
+
+       public void setLayoutData(Object layoutData) {
+               this.layoutData = layoutData;
+               if (display != null && !display.isDisposed())
+                       display.setLayoutData(layoutData);
+       }
+
+}
\ No newline at end of file
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/TextInterpreter.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/TextInterpreter.java
new file mode 100644 (file)
index 0000000..9da2f6f
--- /dev/null
@@ -0,0 +1,14 @@
+package org.argeo.app.ui.docbook;
+
+import javax.jcr.Item;
+
+/** Convert from/to data layer to/from presentation layer. */
+public interface TextInterpreter {
+       String raw(Item item);
+
+       String read(Item item);
+
+       String readSimpleHtml(Item item);
+
+       void write(Item item, String content);
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/TextSection.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/docbook/TextSection.java
new file mode 100644 (file)
index 0000000..c462d10
--- /dev/null
@@ -0,0 +1,82 @@
+package org.argeo.app.ui.docbook;
+
+import javax.jcr.Node;
+
+import org.argeo.app.docbook.DbkType;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.swt.SwtEditablePart;
+import org.argeo.cms.ui.viewers.Section;
+import org.argeo.cms.ui.widgets.TextStyles;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+/** An editable section. */
+public class TextSection extends Section {
+       private static final long serialVersionUID = -8625209546243220689L;
+       private String defaultTextStyle = DbkType.para.name();
+       private String titleStyle;
+
+       private final boolean flat;
+
+       private boolean titleReadOnly = false;
+
+       private final int level;
+
+       public TextSection(Composite parent, int style, Node node) {
+               this(parent, findSection(parent), style, node);
+       }
+
+       public TextSection(TextSection section, int style, Node node) {
+               this(section, section.getParentSection(), style, node);
+       }
+
+       private TextSection(Composite parent, Section parentSection, int style, Node node) {
+               super(parent, parentSection, style, node);
+               flat = SWT.FLAT == (style & SWT.FLAT);
+               if (parentSection instanceof TextSection) {
+                       level = ((TextSection) parentSection).getLevel() + 1;
+               } else {
+                       level = 0;
+               }
+               CmsSwtUtils.style(this, DbkType.section.name());
+       }
+
+       public String getDefaultTextStyle() {
+               return defaultTextStyle;
+       }
+
+       public boolean isFlat() {
+               return flat;
+       }
+
+       /** The level of this section, similar to h1, h2, etc. in HTML. */
+       public int getLevel() {
+               return level;
+       }
+
+       public String getTitleStyle() {
+               if (titleStyle != null)
+                       return titleStyle;
+               // TODO make base H styles configurable
+//             Integer relativeDepth = getRelativeDepth();
+//             System.out.println("Level: " + getLevel());
+               return "h" + (getLevel() + 1);
+       }
+
+       public void setDefaultTextStyle(String defaultTextStyle) {
+               this.defaultTextStyle = defaultTextStyle;
+       }
+
+       public void setTitleStyle(String titleStyle) {
+               this.titleStyle = titleStyle;
+       }
+
+       public boolean isTitleReadOnly() {
+               return titleReadOnly;
+       }
+
+       public void setTitleReadOnly(boolean titleReadOnly) {
+               this.titleReadOnly = titleReadOnly;
+       }
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/forms/AbstractTermsPart.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/forms/AbstractTermsPart.java
new file mode 100644 (file)
index 0000000..b1cadca
--- /dev/null
@@ -0,0 +1,131 @@
+package org.argeo.app.ui.forms;
+
+import javax.jcr.Item;
+
+import org.argeo.api.cms.ux.CmsIcon;
+import org.argeo.app.api.Term;
+import org.argeo.app.api.TermsManager;
+import org.argeo.app.api.Typology;
+import org.argeo.cms.Localized;
+import org.argeo.cms.swt.CmsSwtTheme;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.swt.SwtEditablePart;
+import org.argeo.cms.swt.widgets.ContextOverlay;
+import org.argeo.cms.ui.widgets.StyledControl;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.ToolItem;
+
+/** Common logic between single and mutliple terms editable part. */
+public abstract class AbstractTermsPart extends StyledControl implements SwtEditablePart {
+       private static final long serialVersionUID = -5497097995341927710L;
+       protected final TermsManager termsManager;
+       protected final Typology typology;
+
+       private final boolean editable;
+
+       private CmsIcon deleteIcon;
+       private CmsIcon addIcon;
+       private CmsIcon cancelIcon;
+
+       private Color highlightColor;
+       private Composite highlight;
+
+       protected final CmsSwtTheme theme;
+
+       public AbstractTermsPart(Composite parent, int style, Item item, TermsManager termsManager, String typology) {
+               super(parent, style, item);
+               if (item == null)
+                       throw new IllegalArgumentException("Item cannot be null");
+               this.termsManager = termsManager;
+               this.typology = termsManager.getTypology(typology);
+               this.theme = CmsSwtUtils.getCmsTheme(parent);
+               editable = !(SWT.READ_ONLY == (style & SWT.READ_ONLY));
+               highlightColor = parent.getDisplay().getSystemColor(SWT.COLOR_GRAY);
+       }
+
+       public boolean isEditable() {
+               return editable;
+       }
+
+       protected void createHighlight(Composite block) {
+               highlight = new Composite(block, SWT.NONE);
+               highlight.setBackground(highlightColor);
+               GridData highlightGd = new GridData(SWT.FILL, SWT.FILL, false, false);
+               highlightGd.widthHint = 5;
+               highlightGd.heightHint = 3;
+               highlight.setLayoutData(highlightGd);
+
+       }
+
+       protected String getTermLabel(Term term) {
+               if (term instanceof Localized)
+                       return ((Localized) term).lead();
+               else
+                       return term.getName();
+
+       }
+
+       protected abstract void refresh(ContextOverlay contextArea, String filter, Text txt);
+
+       protected boolean isTermSelectable(Term term) {
+               return true;
+       }
+
+       protected void processTermListLabel(Term term, Label label) {
+
+       }
+
+       protected void setControlLayoutData(Control control) {
+               control.setLayoutData(CmsSwtUtils.fillAll());
+       }
+
+       protected void setContainerLayoutData(Composite composite) {
+               composite.setLayoutData(CmsSwtUtils.fillAll());
+       }
+
+       //
+       // STYLING
+       //
+       public void setDeleteIcon(CmsIcon deleteIcon) {
+               this.deleteIcon = deleteIcon;
+       }
+
+       public void setAddIcon(CmsIcon addIcon) {
+               this.addIcon = addIcon;
+       }
+
+       public void setCancelIcon(CmsIcon cancelIcon) {
+               this.cancelIcon = cancelIcon;
+       }
+
+       protected TermsManager getTermsManager() {
+               return termsManager;
+       }
+
+       protected void styleDelete(ToolItem deleteItem) {
+               if (deleteIcon != null)
+                       deleteItem.setImage(theme.getSmallIcon(deleteIcon));
+               else
+                       deleteItem.setText("-");
+       }
+
+       protected void styleCancel(ToolItem cancelItem) {
+               if (cancelIcon != null)
+                       cancelItem.setImage(theme.getSmallIcon(cancelIcon));
+               else
+                       cancelItem.setText("X");
+       }
+
+       protected void styleAdd(ToolItem addItem) {
+               if (addIcon != null)
+                       addItem.setImage(theme.getSmallIcon(addIcon));
+               else
+                       addItem.setText("+");
+       }
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/forms/MultiTermsPart.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/forms/MultiTermsPart.java
new file mode 100644 (file)
index 0000000..c936db3
--- /dev/null
@@ -0,0 +1,206 @@
+package org.argeo.app.ui.forms;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.jcr.Item;
+
+import org.argeo.api.cms.CmsLog;
+import org.argeo.app.api.Term;
+import org.argeo.app.api.TermsManager;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.swt.SwtEditablePart;
+import org.argeo.cms.swt.MouseDoubleClick;
+import org.argeo.cms.swt.MouseDown;
+import org.argeo.cms.swt.Selected;
+import org.argeo.cms.swt.widgets.ContextOverlay;
+import org.argeo.cms.ui.forms.FormStyle;
+import org.argeo.jcr.Jcr;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.FocusListener;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+
+/** {@link SwtEditablePart} for multiple terms. */
+public class MultiTermsPart extends AbstractTermsPart {
+       private static final long serialVersionUID = -4961135649177920808L;
+       private final static CmsLog log = CmsLog.getLog(MultiTermsPart.class);
+
+       public MultiTermsPart(Composite parent, int style, Item item, TermsManager termsManager, String typology) {
+               super(parent, style, item, termsManager, typology);
+       }
+
+       @Override
+       protected Control createControl(Composite box, String style) {
+               Composite placeholder = new Composite(box, SWT.NONE);
+
+               boolean vertical = SWT.VERTICAL == (getStyle() & SWT.VERTICAL);
+               RowLayout rl = new RowLayout(vertical ? SWT.VERTICAL : SWT.HORIZONTAL);
+               rl = CmsSwtUtils.noMarginsRowLayout(rl);
+//             rl.wrap = true;
+//             rl.justify = true;
+               placeholder.setLayout(rl);
+               List<Term> currentValue = getValue();
+               if (currentValue != null && !currentValue.isEmpty()) {
+                       for (Term value : currentValue) {
+                               Composite block = new Composite(placeholder, SWT.NONE);
+                               block.setLayout(CmsSwtUtils.noSpaceGridLayout(3));
+                               Label lbl = new Label(block, SWT.NONE);
+                               String display = getTermLabel(value);
+                               lbl.setText(display);
+                               CmsSwtUtils.style(lbl, style == null ? FormStyle.propertyText.style() : style);
+                               processTermListLabel(value, lbl);
+                               if (isEditable())
+                                       lbl.addMouseListener((MouseDoubleClick) (e) -> {
+                                               startEditing();
+                                       });
+                               if (isEditing()) {
+                                       ToolBar toolBar = new ToolBar(block, SWT.HORIZONTAL);
+                                       ToolItem deleteItem = new ToolItem(toolBar, SWT.FLAT);
+                                       styleDelete(deleteItem);
+                                       deleteItem.addSelectionListener((Selected) (e) -> {
+                                               // we retrieve them again here because they may have changed
+                                               List<Term> curr = getValue();
+                                               List<Term> newValue = new ArrayList<>();
+                                               for (Term v : curr) {
+                                                       if (!v.equals(value))
+                                                               newValue.add(v);
+                                               }
+                                               setValue(newValue);
+                                               block.dispose();
+                                               layout(true, true);
+                                       });
+
+                               }
+                       }
+               } else {// empty
+                       if (isEditable() && !isEditing()) {
+                               ToolBar toolBar = new ToolBar(placeholder, SWT.HORIZONTAL);
+                               ToolItem addItem = new ToolItem(toolBar, SWT.FLAT);
+                               styleAdd(addItem);
+                               addItem.addSelectionListener((Selected) (e) -> {
+                                       startEditing();
+                               });
+                       }
+               }
+
+               if (isEditing()) {
+                       Composite block = new Composite(placeholder, SWT.NONE);
+                       block.setLayout(CmsSwtUtils.noSpaceGridLayout(3));
+
+                       createHighlight(block);
+
+                       Text txt = new Text(block, SWT.SINGLE | SWT.BORDER);
+                       txt.setLayoutData(CmsSwtUtils.fillWidth());
+//                     txt.setMessage("[new]");
+
+                       CmsSwtUtils.style(txt, style == null ? FormStyle.propertyText.style() : style);
+
+                       ToolBar toolBar = new ToolBar(block, SWT.HORIZONTAL);
+                       ToolItem cancelItem = new ToolItem(toolBar, SWT.FLAT);
+                       styleCancel(cancelItem);
+                       cancelItem.addSelectionListener((Selected) (e) -> {
+                               stopEditing();
+                       });
+
+                       ContextOverlay contextOverlay = new ContextOverlay(txt, SWT.NONE) {
+                               private static final long serialVersionUID = -7980078594405384874L;
+
+                               @Override
+                               protected void onHide() {
+                                       stopEditing();
+                               }
+                       };
+                       contextOverlay.setLayout(new GridLayout());
+                       // filter
+                       txt.addModifyListener((e) -> {
+                               String filter = txt.getText().toLowerCase();
+                               if ("".equals(filter.trim()))
+                                       filter = null;
+                               refresh(contextOverlay, filter, txt);
+                       });
+                       txt.addFocusListener(new FocusListener() {
+                               private static final long serialVersionUID = -6024501573409619949L;
+
+                               @Override
+                               public void focusLost(FocusEvent event) {
+//                                     if (!contextOverlay.isDisposed() && contextOverlay.isShellVisible())
+//                                             getDisplay().asyncExec(() -> stopEditing());
+                               }
+
+                               @Override
+                               public void focusGained(FocusEvent event) {
+                                       // txt.setText("");
+                                       if (!contextOverlay.isDisposed() && !contextOverlay.isShellVisible())
+                                               refresh(contextOverlay, null, txt);
+                               }
+                       });
+                       layout(new Control[] { txt });
+                       // getDisplay().asyncExec(() -> txt.setFocus());
+               }
+               return placeholder;
+       }
+
+       @Override
+       protected void refresh(ContextOverlay contextArea, String filter, Text txt) {
+               CmsSwtUtils.clear(contextArea);
+               List<? extends Term> terms = termsManager.listAllTerms(typology.getId());
+               List<Term> currentValue = getValue();
+               terms: for (Term term : terms) {
+                       if (currentValue != null && currentValue.contains(term))
+                               continue terms;
+                       String display = getTermLabel(term);
+                       if (filter != null && !display.toLowerCase().contains(filter))
+                               continue terms;
+                       Label termL = new Label(contextArea, SWT.WRAP);
+                       termL.setText(display);
+                       processTermListLabel(term, termL);
+                       if (isTermSelectable(term))
+                               termL.addMouseListener((MouseDown) (e) -> {
+                                       List<Term> newValue = new ArrayList<>();
+                                       List<Term> curr = getValue();
+                                       if (currentValue != null)
+                                               newValue.addAll(curr);
+                                       newValue.add(term);
+                                       setValue(newValue);
+                                       contextArea.hide();
+                                       stopEditing();
+                               });
+               }
+               contextArea.show();
+       }
+
+       protected List<Term> getValue() {
+               String property = typology.getId();
+               List<String> curr = Jcr.getMultiple(getNode(), property);
+               List<Term> res = new ArrayList<>();
+               if (curr != null)
+                       terms: for (String str : curr) {
+                               Term term = termsManager.getTerm(str);
+                               if (term == null) {
+                                       log.warn("Ignoring term " + str + " for " + getNode() + ", as it was not found.");
+                                       continue terms;
+                               }
+                               res.add(term);
+                       }
+               return res;
+       }
+
+       protected void setValue(List<Term> value) {
+               String property = typology.getId();
+               List<String> ids = new ArrayList<>();
+               for (Term term : value) {
+                       ids.add(term.getId());
+               }
+               Jcr.set(getNode(), property, ids);
+               Jcr.save(getNode());
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/forms/SingleTermPart.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/forms/SingleTermPart.java
new file mode 100644 (file)
index 0000000..57086ad
--- /dev/null
@@ -0,0 +1,159 @@
+package org.argeo.app.ui.forms;
+
+import java.util.List;
+
+import javax.jcr.Item;
+
+import org.argeo.app.api.Term;
+import org.argeo.app.api.TermsManager;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.swt.SwtEditablePart;
+import org.argeo.cms.swt.MouseDoubleClick;
+import org.argeo.cms.swt.MouseDown;
+import org.argeo.cms.swt.Selected;
+import org.argeo.cms.swt.widgets.ContextOverlay;
+import org.argeo.cms.ui.forms.FormStyle;
+import org.argeo.jcr.Jcr;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.FocusListener;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+
+/** {@link SwtEditablePart} for terms. */
+public class SingleTermPart extends AbstractTermsPart {
+       private static final long serialVersionUID = -4961135649177920808L;
+
+       public SingleTermPart(Composite parent, int style, Item item, TermsManager termsManager, String typology) {
+               super(parent, style, item, termsManager, typology);
+       }
+
+       @Override
+       protected Control createControl(Composite box, String style) {
+               if (isEditing()) {
+                       Composite block = new Composite(box, SWT.NONE);
+                       block.setLayout(CmsSwtUtils.noSpaceGridLayout(3));
+
+                       createHighlight(block);
+
+                       Text txt = new Text(block, SWT.SINGLE | SWT.BORDER);
+                       CmsSwtUtils.style(txt, style == null ? FormStyle.propertyText.style() : style);
+
+                       ToolBar toolBar = new ToolBar(block, SWT.HORIZONTAL);
+                       ToolItem deleteItem = new ToolItem(toolBar, SWT.PUSH);
+                       styleDelete(deleteItem);
+                       deleteItem.addSelectionListener((Selected) (e) -> {
+                               setValue(null);
+                               stopEditing();
+                       });
+                       ToolItem cancelItem = new ToolItem(toolBar, SWT.PUSH);
+                       styleCancel(cancelItem);
+                       cancelItem.addSelectionListener((Selected) (e) -> {
+                               stopEditing();
+                       });
+
+                       ContextOverlay contextOverlay = new ContextOverlay(txt, SWT.NONE) {
+                               private static final long serialVersionUID = -7980078594405384874L;
+
+                               @Override
+                               protected void onHide() {
+                                       stopEditing();
+                               }
+                       };
+                       contextOverlay.setLayout(new GridLayout());
+                       // filter
+                       txt.addModifyListener((e) -> {
+                               String filter = txt.getText().toLowerCase();
+                               if ("".equals(filter.trim()))
+                                       filter = null;
+                               refresh(contextOverlay, filter, txt);
+                       });
+                       txt.addFocusListener(new FocusListener() {
+                               private static final long serialVersionUID = -6024501573409619949L;
+
+                               @Override
+                               public void focusLost(FocusEvent event) {
+//                                     if (!contextOverlay.isDisposed() && contextOverlay.isShellVisible())
+//                                             getDisplay().asyncExec(() -> stopEditing());
+                               }
+
+                               @Override
+                               public void focusGained(FocusEvent event) {
+                                       // txt.setText("");
+                                       if (!contextOverlay.isDisposed() && !contextOverlay.isShellVisible())
+                                               refresh(contextOverlay, null, txt);
+                               }
+                       });
+                       layout(new Control[] { block });
+                       getDisplay().asyncExec(() -> txt.setFocus());
+                       return block;
+               } else {
+                       Composite block = new Composite(box, SWT.NONE);
+                       block.setLayout(CmsSwtUtils.noSpaceGridLayout(2));
+                       Term currentValue = getValue();
+                       if (currentValue != null) {
+                               Label lbl = new Label(block, SWT.SINGLE);
+                               String display = getTermLabel(currentValue);
+                               lbl.setText(display);
+                               CmsSwtUtils.style(lbl, style == null ? FormStyle.propertyText.style() : style);
+                               processTermListLabel(currentValue, lbl);
+                               if (isEditable()) {
+                                       lbl.addMouseListener((MouseDoubleClick) (e) -> {
+                                               startEditing();
+                                       });
+                               }
+                       } else {
+                               if (isEditable()) {
+                                       ToolBar toolBar = new ToolBar(block, SWT.HORIZONTAL);
+                                       ToolItem addItem = new ToolItem(toolBar, SWT.FLAT);
+                                       styleAdd(addItem);
+                                       addItem.addSelectionListener((Selected) (e) -> {
+                                               startEditing();
+                                       });
+                               }
+                       }
+                       return block;
+               }
+       }
+
+       @Override
+       protected void refresh(ContextOverlay contextArea, String filter, Text txt) {
+               CmsSwtUtils.clear(contextArea);
+               List<? extends Term> terms = termsManager.listAllTerms(typology.getId());
+               terms: for (Term term : terms) {
+                       String display = getTermLabel(term);
+                       if (filter != null && !display.toLowerCase().contains(filter))
+                               continue terms;
+                       Label termL = new Label(contextArea, SWT.WRAP);
+                       termL.setText(display);
+                       processTermListLabel(term, termL);
+                       if (isTermSelectable(term))
+                               termL.addMouseListener((MouseDown) (e) -> {
+                                       setValue(term);
+                                       contextArea.hide();
+                                       stopEditing();
+                               });
+               }
+               contextArea.show();
+               // txt.setFocus();
+       }
+
+       protected Term getValue() {
+               String property = typology.getId();
+               String id = Jcr.get(getNode(), property);
+               Term term = termsManager.getTerm(id);
+
+               return term;
+       }
+
+       protected void setValue(Term value) {
+               String property = typology.getId();
+               Jcr.set(getNode(), property, value != null ? value.getId() : null);
+               Jcr.save(getNode());
+       }
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/ContentEntryArea.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/ContentEntryArea.java
new file mode 100644 (file)
index 0000000..b34c605
--- /dev/null
@@ -0,0 +1,54 @@
+package org.argeo.app.ui.library;
+
+import org.argeo.api.acr.Content;
+import org.argeo.api.acr.spi.ProvidedContent;
+import org.argeo.api.cms.CmsLog;
+import org.argeo.api.cms.ux.CmsView;
+import org.argeo.app.api.EntityType;
+import org.argeo.app.ui.SuiteUxEvent;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.swt.acr.SwtUiProvider;
+import org.argeo.cms.swt.widgets.SwtTreeView;
+import org.argeo.cms.ux.acr.ContentHierarchicalPart;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+
+public class ContentEntryArea implements SwtUiProvider {
+       private final static CmsLog log = CmsLog.getLog(ContentEntryArea.class);
+
+       @Override
+       public Control createUiPart(Composite parent, Content context) {
+               CmsView cmsView = CmsSwtUtils.getCmsView(parent);
+
+               parent.setLayout(new GridLayout());
+
+               new Label(parent, 0).setText(context.toString());
+
+               Content rootContent = ((ProvidedContent) context).getSession().getRepository().get().get("/srv");
+
+               ContentHierarchicalPart contentPart = new ContentHierarchicalPart() {
+
+                       @Override
+                       protected boolean isLeaf(Content content) {
+                               if (content.hasContentClass(EntityType.document.qName()))
+                                       return true;
+                               return super.isLeaf(content);
+                       }
+               };
+               contentPart.setInput(rootContent);
+
+               SwtTreeView<Content> view = new SwtTreeView<>(parent, 0, contentPart);
+               view.setLayoutData(CmsSwtUtils.fillAll());
+
+               contentPart.setInput(rootContent);
+               contentPart.onSelected((o) -> {
+                       Content c = (Content) o;
+                       log.debug(c.getPath());
+                       cmsView.sendEvent(SuiteUxEvent.refreshPart.topic(), SuiteUxEvent.eventProperties(c));
+               });
+               return view;
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsContextMenu.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsContextMenu.java
new file mode 100644 (file)
index 0000000..82a21c1
--- /dev/null
@@ -0,0 +1,177 @@
+package org.argeo.app.ui.library;
+
+import static org.argeo.app.ui.library.DocumentsUiService.ACTION_ID_BOOKMARK_FOLDER;
+import static org.argeo.app.ui.library.DocumentsUiService.ACTION_ID_CREATE_FOLDER;
+import static org.argeo.app.ui.library.DocumentsUiService.ACTION_ID_DELETE;
+import static org.argeo.app.ui.library.DocumentsUiService.ACTION_ID_DOWNLOAD_FOLDER;
+import static org.argeo.app.ui.library.DocumentsUiService.ACTION_ID_RENAME;
+import static org.argeo.app.ui.library.DocumentsUiService.ACTION_ID_SHARE_FOLDER;
+import static org.argeo.app.ui.library.DocumentsUiService.ACTION_ID_UPLOAD_FILE;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+
+import org.argeo.app.ui.widgets.AbstractConnectContextMenu;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Control;
+
+/** Generic popup context menu to manage NIO Path in a Viewer. */
+public class DocumentsContextMenu extends AbstractConnectContextMenu {
+       // Local context
+       private final DocumentsFolderComposite browser;
+       private final DocumentsUiService uiService;
+//     private final Repository repository;
+
+       private final static String[] DEFAULT_ACTIONS = { ACTION_ID_CREATE_FOLDER, ACTION_ID_BOOKMARK_FOLDER,
+                       ACTION_ID_SHARE_FOLDER, ACTION_ID_DOWNLOAD_FOLDER, ACTION_ID_UPLOAD_FILE, ACTION_ID_RENAME,
+                       ACTION_ID_DELETE };
+
+       private Path currFolderPath;
+
+       public DocumentsContextMenu(DocumentsFolderComposite browser,
+                       DocumentsUiService documentsUiService) {
+               super(browser.getDisplay(), DEFAULT_ACTIONS);
+               this.browser = browser;
+               this.uiService = documentsUiService;
+//             this.repository = repository;
+
+               createControl();
+       }
+
+       public void setCurrFolderPath(Path currFolderPath) {
+               this.currFolderPath = currFolderPath;
+       }
+
+       protected boolean aboutToShow(Control source, Point location, IStructuredSelection selection) {
+               boolean emptySel = true;
+               boolean multiSel = false;
+               boolean isFolder = true;
+               if (selection != null && !selection.isEmpty()) {
+                       emptySel = false;
+                       multiSel = selection.size() > 1;
+                       if (!multiSel && selection.getFirstElement() instanceof Path) {
+                               isFolder = Files.isDirectory((Path) selection.getFirstElement());
+                       }
+               }
+               if (emptySel) {
+                       setVisible(true, ACTION_ID_CREATE_FOLDER, ACTION_ID_UPLOAD_FILE, ACTION_ID_BOOKMARK_FOLDER);
+                       setVisible(false, ACTION_ID_SHARE_FOLDER, ACTION_ID_DOWNLOAD_FOLDER, ACTION_ID_RENAME, ACTION_ID_DELETE
+                               );
+               } else if (multiSel) {
+                       setVisible(true, ACTION_ID_CREATE_FOLDER, ACTION_ID_UPLOAD_FILE, ACTION_ID_DELETE,
+                                       ACTION_ID_BOOKMARK_FOLDER);
+                       setVisible(false, ACTION_ID_SHARE_FOLDER, ACTION_ID_DOWNLOAD_FOLDER, ACTION_ID_RENAME);
+               } else if (isFolder) {
+                       setVisible(true, ACTION_ID_CREATE_FOLDER, ACTION_ID_UPLOAD_FILE, ACTION_ID_RENAME, ACTION_ID_DELETE,
+                                       ACTION_ID_BOOKMARK_FOLDER);
+                       setVisible(false, 
+                                       // to be implemented
+                                       ACTION_ID_SHARE_FOLDER, ACTION_ID_DOWNLOAD_FOLDER);
+               } else {
+                       setVisible(true, ACTION_ID_CREATE_FOLDER, ACTION_ID_UPLOAD_FILE, ACTION_ID_RENAME,
+                                       ACTION_ID_DELETE);
+                       setVisible(false, ACTION_ID_SHARE_FOLDER, ACTION_ID_DOWNLOAD_FOLDER, ACTION_ID_BOOKMARK_FOLDER);
+               }
+               return true;
+       }
+
+       public void show(Control source, Point location, IStructuredSelection selection, Path currFolderPath) {
+               // TODO find a better way to retrieve the parent path (cannot be deduced
+               // from table content because it will fail on an empty folder)
+               this.currFolderPath = currFolderPath;
+               super.show(source, location, selection);
+
+       }
+
+       @Override
+       protected boolean performAction(String actionId) {
+               switch (actionId) {
+               case ACTION_ID_CREATE_FOLDER:
+                       createFolder();
+                       break;
+               case ACTION_ID_BOOKMARK_FOLDER:
+                       bookmarkFolder();
+                       break;
+               case ACTION_ID_RENAME:
+                       renameItem();
+                       break;
+               case ACTION_ID_DELETE:
+                       deleteItems();
+                       break;
+//             case ACTION_ID_OPEN:
+//                     openFile();
+//                     break;
+               case ACTION_ID_UPLOAD_FILE:
+                       uploadFiles();
+                       break;
+               default:
+                       throw new IllegalArgumentException("Unimplemented action " + actionId);
+                       // case ACTION_ID_SHARE_FOLDER:
+                       // return "Share Folder";
+                       // case ACTION_ID_DOWNLOAD_FOLDER:
+                       // return "Download as zip archive";
+               }
+               browser.setFocus();
+               return false;
+       }
+
+       @Override
+       protected String getLabel(String actionId) {
+               return uiService.getLabel(actionId);
+       }
+
+       private void openFile() {
+               IStructuredSelection selection = ((IStructuredSelection) browser.getViewer().getSelection());
+               if (selection.isEmpty() || selection.size() > 1)
+                       // Should never happen
+                       return;
+               Path toOpenPath = ((Path) selection.getFirstElement());
+               uiService.openFile(toOpenPath);
+       }
+
+       private void deleteItems() {
+               IStructuredSelection selection = ((IStructuredSelection) browser.getViewer().getSelection());
+               if (selection.isEmpty())
+                       return;
+               else if (uiService.deleteItems(getParentShell(), selection))
+                       browser.refresh();
+       }
+
+       private void renameItem() {
+               IStructuredSelection selection = ((IStructuredSelection) browser.getViewer().getSelection());
+               if (selection.isEmpty() || selection.size() > 1)
+                       // Should never happen
+                       return;
+               Path toRenamePath = ((Path) selection.getFirstElement());
+               if (uiService.renameItem(getParentShell(), currFolderPath, toRenamePath))
+                       browser.refresh();
+       }
+
+       private void createFolder() {
+               if (uiService.createFolder(getParentShell(), currFolderPath))
+                       browser.refresh();
+       }
+
+       private void bookmarkFolder() {
+               Path toBookmarkPath = null;
+               IStructuredSelection selection = ((IStructuredSelection) browser.getViewer().getSelection());
+               if (selection.isEmpty())
+                       toBookmarkPath = currFolderPath;
+               else if (selection.size() > 1)
+                       toBookmarkPath = currFolderPath;
+               else if (selection.size() == 1) {
+                       Path currSelected = ((Path) selection.getFirstElement());
+                       if (Files.isDirectory(currSelected))
+                               toBookmarkPath = currSelected;
+                       else
+                               return;
+               }
+               //uiService.bookmarkFolder(toBookmarkPath, repository, null);
+       }
+
+       private void uploadFiles() {
+               if (uiService.uploadFiles(getParentShell(), currFolderPath))
+                       browser.refresh();
+       }
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsFileComposite.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsFileComposite.java
new file mode 100644 (file)
index 0000000..d4b70bb
--- /dev/null
@@ -0,0 +1,118 @@
+package org.argeo.app.ui.library;
+
+import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.spi.FileSystemProvider;
+
+import javax.jcr.Node;
+
+import org.argeo.api.cms.CmsLog;
+import org.argeo.cms.fs.CmsFsUtils;
+import org.argeo.cms.ui.util.CmsUiUtils;
+import org.argeo.eclipse.ui.EclipseUiUtils;
+import org.argeo.eclipse.ui.fs.FsUiUtils;
+import org.argeo.eclipse.ui.specific.UiContext;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+/**
+ * Default Documents file composite: a sashForm with a browser in the middle and
+ * meta data at right hand side.
+ */
+public class DocumentsFileComposite extends Composite {
+       private static final long serialVersionUID = -7567632342889241793L;
+
+       private final static CmsLog log = CmsLog.getLog(DocumentsFileComposite.class);
+
+       private final Node currentBaseContext;
+
+       // UI Parts for the browser
+       private Composite rightPannelCmp;
+
+       public DocumentsFileComposite(Composite parent, int style, Node context, FileSystemProvider fsp) {
+               super(parent, style);
+               this.currentBaseContext = context;
+               this.setLayout(EclipseUiUtils.noSpaceGridLayout());
+               SashForm form = new SashForm(this, SWT.HORIZONTAL);
+
+               Composite centerCmp = new Composite(form, SWT.BORDER | SWT.NO_FOCUS);
+               createDisplay(centerCmp);
+
+               rightPannelCmp = new Composite(form, SWT.NO_FOCUS);
+
+               Path path = CmsFsUtils.getPath(fsp, context);
+               setOverviewInput(path);
+               form.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+               form.setWeights(new int[] { 55, 20 });
+       }
+
+       private void createDisplay(final Composite parent) {
+               parent.setLayout(EclipseUiUtils.noSpaceGridLayout());
+               Browser browser = new Browser(parent, SWT.NONE);
+               // browser.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true,
+               // true));
+               browser.setLayoutData(EclipseUiUtils.fillAll());
+               // FIXME make it more robust
+               String url = CmsUiUtils.getDataUrl(currentBaseContext, UiContext.getHttpRequest());
+               // FIXME issue with the redirection to https
+               if (url.startsWith("http://") && !url.startsWith("http://localhost"))
+                       url = "https://" + url.substring("http://".length(), url.length());
+               if (log.isTraceEnabled())
+                       log.debug("Trying to display " + url);
+               browser.setUrl(url);
+               browser.layout(true, true);
+       }
+
+       /**
+        * Recreates the content of the box that displays information about the current
+        * selected Path.
+        */
+       private void setOverviewInput(Path path) {
+               try {
+                       EclipseUiUtils.clear(rightPannelCmp);
+                       rightPannelCmp.setLayout(new GridLayout());
+                       if (path != null) {
+                               // if (isImg(context)) {
+                               // EditableImage image = new Img(parent, RIGHT, context,
+                               // imageWidth);
+                               // image.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER,
+                               // true, false,
+                               // 2, 1));
+                               // }
+
+                               Label contextL = new Label(rightPannelCmp, SWT.NONE);
+                               contextL.setText(path.getFileName().toString());
+                               contextL.setFont(EclipseUiUtils.getBoldFont(rightPannelCmp));
+                               addProperty(rightPannelCmp, "Last modified", Files.getLastModifiedTime(path).toString());
+                               // addProperty(rightPannelCmp, "Owner",
+                               // Files.getOwner(path).getName());
+                               if (Files.isDirectory(path)) {
+                                       addProperty(rightPannelCmp, "Type", "Folder");
+                               } else {
+                                       String mimeType = Files.probeContentType(path);
+                                       if (EclipseUiUtils.isEmpty(mimeType))
+                                               mimeType = "<i>Unknown</i>";
+                                       addProperty(rightPannelCmp, "Type", mimeType);
+                                       addProperty(rightPannelCmp, "Size", FsUiUtils.humanReadableByteCount(Files.size(path), false));
+                               }
+                       }
+                       rightPannelCmp.layout(true, true);
+               } catch (IOException e) {
+                       throw new IllegalStateException("Cannot display details for " + path.toString(), e);
+               }
+       }
+
+       // Simplify UI implementation
+       private void addProperty(Composite parent, String propName, String value) {
+               Label propLbl = new Label(parent, SWT.NONE);
+               // propLbl.setText(ConnectUtils.replaceAmpersand(propName + ": " + value));
+               propLbl.setText(value);
+               // CmsUiUtils.markup(propLbl);
+       }
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsFolderComposite.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsFolderComposite.java
new file mode 100644 (file)
index 0000000..58ceed6
--- /dev/null
@@ -0,0 +1,454 @@
+package org.argeo.app.ui.library;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.attribute.FileTime;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.jcr.Node;
+
+import org.argeo.api.cms.CmsLog;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.ui.fs.FileDrop;
+import org.argeo.cms.ui.fs.FsStyles;
+import org.argeo.eclipse.ui.ColumnDefinition;
+import org.argeo.eclipse.ui.EclipseUiUtils;
+import org.argeo.eclipse.ui.fs.FileIconNameLabelProvider;
+import org.argeo.eclipse.ui.fs.FsTableViewer;
+import org.argeo.eclipse.ui.fs.FsUiConstants;
+import org.argeo.eclipse.ui.fs.FsUiUtils;
+import org.argeo.eclipse.ui.fs.NioFileLabelProvider;
+import org.argeo.eclipse.ui.fs.ParentDir;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.RowData;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * Default Documents folder composite: a sashForm layout with a simple table in
+ * the middle and an overview at right hand side.
+ */
+public class DocumentsFolderComposite extends Composite {
+       private final static CmsLog log = CmsLog.getLog(DocumentsFolderComposite.class);
+       private static final long serialVersionUID = -40347919096946585L;
+
+       private final Node currentBaseContext;
+
+       private final DocumentsUiService documentUiService = new DocumentsUiService();
+
+       // UI Parts for the browser
+       private Composite filterCmp;
+       private Composite breadCrumbCmp;
+       private Text filterTxt;
+       private FsTableViewer directoryDisplayViewer;
+       private Composite rightPanelCmp;
+
+       private DocumentsContextMenu contextMenu;
+       private DateFormat dateFormat = new SimpleDateFormat("YYYY-MM-dd HH:mm");
+
+       // Local context
+       private Path initialPath;
+       private Path currentFolder;
+
+       public DocumentsFolderComposite(Composite parent, int style, Node context) {
+               super(parent, style);
+               this.currentBaseContext = context;
+
+               this.setLayout(EclipseUiUtils.noSpaceGridLayout());
+
+               SashForm form = new SashForm(this, SWT.HORIZONTAL);
+
+               Composite centerCmp = new Composite(form, SWT.BORDER | SWT.NO_FOCUS);
+               createDisplay(centerCmp);
+
+               rightPanelCmp = new Composite(form, SWT.NO_FOCUS);
+
+               form.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+               form.setWeights(new int[] { 55, 20 });
+       }
+
+       public void populate(Path path) {
+               initialPath = path;
+               directoryDisplayViewer.setInitialPath(initialPath);
+               setInput(path);
+       }
+
+       void refresh() {
+               modifyFilter(false);
+       }
+
+       private void createDisplay(final Composite parent) {
+               parent.setLayout(EclipseUiUtils.noSpaceGridLayout());
+
+               // top filter
+               filterCmp = new Composite(parent, SWT.NO_FOCUS);
+               filterCmp.setLayoutData(EclipseUiUtils.fillWidth());
+               RowLayout rl = new RowLayout(SWT.HORIZONTAL);
+               rl.wrap = true;
+               rl.center = true;
+               filterCmp.setLayout(rl);
+               // addFilterPanel(filterCmp);
+
+               // Main display
+               directoryDisplayViewer = new FsTableViewer(parent, SWT.MULTI);
+               List<ColumnDefinition> colDefs = new ArrayList<>();
+               colDefs.add(new ColumnDefinition(new FileIconNameLabelProvider(), " Name", 250));
+               colDefs.add(new ColumnDefinition(new NioFileLabelProvider(FsUiConstants.PROPERTY_SIZE), "Size", 100));
+//             colDefs.add(new ColumnDefinition(new NioFileLabelProvider(FsUiConstants.PROPERTY_TYPE), "Type", 150));
+               colDefs.add(new ColumnDefinition(new NioFileLabelProvider(FsUiConstants.PROPERTY_LAST_MODIFIED),
+                               "Last modified", 400));
+               final Table table = directoryDisplayViewer.configureDefaultTable(colDefs);
+               table.setLayoutData(EclipseUiUtils.fillAll());
+
+               directoryDisplayViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+
+                       @Override
+                       public void selectionChanged(SelectionChangedEvent event) {
+                               IStructuredSelection selection = (IStructuredSelection) directoryDisplayViewer.getSelection();
+                               Path selected = null;
+                               if (selection.isEmpty())
+                                       setSelected(null);
+                               else {
+                                       Object o = selection.getFirstElement();
+                                       if (o instanceof Path)
+                                               selected = (Path) o;
+                                       else if (o instanceof ParentDir)
+                                               selected = ((ParentDir) o).getPath();
+                               }
+                               if (selected != null) {
+                                       // TODO manage multiple selection
+                                       setSelected(selected);
+                               }
+                       }
+               });
+
+               directoryDisplayViewer.addDoubleClickListener(new IDoubleClickListener() {
+                       @Override
+                       public void doubleClick(DoubleClickEvent event) {
+                               IStructuredSelection selection = (IStructuredSelection) directoryDisplayViewer.getSelection();
+                               Path selected = null;
+                               if (!selection.isEmpty()) {
+                                       Object o = selection.getFirstElement();
+                                       if (o instanceof Path)
+                                               selected = (Path) o;
+                                       else if (o instanceof ParentDir)
+                                               selected = ((ParentDir) o).getPath();
+                               }
+                               if (selected != null) {
+                                       if (Files.isDirectory(selected))
+                                               setInput(selected);
+                                       else
+                                               externalNavigateTo(selected);
+                               }
+                       }
+               });
+
+               // The context menu
+               contextMenu = new DocumentsContextMenu(this,  documentUiService);
+
+               table.addMouseListener(new MouseAdapter() {
+                       private static final long serialVersionUID = 6737579410648595940L;
+
+                       @Override
+                       public void mouseDown(MouseEvent e) {
+                               if (e.button == 3) {
+                                       // contextMenu.setCurrFolderPath(currDisplayedFolder);
+                                       contextMenu.show(table, new Point(e.x, e.y),
+                                                       (IStructuredSelection) directoryDisplayViewer.getSelection(), currentFolder);
+                               }
+                       }
+               });
+
+               FileDrop fileDrop = new FileDrop() {
+
+                       @Override
+                       protected void processFileUpload(InputStream in, String fileName, String contetnType) throws IOException {
+                               Path file = currentFolder.resolve(fileName);
+                               Files.copy(in, file);
+                               refresh();
+                       }
+               };
+               fileDrop.createDropTarget(directoryDisplayViewer.getTable());
+       }
+
+       /**
+        * Overwrite to enable single sourcing between workbench and CMS navigation
+        */
+       protected void externalNavigateTo(Path path) {
+
+       }
+
+       private void addPathElementBtn(Path path) {
+               Button elemBtn = new Button(breadCrumbCmp, SWT.PUSH);
+               String nameStr;
+               if (path.toString().equals("/"))
+                       nameStr = "[jcr:root]";
+               else
+                       nameStr = path.getFileName().toString();
+//             elemBtn.setText(nameStr + " >> ");
+               elemBtn.setText(nameStr);
+               CmsSwtUtils.style(elemBtn, FsStyles.BREAD_CRUMB_BTN);
+               elemBtn.addSelectionListener(new SelectionAdapter() {
+                       private static final long serialVersionUID = -4103695476023480651L;
+
+                       @Override
+                       public void widgetSelected(SelectionEvent e) {
+                               setInput(path);
+                       }
+               });
+       }
+
+       public void setInput(Path path) {
+               if (path.equals(currentFolder))
+                       return;
+               // below initial path
+               if (!initialPath.equals(path) && initialPath.startsWith(path))
+                       return;
+               currentFolder = path;
+
+               Path diff = initialPath.relativize(currentFolder);
+
+               for (Control child : filterCmp.getChildren())
+                       if (!child.equals(filterTxt))
+                               child.dispose();
+
+               // Bread crumbs
+               breadCrumbCmp = new Composite(filterCmp, SWT.NO_FOCUS);
+               CmsSwtUtils.style(breadCrumbCmp, FsStyles.BREAD_CRUMB_BTN);
+               RowLayout breadCrumbLayout = new RowLayout();
+               breadCrumbLayout.spacing = 0;
+               breadCrumbLayout.marginTop = 0;
+               breadCrumbLayout.marginBottom = 0;
+               breadCrumbLayout.marginRight = 0;
+               breadCrumbLayout.marginLeft = 0;
+               breadCrumbCmp.setLayout(breadCrumbLayout);
+               addPathElementBtn(initialPath);
+               Path currTarget = initialPath;
+               if (!diff.toString().equals(""))
+                       for (Path pathElem : diff) {
+                               currTarget = currTarget.resolve(pathElem);
+                               addPathElementBtn(currTarget);
+                       }
+
+               if (filterTxt != null) {
+                       filterTxt.setText("");
+                       filterTxt.moveBelow(null);
+               } else {
+                       modifyFilter(false);
+               }
+               setSelected(null);
+               filterCmp.getParent().layout(true, true);
+       }
+
+       private void setSelected(Path path) {
+               if (path == null)
+                       setOverviewInput(currentFolder);
+               else
+                       setOverviewInput(path);
+       }
+
+       public Viewer getViewer() {
+               return directoryDisplayViewer;
+       }
+
+       /**
+        * Recreates the content of the box that displays information about the current
+        * selected Path.
+        */
+       private void setOverviewInput(Path path) {
+               try {
+                       EclipseUiUtils.clear(rightPanelCmp);
+                       rightPanelCmp.setLayout(new GridLayout());
+                       if (path != null) {
+                               // if (isImg(context)) {
+                               // EditableImage image = new Img(parent, RIGHT, context,
+                               // imageWidth);
+                               // image.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER,
+                               // true, false,
+                               // 2, 1));
+                               // }
+
+                               Label contextL = new Label(rightPanelCmp, SWT.NONE);
+                               contextL.setText(path.getFileName().toString());
+                               contextL.setFont(EclipseUiUtils.getBoldFont(rightPanelCmp));
+                               FileTime lastModified = Files.getLastModifiedTime(path);
+                               if (lastModified.toMillis() != 0)
+                                       try {
+                                               String lastModifiedStr = dateFormat.format(new Date(lastModified.toMillis()));
+                                               addProperty(rightPanelCmp, "Last modified", lastModifiedStr);
+                                       } catch (Exception e) {
+                                               log.error("Workarounded issue while getting last update date for " + path, e);
+                                               addProperty(rightPanelCmp, "Last modified", "-");
+                                       }
+                               // addProperty(rightPannelCmp, "Owner",
+                               // Files.getOwner(path).getName());
+                               if (Files.isDirectory(path)) {
+                                       addProperty(rightPanelCmp, "Type", "Folder");
+                               } else {
+                                       String mimeType = Files.probeContentType(path);
+                                       if (EclipseUiUtils.isEmpty(mimeType))
+                                               mimeType = "<i>Unknown</i>";
+                                       addProperty(rightPanelCmp, "Type", mimeType);
+                                       addProperty(rightPanelCmp, "Size", FsUiUtils.humanReadableByteCount(Files.size(path), false));
+                               }
+
+                               // read all attributes
+//                             Map<String, Object> attrs = Files.readAttributes(path, "*");
+//                             for (String attr : attrs.keySet()) {
+//                                     Object value = attrs.get(attr);
+//                                     String str;
+//                                     if (value instanceof Calendar) {
+//                                             str = dateFormat.format(((Calendar) value).getTime());
+//                                     } else {
+//                                             str = value.toString();
+//                                     }
+//                                     addProperty(rightPanelCmp, attr, str);
+//
+//                             }
+                       }
+                       rightPanelCmp.layout(true, true);
+               } catch (IOException e) {
+                       throw new IllegalStateException("Cannot display details for " + path.toString(), e);
+               }
+       }
+
+       private void addFilterPanel(Composite parent) {
+               // parent.setLayout(EclipseUiUtils.noSpaceGridLayout(new GridLayout(2,
+               // false)));
+
+               filterTxt = new Text(parent, SWT.SEARCH | SWT.ICON_CANCEL);
+               filterTxt.setMessage("Search current folder");
+               filterTxt.setLayoutData(new RowData(250, SWT.DEFAULT));
+               filterTxt.addModifyListener(new ModifyListener() {
+                       private static final long serialVersionUID = 1L;
+
+                       public void modifyText(ModifyEvent event) {
+                               modifyFilter(false);
+                       }
+               });
+               filterTxt.addKeyListener(new KeyListener() {
+                       private static final long serialVersionUID = 2533535233583035527L;
+
+                       @Override
+                       public void keyReleased(KeyEvent e) {
+                       }
+
+                       @Override
+                       public void keyPressed(KeyEvent e) {
+                               // boolean shiftPressed = (e.stateMask & SWT.SHIFT) != 0;
+                               // // boolean altPressed = (e.stateMask & SWT.ALT) != 0;
+                               // FilterEntitiesVirtualTable currTable = null;
+                               // if (currEdited != null) {
+                               // FilterEntitiesVirtualTable table =
+                               // browserCols.get(currEdited);
+                               // if (table != null && !table.isDisposed())
+                               // currTable = table;
+                               // }
+                               //
+                               // if (e.keyCode == SWT.ARROW_DOWN)
+                               // currTable.setFocus();
+                               // else if (e.keyCode == SWT.BS) {
+                               // if (filterTxt.getText().equals("")
+                               // && !(currEdited.getNameCount() == 1 ||
+                               // currEdited.equals(initialPath))) {
+                               // Path oldEdited = currEdited;
+                               // Path parentPath = currEdited.getParent();
+                               // setEdited(parentPath);
+                               // if (browserCols.containsKey(parentPath))
+                               // browserCols.get(parentPath).setSelected(oldEdited);
+                               // filterTxt.setFocus();
+                               // e.doit = false;
+                               // }
+                               // } else if (e.keyCode == SWT.TAB && !shiftPressed) {
+                               // Path uniqueChild = getOnlyChild(currEdited,
+                               // filterTxt.getText());
+                               // if (uniqueChild != null) {
+                               // // Highlight the unique chosen child
+                               // currTable.setSelected(uniqueChild);
+                               // setEdited(uniqueChild);
+                               // }
+                               // filterTxt.setFocus();
+                               // e.doit = false;
+                               // }
+                       }
+               });
+       }
+
+       // private Path getOnlyChild(Path parent, String filter) {
+       // try (DirectoryStream<Path> stream =
+       // Files.newDirectoryStream(currDisplayedFolder, filter + "*")) {
+       // Path uniqueChild = null;
+       // boolean moreThanOne = false;
+       // loop: for (Path entry : stream) {
+       // if (uniqueChild == null) {
+       // uniqueChild = entry;
+       // } else {
+       // moreThanOne = true;
+       // break loop;
+       // }
+       // }
+       // if (!moreThanOne)
+       // return uniqueChild;
+       // return null;
+       // } catch (IOException ioe) {
+       // throw new DocumentsException(
+       // "Unable to determine unique child existence and get it under " + parent +
+       // " with filter " + filter,
+       // ioe);
+       // }
+       // }
+
+       private void modifyFilter(boolean fromOutside) {
+               if (!fromOutside)
+                       if (currentFolder != null) {
+                               String filter;
+                               if (filterTxt != null)
+                                       filter = filterTxt.getText() + "*";
+                               else
+                                       filter = "*";
+                               directoryDisplayViewer.setInput(currentFolder, filter);
+                       }
+       }
+
+       // Simplify UI implementation
+       private void addProperty(Composite parent, String propName, String value) {
+               Label propLbl = new Label(parent, SWT.NONE);
+               //propLbl.setText(ConnectUtils.replaceAmpersand(propName + ": " + value));
+               propLbl.setText(value);
+               //CmsUiUtils.markup(propLbl);
+       }
+
+       public Path getCurrentFolder() {
+               return currentFolder;
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsFolderUiProvider.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsFolderUiProvider.java
new file mode 100644 (file)
index 0000000..657a851
--- /dev/null
@@ -0,0 +1,44 @@
+package org.argeo.app.ui.library;
+
+import java.nio.file.Path;
+import java.nio.file.spi.FileSystemProvider;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+
+import org.argeo.api.cms.ux.CmsView;
+import org.argeo.app.ui.SuiteUxEvent;
+import org.argeo.cms.fs.CmsFsUtils;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.ui.CmsUiProvider;
+import org.argeo.jcr.Jcr;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+/** UI provider of a document folder. */
+public class DocumentsFolderUiProvider implements CmsUiProvider {
+       private FileSystemProvider nodeFileSystemProvider;
+
+       @Override
+       public Control createUi(Composite parent, Node context) throws RepositoryException {
+               CmsView cmsView = CmsSwtUtils.getCmsView(parent);
+               DocumentsFolderComposite dfc = new DocumentsFolderComposite(parent, SWT.NONE, context) {
+
+                       @Override
+                       protected void externalNavigateTo(Path path) {
+                               Node folderNode = cmsView.doAs(() -> CmsFsUtils.getNode(Jcr.getSession(context).getRepository(), path));
+                               parent.addDisposeListener((e1) -> Jcr.logout(folderNode));
+                               cmsView.sendEvent(SuiteUxEvent.openNewPart.topic(), SuiteUxEvent.eventProperties(folderNode));
+                       }
+               };
+               dfc.setLayoutData(CmsSwtUtils.fillAll());
+               dfc.populate(cmsView.doAs(() -> CmsFsUtils.getPath(nodeFileSystemProvider, context)));
+               return dfc;
+       }
+
+       public void setNodeFileSystemProvider(FileSystemProvider nodeFileSystemProvider) {
+               this.nodeFileSystemProvider = nodeFileSystemProvider;
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsTreeUiProvider.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsTreeUiProvider.java
new file mode 100644 (file)
index 0000000..6c0bdfc
--- /dev/null
@@ -0,0 +1,80 @@
+package org.argeo.app.ui.library;
+
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.spi.FileSystemProvider;
+
+import javax.jcr.Node;
+import javax.jcr.Repository;
+import javax.jcr.RepositoryException;
+
+import org.argeo.app.ui.SuiteUxEvent;
+import org.argeo.api.cms.CmsConstants;
+import org.argeo.api.cms.ux.CmsView;
+import org.argeo.cms.fs.CmsFsUtils;
+import org.argeo.cms.jcr.CmsJcrUtils;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.ui.CmsUiProvider;
+import org.argeo.eclipse.ui.fs.FsTreeViewer;
+import org.argeo.jcr.Jcr;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+/** Tree view of a user root folders. */
+public class DocumentsTreeUiProvider implements CmsUiProvider {
+       private FileSystemProvider nodeFileSystemProvider;
+       private Repository repository;
+
+       @Override
+       public Control createUi(Composite parent, Node context) throws RepositoryException {
+               parent.setLayout(new GridLayout());
+               FsTreeViewer fsTreeViewer = new FsTreeViewer(parent, SWT.NONE);
+               fsTreeViewer.configureDefaultSingleColumnTable(500);
+               CmsView cmsView = CmsSwtUtils.getCmsView(parent);
+               Node homeNode = CmsJcrUtils.getUserHome(cmsView.doAs(() -> Jcr.login(repository, CmsConstants.HOME_WORKSPACE)));
+               parent.addDisposeListener((e1) -> Jcr.logout(homeNode));
+               Path homePath = CmsFsUtils.getPath(nodeFileSystemProvider, homeNode);
+               fsTreeViewer.addSelectionChangedListener((e) -> {
+                       IStructuredSelection selection = (IStructuredSelection) fsTreeViewer.getSelection();
+                       if (selection.isEmpty())
+                               return;
+                       else {
+                               Path newSelected = (Path) selection.getFirstElement();
+                               if (Files.isDirectory(newSelected)) {
+                                       Node folderNode = cmsView.doAs(() -> CmsFsUtils.getNode(repository, newSelected));
+                                       parent.addDisposeListener((e1) -> Jcr.logout(folderNode));
+                                       cmsView.sendEvent(SuiteUxEvent.refreshPart.topic(), SuiteUxEvent.eventProperties(folderNode));
+                               }
+                       }
+               });
+               fsTreeViewer.addDoubleClickListener((e) -> {
+                       IStructuredSelection selection = (IStructuredSelection) fsTreeViewer.getSelection();
+                       if (selection.isEmpty())
+                               return;
+                       else {
+                               Path newSelected = (Path) selection.getFirstElement();
+                               if (Files.isDirectory(newSelected)) {
+                                       Node folderNode = cmsView.doAs(() -> CmsFsUtils.getNode(repository, newSelected));
+                                       parent.addDisposeListener((e1) -> Jcr.logout(folderNode));
+                                       cmsView.sendEvent(SuiteUxEvent.openNewPart.topic(), SuiteUxEvent.eventProperties(folderNode));
+                               }
+                       }
+               });
+               fsTreeViewer.setPathsInput(homePath);
+               fsTreeViewer.getControl().setLayoutData(CmsSwtUtils.fillAll());
+               fsTreeViewer.getControl().getParent().layout(true, true);
+               return fsTreeViewer.getControl();
+       }
+
+       public void setNodeFileSystemProvider(FileSystemProvider nodeFileSystemProvider) {
+               this.nodeFileSystemProvider = nodeFileSystemProvider;
+       }
+
+       public void setRepository(Repository repository) {
+               this.repository = repository;
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsUiService.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/DocumentsUiService.java
new file mode 100644 (file)
index 0000000..55a5a94
--- /dev/null
@@ -0,0 +1,308 @@
+package org.argeo.app.ui.library;
+
+import static org.argeo.cms.swt.dialogs.CmsMessageDialog.openConfirm;
+import static org.argeo.cms.swt.dialogs.CmsMessageDialog.openError;
+import static org.argeo.cms.swt.dialogs.SingleValueDialog.ask;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.lang.reflect.Method;
+import java.net.URI;
+import java.nio.file.DirectoryNotEmptyException;
+import java.nio.file.FileVisitResult;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.SimpleFileVisitor;
+import java.nio.file.attribute.BasicFileAttributes;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+
+import org.argeo.api.cms.CmsLog;
+import org.argeo.cms.swt.dialogs.CmsFeedback;
+import org.argeo.eclipse.ui.EclipseUiUtils;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Shell;
+
+public class DocumentsUiService {
+       private final static CmsLog log = CmsLog.getLog(DocumentsUiService.class);
+
+       // Default known actions
+       public final static String ACTION_ID_CREATE_FOLDER = "createFolder";
+       public final static String ACTION_ID_BOOKMARK_FOLDER = "bookmarkFolder";
+       public final static String ACTION_ID_SHARE_FOLDER = "shareFolder";
+       public final static String ACTION_ID_DOWNLOAD_FOLDER = "downloadFolder";
+       public final static String ACTION_ID_RENAME = "rename";
+       public final static String ACTION_ID_DELETE = "delete";
+       public final static String ACTION_ID_UPLOAD_FILE = "uploadFiles";
+       // public final static String ACTION_ID_OPEN = "open";
+       public final static String ACTION_ID_DELETE_BOOKMARK = "deleteBookmark";
+       public final static String ACTION_ID_RENAME_BOOKMARK = "renameBookmark";
+
+       public String getLabel(String actionId) {
+               switch (actionId) {
+               case ACTION_ID_CREATE_FOLDER:
+                       return "Create Folder";
+               case ACTION_ID_BOOKMARK_FOLDER:
+                       return "Bookmark Folder";
+               case ACTION_ID_SHARE_FOLDER:
+                       return "Share Folder";
+               case ACTION_ID_DOWNLOAD_FOLDER:
+                       return "Download as zip archive";
+               case ACTION_ID_RENAME:
+                       return "Rename";
+               case ACTION_ID_DELETE:
+                       return "Delete";
+               case ACTION_ID_UPLOAD_FILE:
+                       return "Upload Files";
+//             case ACTION_ID_OPEN:
+//                     return "Open";
+               case ACTION_ID_DELETE_BOOKMARK:
+                       return "Delete bookmark";
+               case ACTION_ID_RENAME_BOOKMARK:
+                       return "Rename bookmark";
+               default:
+                       throw new IllegalArgumentException("Unknown action ID " + actionId);
+               }
+       }
+
+       public void openFile(Path toOpenPath) {
+               try {
+                       String name = toOpenPath.getFileName().toString();
+                       File tmpFile = File.createTempFile("tmp", name);
+                       tmpFile.deleteOnExit();
+                       try (OutputStream os = new FileOutputStream(tmpFile)) {
+                               Files.copy(toOpenPath, os);
+                       } catch (IOException e) {
+                               throw new IllegalStateException("Cannot open copy " + name + " to tmpFile.", e);
+                       }
+                       String uri = Paths.get(tmpFile.getAbsolutePath()).toUri().toString();
+                       Map<String, String> params = new HashMap<String, String>();
+//                     params.put(OpenFile.PARAM_FILE_NAME, name);
+//                     params.put(OpenFile.PARAM_FILE_URI, uri);
+                       // FIXME open file without a command
+                       // CommandUtils.callCommand(OpenFile.ID, params);
+               } catch (IOException e1) {
+                       throw new IllegalStateException("Cannot create tmp copy of " + toOpenPath, e1);
+               }
+       }
+
+       public boolean deleteItems(Shell shell, IStructuredSelection selection) {
+               if (selection.isEmpty())
+                       return false;
+
+               StringBuilder builder = new StringBuilder();
+               @SuppressWarnings("unchecked")
+               Iterator<Object> iterator = selection.iterator();
+               List<Path> paths = new ArrayList<>();
+
+               while (iterator.hasNext()) {
+                       Path path = (Path) iterator.next();
+                       builder.append(path.getFileName() + ", ");
+                       paths.add(path);
+               }
+               String msg = "You are about to delete following elements: " + builder.substring(0, builder.length() - 2)
+                               + ". Are you sure?";
+               if (openConfirm(msg)) {
+                       for (Path path : paths) {
+                               try {
+                                       // recursively delete directory and its content
+                                       Files.walkFileTree(path, new SimpleFileVisitor<Path>() {
+                                               @Override
+                                               public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
+                                                       Files.delete(file);
+                                                       return FileVisitResult.CONTINUE;
+                                               }
+
+                                               @Override
+                                               public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {
+                                                       Files.delete(dir);
+                                                       return FileVisitResult.CONTINUE;
+                                               }
+                                       });
+                               } catch (DirectoryNotEmptyException e) {
+                                       String errMsg = path.getFileName() + " cannot be deleted: directory is not empty.";
+                                       openError( errMsg);
+                                       throw new IllegalArgumentException("Cannot delete path " + path, e);
+                               } catch (IOException e) {
+                                       String errMsg = e.toString();
+                                       openError(errMsg);
+                                       throw new IllegalArgumentException("Cannot delete path " + path, e);
+                               }
+                       }
+                       return true;
+               }
+               return false;
+       }
+
+       public boolean renameItem(Shell shell, Path parentFolderPath, Path toRenamePath) {
+               String msg = "Enter a new name:";
+               String name = ask( msg, toRenamePath.getFileName().toString());
+               // TODO enhance check of name validity
+               if (EclipseUiUtils.notEmpty(name)) {
+                       try {
+                               Path child = parentFolderPath.resolve(name);
+                               if (Files.exists(child)) {
+                                       String errMsg = "An object named " + name + " already exists at " + parentFolderPath.toString()
+                                                       + ", please provide another name";
+                                       openError( errMsg);
+                                       throw new IllegalArgumentException(errMsg);
+                               } else {
+                                       Files.move(toRenamePath, child);
+                                       return true;
+                               }
+                       } catch (IOException e) {
+                               throw new IllegalStateException("Cannot rename " + name + " at " + parentFolderPath.toString(), e);
+                       }
+               }
+               return false;
+       }
+
+       public boolean createFolder(Shell shell, Path currFolderPath) {
+               String msg = "Enter a name:";
+               String name = ask( msg);
+               // TODO enhance check of name validity
+               if (EclipseUiUtils.notEmpty(name)) {
+                       name = name.trim();
+                       try {
+                               Path child = currFolderPath.resolve(name);
+                               if (Files.exists(child)) {
+                                       String errMsg = "A folder named " + name + " already exists at " + currFolderPath.toString()
+                                                       + ", cannot create";
+                                       openError(errMsg);
+                                       throw new IllegalArgumentException(errMsg);
+                               } else {
+                                       Files.createDirectories(child);
+                                       return true;
+                               }
+                       } catch (IOException e) {
+                               throw new IllegalStateException("Cannot create folder " + name + " at " + currFolderPath.toString(), e);
+                       }
+               }
+               return false;
+       }
+
+//     public void bookmarkFolder(Path toBookmarkPath, Repository repository, DocumentsService documentsService) {
+//             String msg = "Provide a name:";
+//             String name = SingleQuestion.ask("Create bookmark", msg, toBookmarkPath.getFileName().toString());
+//             if (EclipseUiUtils.notEmpty(name))
+//                     documentsService.createFolderBookmark(toBookmarkPath, name, repository);
+//     }
+
+       public boolean uploadFiles(Shell shell, Path currFolderPath) {
+//             shell = Display.getCurrent().getActiveShell();// ignore argument
+               try {
+                       FileDialog dialog = new FileDialog(shell, SWT.MULTI);
+                       dialog.setText("Choose one or more files to upload");
+
+                       if (EclipseUiUtils.notEmpty(dialog.open())) {
+                               String[] names = dialog.getFileNames();
+                               // Workaround small differences between RAP and RCP
+                               // 1. returned names are absolute path on RAP and
+                               // relative in RCP
+                               // 2. in RCP we must use getFilterPath that does not
+                               // exists on RAP
+                               Method filterMethod = null;
+                               Path parPath = null;
+                               try {
+                                       filterMethod = dialog.getClass().getDeclaredMethod("getFilterPath");
+                                       String filterPath = (String) filterMethod.invoke(dialog);
+                                       parPath = Paths.get(filterPath);
+                               } catch (NoSuchMethodException nsme) { // RAP
+                               }
+                               if (names.length == 0)
+                                       return false;
+                               else {
+                                       loop: for (String name : names) {
+                                               Path tmpPath = Paths.get(name);
+                                               if (parPath != null)
+                                                       tmpPath = parPath.resolve(tmpPath);
+                                               if (Files.exists(tmpPath)) {
+                                                       URI uri = tmpPath.toUri();
+                                                       String uriStr = uri.toString();
+
+                                                       if (Files.isDirectory(tmpPath)) {
+                                                               openError(
+                                                                               "Upload of directories in the system is not yet implemented");
+                                                               continue loop;
+                                                       }
+                                                       Path targetPath = currFolderPath.resolve(tmpPath.getFileName().toString());
+                                                       try (InputStream in = new FileInputStream(tmpPath.toFile())) {
+                                                               Files.copy(in, targetPath);
+                                                               Files.delete(tmpPath);
+                                                       }
+                                                       if (log.isDebugEnabled())
+                                                               log.debug("copied uploaded file " + uriStr + " to " + targetPath.toString());
+                                               } else {
+                                                       String msg = "Cannot copy tmp file from " + tmpPath.toString();
+                                                       if (parPath != null)
+                                                               msg += "\nPlease remember that file upload fails when choosing files from the \"Recently Used\" bookmarks on some OS";
+                                                       openError( msg);
+                                                       continue loop;
+                                               }
+                                       }
+                                       return true;
+                               }
+                       }
+               } catch (Exception e) {
+                       CmsFeedback.error("Cannot import files to " + currFolderPath,e);
+               }
+               return false;
+       }
+
+//     public boolean deleteBookmark(Shell shell, IStructuredSelection selection, Node bookmarkParent) {
+//             if (selection.isEmpty())
+//                     return false;
+//
+//             StringBuilder builder = new StringBuilder();
+//             @SuppressWarnings("unchecked")
+//             Iterator<Object> iterator = selection.iterator();
+//             List<Node> nodes = new ArrayList<>();
+//
+//             while (iterator.hasNext()) {
+//                     Node node = (Node) iterator.next();
+//                     builder.append(Jcr.get(node, Property.JCR_TITLE) + ", ");
+//                     nodes.add(node);
+//             }
+//             String msg = "You are about to delete following bookmark: " + builder.substring(0, builder.length() - 2)
+//                             + ". Are you sure?";
+//             if (MessageDialog.openConfirm(shell, "Confirm deletion", msg)) {
+//                     Session session = Jcr.session(bookmarkParent);
+//                     try {
+//                             if (session.hasPendingChanges())
+//                                     throw new DocumentsException("Cannot remove bookmarks, session is not clean");
+//                             for (Node path : nodes)
+//                                     path.remove();
+//                             bookmarkParent.getSession().save();
+//                             return true;
+//                     } catch (RepositoryException e) {
+//                             JcrUtils.discardQuietly(session);
+//                             throw new DocumentsException("Cannot delete bookmarks " + builder.toString(), e);
+//                     }
+//             }
+//             return false;
+//     }
+
+//     public boolean renameBookmark(IStructuredSelection selection) {
+//             if (selection.isEmpty() || selection.size() > 1)
+//                     return false;
+//             Node toRename = (Node) selection.getFirstElement();
+//             String msg = "Please provide a new name.";
+//             String name = SingleQuestion.ask("Rename bookmark", msg, ConnectJcrUtils.get(toRename, Property.JCR_TITLE));
+//             if (EclipseUiUtils.notEmpty(name)
+//                             && ConnectJcrUtils.setJcrProperty(toRename, Property.JCR_TITLE, PropertyType.STRING, name)) {
+//                     ConnectJcrUtils.saveIfNecessary(toRename);
+//                     return true;
+//             }
+//             return false;
+//     }
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/JcrContentEntryArea.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/library/JcrContentEntryArea.java
new file mode 100644 (file)
index 0000000..0fbb5cb
--- /dev/null
@@ -0,0 +1,178 @@
+package org.argeo.app.ui.library;
+
+import java.util.SortedMap;
+import java.util.TreeMap;
+
+import javax.jcr.Node;
+import javax.jcr.NodeIterator;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.nodetype.NodeType;
+import javax.jcr.query.Query;
+
+import org.argeo.api.acr.Content;
+import org.argeo.api.cms.CmsConstants;
+import org.argeo.app.api.EntityType;
+import org.argeo.app.ui.SuiteUxEvent;
+import org.argeo.app.ui.SuiteIcon;
+import org.argeo.app.ui.widgets.TreeOrSearchArea;
+import org.argeo.cms.jcr.acr.JcrContentProvider;
+import org.argeo.cms.swt.CmsSwtTheme;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.ui.CmsUiProvider;
+import org.argeo.jcr.Jcr;
+import org.argeo.jcr.JcrException;
+import org.eclipse.jface.viewers.ColumnLabelProvider;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeViewerColumn;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+public class JcrContentEntryArea implements CmsUiProvider {
+       private JcrContentProvider jcrContentProvider;
+
+       @Override
+       public Control createUiPart(Composite parent, Content context) {
+               CmsSwtTheme theme = CmsSwtUtils.getCmsTheme(parent);
+
+               parent.setLayout(new GridLayout());
+               Ui ui = new Ui(parent, SWT.NONE);
+               ui.setLayoutData(CmsSwtUtils.fillAll());
+
+               TreeViewerColumn nameCol = new TreeViewerColumn(ui.getTreeViewer(), SWT.NONE);
+               nameCol.getColumn().setWidth(400);
+               nameCol.setLabelProvider(new ColumnLabelProvider() {
+
+                       @Override
+                       public String getText(Object element) {
+                               Node node = (Node) element;
+                               return Jcr.getTitle(node);
+                       }
+
+                       @Override
+                       public Image getImage(Object element) {
+                               Node node = (Node) element;
+                               Image icon;
+                               if (Jcr.isNodeType(node, NodeType.NT_FOLDER)) {
+                                       icon = theme.getSmallIcon(SuiteIcon.folder);
+                               } else if (Jcr.isNodeType(node, NodeType.NT_FILE)) {
+                                       // TODO check recognized document types
+                                       icon = theme.getSmallIcon(SuiteIcon.document);
+                               } else if (Jcr.isNodeType(node, EntityType.document.get())) {
+                                       icon = theme.getSmallIcon(SuiteIcon.document);
+                               } else {
+                                       if (!isLeaf(node))
+                                               icon = theme.getSmallIcon(SuiteIcon.folder);
+                                       else
+                                               icon = null;
+                               }
+                               return icon;
+                       }
+
+               });
+
+               ui.getTreeViewer().addDoubleClickListener(new IDoubleClickListener() {
+
+                       @Override
+                       public void doubleClick(DoubleClickEvent event) {
+                               Node user = (Node) ui.getTreeViewer().getStructuredSelection().getFirstElement();
+                               if (user != null) {
+                                       CmsSwtUtils.getCmsView(parent).sendEvent(SuiteUxEvent.openNewPart.topic(),
+                                                       SuiteUxEvent.eventProperties(user));
+                               }
+
+                       }
+               });
+               ui.getTreeViewer().addSelectionChangedListener(new ISelectionChangedListener() {
+                       public void selectionChanged(SelectionChangedEvent event) {
+                               Node user = (Node) ui.getTreeViewer().getStructuredSelection().getFirstElement();
+                               if (user != null) {
+                                       CmsSwtUtils.getCmsView(parent).sendEvent(SuiteUxEvent.refreshPart.topic(),
+                                                       SuiteUxEvent.eventProperties(user));
+                               }
+                       }
+               });
+
+               ui.getTreeViewer().setContentProvider(new SpacesContentProvider());
+               Session session = jcrContentProvider.getJcrSession(context, CmsConstants.SYS_WORKSPACE);
+               ui.getTreeViewer().setInput(session);
+               return ui;
+       }
+
+       protected boolean isLeaf(Node node) {
+               return Jcr.isNodeType(node, EntityType.entity.get()) || Jcr.isNodeType(node, EntityType.document.get())
+                               || Jcr.isNodeType(node, NodeType.NT_FILE);
+       }
+
+       public void setJcrContentProvider(JcrContentProvider jcrContentProvider) {
+               this.jcrContentProvider = jcrContentProvider;
+       }
+
+       class Ui extends TreeOrSearchArea {
+
+               public Ui(Composite parent, int style) {
+                       super(parent, style);
+               }
+
+       }
+
+       class SpacesContentProvider implements ITreeContentProvider {
+
+               @Override
+               public Object[] getElements(Object inputElement) {
+                       Session session = (Session) inputElement;
+                       try {
+                               Query query = session.getWorkspace().getQueryManager()
+                                               .createQuery("SELECT * FROM [" + EntityType.space.get() + "]", Query.JCR_SQL2);
+                               NodeIterator spacesIt = query.execute().getNodes();
+                               SortedMap<String, Node> map = new TreeMap<>();
+                               while (spacesIt.hasNext()) {
+                                       Node space = spacesIt.nextNode();
+                                       String path = space.getPath();
+                                       map.put(path, space);
+                               }
+                               return map.values().toArray();
+                       } catch (RepositoryException e) {
+                               throw new JcrException(e);
+                       }
+               }
+
+               @Override
+               public Object[] getChildren(Object parentElement) {
+                       Node parent = (Node) parentElement;
+                       if (isLeaf(parent))
+                               return null;
+                       return Jcr.getNodes(parent).toArray();
+               }
+
+               @Override
+               public Object getParent(Object element) {
+                       Node node = (Node) element;
+                       return Jcr.getParent(node);
+               }
+
+               @Override
+               public boolean hasChildren(Object element) {
+                       Node node = (Node) element;
+                       return !isLeaf(node);
+               }
+
+               @Override
+               public void dispose() {
+               }
+
+               @Override
+               public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+               }
+
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/openlayers/OLMap.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/openlayers/OLMap.java
new file mode 100644 (file)
index 0000000..1301325
--- /dev/null
@@ -0,0 +1,21 @@
+package org.argeo.app.ui.openlayers;
+
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+
+public class OLMap extends Composite {
+       private Label div;
+
+       public OLMap(Composite parent, int style) {
+               super(parent, style);
+               setLayout(CmsSwtUtils.noSpaceGridLayout());
+               div = new Label(this, SWT.NONE);
+               CmsSwtUtils.markup(div);
+               CmsSwtUtils.disableMarkupValidation(div);
+               div.setText("<div id='map'></div>");
+               div.setLayoutData(CmsSwtUtils.fillAll());
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/openlayers/OpenLayersMap.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/openlayers/OpenLayersMap.java
new file mode 100644 (file)
index 0000000..97c0e7c
--- /dev/null
@@ -0,0 +1,307 @@
+package org.argeo.app.ui.openlayers;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.nio.charset.StandardCharsets;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+
+import org.apache.commons.io.IOUtils;
+import org.argeo.app.api.EntityNames;
+import org.argeo.app.api.EntityType;
+import org.argeo.app.ui.SuiteUxEvent;
+import org.argeo.api.cms.CmsLog;
+import org.argeo.api.cms.ux.CmsView;
+import org.argeo.api.cms.CmsConstants;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.browser.BrowserFunction;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+
+/** Display a map. */
+public class OpenLayersMap extends Composite {
+       private static final long serialVersionUID = 1055893020490283622L;
+
+       private final static CmsLog log = CmsLog.getLog(OpenLayersMap.class);
+
+       private Browser browser;
+       private boolean renderCompleted = false;
+
+       private Double centerLng = null, centerLat = null;
+       private Integer zoom = null;
+       private String vectorSource = null;
+       private String gpxSource = null;
+
+       private String vectorSourceStyle;
+
+       private List<String> geoJsonSources = new ArrayList<>();
+       private Map<String, String> vectorSources = new HashMap<>();
+       private Map<String, String> layerStyles = new HashMap<>();
+
+       private CmsView cmsView;
+
+       public OpenLayersMap(Composite parent, int style, URL mapHtml) {
+               super(parent, style);
+               cmsView = CmsSwtUtils.getCmsView(parent);
+               setLayout(new GridLayout());
+
+               browser = new Browser(this, SWT.BORDER);
+               browser.setLayoutData(CmsSwtUtils.fillAll());
+               String html;
+               try (InputStream in = mapHtml.openStream()) {
+                       html = IOUtils.toString(in, StandardCharsets.UTF_8);
+               } catch (IOException e) {
+                       throw new RuntimeException(e);
+               }
+               new RenderCompleted(browser, "renderCompleted");
+               new OnFeatureSelect(browser, "onFeatureSelect");
+               new OnFeatureUnselect(browser, "onFeatureUnselect");
+               new OnFeatureClick(browser, "onFeatureClick");
+               browser.setText(html);
+       }
+
+       public void setCenter(Double lng, Double lat) {
+               if (isRenderCompleted())
+                       browser.evaluate("map.getView().setCenter(ol.proj.fromLonLat([" + lng + ", " + lat + "]))");
+               this.centerLat = lat;
+               this.centerLng = lng;
+       }
+
+       public synchronized void setRenderCompleted(boolean renderCompleted) {
+               this.renderCompleted = renderCompleted;
+               notifyAll();
+       }
+
+       public synchronized boolean isRenderCompleted() {
+               return renderCompleted;
+       }
+
+       @Override
+       public synchronized void dispose() {
+               long timeout = 500;
+               long begin = System.currentTimeMillis();
+               while (!isRenderCompleted() && ((System.currentTimeMillis() - begin) < timeout)) {
+                       try {
+                               wait(50);
+                       } catch (InterruptedException e) {
+                               // silent
+                       }
+               }
+               super.dispose();
+       }
+
+       public void setZoom(int zoom) {
+               if (isRenderCompleted())
+                       browser.evaluate("map.getView().setZoom(" + zoom + ")");
+               this.zoom = zoom;
+       }
+
+       protected String asVectorSource(List<Node> geoPoints) throws RepositoryException {
+               boolean first = true;
+               StringBuffer sb = new StringBuffer("new ol.source.Vector({ features: [");
+               for (int i = 0; i < geoPoints.size(); i++) {
+                       Node node = geoPoints.get(i);
+                       if (node.isNodeType(EntityType.geopoint.get())) {
+                               if (first)
+                                       first = false;
+                               else
+                                       sb.append(",");
+                               Double lng = node.getProperty(EntityNames.GEO_LONG).getDouble();
+                               Double lat = node.getProperty(EntityNames.GEO_LAT).getDouble();
+                               sb.append("new ol.Feature({ geometry:");
+                               sb.append("new ol.geom.Point(ol.proj.fromLonLat([");
+                               sb.append(lng).append(',').append(lat);
+                               sb.append("]))");
+                               sb.append(",path:\"").append(node.getPath()).append("\"");
+                               sb.append(",name:\"").append(node.getName()).append("\"");
+                               String entityType = null;
+                               if (node.isNodeType(EntityType.local.get())) {
+                                       entityType = node.getProperty(EntityNames.ENTITY_TYPE).getString();
+                                       sb.append(", type:'").append(entityType).append("'");
+                               }
+                               enrichFeature(node, sb);
+                               sb.append("})");
+                       }
+               }
+               sb.append("]");
+               sb.append(" })");
+               return sb.toString();
+       }
+
+       protected void enrichFeature(Node node, StringBuffer sb) throws RepositoryException {
+
+       }
+
+       public void addPoints(List<Node> geoPoints) throws RepositoryException {
+               this.vectorSource = asVectorSource(geoPoints);
+               if (log.isTraceEnabled())
+                       log.trace("Vector source: " + vectorSource);
+               renderVectorSource();
+       }
+
+       public void addPoints(String layerName, List<Node> geoPoints, String style) throws RepositoryException {
+               this.vectorSources.put(layerName, asVectorSource(geoPoints));
+               if (style != null) {
+                       layerStyles.put(layerName, style);
+               }
+               renderVectorSources();
+       }
+
+       protected void renderVectorSource() {
+               if (vectorSource == null)
+                       return;
+               if (isRenderCompleted()) {
+//                     String style = ", style: new ol.style.Style({  image: new ol.style.Icon({ src: '/pkg/org.djapps.on.openheritage.ui/map_oc.png' }) })";
+                       String style = vectorSourceStyle != null ? ", style: " + vectorSourceStyle : "";
+//                     String style = "";
+                       String toEvaluate = "map.addLayer(new ol.layer.Vector({ source: " + vectorSource + style + "}));";
+//                     System.out.println(toEvaluate);
+                       browser.execute(toEvaluate);
+               }
+       }
+
+       protected void renderVectorSources() {
+               if (vectorSources.isEmpty())
+                       return;
+               if (isRenderCompleted()) {
+                       StringBuilder toExecute = new StringBuilder();
+                       for (String name : vectorSources.keySet()) {
+                               String style = layerStyles.containsKey(name) ? ", style: " + layerStyles.get(name) : "";
+                               String toEvaluate = "map.addLayer(new ol.layer.Vector({ source: " + vectorSources.get(name) + style
+                                               + ",name: '" + name + "'}));";
+                               toExecute.append(toEvaluate);
+                       }
+                       if (log.isTraceEnabled())
+                               log.trace(toExecute);
+                       browser.execute(toExecute.toString());
+               }
+       }
+
+       public void addPoint(Double lng, Double lat) {
+               this.vectorSource = "new ol.source.Vector({ features: [ new ol.Feature({ geometry:"
+                               + " new ol.geom.Point(ol.proj.fromLonLat([" + lng + ", " + lat + "])) }) ] })";
+//             if (renderCompleted) {
+//                     browser.evaluate(
+//                                     "map.addLayer(new ol.layer.Vector({ source: new ol.source.Vector({ features: [ new ol.Feature({ geometry:"
+//                                                     + " new ol.geom.Point(ol.proj.fromLonLat([" + lng + ", " + lat + "])) }) ] }) }));");
+//             }
+               renderVectorSource();
+       }
+
+       public void addGpx(String path) {
+               this.gpxSource = "new ol.source.Vector({ url: '" + path + "', format: new ol.format.GPX() })";
+               renderGpxSource();
+       }
+
+       protected void renderGpxSource() {
+               if (gpxSource == null)
+                       return;
+               if (isRenderCompleted())
+                       browser.evaluate("map.addLayer(new ol.layer.Vector({ source: " + gpxSource + "}));");
+       }
+
+       public void addGeoJson(String path) {
+               String geoJsonSource = "new ol.source.Vector({ url: '" + path + "', format: new ol.format.GeoJSON() })";
+               geoJsonSources.add(geoJsonSource);
+               renderGeoJsonSources();
+       }
+
+       protected void renderGeoJsonSources() {
+               if (geoJsonSources.isEmpty())
+                       return;
+               if (isRenderCompleted()) {
+                       for (String geoJson : geoJsonSources) {
+                               browser.evaluate("map.addLayer(new ol.layer.Vector({ source: " + geoJson + "}));");
+                       }
+               }
+       }
+
+       public void setVectorSourceStyle(String vectorSourceStyle) {
+               this.vectorSourceStyle = vectorSourceStyle;
+       }
+
+       private class RenderCompleted extends BrowserFunction {
+
+               RenderCompleted(Browser browser, String name) {
+                       super(browser, name);
+               }
+
+               @Override
+               public Object function(Object[] arguments) {
+                       try {
+                               if (!isRenderCompleted()) {
+                                       setRenderCompleted(true);
+                                       if (zoom != null)
+                                               setZoom(zoom);
+                                       if (centerLat != null && centerLng != null) {
+                                               setCenter(centerLng, centerLat);
+                                       }
+                                       if (!geoJsonSources.isEmpty())
+                                               renderGeoJsonSources();
+                                       if (gpxSource != null)
+                                               renderGpxSource();
+                                       if (vectorSource != null)
+                                               renderVectorSource();
+                                       if (!vectorSources.isEmpty())
+                                               renderVectorSources();
+                               }
+                               return null;
+                       } catch (Exception e) {
+                               log.error("Cannot render map", e);
+                               return null;
+                       }
+               }
+       }
+
+       private class OnFeatureSelect extends BrowserFunction {
+
+               OnFeatureSelect(Browser browser, String name) {
+                       super(browser, name);
+               }
+
+               @Override
+               public Object function(Object[] arguments) {
+                       if (arguments.length == 0)
+                               return null;
+                       String path = arguments[0].toString();
+                       Map<String, Object> properties = new HashMap<>();
+//                     properties.put(SuiteEvent.NODE_PATH, path);
+//                     properties.put(SuiteEvent.WORKSPACE, CmsConstants.SYS_WORKSPACE);
+                       properties.put(SuiteUxEvent.CONTENT_PATH, '/' + CmsConstants.SYS_WORKSPACE + path);
+                       cmsView.sendEvent(SuiteUxEvent.refreshPart.topic(), properties);
+                       return null;
+               }
+       }
+
+       private class OnFeatureUnselect extends BrowserFunction {
+
+               OnFeatureUnselect(Browser browser, String name) {
+                       super(browser, name);
+               }
+
+               @Override
+               public Object function(Object[] arguments) {
+                       return null;
+               }
+       }
+
+       private class OnFeatureClick extends BrowserFunction {
+
+               OnFeatureClick(Browser browser, String name) {
+                       super(browser, name);
+               }
+
+               @Override
+               public Object function(Object[] arguments) {
+                       return null;
+               }
+       }
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/openlayers/OverviewMap.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/openlayers/OverviewMap.java
new file mode 100644 (file)
index 0000000..e4e63b8
--- /dev/null
@@ -0,0 +1,77 @@
+package org.argeo.app.ui.openlayers;
+
+import java.util.List;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import javax.jcr.observation.Event;
+import javax.jcr.observation.EventIterator;
+import javax.jcr.observation.EventListener;
+import javax.jcr.query.Query;
+
+import org.argeo.api.acr.Content;
+import org.argeo.api.cms.CmsConstants;
+import org.argeo.app.api.EntityType;
+import org.argeo.cms.jcr.acr.JcrContentProvider;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.ui.CmsUiProvider;
+import org.argeo.jcr.JcrException;
+import org.argeo.jcr.JcrUtils;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+/** Displays an overview map. */
+public class OverviewMap implements CmsUiProvider {
+       private JcrContentProvider jcrContentProvider;
+
+       @Override
+       public Control createUiPart(Composite parent, Content context) {
+               parent.setLayout(new GridLayout());
+               Session session = jcrContentProvider.getJcrSession(context, CmsConstants.SYS_WORKSPACE);
+
+               try {
+                       refreshUi(parent, session);
+                       String[] nodeTypes = { EntityType.geopoint.get() };
+                       session.getWorkspace().getObservationManager().addEventListener(new EventListener() {
+
+                               @Override
+                               public void onEvent(EventIterator events) {
+                                       if (!parent.isDisposed())
+                                               parent.getDisplay().asyncExec(() -> {
+                                                       try {
+                                                               refreshUi(parent, session);
+                                                       } catch (RepositoryException e) {
+                                                               throw new JcrException(e);
+                                                       }
+                                               });
+                               }
+                       }, Event.PROPERTY_CHANGED | Event.NODE_ADDED | Event.NODE_REMOVED | Event.PROPERTY_ADDED, "/", true, null,
+                                       nodeTypes, false);
+               } catch (RepositoryException e) {
+                       throw new JcrException("Cannot add JCR observer", e);
+               }
+
+               return parent;
+       }
+
+       protected void refreshUi(Composite parent, Session session) throws RepositoryException {
+               CmsSwtUtils.clear(parent);
+               Query query = session.getWorkspace().getQueryManager()
+                               .createQuery("SELECT * FROM [" + EntityType.geopoint.get() + "]", Query.JCR_SQL2);
+               List<Node> geoPoints = JcrUtils.nodeIteratorToList(query.execute().getNodes());
+               OpenLayersMap map = new OpenLayersMap(parent, SWT.NONE, getClass().getResource("map-osm.html"));
+               map.setLayoutData(CmsSwtUtils.fillAll());
+
+               // apafMap.setZoom(7);
+               // apafMap.setCenter(-2.472, 8.010);
+               map.addPoints(geoPoints);
+       }
+
+       public void setJcrContentProvider(JcrContentProvider jcrContentProvider) {
+               this.jcrContentProvider = jcrContentProvider;
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/openlayers/map-osm.html b/swt/org.argeo.app.ui/src/org/argeo/app/ui/openlayers/map-osm.html
new file mode 100644 (file)
index 0000000..157d708
--- /dev/null
@@ -0,0 +1,41 @@
+<html lang="en">
+<head>
+<link rel="stylesheet"
+       href="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.4.3/css/ol.css"
+       type="text/css">
+<style>
+</style>
+<script
+       src="https://cdn.jsdelivr.net/gh/openlayers/openlayers.github.io@master/en/v6.4.3/build/ol.js"></script>
+</head>
+<body>
+       <div id="map" class="map"></div>
+       <script type="text/javascript">
+       // default OSM
+       var source_OSM = new ol.source.OSM();
+       
+       var map = new ol.Map({
+                       target : 'map',
+                       layers : [ new ol.layer.Tile({
+                               source : source_OSM
+                       }) ],
+                       view : new ol.View({
+                               center : ol.proj.fromLonLat([ 34, 34 ]),
+                               zoom : 4
+                       })
+               });
+               map.on('rendercomplete', e => {
+                       console.log('Render completed.');
+                       renderCompleted();
+               });
+               var select = new ol.interaction.Select();
+               map.addInteraction(select);
+           select.on('select',function (e) {
+               if(e.selected.length>0){
+                               console.log('Feature selected: '+e.selected[0].get('path'));
+                       onFeatureSelect(e.selected[0].get('path'));
+               }
+           });
+       </script>
+</body>
+</html>
\ No newline at end of file
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/openlayers/map.js b/swt/org.argeo.app.ui/src/org/argeo/app/ui/openlayers/map.js
new file mode 100644 (file)
index 0000000..68489fb
--- /dev/null
@@ -0,0 +1,11 @@
+var map = new ol.Map({
+       target : 'map',
+       layers : [ new ol.layer.Tile({
+               source : new ol.source.OSM()
+       }) ],
+       view : new ol.View({
+               center : ol.proj.fromLonLat([ 34, 34 ]),
+               zoom : 4
+       })
+});
+               
\ No newline at end of file
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/ChooseUserDialog.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/ChooseUserDialog.java
new file mode 100644 (file)
index 0000000..99c7872
--- /dev/null
@@ -0,0 +1,76 @@
+package org.argeo.app.ui.people;
+
+import org.argeo.api.acr.Content;
+import org.argeo.api.acr.ContentSession;
+import org.argeo.api.cms.directory.CmsUserManager;
+import org.argeo.api.cms.directory.HierarchyUnit;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.swt.dialogs.CmsMessageDialog;
+import org.argeo.cms.swt.widgets.SwtTableView;
+import org.argeo.cms.swt.widgets.SwtTreeView;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+
+/** Pick up a user within a hierarchy. */
+public class ChooseUserDialog extends CmsMessageDialog {
+       private ContentSession contentSession;
+       private CmsUserManager cmsUserManager;
+       private HierarchyUnit defaultHierarchyUnit;
+
+       private Content selected;
+
+       public ChooseUserDialog(Shell parentShell, String message, ContentSession contentSession,
+                       CmsUserManager cmsUserManager, HierarchyUnit defaultHierarchyUnit) {
+               super(parentShell, message, CmsMessageDialog.QUESTION);
+               this.contentSession = contentSession;
+               this.cmsUserManager = cmsUserManager;
+               this.defaultHierarchyUnit = defaultHierarchyUnit;
+       }
+
+       @Override
+       protected Control createInputArea(Composite parent) {
+               SashForm sashForm = new SashForm(parent, SWT.HORIZONTAL);
+               CmsSwtUtils.fill(sashForm);
+
+               HierarchyUnitPart hierarchyPart = new HierarchyUnitPart(contentSession, cmsUserManager);
+               SwtTreeView<HierarchyUnit> directoriesView = new SwtTreeView<>(sashForm, SWT.BORDER, hierarchyPart);
+
+               UsersPart usersPart = new UsersPart(contentSession, cmsUserManager);
+
+               SwtTableView<?, ?> usersView = new SwtTableView<>(sashForm, SWT.BORDER, usersPart);
+               usersView.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+               // CONTROLLER
+               hierarchyPart.onSelected((o) -> {
+                       if (o instanceof HierarchyUnit) {
+                               HierarchyUnit hierarchyUnit = (HierarchyUnit) o;
+                               usersPart.setInput(hierarchyUnit);
+                       }
+               });
+
+               usersPart.onSelected((o) -> {
+                       Content user = (Content) o;
+                       selected = user;
+               });
+
+               hierarchyPart.refresh();
+
+               sashForm.setWeights(new int[] { 40, 60 });
+               return sashForm;
+       }
+
+       public Content getSelected() {
+               return selected;
+       }
+
+       @Override
+       protected Point getInitialSize() {
+               return new Point(800, 600);
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/GroupUiProvider.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/GroupUiProvider.java
new file mode 100644 (file)
index 0000000..f0de1ca
--- /dev/null
@@ -0,0 +1,129 @@
+package org.argeo.app.ui.people;
+
+import org.argeo.api.acr.Content;
+import org.argeo.api.acr.ContentSession;
+import org.argeo.api.acr.ldap.LdapAcrUtils;
+import org.argeo.api.acr.ldap.LdapAttr;
+import org.argeo.api.acr.ldap.LdapObj;
+import org.argeo.api.acr.spi.ProvidedContent;
+import org.argeo.api.cms.directory.CmsGroup;
+import org.argeo.api.cms.directory.CmsUser;
+import org.argeo.api.cms.directory.CmsUserManager;
+import org.argeo.api.cms.directory.HierarchyUnit;
+import org.argeo.app.ui.SuiteIcon;
+import org.argeo.app.ui.SuiteMsg;
+import org.argeo.app.ui.SuiteUiUtils;
+import org.argeo.cms.CurrentUser;
+import org.argeo.cms.acr.ContentUtils;
+import org.argeo.cms.auth.CmsRole;
+import org.argeo.cms.swt.CmsSwtTheme;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.swt.Selected;
+import org.argeo.cms.swt.acr.SwtSection;
+import org.argeo.cms.swt.acr.SwtUiProvider;
+import org.argeo.cms.swt.widgets.SwtTableView;
+import org.argeo.cms.ux.widgets.AbstractTabularPart;
+import org.argeo.cms.ux.widgets.CmsDialog;
+import org.argeo.cms.ux.widgets.TabularPart;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+import org.osgi.service.useradmin.Role;
+
+public class GroupUiProvider implements SwtUiProvider {
+       private CmsUserManager cmsUserManager;
+
+       @Override
+       public Control createUiPart(Composite parent, Content context) {
+               CmsSwtTheme theme = CmsSwtUtils.getCmsTheme(parent);
+
+               Content hierarchyUnitContent = context.getParent().getParent();
+               HierarchyUnit hierarchyUnit = hierarchyUnitContent.adapt(HierarchyUnit.class);
+
+               ContentSession contentSession = ((ProvidedContent) context).getSession();
+
+               TabularPart<Content, Content> membersPart = new AbstractTabularPart<Content, Content>() {
+                       Role[] roles;
+
+                       @Override
+                       public int getItemCount() {
+                               roles = context.adapt(CmsGroup.class).getMembers();
+                               return roles.length;
+                       }
+
+                       @Override
+                       public Content getData(int row) {
+                               Role role = roles[row];
+                               Content content = ContentUtils.roleToContent(cmsUserManager, contentSession, role);
+                               return content;
+                       }
+
+               };
+               membersPart.addColumn(new UserColumn());
+
+               // VIEW
+               SwtSection area = new SwtSection(parent, 0, context);
+               area.setLayoutData(CmsSwtUtils.fillAll());
+               area.setLayout(new GridLayout());
+
+               // title
+               // TODO localise at content level
+               String title = (context.hasContentClass(LdapObj.organization) ? SuiteMsg.org.lead() : SuiteMsg.group.lead())
+                               + " " + LdapAcrUtils.getLocalized(context, LdapAttr.cn.qName(), CurrentUser.locale()) + " ("
+                               + hierarchyUnit.getHierarchyUnitLabel(CurrentUser.locale()) + ")";
+               SuiteUiUtils.addFormLabel(area, title);
+
+               // toolbar
+               ToolBar toolBar = new ToolBar(area, SWT.NONE);
+               toolBar.setLayoutData(new GridData(SWT.END, SWT.FILL, true, false));
+
+               ToolItem deleteItem = new ToolItem(toolBar, SWT.FLAT);
+               deleteItem.setEnabled(false);
+               deleteItem.setImage(theme.getSmallIcon(SuiteIcon.delete));
+
+               ToolItem addItem = new ToolItem(toolBar, SWT.FLAT);
+               addItem.setImage(theme.getSmallIcon(SuiteIcon.add));
+               addItem.setEnabled(CurrentUser.implies(CmsRole.groupAdmin, hierarchyUnit.getBase()));
+
+               // members view
+               SwtTableView<Content, Content> membersView = new SwtTableView<>(area, SWT.BORDER, membersPart);
+               membersView.setLayoutData(CmsSwtUtils.fillAll());
+               membersView.refresh();
+
+               // CONTROLLER
+               membersPart.onSelected((model) -> {
+                       deleteItem.setEnabled(CurrentUser.implies(CmsRole.groupAdmin, hierarchyUnit.getBase()));
+                       deleteItem.setData(model);
+               });
+
+               addItem.addSelectionListener((Selected) (e) -> {
+                       ChooseUserDialog chooseUserDialog = new ChooseUserDialog(parent.getDisplay().getActiveShell(),
+                                       SuiteMsg.chooseAMember.lead(), contentSession, cmsUserManager, hierarchyUnit);
+                       if (chooseUserDialog.open() == CmsDialog.OK) {
+                               Content chosen = chooseUserDialog.getSelected();
+                               cmsUserManager.addMember(context.adapt(CmsGroup.class), chosen.adapt(CmsUser.class));
+                               membersPart.refresh();
+                       }
+               });
+
+               deleteItem.addSelectionListener((Selected) (e) -> {
+                       if (deleteItem.getData() != null) {
+                               Content chosen = (Content) deleteItem.getData();
+                               cmsUserManager.removeMember(context.adapt(CmsGroup.class), chosen.adapt(CmsUser.class));
+                               membersPart.refresh();
+                       }
+               });
+
+               return membersView;
+
+       }
+
+       public void setCmsUserManager(CmsUserManager cmsUserManager) {
+               this.cmsUserManager = cmsUserManager;
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/HierarchyUnitPart.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/HierarchyUnitPart.java
new file mode 100644 (file)
index 0000000..3316031
--- /dev/null
@@ -0,0 +1,74 @@
+package org.argeo.app.ui.people;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.argeo.api.acr.Content;
+import org.argeo.api.acr.ContentSession;
+import org.argeo.api.acr.ldap.LdapObj;
+import org.argeo.api.cms.directory.CmsDirectory;
+import org.argeo.api.cms.directory.CmsUserManager;
+import org.argeo.api.cms.directory.HierarchyUnit;
+import org.argeo.api.cms.directory.UserDirectory;
+import org.argeo.api.cms.ux.CmsIcon;
+import org.argeo.app.ui.SuiteIcon;
+import org.argeo.cms.CurrentUser;
+import org.argeo.cms.acr.ContentUtils;
+import org.argeo.cms.auth.CmsRole;
+import org.argeo.cms.ux.widgets.AbstractHierarchicalPart;
+import org.argeo.cms.ux.widgets.Column;
+
+public class HierarchyUnitPart extends AbstractHierarchicalPart<HierarchyUnit> {
+       private ContentSession contentSession;
+       private CmsUserManager cmsUserManager;
+
+       public HierarchyUnitPart(ContentSession contentSession, CmsUserManager cmsUserManager) {
+               this.contentSession = contentSession;
+               this.cmsUserManager = cmsUserManager;
+
+               addColumn(new Column<HierarchyUnit>() {
+
+                       @Override
+                       public String getText(HierarchyUnit model) {
+                               return model.getHierarchyUnitLabel(CurrentUser.locale());
+                       }
+
+                       @Override
+                       public CmsIcon getIcon(HierarchyUnit model) {
+                               Content content = ContentUtils.hierarchyUnitToContent(contentSession, model);
+                               if (content.hasContentClass(LdapObj.organization))
+                                       return SuiteIcon.organisation;
+                               else if (content.hasContentClass(LdapObj.posixGroup))
+                                       return SuiteIcon.users;
+                               else
+                                       return SuiteIcon.addressBook;
+                       }
+               });
+       }
+
+       @Override
+       public List<HierarchyUnit> getChildren(HierarchyUnit parent) {
+               List<HierarchyUnit> visible = new ArrayList<>();
+               if (parent != null) {
+                       if (parent instanceof CmsDirectory) // do no show children of the directories
+                               return visible;
+                       for (HierarchyUnit hu : parent.getDirectHierarchyUnits(true)) {
+                               visible.add(hu);
+                       }
+               } else {
+                       for (UserDirectory directory : cmsUserManager.getUserDirectories()) {
+                               if (CurrentUser.implies(CmsRole.userAdmin, directory.getBase())) {
+                                       visible.add(directory);
+                               }
+                               for (HierarchyUnit hu : directory.getDirectHierarchyUnits(true)) {
+                                       if (CurrentUser.implies(CmsRole.userAdmin, hu.getBase())) {
+                                               visible.add(hu);
+                                       }
+                               }
+
+                       }
+               }
+               return visible;
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/HierarchyUnitUiProvider.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/HierarchyUnitUiProvider.java
new file mode 100644 (file)
index 0000000..374e194
--- /dev/null
@@ -0,0 +1,23 @@
+package org.argeo.app.ui.people;
+
+import org.argeo.api.acr.Content;
+import org.argeo.api.cms.directory.CmsUserManager;
+import org.argeo.cms.swt.acr.SwtUiProvider;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+
+public class HierarchyUnitUiProvider implements SwtUiProvider {
+       private CmsUserManager cmsUserManager;
+
+       @Override
+       public Control createUiPart(Composite parent, Content context) {
+               new Label(parent,0).setText("Hierarchy unit "+context);
+               return null;
+       }
+
+       public void setCmsUserManager(CmsUserManager cmsUserManager) {
+               this.cmsUserManager = cmsUserManager;
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/NewOrgForm.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/NewOrgForm.java
new file mode 100644 (file)
index 0000000..e39ba0a
--- /dev/null
@@ -0,0 +1,119 @@
+package org.argeo.app.ui.people;
+
+import static org.argeo.eclipse.ui.EclipseUiUtils.isEmpty;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import org.argeo.api.acr.Content;
+import org.argeo.api.acr.ldap.LdapAttr;
+import org.argeo.api.acr.ldap.LdapObj;
+import org.argeo.api.cms.directory.CmsGroup;
+import org.argeo.api.cms.directory.CmsUserManager;
+import org.argeo.api.cms.directory.HierarchyUnit;
+import org.argeo.app.ui.SuiteMsg;
+import org.argeo.app.ui.SuiteUiUtils;
+import org.argeo.cms.swt.dialogs.CmsFeedback;
+import org.argeo.cms.swt.widgets.SwtGuidedFormPage;
+import org.argeo.cms.ux.widgets.AbstractGuidedForm;
+import org.argeo.eclipse.ui.EclipseUiUtils;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+
+/** Form to create a new organisation. */
+public class NewOrgForm extends AbstractGuidedForm {
+       private Content hierarchyUnit;
+       private CmsUserManager cmsUserManager;
+
+       protected Text orgNameT;
+
+       public NewOrgForm(CmsUserManager cmsUserManager, Content hierarchyUnit) {
+               this.hierarchyUnit = hierarchyUnit;
+               this.cmsUserManager = cmsUserManager;
+       }
+
+       @Override
+       public void addPages() {
+               try {
+                       MainInfoPage page = new MainInfoPage("main");
+                       addPage(page);
+               } catch (Exception e) {
+                       throw new RuntimeException("Cannot add page to wizard", e);
+               }
+               setFormTitle(SuiteMsg.orgWizardWindowTitle.lead());
+       }
+
+       @Override
+       public boolean performFinish() {
+               String orgName = orgNameT.getText();
+               if (EclipseUiUtils.isEmpty(orgName)) {
+                       CmsFeedback.show(SuiteMsg.allFieldsMustBeSet.lead());
+                       return false;
+               } else {
+                       HierarchyUnit hu = hierarchyUnit.adapt(HierarchyUnit.class);
+                       String dn = "cn=" + orgName + ",ou=Groups," + hu.getBase();
+
+                       CmsGroup user = cmsUserManager.createGroup(dn);
+
+                       Map<String, Object> additionalProperties = new HashMap<>();
+                       additionalProperties.put(LdapAttr.o.name(), orgName);
+
+                       Set<String> objectClasses = new HashSet<>();
+                       objectClasses.add(LdapObj.organization.name());
+                       cmsUserManager.addObjectClasses(user, objectClasses, additionalProperties);
+                       return true;
+               }
+       }
+
+       @Override
+       public boolean performCancel() {
+               return true;
+       }
+
+       @Override
+       public boolean canFinish() {
+               String firstName = orgNameT.getText();
+               if (isEmpty(firstName)) {
+                       return false;
+               } else
+                       return true;
+       }
+
+       protected class MainInfoPage extends SwtGuidedFormPage {
+
+               public MainInfoPage(String pageName) {
+                       super(pageName);
+                       setTitle(SuiteMsg.orgWizardPageTitle.lead());
+               }
+
+               public void createControl(Composite parent) {
+                       parent.setLayout(new GridLayout(2, false));
+
+                       // FirstName
+                       SuiteUiUtils.createBoldLabel(parent, SuiteMsg.org);
+                       orgNameT = new Text(parent, SWT.BORDER);
+                       // firstNameTxt.setMessage("a first name");
+                       orgNameT.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+                       ModifyListener ml = new ModifyListener() {
+                               private static final long serialVersionUID = 1939491923843870844L;
+
+                               @Override
+                               public void modifyText(ModifyEvent event) {
+                                       getView().updateButtons();
+                               }
+                       };
+
+                       orgNameT.addModifyListener(ml);
+
+                       orgNameT.setFocus();
+               }
+       }
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/NewUserForm.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/NewUserForm.java
new file mode 100644 (file)
index 0000000..5a73b1b
--- /dev/null
@@ -0,0 +1,161 @@
+package org.argeo.app.ui.people;
+
+import static org.argeo.eclipse.ui.EclipseUiUtils.isEmpty;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.UUID;
+
+import org.argeo.api.acr.Content;
+import org.argeo.api.acr.ldap.LdapAttr;
+import org.argeo.api.acr.ldap.LdapObj;
+import org.argeo.api.cms.directory.CmsUser;
+import org.argeo.api.cms.directory.CmsUserManager;
+import org.argeo.api.cms.directory.HierarchyUnit;
+import org.argeo.app.core.SuiteUtils;
+import org.argeo.app.ui.SuiteMsg;
+import org.argeo.app.ui.SuiteUiUtils;
+import org.argeo.cms.swt.dialogs.CmsFeedback;
+import org.argeo.cms.swt.widgets.SwtGuidedFormPage;
+import org.argeo.cms.ux.widgets.AbstractGuidedForm;
+import org.argeo.eclipse.ui.EclipseUiUtils;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+
+/** Ask first & last name. Update the passed node on finish */
+public class NewUserForm extends AbstractGuidedForm {
+       private Content hierarchyUnit;
+       private CmsUserManager cmsUserManager;
+
+       protected Text lastNameT;
+       protected Text firstNameT;
+       protected Text emailT;
+
+       public NewUserForm(CmsUserManager cmsUserManager, Content hierarchyUnit) {
+               this.hierarchyUnit = hierarchyUnit;
+               if (!hierarchyUnit.hasContentClass(LdapObj.posixGroup.qName()))
+                       throw new IllegalArgumentException(hierarchyUnit + " is not a POSIX group");
+               this.cmsUserManager = cmsUserManager;
+       }
+
+       @Override
+       public void addPages() {
+               try {
+                       MainInfoPage page = new MainInfoPage("main");
+                       addPage(page);
+               } catch (Exception e) {
+                       throw new RuntimeException("Cannot add page to wizard", e);
+               }
+               setFormTitle(SuiteMsg.personWizardWindowTitle.lead());
+       }
+
+       /**
+        * Called when the user click on 'Finish' in the wizard. The task is then
+        * created and the corresponding session saved.
+        */
+       @Override
+       public boolean performFinish() {
+               String lastName = lastNameT.getText();
+               String firstName = firstNameT.getText();
+               String email = emailT.getText();
+               if (EclipseUiUtils.isEmpty(lastName) || EclipseUiUtils.isEmpty(firstName) || EclipseUiUtils.isEmpty(email)) {
+                       CmsFeedback.show(SuiteMsg.allFieldsMustBeSet.lead());
+                       return false;
+               } else {
+                       UUID uuid = UUID.randomUUID();
+                       String shortId = uuid.toString().split("-")[0];
+                       String uid = "u" + shortId;
+                       HierarchyUnit hu = hierarchyUnit.adapt(HierarchyUnit.class);
+                       String username = "uid=" + uid + ",ou=People," + hu.getBase();
+
+                       Map<String, Object> properties = new HashMap<>();
+                       properties.put(LdapAttr.givenName.name(), firstName);
+                       properties.put(LdapAttr.sn.name(), lastName);
+                       properties.put(LdapAttr.mail.name(), email);
+                       properties.put(LdapAttr.cn.name(), firstName + " " + lastName);
+                       properties.put(LdapAttr.employeeNumber.name(), uuid.toString());
+
+                       Map<String, Object> credentials = new HashMap<>();
+                       CmsUser user = cmsUserManager.createUser(username, properties, credentials);
+
+                       Long huGidNumber = hierarchyUnit.get(LdapAttr.gidNumber.qName(), Long.class).orElseThrow();
+                       Long nextUserId = SuiteUtils.findNextId(hierarchyUnit, LdapObj.posixAccount.qName());
+                       String homeDirectory = "/home/" + uid;
+                       Map<String, Object> additionalProperties = new HashMap<>();
+                       additionalProperties.put(LdapAttr.uidNumber.name(), nextUserId.toString());
+                       additionalProperties.put(LdapAttr.gidNumber.name(), huGidNumber.toString());
+                       additionalProperties.put(LdapAttr.homeDirectory.name(), homeDirectory);
+
+                       Set<String> objectClasses = new HashSet<>();
+                       objectClasses.add(LdapObj.posixAccount.name());
+                       cmsUserManager.addObjectClasses(user, objectClasses, additionalProperties);
+                       return true;
+               }
+       }
+
+       @Override
+       public boolean performCancel() {
+               return true;
+       }
+
+       @Override
+       public boolean canFinish() {
+               String lastName = lastNameT.getText();
+               String firstName = firstNameT.getText();
+               String email = emailT.getText();
+               if (isEmpty(lastName) || isEmpty(firstName) || isEmpty(email)) {
+                       return false;
+               } else
+                       return true;
+       }
+
+       protected class MainInfoPage extends SwtGuidedFormPage {
+
+               public MainInfoPage(String pageName) {
+                       super(pageName);
+                       setTitle(SuiteMsg.personWizardPageTitle.lead());
+               }
+
+               public void createControl(Composite parent) {
+                       parent.setLayout(new GridLayout(2, false));
+
+                       // FirstName
+                       SuiteUiUtils.createBoldLabel(parent, SuiteMsg.firstName);
+                       firstNameT = new Text(parent, SWT.BORDER);
+                       // firstNameTxt.setMessage("a first name");
+                       firstNameT.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+                       // LastName
+                       SuiteUiUtils.createBoldLabel(parent, SuiteMsg.lastName);
+                       lastNameT = new Text(parent, SWT.BORDER);
+                       // lastNameTxt.setMessage("a last name");
+                       lastNameT.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+                       SuiteUiUtils.createBoldLabel(parent, SuiteMsg.email);
+                       emailT = new Text(parent, SWT.BORDER);
+                       emailT.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
+
+                       ModifyListener ml = new ModifyListener() {
+                               private static final long serialVersionUID = 1939491923843870844L;
+
+                               @Override
+                               public void modifyText(ModifyEvent event) {
+                                       getView().updateButtons();
+                               }
+                       };
+
+                       firstNameT.addModifyListener(ml);
+                       lastNameT.addModifyListener(ml);
+                       emailT.addModifyListener(ml);
+
+                       firstNameT.setFocus();
+               }
+       }
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/PeopleEntryArea.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/PeopleEntryArea.java
new file mode 100644 (file)
index 0000000..f7141a4
--- /dev/null
@@ -0,0 +1,191 @@
+package org.argeo.app.ui.people;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+
+import org.argeo.api.acr.Content;
+import org.argeo.api.acr.ContentRepository;
+import org.argeo.api.acr.ContentSession;
+import org.argeo.api.acr.ldap.LdapAttr;
+import org.argeo.api.cms.directory.CmsUserManager;
+import org.argeo.api.cms.directory.HierarchyUnit;
+import org.argeo.api.cms.ux.CmsView;
+import org.argeo.app.ui.SuiteIcon;
+import org.argeo.app.ui.SuiteMsg;
+import org.argeo.app.ui.SuiteUxEvent;
+import org.argeo.cms.CurrentUser;
+import org.argeo.cms.acr.ContentUtils;
+import org.argeo.cms.auth.CmsRole;
+import org.argeo.cms.jcr.acr.JcrContent;
+import org.argeo.cms.swt.CmsSwtTheme;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.swt.Selected;
+import org.argeo.cms.swt.acr.SwtUiProvider;
+import org.argeo.cms.swt.dialogs.CmsFeedback;
+import org.argeo.cms.swt.widgets.SwtGuidedFormDialog;
+import org.argeo.cms.swt.widgets.SwtTableView;
+import org.argeo.cms.swt.widgets.SwtTreeView;
+import org.argeo.cms.ui.CmsUiProvider;
+import org.argeo.cms.ux.widgets.CmsDialog;
+import org.argeo.cms.ux.widgets.Column;
+import org.argeo.cms.ux.widgets.GuidedForm;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+
+/** Entry to the admin area. */
+public class PeopleEntryArea implements SwtUiProvider, CmsUiProvider {
+
+       private CmsUserManager cmsUserManager;
+
+       private ContentRepository contentRepository;
+
+       @Override
+       public Control createUiPart(Composite parent, Content context) {
+               CmsSwtTheme theme = CmsSwtUtils.getCmsTheme(parent);
+               CmsView cmsView = CmsSwtUtils.getCmsView(parent);
+               parent.setLayout(new GridLayout());
+
+               ContentSession contentSession = contentRepository.get();
+               SashForm sashForm = new SashForm(parent, SWT.VERTICAL);
+               CmsSwtUtils.fill(sashForm);
+
+               // VIEW
+               HierarchyUnitPart hierarchyPart = new HierarchyUnitPart(contentSession, cmsUserManager);
+               SwtTreeView<HierarchyUnit> directoriesView = new SwtTreeView<>(sashForm, SWT.BORDER, hierarchyPart);
+
+               UsersPart usersPart = new UsersPart(contentSession, cmsUserManager);
+               usersPart.addColumn(new Column<Content>() {
+
+                       @Override
+                       public String getText(Content role) {
+                               return role.attr(LdapAttr.mail);
+                       }
+
+                       @Override
+                       public int getWidth() {
+                               return 300;
+                       }
+               });
+               // toolbar
+               Composite bottom = new Composite(sashForm, SWT.NONE);
+               bottom.setLayoutData(CmsSwtUtils.fillWidth());
+               bottom.setLayout(CmsSwtUtils.noSpaceGridLayout());
+               ToolBar bottomToolBar = new ToolBar(bottom, SWT.NONE);
+               bottomToolBar.setLayoutData(new GridData(SWT.END, SWT.FILL, true, false));
+
+//             ToolItem deleteItem = new ToolItem(bottomToolBar, SWT.FLAT);
+//             deleteItem.setEnabled(false);
+//             deleteItem.setImage(theme.getSmallIcon(SuiteIcon.delete));
+
+               Menu menu = new Menu(Display.getCurrent().getActiveShell(), SWT.POP_UP);
+               // TODO display add user only if hierarchy unit is a POSIX group
+               // hierarchyUnit.hasContentClass(LdapObjs.posixGroup.qName())
+               MenuItem addUserItem = new MenuItem(menu, SWT.PUSH);
+               addUserItem.setImage(theme.getSmallIcon(SuiteIcon.user));
+               addUserItem.setText(SuiteMsg.user.lead());
+               addUserItem.addSelectionListener((Selected) (e) -> {
+                       HierarchyUnit hierarchyUnit = usersPart.getInput();
+                       Content huContent = ContentUtils.hierarchyUnitToContent(contentSession, hierarchyUnit);
+                       GuidedForm wizard = new NewUserForm(cmsUserManager, huContent);
+                       SwtGuidedFormDialog dialog = new SwtGuidedFormDialog(parent.getShell(), wizard);
+                       if (dialog.open() == CmsDialog.OK) {
+                               CmsFeedback.show(SuiteMsg.personWizardFeedback.lead());
+                               usersPart.refresh();
+                       }
+               });
+
+               MenuItem addOrgItem = new MenuItem(menu, SWT.PUSH);
+               addOrgItem.setImage(theme.getSmallIcon(SuiteIcon.organisation));
+               addOrgItem.setText(SuiteMsg.org.lead());
+               addOrgItem.addSelectionListener((Selected) (e) -> {
+                       HierarchyUnit hierarchyUnit = usersPart.getInput();
+                       Content huContent = ContentUtils.hierarchyUnitToContent(contentSession, hierarchyUnit);
+                       GuidedForm wizard = new NewOrgForm(cmsUserManager, huContent);
+                       SwtGuidedFormDialog dialog = new SwtGuidedFormDialog(parent.getShell(), wizard);
+                       if (dialog.open() == CmsDialog.OK) {
+                               CmsFeedback.show(SuiteMsg.orgWizardFeedback.lead());
+                               usersPart.refresh();
+                       }
+               });
+
+               ToolItem addItem = new ToolItem(bottomToolBar, SWT.PUSH);
+               addItem.setEnabled(false);
+               addItem.setImage(theme.getSmallIcon(SuiteIcon.add));
+
+               sashForm.setWeights(new int[] { 30, 70 });
+
+               SwtTableView<?, ?> usersView = new SwtTableView<>(bottom, SWT.BORDER, usersPart);
+               usersView.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+
+               // CONTROLLER
+               hierarchyPart.onSelected((o) -> {
+                       if (o instanceof HierarchyUnit) {
+                               HierarchyUnit hierarchyUnit = (HierarchyUnit) o;
+                               usersPart.setInput(hierarchyUnit);
+                               addItem.setEnabled(true);
+
+                               addOrgItem.setEnabled(usersPart.getInput() != null
+                                               && CurrentUser.implies(CmsRole.groupAdmin, usersPart.getInput().getBase()));
+//                             cmsView.sendEvent(SuiteUxEvent.refreshPart.topic(), SuiteUxEvent
+//                                             .eventProperties(ContentUtils.hierarchyUnitToContent(contentSession, hierarchyUnit)));
+                       }
+               });
+
+               usersPart.onSelected((o) -> {
+                       Content user = (Content) o;
+                       if (user != null) {
+                               cmsView.sendEvent(SuiteUxEvent.refreshPart.topic(), SuiteUxEvent.eventProperties(user));
+//                             deleteItem.setEnabled(true);
+                       } else {
+//                             deleteItem.setEnabled(false);
+                       }
+               });
+
+               usersPart.onAction((o) -> {
+                       Content user = (Content) o;
+                       if (user != null) {
+                               cmsView.sendEvent(SuiteUxEvent.openNewPart.topic(), SuiteUxEvent.eventProperties(user));
+                       }
+               });
+
+               addItem.addSelectionListener((Selected) (e) -> {
+//                     if (e.detail == SWT.ARROW) {
+                       Rectangle rect = addItem.getBounds();
+                       Point pt = new Point(rect.x, rect.y + rect.height);
+                       pt = bottomToolBar.toDisplay(pt);
+                       menu.setLocation(pt.x, pt.y);
+                       menu.setVisible(true);
+//                     }
+               });
+
+               directoriesView.refresh();
+//             usersView.refresh();
+
+               return sashForm;
+       }
+
+       public void setCmsUserManager(CmsUserManager cmsUserManager) {
+               this.cmsUserManager = cmsUserManager;
+       }
+
+       @Override
+       public Control createUi(Composite parent, Node context) throws RepositoryException {
+               return createUiPart(parent, JcrContent.nodeToContent(context));
+       }
+
+       public void setContentRepository(ContentRepository contentRepository) {
+               this.contentRepository = contentRepository;
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/PersonUiProvider.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/PersonUiProvider.java
new file mode 100644 (file)
index 0000000..8a22a10
--- /dev/null
@@ -0,0 +1,215 @@
+package org.argeo.app.ui.people;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Map;
+
+import org.argeo.api.acr.Content;
+import org.argeo.api.acr.QNamed;
+import org.argeo.api.acr.ldap.LdapAttr;
+import org.argeo.api.acr.ldap.LdapObj;
+import org.argeo.api.cms.directory.CmsGroup;
+import org.argeo.api.cms.directory.CmsUser;
+import org.argeo.api.cms.directory.CmsUserManager;
+import org.argeo.api.cms.directory.HierarchyUnit;
+import org.argeo.api.cms.directory.HierarchyUnit.Type;
+import org.argeo.app.api.SuiteRole;
+import org.argeo.app.ui.SuiteMsg;
+import org.argeo.app.ui.SuiteStyle;
+import org.argeo.app.ui.SuiteUiUtils;
+import org.argeo.cms.CmsMsg;
+import org.argeo.cms.CurrentUser;
+import org.argeo.cms.Localized;
+import org.argeo.cms.RoleNameUtils;
+import org.argeo.cms.SystemRole;
+import org.argeo.cms.auth.CmsRole;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.swt.Selected;
+import org.argeo.cms.swt.acr.SwtSection;
+import org.argeo.cms.swt.acr.SwtUiProvider;
+import org.argeo.cms.swt.dialogs.CmsFeedback;
+import org.argeo.cms.swt.widgets.EditableText;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+
+/** Edit a suite user. */
+public class PersonUiProvider implements SwtUiProvider {
+       private CmsUserManager cmsUserManager;
+
+       @Override
+       public Control createUiPart(Composite parent, Content context) {
+               SwtSection main = new SwtSection(parent, SWT.NONE, context);
+               main.setLayoutData(CmsSwtUtils.fillAll());
+
+               main.setLayout(new GridLayout(2, false));
+
+               CmsUser user = context.adapt(CmsUser.class);
+
+               Content hierarchyUnitContent = context.getParent().getParent();
+               HierarchyUnit hierarchyUnit = hierarchyUnitContent.adapt(HierarchyUnit.class);
+
+               String roleContext = RoleNameUtils.getContext(user.getName());
+
+               if (context.hasContentClass(LdapObj.person.qName())) {
+
+                       addFormLine(main, SuiteMsg.firstName, context, LdapAttr.givenName);
+                       addFormLine(main, SuiteMsg.lastName, context, LdapAttr.sn);
+                       addFormLine(main, SuiteMsg.email, context, LdapAttr.mail);
+               }
+
+               if (context.hasContentClass(LdapObj.posixAccount.qName())) {
+                       if (hierarchyUnitContent.hasContentClass(LdapObj.organization)) {
+                               SwtSection rolesSection = new SwtSection(main, SWT.NONE);
+                               rolesSection.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
+                               rolesSection.setLayout(new GridLayout(2, false));
+                               List<String> roles = Arrays.asList(cmsUserManager.getUserRoles(user.getName()));
+                               addRoleCheckBox(rolesSection, hierarchyUnit, user, SuiteMsg.coworkerRole, SuiteRole.coworker,
+                                               roleContext, roles);
+                               addRoleCheckBox(rolesSection, hierarchyUnit, user, SuiteMsg.publisherRole, SuiteRole.publisher,
+                                               roleContext, roles);
+                               addRoleCheckBox(rolesSection, hierarchyUnit, user, SuiteMsg.userAdminRole, CmsRole.userAdmin,
+                                               roleContext, roles);
+                       }
+//                     Composite facetsSection = new Composite(main, SWT.NONE);
+//                     facetsSection.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
+//                     facetsSection.setLayout(new GridLayout());
+//                     if (context.hasContentClass(LdapObjs.groupOfNames.qName())) {
+//                             String[] members = context.attr(LdapAttrs.member.qName()).split("\n");
+//                             for (String member : members) {
+//                                     new Label(facetsSection, SWT.NONE).setText(member);
+//                             }
+//                     }
+                       if (CurrentUser.implies(CmsRole.userAdmin, roleContext)) {
+                               SwtSection changePasswordSection = new SwtSection(main, SWT.BORDER);
+                               changePasswordSection.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
+                               changePasswordSection.setLayout(new GridLayout(2, false));
+//                             SuiteUiUtils.addFormLabel(changePasswordSection, CmsMsg.changePassword)
+//                                             .setLayoutData(new GridData(SWT.LEAD, SWT.CENTER, false, false, 2, 1));
+                               SuiteUiUtils.addFormLabel(changePasswordSection, CmsMsg.newPassword);
+                               Text newPasswordT = SuiteUiUtils.addFormTextField(changePasswordSection, null, null,
+                                               SWT.PASSWORD | SWT.BORDER);
+                               newPasswordT.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+                               SuiteUiUtils.addFormLabel(changePasswordSection, CmsMsg.repeatNewPassword);
+                               Text repeatNewPasswordT = SuiteUiUtils.addFormTextField(changePasswordSection, null, null,
+                                               SWT.PASSWORD | SWT.BORDER);
+                               repeatNewPasswordT.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+                               Button apply = new Button(changePasswordSection, SWT.FLAT);
+                               apply.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false, 2, 1));
+                               apply.setText(CmsMsg.changePassword.lead());
+                               apply.addSelectionListener((Selected) (e) -> {
+                                       try {
+                                               char[] newPassword = newPasswordT.getTextChars();
+                                               char[] repeatNewPassword = repeatNewPasswordT.getTextChars();
+                                               if (newPassword.length > 0 && Arrays.equals(newPassword, repeatNewPassword)) {
+                                                       cmsUserManager.resetPassword(user.getName(), newPassword);
+                                                       CmsFeedback.show(CmsMsg.passwordChanged.lead());
+                                               } else {
+                                                       CmsFeedback.error(CmsMsg.invalidPassword.lead(), null);
+                                               }
+                                       } catch (Exception e1) {
+                                               CmsFeedback.error(CmsMsg.invalidPassword.lead(), e1);
+                                       }
+                               });
+                       }
+               }
+
+               return main;
+       }
+
+       private void addFormLine(SwtSection parent, Localized msg, Content content, QNamed attr) {
+               SuiteUiUtils.addFormLabel(parent, msg.lead());
+               EditableText text = new EditableText(parent, SWT.SINGLE | SWT.FLAT);
+               text.setLayoutData(CmsSwtUtils.fillWidth());
+               text.setStyle(SuiteStyle.simpleInput);
+               String txt = content.attr(attr);
+               if (txt == null) // FIXME understand why email is not found in IPA
+                       txt = "";
+               text.setText(txt);
+               text.setMouseListener(new MouseAdapter() {
+
+                       private static final long serialVersionUID = 1L;
+
+                       @Override
+                       public void mouseDoubleClick(MouseEvent e) {
+                               String currentTxt = text.getText();
+                               text.startEditing();
+                               text.setText(currentTxt);
+                               ((Text) text.getControl()).addSelectionListener(new SelectionListener() {
+
+                                       private static final long serialVersionUID = 1L;
+
+                                       @Override
+                                       public void widgetSelected(SelectionEvent e) {
+                                       }
+
+                                       @Override
+                                       public void widgetDefaultSelected(SelectionEvent e) {
+                                               String editedTxt = text.getText();
+                                               content.put(attr, editedTxt);
+                                               text.stopEditing();
+                                               text.setText(editedTxt);
+                                               text.getParent().layout(new Control[] { text.getControl() });
+                                       }
+                               });
+                       }
+
+               });
+       }
+
+       private void addRoleCheckBox(SwtSection parent, HierarchyUnit hierarchyUnit, CmsUser user, Localized msg,
+                       SystemRole systemRole, String roleContext, List<String> roles) {
+               Button radio = new Button(parent, SWT.CHECK);
+               radio.setSelection(false);
+               roles: for (String dn : roles) {
+                       if (systemRole.implied(dn, roleContext)) {
+                               radio.setSelection(true);
+                               break roles;
+                       }
+               }
+
+               if (systemRole.equals(CmsRole.userAdmin)) {
+                       if (!CurrentUser.isUserContext(roleContext) && CurrentUser.implies(CmsRole.userAdmin, roleContext)) {
+                               // a user admin cannot modify the user admins of their own context
+                               radio.setEnabled(true);
+                       } else {
+                               radio.setEnabled(false);
+                       }
+               } else {
+                       radio.setEnabled(CurrentUser.implies(CmsRole.userAdmin, roleContext));
+               }
+
+               radio.addSelectionListener((Selected) (e) -> {
+                       HierarchyUnit rolesHu = hierarchyUnit.getDirectChild(Type.ROLES);
+                       CmsGroup roleGroup = cmsUserManager.getOrCreateSystemRole(rolesHu, systemRole.qName());
+                       if (radio.getSelection())
+                               cmsUserManager.addMember(roleGroup, user);
+                       else
+                               cmsUserManager.removeMember(roleGroup, user);
+               });
+
+               new Label(parent, 0).setText(msg.lead());
+
+       }
+
+       public void setCmsUserManager(CmsUserManager cmsUserManager) {
+               this.cmsUserManager = cmsUserManager;
+       }
+
+//     private String getUserProperty(Object element, String key) {
+//             Object value = ((User) element).getProperties().get(key);
+//             return value != null ? value.toString() : null;
+//     }
+
+       public void init(Map<String, Object> properties) {
+       }
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/UserColumn.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/UserColumn.java
new file mode 100644 (file)
index 0000000..9dae8a4
--- /dev/null
@@ -0,0 +1,43 @@
+package org.argeo.app.ui.people;
+
+import org.argeo.api.acr.Content;
+import org.argeo.api.acr.ldap.LdapAcrUtils;
+import org.argeo.api.acr.ldap.LdapAttr;
+import org.argeo.api.acr.ldap.LdapObj;
+import org.argeo.api.cms.ux.CmsIcon;
+import org.argeo.app.ui.SuiteIcon;
+import org.argeo.cms.CurrentUser;
+import org.argeo.cms.auth.UserAdminUtils;
+import org.argeo.cms.ux.widgets.Column;
+import org.osgi.service.useradmin.User;
+
+public class UserColumn implements Column<Content> {
+       @Override
+       public String getText(Content role) {
+               if (role.hasContentClass(LdapObj.inetOrgPerson))
+                       return UserAdminUtils.getUserDisplayName(role.adapt(User.class));
+               else if (role.hasContentClass(LdapObj.organization))
+                       return role.attr(LdapAttr.o);
+               else if (role.hasContentClass(LdapObj.groupOfNames)) {
+                       // TODO make it more generic at ACR level
+                       Object label = LdapAcrUtils.getLocalized(role, LdapAttr.cn.qName(), CurrentUser.locale());
+                       return label.toString();
+               } else
+                       return null;
+       }
+
+       @Override
+       public CmsIcon getIcon(Content role) {
+               if (role.hasContentClass(LdapObj.posixAccount))
+                       return SuiteIcon.user;
+               else if (role.hasContentClass(LdapObj.inetOrgPerson))
+                       return SuiteIcon.person;
+               else if (role.hasContentClass(LdapObj.organization))
+                       return SuiteIcon.organisationContact;
+               else if (role.hasContentClass(LdapObj.groupOfNames))
+                       return SuiteIcon.group;
+               else
+                       return null;
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/UsersPart.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/UsersPart.java
new file mode 100644 (file)
index 0000000..c615ebf
--- /dev/null
@@ -0,0 +1,59 @@
+package org.argeo.app.ui.people;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.argeo.api.acr.Content;
+import org.argeo.api.acr.ContentSession;
+import org.argeo.api.acr.ldap.LdapObj;
+import org.argeo.api.cms.directory.CmsUserManager;
+import org.argeo.api.cms.directory.HierarchyUnit;
+import org.argeo.api.cms.directory.UserDirectory;
+import org.argeo.cms.acr.ContentUtils;
+import org.argeo.cms.ux.widgets.DefaultTabularPart;
+import org.osgi.service.useradmin.Role;
+
+public class UsersPart extends DefaultTabularPart<HierarchyUnit, Content> {
+       private ContentSession contentSession;
+       private CmsUserManager cmsUserManager;
+
+       public UsersPart(ContentSession contentSession, CmsUserManager cmsUserManager) {
+               this.contentSession = contentSession;
+               this.cmsUserManager = cmsUserManager;
+               addColumn(new UserColumn() {
+
+                       @Override
+                       public int getWidth() {
+                               return 300;
+                       }
+
+               });
+       }
+
+       @Override
+       protected List<Content> asList(HierarchyUnit hu) {
+               List<Content> roles = new ArrayList<>();
+               UserDirectory ud = (UserDirectory) hu.getDirectory();
+               if (ud.getRealm().isPresent()) {
+                       for (Role r : ud.getHierarchyUnitRoles(ud, null, true)) {
+                               Content content = ContentUtils.roleToContent(cmsUserManager, contentSession, r);
+                               if (content.hasContentClass(LdapObj.inetOrgPerson, LdapObj.organization))
+                                       roles.add(content);
+                       }
+
+               } else {
+                       for (HierarchyUnit directChild : hu.getDirectHierarchyUnits(false)) {
+                               if (!(directChild.isType(HierarchyUnit.Type.FUNCTIONAL)
+                                               || directChild.isType(HierarchyUnit.Type.ROLES))) {
+                                       for (Role r : ud.getHierarchyUnitRoles(directChild, null, false)) {
+                                               Content content = ContentUtils.roleToContent(cmsUserManager, contentSession, r);
+                                               if (content.hasContentClass(LdapObj.inetOrgPerson, LdapObj.organization, LdapObj.groupOfNames))
+                                                       roles.add(content);
+                                       }
+                               }
+                       }
+               }
+               return roles;
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/vcard/VCardExporter.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/people/vcard/VCardExporter.java
new file mode 100644 (file)
index 0000000..1b5274e
--- /dev/null
@@ -0,0 +1,17 @@
+package org.argeo.app.ui.people.vcard;
+
+import ezvcard.Ezvcard;
+import ezvcard.VCard;
+
+public class VCardExporter {
+
+       public static void main(String[] args) {
+               String str = "BEGIN:VCARD\r\n" + "VERSION:4.0\r\n" + "N:Doe;Jonathan;;Mr;\r\n" + "FN:John Doe\r\n"
+                               + "END:VCARD\r\n";
+
+               VCard vcard = Ezvcard.parse(str).first();
+               String fullName = vcard.getFormattedName().getValue();
+               String lastName = vcard.getStructuredName().getFamily();
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/publish/DocumentUiProvider.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/publish/DocumentUiProvider.java
new file mode 100644 (file)
index 0000000..554ad90
--- /dev/null
@@ -0,0 +1,67 @@
+package org.argeo.app.ui.publish;
+
+import javax.jcr.Node;
+import javax.jcr.RepositoryException;
+import javax.jcr.nodetype.NodeType;
+
+import org.argeo.api.cms.ux.CmsEditable;
+import org.argeo.api.cms.ux.CmsView;
+import org.argeo.app.docbook.DbkType;
+import org.argeo.app.ui.docbook.AbstractDbkViewer;
+import org.argeo.app.ui.docbook.DocumentTextEditor;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.swt.widgets.ScrolledPage;
+import org.argeo.cms.ui.CmsUiProvider;
+import org.argeo.cms.ui.util.CmsLink;
+import org.argeo.cms.ui.util.CmsUiUtils;
+import org.argeo.cms.ui.viewers.JcrVersionCmsEditable;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+public class DocumentUiProvider implements CmsUiProvider {
+
+       @Override
+       public Control createUi(Composite parent, Node context) throws RepositoryException {
+               CmsView cmsView = CmsSwtUtils.getCmsView(parent);
+               CmsEditable cmsEditable = new JcrVersionCmsEditable(context);
+               if (context.hasNode(DbkType.article.get())) {
+                       Node textNode = context.getNode(DbkType.article.get());
+                       // Title
+                       parent.setLayout(CmsSwtUtils.noSpaceGridLayout());
+
+                       Composite links = new Composite(parent, SWT.NONE);
+                       FillLayout linksLayout = new FillLayout();
+                       linksLayout.spacing = 2;
+                       links.setLayout(linksLayout);
+                       CmsLink toHtml = new CmsLink("to HTML", "/html/dbk" + context.getPath() + "/index.html");
+                       toHtml.createUiPart(links, context);
+                       CmsLink toPdf = new CmsLink("to PDF", "/html/dbk" + context.getPath() + "/index.pdf");
+                       toPdf.createUiPart(links, context);
+
+                       ScrolledPage page = new ScrolledPage(parent, SWT.NONE);
+                       page.setLayoutData(CmsSwtUtils.fillAll());
+                       page.setLayout(CmsSwtUtils.noSpaceGridLayout());
+
+                       cmsView.runAs(() -> {
+                               AbstractDbkViewer dbkEditor = new DocumentTextEditor(page, SWT.NONE, textNode, cmsEditable);
+                               dbkEditor.refresh();
+                       });
+                       return page;
+
+               } else if (context.isNodeType(NodeType.NT_FILE)) {
+                       String fileName = context.getName();
+                       if (fileName.endsWith(".pdf")) {
+                               Browser browser = new Browser(parent, SWT.NONE);
+                               String dataPath = CmsUiUtils.getDataPath(context);
+                               browser.setUrl(dataPath);
+                               browser.setLayoutData(CmsSwtUtils.fillAll());
+                               return browser;
+                       }
+               }
+               return null;
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/publish/PdfViewer.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/publish/PdfViewer.java
new file mode 100644 (file)
index 0000000..38d995f
--- /dev/null
@@ -0,0 +1,37 @@
+package org.argeo.app.ui.publish;
+
+import java.awt.image.BufferedImage;
+import java.nio.file.Paths;
+
+import org.apache.pdfbox.pdmodel.PDDocument;
+import org.apache.pdfbox.rendering.PDFRenderer;
+import org.argeo.eclipse.ui.specific.BufferedImageDisplay;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
+public class PdfViewer {
+       public static void main(String[] args) throws Exception {
+               PDDocument doc = PDDocument.load(Paths.get(args[0]).toFile());
+               PDFRenderer renderer = new PDFRenderer(doc);
+
+               BufferedImage image = renderer.renderImageWithDPI(0, 300);
+
+               Display display = new Display();
+               Shell shell = new Shell(display);
+               shell.setLayout(new FillLayout());
+
+               shell.setSize(200, 200);
+
+               BufferedImageDisplay imageDisplay = new BufferedImageDisplay(shell, SWT.NONE);
+               imageDisplay.setImage(image);
+
+               shell.open();
+               while (!shell.isDisposed()) {
+                       if (!display.readAndDispatch())
+                               display.sleep();
+               }
+               display.dispose();
+       }
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/publish/PublishEntryArea.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/publish/PublishEntryArea.java
new file mode 100644 (file)
index 0000000..8aafded
--- /dev/null
@@ -0,0 +1,16 @@
+package org.argeo.app.ui.publish;
+
+import org.argeo.api.acr.Content;
+import org.argeo.cms.swt.acr.SwtUiProvider;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+public class PublishEntryArea implements SwtUiProvider {
+
+       @Override
+       public Control createUiPart(Composite parent, Content context) {
+               // TODO Auto-generated method stub
+               return null;
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/publish/PublishUiProvider.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/publish/PublishUiProvider.java
new file mode 100644 (file)
index 0000000..1c77042
--- /dev/null
@@ -0,0 +1,26 @@
+package org.argeo.app.ui.publish;
+
+import org.argeo.api.acr.Content;
+import org.argeo.api.cms.ux.CmsEditable;
+import org.argeo.app.swt.docbook.DocBookViewer;
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.cms.swt.acr.SwtUiProvider;
+import org.argeo.cms.swt.widgets.ScrolledPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+
+public class PublishUiProvider implements SwtUiProvider {
+
+       @Override
+       public Control createUiPart(Composite parent, Content context) {
+               ScrolledPage page = new ScrolledPage(parent, SWT.NONE);
+               page.setLayoutData(CmsSwtUtils.fillAll());
+               page.setLayout(CmsSwtUtils.noSpaceGridLayout());
+               DocBookViewer docBookViewer = new DocBookViewer(page, 0, context, CmsEditable.NON_EDITABLE);
+//             docBookViewer.setLayoutData(CmsSwtUtils.fillAll());
+               docBookViewer.refresh();
+               return docBookViewer.getControl();
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/publish/PublishingApp.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/publish/PublishingApp.java
new file mode 100644 (file)
index 0000000..ad8a913
--- /dev/null
@@ -0,0 +1,125 @@
+package org.argeo.app.ui.publish;
+
+import static org.argeo.app.ui.SuiteApp.DEFAULT_THEME_ID_PROPERTY;
+import static org.argeo.app.ui.SuiteApp.DEFAULT_UI_NAME_PROPERTY;
+
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import javax.jcr.Node;
+import javax.jcr.Repository;
+import javax.jcr.Session;
+
+import org.argeo.api.cms.CmsApp;
+import org.argeo.api.cms.CmsLog;
+import org.argeo.api.cms.ux.CmsUi;
+import org.argeo.app.ui.SuiteApp;
+import org.argeo.cms.AbstractCmsApp;
+import org.argeo.cms.ui.CmsUiProvider;
+import org.argeo.cms.util.LangUtils;
+import org.argeo.jcr.Jcr;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.osgi.framework.Constants;
+
+/**
+ * A {@link CmsApp} dedicated to publishing, typically a public or internal web
+ * site.
+ */
+public class PublishingApp extends AbstractCmsApp {
+       private final static CmsLog log = CmsLog.getLog(PublishingApp.class);
+
+       private String pid;
+       private String defaultThemeId;
+       private String defaultUiName = "";
+
+       private String publicBasePath = null;
+
+       private CmsUiProvider landingPage;
+       private CmsUiProvider defaultProvider = new DocumentUiProvider();
+
+       private Repository repository;
+
+       public void init(Map<String, String> properties) {
+               if (properties.containsKey(DEFAULT_UI_NAME_PROPERTY))
+                       defaultUiName = LangUtils.get(properties, DEFAULT_UI_NAME_PROPERTY);
+               if (properties.containsKey(DEFAULT_THEME_ID_PROPERTY))
+                       defaultThemeId = LangUtils.get(properties, DEFAULT_THEME_ID_PROPERTY);
+               publicBasePath = LangUtils.get(properties, SuiteApp.PUBLIC_BASE_PATH_PROPERTY);
+               pid = properties.get(Constants.SERVICE_PID);
+
+               if (log.isDebugEnabled())
+                       log.info("Publishing App " + pid + " started");
+       }
+
+       public void destroy(Map<String, String> properties) {
+               if (log.isDebugEnabled())
+                       log.info("Publishing App " + pid + " stopped");
+
+       }
+
+       @Override
+       public Set<String> getUiNames() {
+               Set<String> uiNames = new HashSet<>();
+               uiNames.add(defaultUiName);
+               return uiNames;
+       }
+
+       @Override
+       public CmsUi initUi(Object uiParent) {
+               Composite parent = (Composite) uiParent;
+//             Session adminSession = NodeUtils.openDataAdminSession(getRepository(), null);
+               Session session = Jcr.login(getRepository(), null);
+               parent.setLayout(new GridLayout());
+               Node indexNode = Jcr.getNode(session, publicBasePath + "/index");
+//             try {
+//                     indexNode = JcrUtils.getOrAdd(Jcr.getRootNode(adminSession), DocumentPage.WWW, DbkType.article.get());
+//                     adminSession.save();
+//             } catch (RepositoryException e) {
+//                     throw new IllegalStateException(e);
+//             }
+
+               Control page;
+               if (landingPage != null) {
+                       page = landingPage.createUiPart(parent, indexNode);
+               } else {
+                       page = defaultProvider.createUiPart(parent, indexNode);
+               }
+               return (CmsUi) page;
+       }
+
+       @Override
+       public void refreshUi(CmsUi cmsUi, String state) {
+               Composite parent = (Composite) cmsUi;
+               parent.setLayout(new GridLayout());
+               if (landingPage != null)
+                       landingPage.createUiPart(parent, (Node) null);
+               else
+                       defaultProvider.createUiPart(parent, (Node) null);
+       }
+
+       @Override
+       public void setState(CmsUi cmsUi, String state) {
+
+       }
+
+       @Override
+       protected String getThemeId(String uiName) {
+               return defaultThemeId;
+       }
+
+       public void setLandingPage(CmsUiProvider landingPage) {
+               this.landingPage = landingPage;
+       }
+
+       public Repository getRepository() {
+               return repository;
+       }
+
+       public void setRepository(Repository repository) {
+               this.repository = repository;
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/publish/PublishingStyle.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/publish/PublishingStyle.java
new file mode 100644 (file)
index 0000000..256055c
--- /dev/null
@@ -0,0 +1,23 @@
+package org.argeo.app.ui.publish;
+
+import org.argeo.api.cms.ux.CmsStyle;
+
+/** Publishing styles. */
+public enum PublishingStyle implements CmsStyle {
+       // general
+       page, coverTitle, coverSubTitle, coverTagline, bannerLine1, bannerLine2,
+       // meta data
+       tag, menu,
+       // text style
+       title, subTitle, chapo, para, sectionTitle, subSectionTitle,
+       // links
+       internalLink,
+       // composite style
+       framed, line;
+
+       @Override
+       public String getClassPrefix() {
+               return "argeo-publishing";
+       }
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/widgets/AbstractConnectContextMenu.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/widgets/AbstractConnectContextMenu.java
new file mode 100644 (file)
index 0000000..7824691
--- /dev/null
@@ -0,0 +1,133 @@
+package org.argeo.app.ui.widgets;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.eclipse.ui.EclipseUiUtils;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.ShellEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * Generic popup context menu for TableViewer to enable single sourcing between
+ * CMS and Workbench
+ */
+public abstract class AbstractConnectContextMenu {
+
+       private Shell parentShell;
+       private Shell shell;
+       // Local context
+
+       private final static String KEY_ACTION_ID = "actionId";
+       private final String[] defaultActions;
+       private Map<String, Button> actionButtons = new HashMap<String, Button>();
+
+       public AbstractConnectContextMenu(Display display, String[] defaultActions) {
+               parentShell = display.getActiveShell();
+               shell = new Shell(parentShell, SWT.NO_TRIM | SWT.BORDER | SWT.ON_TOP);
+               this.defaultActions = defaultActions;
+       }
+
+       protected void createControl() {
+               shell.setLayout(EclipseUiUtils.noSpaceGridLayout());
+               Composite boxCmp = new Composite(shell, SWT.NO_FOCUS | SWT.BORDER);
+               boxCmp.setLayout(EclipseUiUtils.noSpaceGridLayout());
+//             CmsUiUtils.style(boxCmp, ConnectUiStyles.CONTEXT_MENU_BOX);
+               createContextMenu(boxCmp);
+               shell.addShellListener(new ActionsShellListener());
+       }
+
+       protected void createContextMenu(Composite boxCmp) {
+               ActionsSelListener asl = new ActionsSelListener();
+               for (String actionId : defaultActions) {
+                       Button btn = new Button(boxCmp, SWT.FLAT | SWT.LEAD);
+                       btn.setText(getLabel(actionId));
+                       btn.setLayoutData(EclipseUiUtils.fillWidth());
+                       CmsSwtUtils.markup(btn);
+//                     CmsUiUtils.style(btn, actionId + ConnectUiStyles.BUTTON_SUFFIX);
+                       btn.setData(KEY_ACTION_ID, actionId);
+                       btn.addSelectionListener(asl);
+                       actionButtons.put(actionId, btn);
+               }
+       }
+
+       protected void setVisible(boolean visible, String... buttonIds) {
+               for (String id : buttonIds) {
+                       Button button = actionButtons.get(id);
+                       button.setVisible(visible);
+                       GridData gd = (GridData) button.getLayoutData();
+                       gd.heightHint = visible ? SWT.DEFAULT : 0;
+               }
+       }
+
+       public void show(Control source, Point location, IStructuredSelection selection) {
+               if (shell.isDisposed()) {
+                       shell = new Shell(Display.getCurrent(), SWT.NO_TRIM | SWT.BORDER | SWT.ON_TOP);
+                       createControl();
+               }
+               if (shell.isVisible())
+                       shell.setVisible(false);
+
+               if (aboutToShow(source, location, selection)) {
+                       shell.pack();
+                       shell.layout();
+                       if (source instanceof Control)
+                               shell.setLocation(((Control) source).toDisplay(location.x, location.y));
+                       shell.open();
+               }
+       }
+
+       protected Shell getParentShell() {
+               return parentShell;
+       }
+
+       class StyleButton extends Label {
+               private static final long serialVersionUID = 7731102609123946115L;
+
+               public StyleButton(Composite parent, int swtStyle) {
+                       super(parent, swtStyle);
+               }
+       }
+
+       class ActionsSelListener extends SelectionAdapter {
+               private static final long serialVersionUID = -1041871937815812149L;
+
+               @Override
+               public void widgetSelected(SelectionEvent e) {
+                       Object eventSource = e.getSource();
+                       if (eventSource instanceof Button) {
+                               Button pressedBtn = (Button) eventSource;
+                               performAction((String) pressedBtn.getData(KEY_ACTION_ID));
+                               shell.close();
+                       }
+               }
+       }
+
+       class ActionsShellListener extends org.eclipse.swt.events.ShellAdapter {
+               private static final long serialVersionUID = -5092341449523150827L;
+
+               @Override
+               public void shellDeactivated(ShellEvent e) {
+                       setVisible(false);
+                       shell.setVisible(false);
+                       //shell.close();
+               }
+       }
+
+       protected abstract boolean performAction(String actionId);
+
+       protected abstract boolean aboutToShow(Control source, Point location, IStructuredSelection selection);
+
+       protected abstract String getLabel(String actionId);
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/widgets/ConnectAbstractDropDown.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/widgets/ConnectAbstractDropDown.java
new file mode 100644 (file)
index 0000000..d1f1a29
--- /dev/null
@@ -0,0 +1,194 @@
+package org.argeo.app.ui.widgets;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.argeo.eclipse.ui.EclipseUiUtils;
+import org.eclipse.rap.rwt.widgets.DropDown;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.FocusListener;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Widget;
+
+/**
+ * Enable easy addition of a {@code DropDown} widget to a text with listeners
+ * configured
+ */
+public abstract class ConnectAbstractDropDown {
+
+       private final Text text;
+       private final DropDown dropDown;
+       private boolean modifyFromList = false;
+
+       // Current displayed text
+       private String userText = "";
+       // Current displayed list items
+       private String[] values;
+
+       // Fine tuning
+       boolean readOnly;
+       boolean refreshOnFocus;
+
+       /** Implementing classes should call refreshValues() after initialisation */
+       public ConnectAbstractDropDown(Text text) {
+               this(text, SWT.NONE, false);
+       }
+
+       /**
+        * Implementing classes should call refreshValues() after initialisation
+        * 
+        * @param text
+        * @param style
+        *            only SWT.READ_ONLY is understood, check if the entered text is
+        *            part of the legal choices.
+        */
+       public ConnectAbstractDropDown(Text text, int style) {
+               this(text, style, false);
+       }
+
+       /**
+        * Implementers should call refreshValues() once init has been done.
+        * 
+        * @param text
+        * @param style
+        *            only SWT.READ_ONLY is understood, check if the entered text is
+        *            part of the legal choices.
+        * @param refreshOnFocus
+        *            if true, the possible values are computed each time the focus is
+        *            gained. It enables, among other to fine tune the getFilteredValues
+        *            method depending on the current context
+        */
+       public ConnectAbstractDropDown(Text text, int style, boolean refreshOnFocus) {
+               this.text = text;
+               dropDown = new DropDown(text);
+               Object obj = dropDown;
+               if (obj instanceof Widget)
+                       CmsSwtUtils.markup((Widget) obj);
+               readOnly = (style & SWT.READ_ONLY) != 0;
+               this.refreshOnFocus = refreshOnFocus;
+               addListeners();
+       }
+
+       /**
+        * Overwrite to force the refresh of the possible values on focus gained event
+        */
+       protected boolean refreshOnFocus() {
+               return refreshOnFocus;
+       }
+
+       public String getText() {
+               return text.getText();
+       }
+
+       public void init() {
+               refreshValues();
+       }
+
+       public void reset(String value) {
+               modifyFromList = true;
+               if (EclipseUiUtils.notEmpty(value))
+                       text.setText(value);
+               else
+                       text.setText("");
+               refreshValues();
+               modifyFromList = false;
+       }
+
+       /** Overwrite to provide specific filtering */
+       protected abstract List<String> getFilteredValues(String filter);
+
+       protected void refreshValues() {
+               List<String> filteredValues = getFilteredValues(text.getText());
+               values = filteredValues.toArray(new String[filteredValues.size()]);
+               dropDown.setItems(values);
+       }
+
+       protected void addListeners() {
+               addModifyListener();
+               addSelectionListener();
+               addDefaultSelectionListener();
+               addFocusListener();
+       }
+
+       protected void addFocusListener() {
+               text.addFocusListener(new FocusListener() {
+                       private static final long serialVersionUID = -7179112097626535946L;
+
+                       public void focusGained(FocusEvent event) {
+                               if (refreshOnFocus) {
+                                       modifyFromList = true;
+                                       refreshValues();
+                                       modifyFromList = false;
+                               }
+                               dropDown.setVisible(true);
+                       }
+
+                       public void focusLost(FocusEvent event) {
+                               dropDown.setVisible(false);
+                               if (readOnly && values != null && !Arrays.asList(values).contains(userText)) {
+                                       modifyFromList = true;
+                                       text.setText("");
+                                       refreshValues();
+                                       modifyFromList = false;
+                               }
+                       }
+               });
+       }
+
+       private void addSelectionListener() {
+               Object obj = dropDown;
+               if (obj instanceof Widget)
+                       ((Widget) obj).addListener(SWT.Selection, new Listener() {
+                               private static final long serialVersionUID = -2357157809365135142L;
+
+                               public void handleEvent(Event event) {
+                                       if (event.index != -1) {
+                                               modifyFromList = true;
+                                               text.setText(values[event.index]);
+                                               modifyFromList = false;
+                                               text.selectAll();
+                                       } else {
+                                               text.setText(userText);
+                                               text.setSelection(userText.length(), userText.length());
+                                               text.setFocus();
+                                       }
+                               }
+                       });
+       }
+
+       private void addDefaultSelectionListener() {
+               Object obj = dropDown;
+               if (obj instanceof Widget)
+                       ((Widget) obj).addListener(SWT.DefaultSelection, new Listener() {
+                               private static final long serialVersionUID = -5958008322630466068L;
+
+                               public void handleEvent(Event event) {
+                                       if (event.index != -1) {
+                                               text.setText(values[event.index]);
+                                               text.setSelection(event.text.length());
+                                               dropDown.setVisible(false);
+                                       }
+                               }
+                       });
+       }
+
+       private void addModifyListener() {
+               text.addListener(SWT.Modify, new Listener() {
+                       private static final long serialVersionUID = -4373972835244263346L;
+
+                       public void handleEvent(Event event) {
+                               if (!modifyFromList) {
+                                       userText = text.getText();
+                                       refreshValues();
+                                       if (values.length == 1)
+                                               dropDown.setSelectionIndex(0);
+                                       dropDown.setVisible(true);
+                               }
+                       }
+               });
+       }
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/widgets/DelayedText.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/widgets/DelayedText.java
new file mode 100644 (file)
index 0000000..ecf6639
--- /dev/null
@@ -0,0 +1,91 @@
+package org.argeo.app.ui.widgets;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledFuture;
+import java.util.concurrent.TimeUnit;
+import java.util.function.Consumer;
+
+import org.eclipse.rap.rwt.service.ServerPushSession;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * A text input which notifies changes after a delay, typically in order to
+ * apply a filter.
+ */
+public class DelayedText {
+       private final static ScheduledExecutorService scheduler;
+       static {
+               // create only one scheduler, in order not to exhaust threads
+               scheduler = Executors.newScheduledThreadPool(0, (r) -> {
+                       Thread thread = new Thread(r, "Delayed text scheduler");
+                       // we mark threads as deamons so that the shutdown hook is triggered
+                       thread.setDaemon(true);
+                       return thread;
+               });
+               Runtime.getRuntime().addShutdownHook(new Thread(() -> {
+                       scheduler.shutdown();
+               }, "Shutdown delayed text scheduler"));
+       }
+       private final static int DEFAULT_DELAY = 800;
+
+       private final long delay;
+       private final InternalModifyListener modifyListener;
+       private final Text text;
+       protected List<Consumer<String>> toDos = new ArrayList<>();
+       private ServerPushSession pushSession;
+
+       private ScheduledFuture<String> lastTask;
+
+       public DelayedText(Composite parent, int style) {
+               this(parent, style, DEFAULT_DELAY);
+       }
+
+       public DelayedText(Composite parent, int style, long delayInMs) {
+               this.delay = delayInMs;
+               this.modifyListener = new InternalModifyListener();
+               pushSession = new ServerPushSession();
+               pushSession.start();
+               text = new Text(parent, style);
+               text.addModifyListener(modifyListener);
+       }
+
+       protected void notifyText(String txt) {
+               // text.getDisplay().syncExec(()-> pushSession.start());
+               for (Consumer<String> toDo : toDos) {
+                       text.getDisplay().syncExec(() -> toDo.accept(txt));
+               }
+               // text.getDisplay().syncExec(()->pushSession.stop());
+       }
+
+       public Text getText() {
+               return text;
+       }
+
+       public void addListener(Consumer<String> toDo) {
+               toDos.add(toDo);
+       }
+
+       private class InternalModifyListener implements ModifyListener {
+               private static final long serialVersionUID = -6178431173400385005L;
+
+               public void modifyText(ModifyEvent e) {
+                       String txt = text.getText();
+                       ScheduledFuture<String> task = scheduler.schedule(() -> {
+                               notifyText(txt);
+                               return txt;
+                       }, delay, TimeUnit.MILLISECONDS);
+                       // cancel previous task
+                       if (lastTask != null && !lastTask.isDone()) {
+                               lastTask.cancel(false);
+                       }
+                       lastTask = task;
+               }
+       };
+
+}
diff --git a/swt/org.argeo.app.ui/src/org/argeo/app/ui/widgets/TreeOrSearchArea.java b/swt/org.argeo.app.ui/src/org/argeo/app/ui/widgets/TreeOrSearchArea.java
new file mode 100644 (file)
index 0000000..2b8f54e
--- /dev/null
@@ -0,0 +1,74 @@
+package org.argeo.app.ui.widgets;
+
+import org.argeo.cms.swt.CmsSwtUtils;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StackLayout;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Text;
+
+/**
+ * Displays a tree by default, which becomes a list if the search text field is
+ * used.
+ */
+public class TreeOrSearchArea extends Composite {
+       private static final long serialVersionUID = -1302546480076719532L;
+
+       private Text searchT;
+       private StackLayout bodyLayout;
+
+       private TreeViewer treeViewer;
+       private TreeViewer searchResultsViewer;
+
+       public TreeOrSearchArea(Composite parent, int style) {
+               super(parent, style);
+               createUi(this);
+       }
+
+       protected void createUi(Composite parent) {
+               parent.setLayout(new GridLayout());
+               Composite searchC = new Composite(parent, SWT.NONE);
+               searchC.setLayout(new GridLayout());
+               searchC.setLayoutData(CmsSwtUtils.fillWidth());
+               createSearchUi(searchC);
+
+               Composite bodyC = new Composite(parent, SWT.NONE);
+               bodyC.setLayoutData(CmsSwtUtils.fillAll());
+               bodyLayout = new StackLayout();
+               bodyC.setLayout(bodyLayout);
+               Composite treeC = new Composite(bodyC, SWT.NONE);
+               createTreeUi(treeC);
+               Composite searchResultsC = new Composite(bodyC, SWT.NONE);
+               createSearchResultsUi(searchResultsC);
+
+               bodyLayout.topControl = treeC;
+       }
+
+       protected void createSearchUi(Composite parent) {
+               parent.setLayout(CmsSwtUtils.noSpaceGridLayout());
+               searchT = new Text(parent, SWT.MULTI | SWT.BORDER);
+               searchT.setLayoutData(CmsSwtUtils.fillWidth());
+       }
+
+       protected void createTreeUi(Composite parent) {
+               parent.setLayout(CmsSwtUtils.noSpaceGridLayout());
+               treeViewer = new TreeViewer(parent);
+               treeViewer.getTree().setLayoutData(CmsSwtUtils.fillAll());
+       }
+
+       protected void createSearchResultsUi(Composite parent) {
+               parent.setLayout(CmsSwtUtils.noSpaceGridLayout());
+               searchResultsViewer = new TreeViewer(parent);
+               searchResultsViewer.getTree().setLayoutData(CmsSwtUtils.fillAll());
+       }
+
+       public TreeViewer getTreeViewer() {
+               return treeViewer;
+       }
+
+       public TreeViewer getSearchResultsViewer() {
+               return searchResultsViewer;
+       }
+
+}