Page 1 of 1

Need to add new Tab in Admin 3.0

Posted: Fri Oct 25, 2013 7:53 am
by rodcefet
I need to add a new module to control my payment types in broadleaf Admin.
I did the way down, but I noticed that in this way are the new settings module to version 2.2. Can you help me, we already have some documentation in version 3.0

public void onModuleLoad() {
addConstants(GWT.<i18nConstants>create(PaymentMessages.class));
setModuleKey("BLCMerchandising");

List<String> paymentPermissions = new ArrayList<String>();
paymentPermissions.add("PERMISSION_CREATE_PAYMENT_CONFIG");
paymentPermissions.add("PERMISSION_UPDATE_PAYMENT_CONFIG");
paymentPermissions.add("PERMISSION_DELETE_PAYMENT_CONFIG");
paymentPermissions.add("PERMISSION_READ_PAYMENT_CONFIG");
setSection(
BLCMain.getMessageManager().getString("paymentMainTitle"),
"paymentLocations",
"org.broadleafcommerce.inventory.admin.client.view.PaymentView",
"paymentLocationPresenter",
"org.broadleafcommerce.inventory.admin.client.view.PaymentPresenter",
paymentPermissions
);

registerModule();
}

Thak you :)

Re: Need to add new Tab in Admin 3.0

Posted: Fri Oct 25, 2013 1:16 pm
by jasoneasterday
Here's how i created a tab for NewProducts and NewProductsImpl

Code: Select all

    @OneToMany(fetch = FetchType.LAZY, targetEntity = NewSkuPricingImpl.class, mappedBy="sku")
    @Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region = "blStandardElements")
    @BatchSize(size = 50)
    @AdminPresentationCollection(friendlyName = "New Pricing", manyToField = "sku",
       currencyCodeField="value",tab = "Special Pricing", tabOrder=1001)

where the key is the

Code: Select all

@AdminPresentationCollection(friendlyName = "New Pricing", manyToField = "sku",
       currencyCodeField="value",tab = "Special Pricing", tabOrder=1001)

use Annotations to setup how you want it to look in the Admin.

Re: Need to add new Tab in Admin 3.0

Posted: Mon Oct 28, 2013 12:05 pm
by rodcefet
Thanks for the reply jasoneasterday

But actually I need to add a new module in GWT version 3.0, not a new Tab A new module that is similar to the Inventory module (http://docs.broadleafcommerce.org/core/ ... y-modules/ inventory)
I have found no documentation.

Could you please help

Thank you

Re: Need to add new Tab in Admin 3.0

Posted: Mon Oct 28, 2013 1:08 pm
by jasoneasterday
yea, i don't use GWT and have been using Spring annotations instead of GWT. Sorry, i can't help you on that :(

Jason

Re: Need to add new Tab in Admin 3.0

Posted: Thu Oct 31, 2013 7:38 am
by rodcefet
Jason got the new button to be shown in the menu, I used the tags AdminPresentation as below

@ Entity
@ Inheritance (strategy = InheritanceType.JOINED)
@ Table (name = "BLC_CONFIG_PAYMENT") @ Cache (usage = CacheConcurrencyStrategy.READ_WRITE, region = "blStandardElements")
@ AdminPresentationClass (populateToOneFields = PopulateToOneFieldsEnum.TRUE, friendlyName = "Payment")
public class PaymentConfigImpl implements Serializable {PaymentConfig

Thank you for the tip