Preface

This book is designed to be read in any order, and is a collection of recipes found, by experience, to be most useful for developers working with the OFBiz project. Let it be your guide to enhancing your OFBiz productivity by saving you valuable time. Written specifically to give clear and straightforward answers to the most commonly asked OFBiz questions, this compendium of OFBiz recipes will show you everything you need to know to get things done in OFBiz.

Whether you are new to OFBiz or an old pro, you are sure to find many useful hints and handy tips here. Topics range from getting started, to configuration and system setup, security and database management, through the final stages of developing and testing new OFBiz applications. We are now Open For Business.

What this book covers

Chapter 1, Getting Started: If you already know how to get started with OFBiz then you can confidently skip this chapter. If, however, you are new to OFBiz, then you may find helpful hints in here to get you started, including getting a copy of the code from the download page or from the Subversion source code repository; fixing installation-related IP port collision errors; setting JAVA_HOME; fixing Java "Class Not Found" errors; installation verification; running JUnit tests; and some basic project artifact navigation hints, including where certain special directories (folders for Windows users) and files may be found.

Chapter 2, Java Development: OFBiz Java development starts with a clear understanding of the role of the Java CLASSPATH. In this chapter, learn how the CLASSPATH enables compilation and runtime loading of OFBiz artifacts. In addition, this chapter reveals how the OFBiz Java file-naming convention is helpful in organizing and finding Java source code. Also learn how to create OFBiz Events and Services, effectively use the provided Java debugging methods, call another OFBiz Service from within a Java program, access HTTP/HTTPS request parameters, use existing tools to handle error messages, use Java properties files, send e-mail using existing OFBiz Service(s), and manipulate XML documents using provided tools.

Chapter 3, The User Interface: Users interact with OFBiz—that is, the "User Interface"—through web pages often referred to within the project as "screens" or "screen views". In this chapter, see how web pages are built from the OFBiz Screen widget, including how to add actions, HTML markup, CSS, and other widgets (Tree, Menu, and Form widgets) to a single screen view widget definition. If your tastes run more towards creating your own screen views, see how to use FreeMarker templates inside Screen widget definitions to build (HTML) web pages. Also discussed in this chapter: passing parameters from the Screen widget's runtime context to the FreeMarker rendering engine, writing JavaScript and including it in a FreeMarker template, calling OFBiz Java methods directly from the FreeMarker context, forcing FreeMarker to render content with HTML markup at runtime, and how to upload a file—that is, support multipart HTML forms—in FreeMarker.

Chapter 4, OFBiz Services: OFBiz "Services" are reusable snippets of code that represent business processing or other logic. You write an OFBiz Service one time and invoke it anytime, anywhere and as often as needed. In this chapter, discover how to manage existing Services, invoke Services from an HTML form, and implement your own Service. Learn how Services communicate and interact during runtime operations using input and output attributes and triggers called Service Event Condition Actions, or SECAs. See best practices for handling errors within a Service and/or SECA. Also discussed are tips on implementing Services in languages other than Java, and a quick introduction to special SECA for incoming e-mail and operations on specific entities.

Chapter 5, The OFBiz Entity Engine: The OFBiz Entity Engine is the magic behind the database agnostic, data-driven tour-de-force that is OFBiz. In this chapter, see how to configure and use the Entity Engine to your advantage. Specifically, see how to change from the default Derby database to another database (note: throughout the OFBiz documentation, the term "data source" is used interchangeably with "database"); how to connect to remote and multiple databases; how entity groups work to help OFBiz organize access to multiple databases; and disable some system database startup checks, map new database field types, create your own entity definition file and entity definition, modify an existing entity definition—often referred to as the entity's model—and build view-entities that represent SQL join statements.

Chapter 6, OFBiz Security: What book about enterprise software would be complete without a word concerning security? In this chapter, get a quick introduction to securing your OFBiz instance, including recipes to lock down communication ports, disable demonstration accounts, protect web pages and web applications using OFBiz Security Groups, enable support for "tarpitting", retrieve forgotten passwords, change existing passwords, handle SSL certificates, and use OFBiz single sign-on support by way of the "external login key" feature.

Chapter 7, WebTools: Often lost in the OFBiz shuffle is a discussion covering basic usage of the many and varied tools that come with the project to manage your OFBiz instance. Collectively called "WebTools", this chapter looks at several important tasks easily accomplished using WebTools, including managing the cache, configuring system and application log tool settings for debug and troubleshooting support; exporting and importing database data; managing localization labels, and accessing databases using the SQL processor tool. Also discussed are introductions to the immensely useful Entity Reference Tool, finding and viewing OFBiz usage statistics, tracing OFBiz artifact dependencies, and working with temporal expressions.

Chapter 8, Web Services: With service orientation at the core of the OFBiz architecture, OFBiz is uniquely qualified to act as both a web services client and service provider for any number of web service interactions. In this chapter, learn how to act as a web services client and request service using URL parameter passing, HttpClient and XML document exchanges, and XML-RPC service requests. If you wish to provide web services, see how to set up OFBiz to serve XML-RPC services, generate and serve WSDL documents, and build both SOAP-based clients and services.

Chapter 9, OFBiz Tips and Tricks: This chapter is a collection of recipes that don't fit under other topic areas. Included here are hints on what to do if you run out of memory during OFBiz execution, reloading/reinitializing the OFBiz database, creating a new administrative user login and password, and getting the OFBiz version number (from Subversion checkouts or trunk builds only). Also included here are hints on using the provided ANT build tool to build an entire OFBiz instance, build a single OFBiz Component, and create a new OFBiz Component or Application. If you are looking for tips on creating a FreeMarker transformation, preparing data using Groovy, how to pop-up a new browser window, and OFBiz visual themes, you will find useful information here.

Appendix, Entity Engine by Example: In this Appendix, see how to effectively use the OFBiz Entity Engine to bring your OFBiz data drive applications to life. From the provided example data model, learn how to create entities and view-entities (SQL join statements) to implement a data model. Also, see how to read, remove, and write data to/from the database using the Entity Engine API; and use the provided EntityUtil API to manipulate database result-sets, access the automatic sequence generator to create new and unique sequence values, and see at a glance valid values for use with the Entity "Operator".

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.137.12