Red Hat Web Application Framework 6.1 Uživatelský manuál

Procházejte online nebo si stáhněte Uživatelský manuál pro Softwarové příručky Red Hat Web Application Framework 6.1. Red Hat Web Application Framework 6.1 User's Manual Uživatelská příručka

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 230
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků

Shrnutí obsahu

Strany 1 - WAF Developer Guide

Red Hat Web ApplicationFramework 6.1WAF Developer Guide

Strany 2

iv Introduction to the WAF Developer GuideWarningBe careful to remove only the necessary Red Hat Applications partitions. Removing other partitionscou

Strany 3 - Table of Contents

86 Chapter 9. Persistence TutorialString firstName;String lastName;String groupName;do{select *from users, groups, membershipwhere users.user_id = mem

Strany 4

Chapter 9. Persistence Tutorial 87from (select level l, related_category_idfrom (select related_category_id, category_idfrom cat_category_category_map

Strany 5

88 Chapter 9. Persistence Tutorial9.5.4. How it WorksYou may be wondering how to add filters and bind variables after retrieving the query. The persist

Strany 6

Chapter 9. Persistence Tutorial 899.6.3. Incorrect Attribute MappingsWhen you receive an error indicating that an attribute cannot be found or an attr

Strany 7 - 2. Document Conventions

90 Chapter 9. Persistence TutorialData Model Problem Likely Cause in PDLMissing foreign keys Object Model doesn’t use associations, but datamodel does

Strany 8 - Mail backupfiles mail reports

Chapter 9. Persistence Tutorial 919.7.2. Manual Transaction ManagementWhen you manage your transactions locally, your starting point is the SessionMan

Strany 9

92 Chapter 9. Persistence Tutorial9.8. Link AttributesWhen modeling many real-world problems, it is common to encounter situations that require associ

Strany 10

Chapter 9. Persistence Tutorial 93String[1..1] name = groups.name;// ...}object type User {BigInteger[1..1] id = users.user_id;String[1..1] name = use

Strany 11 - first term

94 Chapter 9. Persistence Tutorial9.8.2.1. Creating and Initializing LinksThe DataAssociation.add(DataObject object) method is used when creating a li

Strany 12

Chapter 9. Persistence Tutorial 95System.out.println(email + ": " + membershipDate);}9.8.2.3. Updating Link AttributesThe DataAssociationCur

Strany 13 - I. WAF Concepts

Introduction to the WAF Developer Guide vPermissionDescriptor perm =new PermissionDescriptor(PrivilegeDescriptor.READ,acsObject, party);PermissionServ

Strany 14

96 Chapter 9. Persistence Tutorial// Get the members association.DataAssociation members = (DataAssociation) group.get("members");// Iterate

Strany 15 - WAF Overview

Chapter 9. Persistence Tutorial 973. Generates the events for storing information in the schema in memory so that the ObjectTypereturned can be used w

Strany 16 - 1.1. General Architecture

98 Chapter 9. Persistence TutorialIn addition, there are numerous examples that one could concoct where an EJB server (at leastinitially) could be dee

Strany 17 - 1.2. Features

Chapter 9. Persistence Tutorial 992. Developer Specific Questions2.1. I am new to the persistence API. Where do I start?Start with this book’s table of

Strany 18 - 1.2.2. Services

100 Chapter 9. Persistence TutorialSuppose you are defining an object type named "ChewingGum" that extends ACSObject. Tospecify that an objec

Strany 19 - • Domain logic

Chapter 9. Persistence Tutorial 1012.9. How do I retrieve a DataQuery, DataCollection, or DataAssociation in the orderI want (e.g., there is a sort_or

Strany 20 - 1.3. Applications

102 Chapter 9. Persistence Tutorial

Strany 21 - Chapter 1. WAF Overview 7

Chapter 10.Kernel TutorialThis chapter discusses how to use permissioning and domain objects, answers frequently-asked ques-tions about the WAF securi

Strany 22 - 8 Chapter 1. WAF Overview

104 Chapter 10. Kernel Tutorial10.1.2. Revoking AccessRevoking a privilege on an object from a party is accomplished by creating a PermissionDescrip-t

Strany 23 - WAF Component: Persistence

Chapter 10. Kernel Tutorial 105OID party = new OID("com.arsdigita.kernel.User", new BigDecimal(100));PermissionDescriptor perm =new Permissi

Strany 24 - BaseServlet

vi Introduction to the WAF Developer Guide

Strany 25 - WAF Component: Kernel

106 Chapter 10. Kernel TutorialDataCollection objects = SessionManager.getSession().retrieve("example.MyACSObject");OID party = new OID(&quo

Strany 26 - 3.4. Kernel Resources

Chapter 10. Kernel Tutorial 10710.2.1.1. Starting the ClassA domain object starts off as a standard Java class that extends one of the four domain obj

Strany 27 - WAF Component: Services

108 Chapter 10. Kernel Tutorial*/protected String getBaseDataObjectType() {return BASE_DATA_OBJECT_TYPE; (4)}}(1) The AuditedACSObject is imported fro

Strany 28 - 4.3. Formbuilder Service

Chapter 10. Kernel Tutorial 109public class Note extends AuditedACSObject {/*** BASE_DATA_OBJECT_TYPE represents the full objectType name for the* Not

Strany 29 - 4.4. Globalization Service

110 Chapter 10. Kernel Tutorial* DataObject.** @see AuditedACSObject#AuditedACSObject(OID)* @see com.arsdigita.persistence.DataObject* @see com.arsdig

Strany 30 - 4.6. Messaging Service

Chapter 10. Kernel Tutorial 111* new instance.** @see com.arsdigita.persistence.Session#create(String)* @see com.arsdigita.persistence.DataObject* @se

Strany 31 - 4.9. Search Service

112 Chapter 10. Kernel Tutorial}m_dataObject = s.retrieve(oid);if (m_dataObject == null) {throw new DataObjectNotFoundException("Could not retrie

Strany 32 - 4.11. Versioning Service

Chapter 10. Kernel Tutorial 113}...}(1) These constructors are used to create an empty data object. The Session class is used look upthe metadata that

Strany 33 - WAF Component: Presentation

114 Chapter 10. Kernel Tutorial10.2.1.4. DomainObject MethodsSeveral methods are inherited from DomainObject that are useful for building other method

Strany 34 - 5.2. CSS and XSLT

Chapter 10. Kernel Tutorial 115* Called from base class constructors (DomainObject constructors).*/protected void initialize() {super.initialize();if

Strany 35 - 5.2.2. WAF Templating Package

I. WAF ConceptsThis section covers the concepts of WAF. The intention is to provide both a very high-level architec-tural view and a closer review of

Strany 36 - • ::locale:: - (en_US, en)

116 Chapter 10. Kernel TutorialNote that the Message class only support bodies with a primary MIME type of text. The Mes-sageType interface defines leg

Strany 37 - Available Patterns

Chapter 10. Kernel Tutorial 117Note that the above two examples do not explicitly set a MIME type for the content. This is determinedautomatically whe

Strany 38 - • / - { "index" }

118 Chapter 10. Kernel Tutorialmsg[1].setRefersTo(anchor);msg[2] = msg[0].replyTo(from,body);msg[3] = msg[0].replyTo(from,body);msg[4] = msg[2].replyT

Strany 39 - 5.3. JavaServer Pages (JSP)

Chapter 10. Kernel Tutorial 119KernelHelper.getCurrentUser(request) is a convenience method that returns the currentUser object if available, returns

Strany 40 - 5.4.1. Working With Bebop

120 Chapter 10. Kernel Tutorial8. How do I log in a user using a username and password?KernelHelper.getKernelRequestContext(request).getUserContext().

Strany 41

Chapter 10. Kernel Tutorial 12112. How do I set a user’s password?Given the user’s UserAuthentication object, auth.setPassword(password) sets the user

Strany 42

122 Chapter 10. Kernel Tutorial10.4. Extending the Authentication SystemThe main strength of PAM is that the system may be extended with new authentic

Strany 43 - Page on each request

Chapter 11.Services TutorialsThese tutorials build upon the discussion in Chapter 4 WAF Component: Services.11.1. Categorization TutorialThis section

Strany 44 - /define:radioGroup

124 Chapter 11. Services TutorialsFigure 11-1. Categorization schemeIn the above diagram, the default parent of Televised Events is TV Shows. Its seco

Strany 45 - WAF Component: Web

Chapter 11. Services Tutorials 125An application may own more than one category root. Each association may be labeled with a uniquestring, called a co

Strany 47 - II. Equipping Developers

126 Chapter 11. Services Tutorials• removeChild(ACSObject object) is used to delete a mapping with a child.http://rhea.redhat.com/documentation/api/cc

Strany 48

Chapter 11. Services Tutorials 127Category movies = new Category("Movies", "long television shows");// Create the Romantic Comedie

Strany 49 - Developing with WAF

128 Chapter 11. Services TutorialsFigure 11-4. Category hierarchy before and after code executionAdding the "Titanic" category to two catego

Strany 50 - 7.3. Developer Support

Chapter 11. Services Tutorials 129Figure 11-5. Category hierarchy before and after deleting a categoryYou can delete a category in the following ways:

Strany 51 - /ds/ on your

130 Chapter 11. Services TutorialsCategory b = new Category(new OID(124));Category c = new Category(new OID(125));if ( a != null && b != null

Strany 52 - 7.4.1. Installing Eclipse

Chapter 11. Services Tutorials 131Figure 11-7. Category Hierarchy before and after removing parent categories11.2.5. Retrieving all Subcategories of a

Strany 53 - • $RESIN_HOME/lib/resin.jar

132 Chapter 11. Services TutorialsSystem.out.println("object = " + object.getObject());Iterator parents = object.getParentCategories().itera

Strany 54

Chapter 11. Services Tutorials 133// Attach some content fetched from a URLURL url = new URL("http://www.yahoo.com/");MessagePart part = new

Strany 55

134 Chapter 11. Services Tutorials11.3.4. Email AlertsThe examples above assume that applications will simply need to notify users of some event via e

Strany 56 - • Common Tab

Chapter 11. Services Tutorials 135an email alert going out to 1000 users will occupy the same amount of space in the database as a singleemail.11.4. W

Strany 57 - 7.5.1. Log4J

Chapter 1.WAF OverviewThis chapter is an overview of the Web Application Framework architecture. This high-level viewpointis especially useful for gai

Strany 58

136 Chapter 11. Services Tutorialspublic HelloWorldTask(OID oid) throwsDataObjectNotFoundException {super(oid);}public HelloWorldTask(BigDecimal id) t

Strany 59

Chapter 11. Services Tutorials 137super;}update {super;}delete {super;}}4. In your package initializer section, create and add a new instantiator.Doma

Strany 60

138 Chapter 11. Services Tutorials11.4.2. Adding a Task to a WorkflowTo add a task, you call the addTask method in workflow. The task is inactive when c

Strany 61 - 7.5.4. Custom Appenders

Chapter 11. Services Tutorials 139versioned object type Quux {BigInteger[1..1] id = quuces.id INTEGER;String[1..1] name = quuces.name VARCHAR;object k

Strany 62

140 Chapter 11. Services Tutorials11.5.3. Recoverable typesThe case of compound attributes like country is a little more complex. Let’s look at Exampl

Strany 63 - Chapter 8

Chapter 11. Services Tutorials 14111.5.5. PDL SyntaxTo specify which object types should be versioned, developers can use the keywords versionedand un

Strany 64 - 8.4. Build Tools

142 Chapter 11. Services Tutorials}versioned object type VTC3 {BigInteger[1..1] id = t_vtc3.id INTEGER;object key(id);}object type C2 {BigInteger[1..1

Strany 65 - 8.6. Persistent Object Types

Chapter 11. Services Tutorials 143Figure 11-8. PDL definition graph

Strany 66 - 8.7. Java Domain Objects

144 Chapter 11. Services TutorialsBased on Figure 11-8, the versioning service decides which object types should be versioned,recoverable, or simply i

Strany 67

Chapter 11. Services Tutorials 145Gray nodes represent types that are ignored by the versioning service.There are two kinds of edges in Figure 11-9:1.

Strany 68

2 Chapter 1. WAF Overview1.1. General ArchitectureThe WAF architecture described in Figure 1-1 follows the standard n-tier design pattern, with separa

Strany 69

146 Chapter 11. Services TutorialsString[1..1] name = frobs.frob_name VARCHARA;}In the above example, the versioning system will ignore changes to the

Strany 70

Chapter 11. Services Tutorials 147public String getSummary(DomainObject dobj) {Note note = (Note)dobj;// Truncate body text & remove any HTML.retu

Strany 71

148 Chapter 11. Services Tutorials11.6.1.3. Content provisionThe remaining method to be implemented in the MetadataProvider interface is the onethat a

Strany 72 - 8.9. Creating a Web Interface

Chapter 11. Services Tutorials 149public String getTag() {return "Body Text";}public ContentType getType() {return ContentType.RAW;}public b

Strany 73

150 Chapter 11. Services Tutorialspackage com.example.binder;import com.arsdigita.runtime.CompoundInitializer;import com.arsdigita.runtime.DomainInitE

Strany 74

Chapter 11. Services Tutorials 15111.6.2.2. Displaying resultsThe next stage is to add functionality for processing the query specification and display

Strany 75

152 Chapter 11. Services Tutorialsprivate QueryComponent m_query;private FilterComponent m_typeFilter;private ResultsPane m_results;public NoteSearchC

Strany 76

Chapter 12.Presentation (Bebop) TutorialThis chapter provides useful tutorials for learning and exercising the presentation system using Bebop,as intr

Strany 77 - Persistence Tutorial

154 Chapter 12. Presentation (Bebop) Tutorialstream from an outside source. This section discusses methods for handling this pre-formatted textintelli

Strany 78

Chapter 12. Presentation (Bebop) Tutorial 15512.3. Site-Wide Master PagesUsually the pages within the scope of a single application share a common lay

Strany 79

Chapter 1. WAF Overview 31.1.1.1. Presentation LayerThe Presentation Layer is responsible for presenting information to the end user. The presentation

Strany 80

156 Chapter 12. Presentation (Bebop) Tutorialprotected void addContents(Element layout, PageState ps) {Element topPanel =new Element("socksite:to

Strany 81

Chapter 12. Presentation (Bebop) Tutorial 157You would use this Page like any other, for example, Page p = new SockPuppetPage();p.add(...); ... Howev

Strany 82

158 Chapter 12. Presentation (Bebop) Tutorial/tablexsl:apply-templates select="bebop:bottom"//xsl:templateThis template must be associated w

Strany 83

Chapter 12. Presentation (Bebop) Tutorial 159*/private class BannerAd extends SimpleComponent {public void generateXML(PageState ps, Element parent) {

Strany 84 - 9.3. Associations

160 Chapter 12. Presentation (Bebop) TutorialHttpServletRequest req,HttpServletResponse resp)throws IOException, ServletException {RequestContext rctx

Strany 85 - 9.3.2. Composite Associations

Chapter 12. Presentation (Bebop) Tutorial 161only certain components of PermissionsPane, you must subclass it and overwrite the followingpublic method

Strany 86 - 9.3.4. Link Attributes

162 Chapter 12. Presentation (Bebop) Tutorial12.7.1. Implementing and Registering a Process ListenerYour process listener must be a named Java class i

Strany 87

Chapter 12. Presentation (Bebop) Tutorial 163Page applicationPage = new Page();applicationPage.add(new MetaForm() {public MetaForm() {super("appl

Strany 88 - 9.4. Named SQL Events

164 Chapter 12. Presentation (Bebop) Tutorial

Strany 89

Chapter 13.Web Applications Tutorial13.1. Support for GlobalizationThis section discusses the internationalization (I18n) features of Java and WAF, an

Strany 90 - 9.4.2. Data Operations

4 Chapter 1. WAF OverviewFigure 1-3. Basic Configuration1.2.2. ServicesServices are building blocks that address generic requirements common to most WA

Strany 91

166 Chapter 13. Web Applications TutorialNoteIf an application built on WAF relies on a service provided by another package, that package mustalso be

Strany 92

Chapter 13. Web Applications Tutorial 167For example, PropertyResourceBundles might appear as follows for a HelloWorld application,in English, Spanish

Strany 93

168 Chapter 13. Web Applications Tutorial3class. It also contains a localize(java.util.Locale) method, which is used to localize theresource to a part

Strany 94 - 9.5.1. Filtering

Chapter 13. Web Applications Tutorial 169// print in English:System.out.println((String) message.localize(new Locale("en", "", &qu

Strany 95

170 Chapter 13. Web Applications Tutorialimport com.arsdigita.dispatcher.Dispatcher;import com.arsdigita.globalization.GlobalizedMessage;public class

Strany 96

Chapter 13. Web Applications Tutorial 171msg.send();Sending Rich Text MessagesRich text messages (i.e. HTML) require using the setBody(html,alternate)

Strany 97

172 Chapter 13. Web Applications Tutorial

Strany 98

Chapter 14.ReferencesThe following references are pointers to additional information that is relevant to WAF but beyond thescope of this guide.Martin

Strany 99 - 9.5.2. Ordering

174 Chapter 14. References

Strany 100 - 9.5.3. Binding Parameters

III. AppendixesTable of ContentsA. Bebop Tag Library Reference...

Strany 101

Chapter 1. WAF Overview 5Figure 1-4. Basic ConfigurationAs shown in Figure 1-4, all services follow the n-tier design pattern discussed in Section 1.1

Strany 103 - 9.6.6. Dynamic DDL Generation

Appendix A.Bebop Tag Library ReferenceA.1. Bebop/JSPTag Descriptionshow:all/ Simplifies showing all the components of apage. One such directive is the

Strany 104 - 9.7. Transaction Management

178 Appendix A. Bebop Tag Library ReferenceA.2. Available Page Definition TagsCautionThese tags are highly experimental.Tag Descriptiondefine:page name

Strany 105

Appendix A. Bebop Tag Library Reference 179Tag Descriptiondefine:option name=... [value=...][selected=...] [bundle=...] /defines an option within a sel

Strany 106 - 9.8. Link Attributes

180 Appendix A. Bebop Tag Library Reference

Strany 107 - 9.8.2. Link Attributes API

Appendix B.PL/SQL StandardsLike any other part of WAF, PL/SQL code must be maintainable and professional. This means thatit must be consistent and the

Strany 108

182 Appendix B. PL/SQL Standards4. Always qualify end statements. The end statement for a package should be endpackage_name ;, not just end;. The same

Strany 109

Appendix B. PL/SQL Standards 183The function above takes the optional argument object_id. Do this to allow people to use thesame API call when they ar

Strany 110 - 9.9. Dynamic Object Types

184 Appendix B. PL/SQL Standards2. Truncate the column name until it fits.create table example_topics (topic_id integerconstraint example_topics_topic_

Strany 111 - 9.9.2. Dynamic Associations

Appendix B. PL/SQL Standards 185Execution Plan----------------------------------------------------------0 SELECT STATEMENT Optimizer=CHOOSE1 0 NESTED

Strany 112

Red Hat Web Application Framework 6.1: WAF Developer GuideCopyright © 2004 by Red Hat, Inc.Red Hat, Inc.1801 Varsity DriveRaleigh NC 27606-2072 USAPho

Strany 113 - • For each attribute:

6 Chapter 1. WAF Overview1.2.3. InfrastructureInfrastructure contains software to support the mechanics of application building at each layer ofthe ar

Strany 114

186 Appendix B. PL/SQL StandardsExtending this process farther, there should be a single upgrade script for all of WAF per version. Thisupgrade script

Strany 115

Appendix C.Java StandardsA good developer knows that there is more todevelopment than programming. A great de-veloper knows that there is more to deve

Strany 116

188 Appendix C. Java Standards5. Acronyms, such as JDBC or URL, should always be capitalized when used. For instance, writeJDBCLoader instead of JdbcL

Strany 117 - Kernel Tutorial

Appendix D.PDL SyntaxThis chapter introduces the syntax for the Persistence Definition Language.D.1. PDL GrammarThe following is an Extended Backus-Nau

Strany 118 - 10.1.3. Basic Access Check

190 Appendix D. PDL Syntaxproperty :=( <IMMEDIATE> )?( ( <VERSIONED> | <UNVERSIONED> ) )?( <UNIQUE> )?( ( <COMPONENT> |

Strany 119 - 10.1.4. Allowed Targets Check

Appendix D. PDL Syntax 191idpath := id ( <DOT> id )*id := <ID>integer := <INT>D.2. PDL Reserved WordsD.2.1. PDL KeywordsThe followin

Strany 120 - 10.2. Domain Objects Tutorial

192 Appendix D. PDL SyntaxIMPORT = importINSERT = insertJOIN = joinMAP = mapMODEL = modelOBJECTKEY = object <WS> keyOBJECTTYPE = object <WS&g

Strany 121

Appendix D. PDL Syntax 193• component — this word is reserved for future use.• composite — used to signify a definition of a composite relationship bet

Strany 122 - DomainObject or its

194 Appendix D. PDL Syntax• retrieve — used to signify the beginning of the block of code defining the retrieve event. Oneexample of this would be a co

Strany 123

Appendix D. PDL Syntax 195model tutorial;object type Publication {BigDecimal id = publications.publication_id INTEGER;String name = publications.name

Strany 124

Chapter 1. WAF Overview 7Figure 1-5. Basic ConfigurationAgain, each application follows the same n-tier design pattern, and builds upon the kernel and

Strany 125

196 Appendix D. PDL Syntaxobject type screenName {BigDecimal id = screen_names.name_id INTEGER;String screenName = screen_names.screen_name VARCHAR(70

Strany 126

Appendix D. PDL Syntax 197and magazine_article_map.article_id =article_author_map.article_idand article_author_map.author_id = authors.author_id} map

Strany 127

198 Appendix D. PDL SyntaxBigDecimal articleID;options {WRAP_QUERIES = false;}do {select max(article_id) from articles} map {articleID = articles.arti

Strany 128

Appendix D. PDL Syntax 199where relation_type = :relationType)connect by prior related_category_id = category_idstart with category_id = :categoryID)

Strany 129 - 10.2.3. Examples

200 Appendix D. PDL Syntaxcreate table paragraphs (paragraph_id integerconstraint paragraphs_paragraph_id_pkprimary keyconstraint paragraphs_paragraph

Strany 130

Appendix D. PDL Syntax 201DataQueryPLSQLFunction(v_article_id in integer)return numberisv_title varchar(700);beginselect title into v_title from artic

Strany 131

202 Appendix D. PDL Syntax

Strany 132 - 10.3. Security Service FAQ

Persistence GlossaryThe terms used by the persistence system are largely based upon the Unified Modeling Language(UML) terminology. For background info

Strany 133

204 Persistence GlossaryDomain ObjectDomain objects are not part of the persistence layer, but since they are the most common wayto access a Data Obje

Strany 134

Persistence Glossary 205Link AttributesA Link is the path from one object to another. Associations are types of links. A Link Attributeis a property o

Strany 135

8 Chapter 1. WAF Overview

Strany 136 - • Replace certain modules

206 Persistence Glossaryselect code and tables herewhere secondtable.second_object_id_one = firsttable.object_id_oneand secondtable.second_object_id_t

Strany 137 - Services Tutorials

Persistence Glossary 207UML ClassA UML Class is a description of a set of objects that share the same attributes, operations, andrelationships. A UML

Strany 138

208 Persistence Glossary

Strany 139 - 11.1.2. Classes

IndexAacronymspresentation, 19ACSObjectbase permissioning class, 11APImail, 16appenderscustom WAF, 47logging, 47ApplicationBaseServlet defined, 31prope

Strany 140

210logging concepts, 42problems with System.out.println(), 43with Eclipse, 41with log4j, 43deployingwith Eclipse, 40Derived Associations, 203developer

Strany 141

211JJava coding standards, 187references, 188JavaServer Pages(See JSP)Join Element, 204Join Path, 204Join Paths, 89JSPBebop integration, 28dynamic pag

Strany 142 - 11.2.2. Deleting a Category

212OObjectPersistence, 9Object KeyDefined, 206Example, 65Object TypeInheritance, 69Model, 65Object-RelationalMapping, 9OrderingExamples, 79How-To, 85ou

Strany 143

213Ssearchservice concept, 17serviceauditing, concepts of, 13categorization, concepts of, 13formbuilder, concepts of, 14globalization, concepts of, 15

Strany 144

214XXSLPresentation Conventions, 20XSLTBebop, using with, 153globalization, 170implementing, 153overriding default stylesheet, 159using with WAF, 20

Strany 145

ColophonThe Red Hat Applications manuals are written in DocBook SGML v4.1 format. The HTML and PDFformats are produced using custom DSSSL stylesheets

Strany 146 - 11.3. Notification Tutorial

Chapter 2.WAF Component: PersistenceThis chapter discusses the persistence layer in the overall Web Application Framework. This wasoriginally discusse

Strany 148 - 11.3.4. Email Alerts

10 Chapter 2. WAF Component: PersistenceFor a listing of PDL terms, see Appendix D PDL Syntax. Examples of PDL usage can be found inChapter 9 Persiste

Strany 149 - 11.4. Workflow Tutorial

Chapter 3.WAF Component: KernelThis chapter discusses the kernel layer, which provides services used by several parts of the WAFsystem. This component

Strany 150

12 Chapter 3. WAF Component: Kernel• What parties have a particular privilege on a particular object?• What privileges does a particular party have on

Strany 151

Chapter 4.WAF Component: ServicesWAF provides a number of generic services that can be used in developing a WAF application. Ser-vices leverage the bu

Strany 152 - 11.5. Versioning Tutorial

14 Chapter 4. WAF Component: Services• Entertainment• Music• Movies• Television Shows• Education• Literacy• Testing• Home Schooling• Theories• Sports•

Strany 153 - 11.5.2. Fully versioned types

Chapter 4. WAF Component: Services 15introduced to the market. Rather than requiring programming for this straightforward functionality,WAF provides t

Strany 154 - 11.5.3. Recoverable types

Table of ContentsIntroduction to the WAF Developer Guide... i1. A

Strany 155 - 11.5.5. PDL Syntax

16 Chapter 4. WAF Component: Servicesas reported by the user’s browser, and compares them to the list of languages and locales thatthe system is config

Strany 156

Chapter 4. WAF Component: Services 171. The message body should have a MIME type of text/plain or text/html.2. Each attachment to the message can have

Strany 157

18 Chapter 4. WAF Component: Services4.10. Workflow ServiceWorkflows allow specialized members of a group to collaborate using a standard process. Devel

Strany 158

Chapter 5.WAF Component: PresentationInformation in the database ultimately needs to be presented to the user for viewing and manipulating.The Web App

Strany 159

20 Chapter 5. WAF Component: Presentation• JavaServer Pages (JSP) is a J2EE standard for scripting dynamic web pages. JSPs typically produceHTML, thou

Strany 160 - 11.6. Search Tutorial

Chapter 5. WAF Component: Presentation 21BasePresentationManager or swap it out with its own to use a different algorithm for choosing astylesheet for

Strany 161

22 Chapter 5. WAF Component: Presentationcom.arsdigita.templating.PatternStylesheetResolver class is the new preferredresolver and now the default set

Strany 162

Chapter 5. WAF Component: Presentation 235.2.2.3. Pattern GeneratorsThe com.arsdigita.templating.PatternGenerator interface provides the mechanism for

Strany 163

24 Chapter 5. WAF Component: PresentationlocaleThis pattern generator expands to the current kernel execution context locale. ie the value re-turned b

Strany 164 - • FilterComponent.java

Chapter 5. WAF Component: Presentation 255.3. JavaServer Pages (JSP)JSP technology is a J2EE standard for presentation. JSP pages have full access to

Strany 165

8.4. Build Tools... 508.5. Modeling Your Appli

Strany 166

26 Chapter 5. WAF Component: PresentationFigure 5-1. Tabbed Pane Using Bebop Components5.4.1. Working With BebopChapter 12 Presentation (Bebop) Tutori

Strany 167 - Presentation (Bebop) Tutorial

Chapter 5. WAF Component: Presentation 27TabbedPane tabs = new TabbedPane();page.add(tabs);tabs.addTab("Browse", new BrowsePane());tabs.addT

Strany 168

28 Chapter 5. WAF Component: Presentation5. Fire the control event.When a client sends a request to a Bebop page (e.g. a mouse-click on a tab); only o

Strany 169 - 12.3. Site-Wide Master Pages

Chapter 5. WAF Component: Presentation 291. The requested JSP obtains an XML document from a Bebop page object and the current requeststate.2. The tag

Strany 170

30 Chapter 5. WAF Component: Presentationdefine:option label=" %= rtexpr % " value=" %= expr % "/% } %/define:radioGroupThis is es

Strany 171

Chapter 6.WAF Component: WebThe Web component of WAF makes the persistent data and domain logic of your application availableto others over protocols

Strany 172 - 12.4. Varying a Shared Layout

32 Chapter 6. WAF Component: Web• Request context — The BaseServlet packages certain facts about the request, such as the currentuser, current applica

Strany 173

II. Equipping DevelopersThis section provides information needed to develop on the Web Application Framework. Includedis a chapter on setting up a dev

Strany 175

Chapter 7.Developing with WAFThis chapter introduces prerequisites to working with WAF as well as the tools that are available tothe developer.It is p

Strany 176

B.3. Coding Style... 183B.4. Constraint Naming Stan

Strany 177

36 Chapter 7. Developing with WAFincludes a secure telnet replacement and a secure file-copy utility (scp). Both open source and propri-etary implement

Strany 178

Chapter 7. Developing with WAF 37It is possible to have Developer Support enabled and not running. This still provides a measurableperformance hit bec

Strany 179 - Web Applications Tutorial

38 Chapter 7. Developing with WAFShow Hits To Developer SupportThe Show hits to developer support link on the Developer Support index page toggles the

Strany 180

Chapter 7. Developing with WAF 39TipIt is recommended to only select Warning for the options:• Methods overridden but not package visible• Methods wit

Strany 181 - 13.4. Accessing Resources

40 Chapter 7. Developing with WAFCMS and Other ProjectsTo add CMS or other projects to Eclipse, follow the same steps as for adding WAF, with thefollo

Strany 182

Chapter 7. Developing with WAF 41#cleancd $CCM_HOMEant clean#buildcd $CCM_HOMEant deploy#javadoccd $CCM_HOMEant javadocant deploy-apiExample 7-1. Shel

Strany 183 - 13.5. Globalization and Bebop

42 Chapter 7. Developing with WAFWAF Debugging SetupIn Eclipse, select Run = Debug. In the dialog box, select Remote Java Application and thenclick on

Strany 184 - 13.7. Sending Mail Messages

Chapter 7. Developing with WAF 437.5.1. Log4JUsing System.out.println() for logging has numerous drawbacks.1. It degrades performance. There is no eas

Strany 185

44 Chapter 7. Developing with WAFgreater than or equal to the current level of the logger. For example, if you set the foo.bar.bazlogger’s level to wa

Strany 186

Chapter 7. Developing with WAF 45try {doSomething();} catch (FooException ex) {s_log.debug(ex);}Example 7-4. Swallowed stack trace anti-patternThere i

Strany 188 - 174 Chapter 14. References

46 Chapter 7. Developing with WAFpackage foo.bar;import org.apache.log4j.Logger;public class Baz {private final static Logger s_log = Logger.getLogger

Strany 189 - III. Appendixes

Chapter 7. Developing with WAF 47}Example 7-9. Adjusting logging level temporarilyIn the above example, you end up enabling the PreparedStatement logg

Strany 190

48 Chapter 7. Developing with WAFWhat kind of I/O does log4j use: buffered or unbuffered? It depends on how the particular appenderis configured. In th

Strany 191 - Bebop Tag Library Reference

Chapter 8.WAF Application Development TutorialThis tutorial introduces the concepts and techniques needed to create your own application in the RedHat

Strany 192

50 Chapter 8. WAF Application Development TutorialThe standard layout of files in the build environment of a WAF application follows the guidelinesset

Strany 193

Chapter 8. WAF Application Development Tutorial 518.5. Modeling Your ApplicationA new application is represented by a persistent Application object. A

Strany 194

52 Chapter 8. WAF Application Development Tutorial8.7. Java Domain ObjectsEach object type will have a corresponding domain class written in Java. The

Strany 195 - PL/SQL Standards

Chapter 8. WAF Application Development Tutorial 53/*** Removes <code>note</code> from the set of notes tracked by this* <code>Binder

Strany 196

54 Chapter 8. WAF Application Development Tutorialpackage com.example.binder;import com.arsdigita.db.Sequences;import com.arsdigita.domain.DomainObjec

Strany 197 - B.3. Coding Style

Chapter 8. WAF Application Development Tutorial 55/*** Sets the title of the note.** @param title The <code>String</code> title; it cannot

Strany 198 - B.4.3. Naming primary keys

Introduction to the WAF Developer GuideThe Red Hat Web Application Framework is a platform for writing database-backed web applicationsin Sun’s Java®.

Strany 199 - B.4.5. Upgrade Scripts

56 Chapter 8. WAF Application Development TutorialIn many ways, Note.java is just like Binder.java. It declares its data object type; it defines aninst

Strany 200 - - new-version-name .sql

Chapter 8. WAF Application Development Tutorial 57** @return The <code>String</code> title; it cannot be null*/public final String getTitl

Strany 201 - Java Standards

58 Chapter 8. WAF Application Development Tutoriale.getFactory().registerInstantiator(Binder.BASE_DATA_OBJECT_TYPE,new DomainObjectInstantiator() {pro

Strany 202

Chapter 8. WAF Application Development Tutorial 59/*** A servlet to serve pages of the binder application.** @see com.example.binder.Binder* @author J

Strany 203 - PDL Syntax

60 Chapter 8. WAF Application Development Tutorial8.10. Integrating Your Package With CCM ToolsThe WAF environment includes a set of tools for loading

Strany 204 - 190 Appendix D. PDL Syntax

Chapter 8. WAF Application Development Tutorial 61Creating A ccm Tool Upgrade Script in Java1. Create arbitrary Java code that is accessible via a sta

Strany 205 - D.2. PDL Reserved Words

62 Chapter 8. WAF Application Development Tutorial

Strany 206

Chapter 9.Persistence TutorialThis chapter presents a tutorial for using the persistence system. It presumes you are familiar with theconcepts covered

Strany 207

64 Chapter 9. Persistence Tutorial• A database schema to handle the storage of the Data Objects.Some designers may feel more comfortable starting with

Strany 208 - D.2.2. PDL Attribute Types

Chapter 9. Persistence Tutorial 659.2.3.2. Model and Object TypeWhen creating a PDL file, the first line of the file must be the name of the model that d

Strany 209 - Appendix D. PDL Syntax 195

ii Introduction to the WAF Developer GuideapplicationThis style indicates that the program is an end-user application (as opposed to system software).

Strany 210 - 196 Appendix D. PDL Syntax

66 Chapter 9. Persistence TutorialThis object type definition almost models the SQL that we have defined above but it is missing anymention of the uniqu

Strany 211 - Appendix D. PDL Syntax 197

Chapter 9. Persistence Tutorial 67• SessionManager — http://rhea.redhat.com/doc/waf/6.0/api/com/arsdigita/persistence/\ Session-Manager.html.This clas

Strany 212 - 198 Appendix D. PDL Syntax

68 Chapter 9. Persistence Tutorial• PersistenceException — http://rhea.redhat.com/doc/waf/6.0/api/com/arsdigita/persistence/\PersistenceException.html

Strany 213 - Appendix D. PDL Syntax 199

Chapter 9. Persistence Tutorial 69DataCollections are also useful when it is necessary to perform certain tasks on a large numberof Data Objects. Supp

Strany 214 - 200 Appendix D. PDL Syntax

70 Chapter 9. Persistence Tutorial// a "reference key" declaration and "id" is not defined// as one of the attributesreference key

Strany 215 - Appendix D. PDL Syntax 201

Chapter 9. Persistence Tutorial 71NoteThe order of the join path is important. The information that the developer has must come first.That is, when the

Strany 216 - 202 Appendix D. PDL Syntax

72 Chapter 9. Persistence Tutorial}9.3.3. Role ReferencesDevelopers ofen only need to be able to obtain associated information in a single direction.

Strany 217 - Persistence Glossary

Chapter 9. Persistence Tutorial 73// create the mapping table with the page_number column.BigDecimal pageNumber = magazine_article_map.page_number INT

Strany 218

74 Chapter 9. Persistence Tutorialassociation has a Multiplicity of 0..1 or 1..1 (or any upper bound = 1) then developers should usethe setAssociation

Strany 219

Chapter 9. Persistence Tutorial 75To accomplish the task of retrieving the paragraphs as mentioned above, you could declare the fol-lowing DataQuery i

Strany 220

Introduction to the WAF Developer Guide iii$#[stephen@maturin stephen]$leopard login:user inputText that the user has to type, either on the command l

Strany 221 - UML Class

76 Chapter 9. Persistence TutorialThe PDL is simply a Data Query with extra Attribute definitions (remove the "\" and make it all oneline).qu

Strany 222 - 208 Persistence Glossary

Chapter 9. Persistence Tutorial 779.4.2.1. Executing Arbitrary DMLData Operations are similiar to DataQueries in both structure and use. However, whil

Strany 223

78 Chapter 9. Persistence Tutorialselect nvl(max(magazine_id), 0) + 1, :title from magazine_id;end;/show errorsTo do this, first include the above stat

Strany 224

Chapter 9. Persistence Tutorial 79NoteThe do call and OUT parameters are not available for Postgres because Postgres has not yet imple-mented Callable

Strany 225

80 Chapter 9. Persistence Tutorial9.5.1. Filtering9.5.1.1. OverviewThe filtering system is complex, in that it allows developers to create complex expr

Strany 226

Chapter 9. Persistence Tutorial 81}To retrieve all users whose last name is "Smith", do the following:DataQuery query = session.retrieveQuer

Strany 227

82 Chapter 9. Persistence TutorialSystem.out.println("First name = " + query.get("firstName") +"; Last name = " + query.

Strany 228

Chapter 9. Persistence Tutorial 83query retrieveAllUsers {User myUser;do {select user_id, first_name, last_name from users} map {user.id = users.user_

Strany 229 - Colophon

84 Chapter 9. Persistence Tutorialselect article_idfrom authors, author_article_mapwhere authors.author_id = author_article_map.author_idand lower(las

Strany 230

Chapter 9. Persistence Tutorial 859.5.1.6. Filtering Using FunctionsThe filtering methods discussed so far work well when the developer only needs to fi

Komentáře k této Příručce

Žádné komentáře