Apache OFBiz Cookbook pdf

300 4,771 2
  • Loading ...
    Loading ...
    Loading ...

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Tài liệu liên quan

Thông tin tài liệu

Ngày đăng: 07/03/2014, 06:20

www.it-ebooks.infoApache OFBiz CookbookOver 60 simple but incredibly effective recipes for taking control of OFBizRuth HoffmanBIRMINGHAM - MUMBAIwww.it-ebooks.infoApache OFBiz CookbookCopyright © 2010 Packt PublishingAll 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 2010Production Reference: 1020910Published by Packt Publishing Ltd. 32 Lincoln Road Olton Birmingham, B27 6PA, UK.ISBN 978-1-847199-18-8www.packtpub.comCover Image by Harmeet Singh (singharmeet@yahoo.com)www.it-ebooks.infoCreditsAuthorRuth HoffmanReviewersAdrian CrumShi JinghaiAcquisition EditorChaitanya ApteDevelopment EditorRakesh ShejwalTechnical EditorVanjeet D'souzaIndexerHemangini BariEditorial Team LeaderMithun SehgalProject Team LeaderAshwin ShettyProject CoordinatorJoel GoveyaProofreaderJonathan ToddGraphicsGeetanjali SawantProduction Coordinator Arvindkumar GuptaCover WorkArvindkumar Guptawww.it-ebooks.infoAbout the AuthorRuth 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.comAs 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!www.it-ebooks.infoAbout the ReviewersAdrian 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.www.it-ebooks.infowww.it-ebooks.infoTable of ContentsPreface 1Chapter 1: Getting Started 7Introduction 7Getting the project code 9Getting code from the Subversion repository 12Fixing IP port collision errors 14The JAVA_HOME setting 17"Class Not Found" errors 18Installation verication 20SSL verication 22Running JUnit tests 25Locating an OFBiz Component 26Locating an OFBiz Application 28Chapter 2: Java Development 31Introduction 32Java runtime CLASSPATH 32Java compile time CLASSPATH 33Naming conventions 34Writing OFBiz Java Events 35Writing OFBiz Java Services 39Debugging using the logle 42Calling OFBiz Services from a Java program 43Getting and validating request parameters (Events) 45Getting and validating request parameters (Services) 47Managing error messages 48Using Java properties les 50Sending e-mail from an OFBiz Event or Service 51Handling XML les 53www.it-ebooks.infoiiTable of ContentsChapter 3: The User Interface 57Introduction 57Creating HTML web pages 58Adding actions to Screen widgets 63HTML markup in Screen widgets 65CSS styling in Screen widgets 66Platform-specic widgets 68OFBiz Tree widgets 69OFBiz Menu widgets 71OFBiz Form widgets 72Creating web pages using FreeMarker 74Passing Screen widget parameters to FreeMarker 77Calling Java methods from FreeMarker 78Forcing FreeMarker to render HTML markup 79Uploading les in FreeMarker forms 79Chapter 4: OFBiz Services 83Introduction 83Managing existing OFBiz Services 85Calling a Service from an HTML form 86Calling asynchronous Services from HTML forms 89Calling a Service many times from an HTML form 91Creating a new Service denition le 92Creating a new Service denition 93Implementing Services 94Dening Service attributes (INPUT/OUTPUT) 95Service Event Condition Actions 96Service groups 98Handling Service errors 100Writing Groovy Services 102Mail Event Condition Actions 104Entity Event Condition Actions 106Chapter 5: The OFBiz Entity Engine 111Introduction 111Changing the default database 113Connecting to a remote database 119Connecting to multiple databases 120Creating entity groups 121Disabling automatic database checks 123Mapping database data types 123www.it-ebooks.infoiiiTable of ContentsCreating a new entity model 126Modifying an existing entity model 130Building a view-entity 132Chapter 6: OFBiz Security 137Introduction 137Securing communications ports 138Disabling demonstration user accounts 141Protecting OFBiz web pages 142Creating user accounts 144Protecting applications using security groups 147Protecting views ("Tarpitting") 152Retrieving forgotten passwords 154Changing your password 156Adding or changing SSL certicates 157OFBiz single sign-on and the external login key 160Chapter 7: WebTools 163Introduction 163Cache maintenance 164Changing debug settings 167Exporting database data to XML documents 170Loading database(s) from XML documents 172Managing internationalization labels 174Using the SQL processor 176Exploring the entity reference tool 177Viewing OFBiz usage statistics 181Uncovering artifact information 183Working with temporal expressions 186Chapter 8: Web Services 189Introduction 189Requesting web services using URL parameters 190Requesting web services using an HttpClient 193Creating HttpClients and passing XML documents 196Creating XML-RPC web service clients 199Becoming an XML-RPC web service provider 202OFBiz SOAP messaging clients 204Generating a WSDL document 212Creating SOAP-compliant web services 215www.it-ebooks.info[...]... connection with HTTP access to the OFBiz download website How to do it Apache OFBiz can be downloaded as shown in the following steps: 1 Using your browser, navigate to the Apache OFBiz download site (http:/ /ofbiz apache. org/download.html) to reveal the Download Apache OFBiz web page as shown: 10 www.it-ebooks.info Chapter 1 2 Use your browser to select the desired OFBiz release New users are urged... started 5 OFBiz is up and running! See also For more information on prerequisites, getting the OFBiz code, and downloading and starting OFBiz up, please visit the What Do I Get? section on the following OFBiz web page: http:// ci .apache. org/projects /ofbiz/ snapshots/ Note: Be careful not to use the DOWNLOAD OFBIZ button on the snapshots download web page Unless you want to download the latest OFBiz trunk... view the primary OFBiz log file located in ~/runtime/logs /ofbiz. log 14 www.it-ebooks.info Chapter 1 2 Locate the OFBiz configuration file where the port is set 3 Edit the OFBiz configuration by changing the port number to a non-conflicting value 4 Restart OFBiz How it works For example, to fix collisions on port 8080, the IP port that OFBiz listens on for HTTP requests, navigate to the ofbiz- containers.xml... ~framework/base/config/ofbizcontainers.xml ~framework/webapp/config/url properties ~framework/base/config/ofbizcontainers.xml ~framework/base/config/ofbizcontainers.xml ~framework/base/config/ofbizcontainers.xml ~framework/base/config/rmicontainers.xml ~startofbiz.sh ~startofbiz.bat ~startofbizNoLog.bat ~stopofbiz.sh ~framework/base/config/jndiLdap properties Port usage note Tomcat HTTP listener Internal HTTP... following table summarizes OFBiz Java dependencies: Release Java version OFBiz 9.04 1.5 OFBiz 4.0 1.5 OFBiz trunk 1.6 19 www.it-ebooks.info Getting Started There's more There is no recommended Java reference platform for OFBiz Known implementations of the Java SDK that have successfully built OFBiz include the Sun and Mac Java SDKs Installation verification To quickly ascertain if OFBiz has installed correctly... build, this button should not be confused with the DOWNLOAD OFBIZ button found on the official OFBiz loading web page: http:/ /ofbiz .apache. org Getting code from the Subversion repository If you are planning to contribute back to the project or are just curious about downloading from the OFBiz source code control system, you may download a complete OFBiz package from the Subversion source code repository... install OFBiz from within the IDE using IDE-specific commands It goes without saying: you must also have an Internet connection with access to the OFBiz Subversion repository How to do it OFBiz source code can be downloaded from the Subversion repository by the following steps: 1 From a command-line window, type the following Subversion command: svn co http://svn .apache. org/repos/asf /ofbiz/ trunk ofbiz. .. running the OFBiz startup scripts The build script rebuilds all included Java programs, rebuilds the runtime CLASSPATH, and checks and loads the database with seed and demonstration data See also For more information on using Eclipse with the OFBiz Subversion repository, please refer to the following OFBiz Wiki page: http://cwiki .apache. org/confluence/display /OFBIZ/ Running+and+Debuggin g +OFBiz+ in+Eclipse... 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... start up OFBiz Depending on your operating system environment and your proclivities towards working on the command line, you may: ff Use one of the provided start up scripts ff Invoke OFBiz from the command line directly or use the ANT build tool as shown here: Windows Unix Command line startofbiz.bat startofbiz.sh java -Xmx256M -jar ofbiz. jar ant run 11 www.it-ebooks.info Getting Started OFBiz runs . http://www.myofbiz.comAs a long-standing supporter of OFBiz, she has authored several other OFBiz titles, including OFBiz E-Commerce Out-Of-The-Box and The OFBiz. version OFBiz version apache- ofbiz- 09.04.zipRecommended for new users and those looking for the most stable project package.Java 1.5 * apache- ofbiz- 4.0.zipLegacy
- Xem thêm -

Xem thêm: Apache OFBiz Cookbook pdf, Apache OFBiz Cookbook pdf, Apache OFBiz Cookbook pdf

Mục lục

Xem thêm