Page 1 of 1

Need to add new Tab in Admin

Posted: Tue Apr 03, 2012 4:19 am
by aktraj
Hi,

I need to add new Tab for reporting inline to User Management Tab , but I didn't get any documentation for that.
I am using BLC 15 code base.
Kindly help me any document or guideline so that I can new module tab in Admin.
I did the following things but didn't work.
public class ReportModule extends AbstractModule{

@Override
public void onModuleLoad() {
-----------
registerModule();
}


Thanks in advance.
Regards,
Arvind

Re: Need to add new Tab in Admin

Posted: Wed Apr 04, 2012 4:21 am
by aktraj
I have done it, just need to add another gwt module and include it into your mycompany.gwt.xml

Regards,
Arvind

Re: Need to add new Tab in Admin

Posted: Thu Aug 02, 2012 4:56 am
by math7189
Hi,

I'd like to do the same thing and I tried by adding a new GWT module. It didn't work. Maybe I missed a step, could you please
give me more details about it?

Thanks

Math

Re: Need to add new Tab in Admin

Posted: Thu Aug 02, 2012 9:38 am
by aazzolini
Documentation on working with the admin is in progress - it can be a bit tricky, so please give us a little bit of time to finish that up!

Re: Need to add new Tab in Admin

Posted: Thu Aug 02, 2012 10:47 am
by phillipuniverse
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!

Re: Need to add new Tab in Admin

Posted: Fri Aug 03, 2012 3:22 am
by math7189
Thank you for your both posts.

I'll check if I did the same as you said. I'll tell you if I managed to do it.
Otherwhise I'll wait for your documentation and tutorials. :)