Page 1 of 2

Step by step details for broadleaf commerce

Posted: Sat Apr 07, 2012 2:29 am
by sachin
Hi ,
I want to develop an ecommerce site based out of broadleaf commerce. But I m not able to get a start in it.
details and problems I m facing before starting it.
1)I saw there are many project folder avaliable for the platform , which one should I use
2)When i try to buil it I getting errors which is not helping me to go further.
3)clear explanation and java documentation for each module.


Thanks
Regards

Re: Step by step details for broadleaf commerce

Posted: Sat Apr 07, 2012 10:35 am
by bpolster
Make sure you are following these steps to get your project up and running. http://wiki.broadleafcommerce.org/display/BLC15/Getting+Started

From there, you can use the demo application as a reference for adding pages and controllers.

Re: Step by step details for broadleaf commerce

Posted: Tue Apr 10, 2012 1:58 am
by sachin
Thanks bpolster,
I have tried this demo and It was running fine too. But the problem is , it only render checkout module ,
but I want to run full fledged ecommerce webapp as shown on broadleaf commerce homepage which has all necessary module.
Please kindly advice as later I want to customise and extend functioanlities too.
Thanks
regards

Re: Step by step details for broadleaf commerce

Posted: Tue Feb 26, 2013 4:54 am
by alluchandrasekhar
Hi ,

Now i am running demo site and admin modules . But i want to develop a new eCommerce application using broadleaf Commerce. How can i start ? I am not getting any ideas. please help me.
and i downloaded BroadleafCommerce-1.5.0-RC1-with-dependencies.zip file. is this development product or demo is develop ?

I need build new application and modifications too.

please help me . urgent ..... :?

Thanks
Chandrasekhar allu

Re: Step by step details for broadleaf commerce

Posted: Wed Feb 27, 2013 6:16 pm
by phillipuniverse
If you are developing a brand new BroadleafCommerce website, you should use the Heat Clinic (the demo site that you set up via http://docs.broadleafcommerce.org/curre ... arted.html) and modify that for your specific needs.

Re: Step by step details for broadleaf commerce

Posted: Thu Feb 28, 2013 2:12 am
by alluchandrasekhar
Hi phillipuniverse,

Thanks for reply. I am very new for broadleaf commerce. I finding flow is difficulty for me. Is there any cook book for broadleaf. or any tutorials ? what technologies i need to learn . please tell me the steps and list of technologies.


Thanks
Chandu

Re: Step by step details for broadleaf commerce

Posted: Tue Mar 05, 2013 4:57 pm
by phillipuniverse
Technologies we use:
  • Maven
  • JPA/Hibernate
  • Spring and Spring MVC
  • Thymeleaf
  • Ant (sparingly)

We have some tutorials on the docs site (docs.broadleafcommerce.com) and we also offer training services which you might also be interested in: http://www.broadleafcommerce.com/training

Re: Step by step details for broadleaf commerce

Posted: Tue Mar 12, 2013 6:44 am
by alluchandrasekhar
Thanks phillip,

Now i understood , but i did not find any Hibernate annotation plain query in our demo source code. and I have 2 questions ?

1) how can we created new entities , extending entities I know from docs site, but newly create tables how ?

2) I am working demo site and admin modules. If today I created two users through register form, then we can see in the those users details in admin- Customer table. but tomorrow the data will lose why it will happened. How it works exactly. Now i did not connect any data base. please explain me. any default database are there like derby in Ofbiz/opentaps ?

Thanks in advanced
Chandu allu

Re: Step by step details for broadleaf commerce

Posted: Tue Mar 12, 2013 8:47 pm
by RapidTransit
alluchandrasekhar wrote:Thanks phillip,

Now i understood , but i did not find any Hibernate annotation plain query in our demo source code. and I have 2 questions ?

1) how can we created new entities , extending entities I know from docs site, but newly create tables how ?

2) I am working demo site and admin modules. If today I created two users through register form, then we can see in the those users details in admin- Customer table. but tomorrow the data will lose why it will happened. How it works exactly. Now i did not connect any data base. please explain me. any default database are there like derby in Ofbiz/opentaps ?

Thanks in advanced
Chandu allu


(Im using package/folder interchangably)
Whatever your package is... lets say its com.mycompany.mymod
Add a folder "domain" add an interface name it MyMod that extends from serializable (import java.io.Serializable;) now you declare all your getters and setters
ie

Code: Select all

   
public interface Slider extends Serializable{
    public Long getId();
    public void setId(Long id);
    public String getTitle();
    public void setTitle(String title);
    public String getDescription();
    public void setDescription(String description);

etc


Then make a new class "MyModImpl" that implements MyMod interface


ie:

Code: Select all


@Entity
@Table(name="BLC_MYMOD")
public class MyModImpl implements MyMod {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(generator = "MyModId", strategy = GenerationType.TABLE)
    @TableGenerator(name = "MyModId", table="SEQUENCE_GENERATOR", pkColumnName = "ID_NAME", valueColumnName = "ID_VAL", pkColumnValue = "MyModImpl", allocationSize = 1)
    @Column(name = "MYMOD_ID")
    private Long id;

    @Override
    public Long getId() {
        return id;
    }

    @Override
    public void setId(Long id) {
        this.id = id;
    }

    @Column(name="TITLE")
    private String title;

    @Override
    public String getTitle() {
        return title;
    }

    @Override
    public void setTitle(String title) {
        this.title = title;
    }


Make sure you add the appropiate values to the sequence generator it needs to know the name and the starting value.

Under your webapp/WEB-INF (Or they go under resources? Some some modules do it one way or another so why not both) you should add a few xml files like this here's a sample from my work in progress:

File named bl-slider-applicationContext.xml

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xmlns:context="http://www.springframework.org/schema/context"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd
           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
           http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">

    <context:component-scan base-package="org.broadleafcommerce.slider" />

    <bean id="blMergedEntityContexts" class="org.springframework.beans.factory.config.ListFactoryBean">
        <property name="sourceList">
            <list>
                <value>classpath:bl-slider-applicationContext-entity.xml</value>
            </list>
        </property>
    </bean>

    <bean id="blMergedPersistenceXmlLocations" class="org.springframework.beans.factory.config.ListFactoryBean">
        <property name="sourceList">
            <list>
                <value>classpath*:/META-INF/persistence-slider.xml</value>
            </list>
        </property>
    </bean>



</beans>




bl-slider-applicationContext-entity.xml

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd">

    <bean id="org.broadleafcommerce.slider.domain.Slider" class="org.broadleafcommerce.slider.domain.SliderImpl" scope="prototype" />


</beans>



Then in your web.xml of site or admin modules look fors:

Code: Select all

<context-param>
        <param-name>patchConfigLocation</param-name>
        <param-value>
.....
        </param-value>
    </context-param>


and add: classpath:/mymod-applicationContext.xml


Answer to question 2 since it's in development mode it will regenerate the tables every time you redeploy. Each module has a runtime-properties under it all derive from the core module ie: common-shared.properties which gets overidden by what ever the application deployment context is. What you're most likely looking for is under site modules development.properties blPU.hibernate.hbm2ddl.auto

Re: Step by step details for broadleaf commerce

Posted: Wed Mar 13, 2013 3:30 am
by alluchandrasekhar
Thank you so much RapidTransit ,

really helped a lot..



Thanks
Chandrasekhar