OFBiz advanced HelloWorld (1) create a hot deployment module, ofbizhelloworld

Source: Internet
Author: User

OFBiz advanced HelloWorld (1) create a hot deployment module, ofbizhelloworld
Create a hot deployment module

Reference https://cwiki.apache.org/confluence/display/OFBIZ/OFBiz+Tutorial+-+A+Beginners+Development+Guide

1 create directory practice (I .e. the name of the module to be created) under directory hot-deploy 2 Create File ofbiz-component.xml under directory hot-deploy/practice
 1 <?xml version="1.0" encoding="UTF-8"?> 2 <ofbiz-component name="practice" 3        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 4        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd"> 5       <resource-loader   name="main" type="component"/> 6     <webapp name="practice" 7        title="Practice" 8        server="default-server" 9        base-permission="OFBTOOLS"10        location="webapp/practice"11        mount-point="/practice"12        app-bar-display="false"/>13 </ofbiz-component>
2.1 ofbiz-component.xml file description:

A. ofbiz identify this module through ofbiz-component.xml files

B. The resource-loader name can be set flexibly. Set it to main here. Type tells ofbiz that we want to load a component.

1 <resource-loader name="main" type="component"/>

 

C. The Node webapp has many attributes, usually as follows:

1 <webapp name="practice"2        title="Practice"3        server="default-server"4        base-permission="OFBTOOLS"5        location="webapp/practice"6        mount-point="/practice"7        app-bar-display="false"/>

 

Name: web Application name.

Title: The title of the application, which will be displayed in the top navigation bar.

Server: ofbiz the value here shows which server is used.

Base-permission:

Location: default path

Mount-point: the URL to access this service. In this example, it should be: localhost: 8080/practice.

App-bar-display:

3. Create a web app3.1 webapp folder

Create a webapp folder under the directory hot-deploy/practice, which contains all webapp related files of the module.

Content in a webapp follows the J2EE webapp standard.

3.2 Create a practice folder

Create the practice folder (webapp name) under the directory hot-deploy/practice/webapp ).

Note: One module can have multiple webapps. For example, the marketing Module has two webappp (marketing and sfa );

3.3 create a WEB-INF folder

Create a WEB-INF folder under the directory hot-deploy/practice/webapp/practice:

One OFBiz web application requires two configuration files (Controller. xmlAndWeb. xml).

A. controller. xml: tells OFBiz how to process a request, which action is used to process the request, and which page is used to render the request.

B. web. xml: Tell OFBiz how to deal with web-related problems, such as welcome pages, redirection pages, and error pages, which are available resources of the web application (database and business logic access.

3.4 create web. xml (web. xml follows the J2EE webapp Specification)
 1 <context-param> 2     <param-name>webSiteId</param-name> 3     <param-value>PRACTICE</param-value> 4     <description>A unique ID used to look up the WebSite entity to get information about catalogs, etc.</description> 5 </context-param> 6 <context-param> 7      <param-name>localDispatcherName</param-name> 8      <param-value>practice</param-value> 9      <description>A unique name used to identify/recognize the local dispatcher for the Service Engine</description>10 </context-param>11 <context-param>12      <param-name>mainDecoratorLocation</param-name>13      <param-value>component://practice/widget/PracticeScreens.xml</param-value>14      <!-- change the path to the following if the above doesn't work for you -->15      <!-- <param-value>component://practice/webapp/practice/widget/PracticeScreens.xml</param-value> -->16      <description>The location of the main-decorator screen to use for this webapp; referred to as a context variable in screen def XML files.</description>17 </context-param>
3.5 create controller. xml
 1 <?xml version="1.0" encoding="UTF-8"?> 2 <site-conf xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 3        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/site-conf.xsd"> 4        <include location="component://common/webcommon/WEB-INF/common-controller.xml"/> 5        <description>Practice Component Site Configuration File</description> 6        <owner>Copyright 2001-2009 The Apache Software Foundation</owner> 7        3.6 create an error folder

Create a folder error in the directory hot-deploy/practice/webapp/practice and create error. jsp in this folder

3.7 create a widget folder

Create a folder widget under the directory hot-deploy/practice and create a PracticeScreens. xml file

 1 <?xml version="1.0" encoding="UTF-8"?> 2 <screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 3      xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd"> 4     <screen name="main"> 5         <section> 6             <widgets> 7                 <label text="This is first practice"/> 8             </widgets> 9         </section>10     </screen>11 </screens>
3.8 run

Http: // localhost: 8080/practice/control/main


Help: helloworld program of a Linux kernel module

Before 15 rows, is the _ init? There are two underlines. GCC prompts you That the _ init type is unknown, as garymb said downstairs. In addition, where is KERN_DEBUG defined? Have you referenced the header file?

In linux, there is an ofbiz project. How can I access this ofbiz project in win7 in the same lan?

After the installation, you can directly access the OFBiz application through the IP address.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.