logo资料库

Apache OFBiz Cookbook.pdf

第1页 / 共300页
第2页 / 共300页
第3页 / 共300页
第4页 / 共300页
第5页 / 共300页
第6页 / 共300页
第7页 / 共300页
第8页 / 共300页
资料共300页,剩余部分请下载后查看
Cover
Copyright
Credits
About the Author
About the Reviewers
Table of Contents
Preface
Chapter 1: Getting Started
Introduction
Getting the project code
Getting code from the Subversion repository
Fixing IP port collision errors
The JAVA_HOME setting
"Class Not Found" errors
Installation verification
SSL verification
Running JUnit tests
Locating a OFBiz Component
Locating an OFBiz Application
Chapter 2: Java Development
Introduction
Java runtime CLASSPATH
Java compile time CLASSPATH
Naming conventions
Writing OFBiz Java Events
Writing OFBiz Java Services
Debugging using the logfile
Calling OFBiz Services from a Java program
Getting and validating request parameters (Events)
Getting and validating request parameters (Services)
Managing error messages
Using Java properties files
Sending e-mail from an OFBiz Event or Service
Handling XML files
Chapter 3: The User Interface
Introduction
Creating HTML web pages
Adding actions to Screen widgets
HTML markup in Screen widgets
CSS styling in Screen widgets
Platform-specific widgets
OFBiz Tree widgets
OFBiz Menu widgets
OFBiz Form widgets
Creating web pages using FreeMarker
Passing Screen widget parameters to FreeMarker
Calling Java methods from FreeMarker
Forcing FreeMarker to render HTML markup
Uploading files in FreeMarker forms
Chapter 4: OFBiz Services
Introduction
Managing existing OFBiz Services
Calling a Service from an HTML form
Calling asynchronous Services from HTML forms
Calling a Service many times from an HTML form
Creating a new Service definition file
Creating a new Service definition
Implementing Services
Defining Service attributes (INPUT/OUTPUT)
Service Event Condition Actions
Service groups
Handling Service errors
Writing Groovy Services
Mail Event Condition Actions
Entity Event Condition Actions
Chapter 5: The OFBiz Entity Engine
Introduction
Changing the default database
Connecting to a remote database
Connecting to multiple databases
Creating entity groups
Disabling automatic database checks
Mapping database data types
Creating a new entity model
Modifying an existing entity model
Building a view-entity
Chapter 6: OFBiz Security
Introduction
Securing communications ports
Disabling demonstration user accounts
Protecting OFBiz web pages
Creating user accounts
Protecting applications using security groups
Protecting views ("Tarpitting")
Retrieving forgotten passwords
Changing your password
Adding or changing SSL certificates
OFBiz single sign-on and the external login key
Chapter 7: WebTools
Introduction
Cache maintenance
Changing debug settings
Exporting database data to XML documents
Loading database(s) from XML documents
Managing internationalization labels
Using the SQL processor
Exploring the entity reference tool
Viewing OFBiz usage statistics
Uncovering artifact information
Working with temporal expressions
Chapter 8: Web Services
Introduction
Requesting web services using URL parameters
Requesting web services using an HttpClient
Creating HttpClients and passing XML documents
Creating XML-RPC web service clients
Becoming an XML-RPC web service provider
OFBiz SOAP messaging clients
Generating a WSDL document
Creating SOAP-compliant web services
Chapter 9: OFBiz Tips and Tricks
Introduction
Fixing Java memory allocation errors
Reloading OFBiz seed and demo data
Creating new seed data files
Changing the administrative user's password
Creating a new administrative user
Getting the OFBiz version number
Building an OFBiz instance
Building a single OFBiz Component
Creating a new OFBiz Component or Application
Creating a FreeMarker transform
Preparing data using Groovy
Pop-up new browser windows
Installing an OFBiz Visual Theme
Creating an OFBiz Visual Theme
Appendix: Entity Engine by Example
Introduction
Putting it all together with a data model example
Reading data from an OFBiz data source
Working with large result sets (EntityListIterator)
Removing data from the database (Java)
Writing data to the database (Java)
Using the automatic sequence generator
EntityUtil
EntityOperator reference
Index
Apache OFBiz Cookbook Over 60 simple but incredibly effective recipes for taking control of OFBiz Ruth Hoffman BIRMINGHAM - MUMBAI
Apache OFBiz Cookbook Copyright © 2010 Packt Publishing All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews. Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book. Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information. First published: September 2010 Production Reference: 1020910 Published by Packt Publishing Ltd. 32 Lincoln Road Olton Birmingham, B27 6PA, UK. ISBN 978-1-847199-18-8 www.packtpub.com Cover Image by Harmeet Singh (singharmeet@yahoo.com)
Credits Author Ruth Hoffman Reviewers Adrian Crum Shi Jinghai Acquisition Editor Chaitanya Apte Development Editor Rakesh Shejwal Technical Editor Vanjeet D'souza Indexer Hemangini Bari Editorial Team Leader Mithun Sehgal Project Team Leader Ashwin Shetty Project Coordinator Joel Goveya Proofreader Jonathan Todd Graphics Geetanjali Sawant Production Coordinator Arvindkumar Gupta Cover Work Arvindkumar Gupta
About the Author Ruth Hoffman is an OFBiz evangelist with over 25 years of information technology experience, including stints in software design and development, training, project management, product marketing, and software sales, She has dedicated the last few years of her eventful career to furthering the OFBiz vision. Whether it be writing about OFBiz, providing implementation and OFBiz consulting services, or just "kicking the OFBiz tires" for each new release, she enjoys working with and telling the world about all that this amazing ERP software suite has to offer. Ruth's current passion is her quest to provide high quality, cost effective OFBiz training and documentation. She has pursued this quest through multiple channels, including the OFBiz website. She invites everyone to stop by, take a gander, and give some feedback at http://www.myofbiz.com As a long-standing supporter of OFBiz, she has authored several other OFBiz titles, including OFBiz E-Commerce Out-Of-The-Box and The OFBiz Catalog Manager. For more information, please see: http://www.myofbiz.com. I would like to thank my partner, JC, for being so patient and understanding, my daughter for not getting too upset when I cancelled our planned Lilac Festival adventure, and my dog Sadie for sitting by me all those long hours when no one else would. Also, my sincerest thanks go to Adrian Crum and Shi Jinghai for their dedicated efforts in providing technical reviews of this book. Thanks for keeping me honest and setting me straight on a number of occasions. Your contributions are greatly appreciated!
About the Reviewers Adrian Crum is an IT Manager/Computer programmer for a company that builds homes. Prior to that, he owned and operated a computer retail/service/consulting business. He was Technical Editor of Coast Compute Magazine, and a contributing writer for Programmer's Journal. Adrian has been involved with the Apache OFBiz project as a contributing programmer since 2004, and he is a member of the Project Management Committee. His extensive experience in many programming languages and cross-platform development has been a key part of his contributions to the Apache OFBiz project. Shi Jinghai graduated from Tsinghua University in 1991. In 2001, he took part in the China 2G Citizen Card Project and became an important system designer of the National Citizen Identity Information System of China. In 2004, he started his own company (Beijing Langhua Ltd.) focusing on IT services based on some excellent open source projects such as OFBiz, OpenCms, JBoss Portal, and Jasig CAS among others.
Table of Contents Preface Chapter 1: Getting Started Introduction Getting the project code Getting code from the Subversion repository Fixing IP port collision errors The JAVA_HOME setting "Class Not Found" errors Installation verification SSL verification Running JUnit tests Locating an OFBiz Component Locating an OFBiz Application Chapter 2: Java Development Introduction Java runtime CLASSPATH Java compile time CLASSPATH Naming conventions Writing OFBiz Java Events Writing OFBiz Java Services Debugging using the logfile Calling OFBiz Services from a Java program Getting and validating request parameters (Events) Getting and validating request parameters (Services) Managing error messages Using Java properties files Sending e-mail from an OFBiz Event or Service Handling XML files 1 7 7 9 12 14 17 18 20 22 25 26 28 31 32 32 33 34 35 39 42 43 45 47 48 50 51 53
分享到:
收藏