At a high level, here are the essential steps:
1) Add your new GWT module class that extends from AbstractModule (let's say this is at com.yourcompany.admin.client.ReportingModule.java)
2) Set up your HLayout/DynamicFormDisplay and DynamicEntityPresenter subclasses. The DynamicFormDisplay implementation (the HLayout subclass) is where all of your view information goes, and the Presenter is where you hook up all of datasources and define actions. This gets hooked up in the onModuleLoad() method of your Module. For reference, look at the MerchandisingModule:
Code: Select all
List<String> categoryPermissions = new ArrayList<String>();
categoryPermissions.add("PERMISSION_CREATE_CATEGORY");
categoryPermissions.add("PERMISSION_UPDATE_CATEGORY");
categoryPermissions.add("PERMISSION_DELETE_CATEGORY");
categoryPermissions.add("PERMISSION_READ_CATEGORY");
setSection(
BLCMain.getMessageManager().getString("categoryMainTitle"),
"category",
"org.broadleafcommerce.admin.client.view.catalog.category.CategoryView",
"categoryPresenter",
"org.broadleafcommerce.admin.client.presenter.catalog.category.CategoryPresenter",
categoryPermissions
);
As you can see, this associates a new view and presenter in that section. This appears as sub-tabs underneath the main module tab. You can see in that module where it creates the 4 different sections, corresponding to the 4 tabs underneath the "Catalog and Merchandising" tab.
2) Add the fully-qualified name of your module to the myCompanyAdmin.gwt.xml (from the demo, this file is in admin/src/main/resources/com/mycompany/gwt):
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<module>
<inherits name="com.google.gwt.user.User" />
<inherits name="org.broadleafcommerce.admin.merchandisingModule" />
<inherits name="org.broadleafcommerce.admin.customerCareModule" />
<inherits name="org.broadleafcommerce.openadmin.userModule" />
<inherits name="org.broadleafcommerce.cms.admin.contentManagementModule" />
<inherits name="com.google.gwt.core.CompilerParameters"/>
<inherits name="com.google.gwt.i18n.I18N"/>
<!-- YOUR CUSTOM MODULE -->
<inherits name="com.yourcompany.admin.client.reportingModule" />
<extend-property name="locale" values="en_US"/>
<entry-point class="org.broadleafcommerce.openadmin.client.BLCLaunch" />
<!-- Uncomment the folowing line to turn on logging -->
<!-- <inherits name="com.google.gwt.logging.Logging"/> -->
<!-- Uncomment this line to compile only for Firefox and Chrome. It will speed up compiliation times while developing -->
<set-property name="user.agent" value="safari,gecko1_8" />
<!--smartgwt requires quirk mode, so disable gwt warnings for now. http://planet.jboss.org/post/smartgwt_ie7_ie8_support-->
<extend-configuration-property name="document.compatMode" value="BackCompat"/>
</module>
And then you should be good to go. As Andre said, we're still in process of getting some tutorials and other admin docs onto our new documentation site so stay tuned!