## Where communities thrive

• Join over 1.5M+ people
• Join over 100K+ communities
• Free without limits
• Create your own community
##### Activity
Jay Aisenbrey
@cja769
If you haven't already, I would suggest simply starting with https://github.com/BroadleafCommerce/DemoSite. It's SpringBoot demo project using Broadleaf and is the easiest way to start experimenting.
gsujeeth
@gsujeeth
Can i get it as a dependency into my project
Can i add it as a dependency into my Project,If so can you please provide me the dependencies to be used
Jay Aisenbrey
@cja769
If you're referring to the DemoSite project, no. It has its own site/admin/api Spring Boot projects.
gsujeeth
@gsujeeth
Presently i am not refereing to any project
I have my own Project wherein i want to use the Broadleaf tables
Can you provide me the dependencies if i can access it through the dependencies
Phillip Verheyden
@phillipuniverse

@gsujeeth we have not optimized for adding Broadleaf to another project. The DemoSite that you referenced has a fair amount of additional boilerplate (e.g. security settings) that you would need to likely re-create if you wanted to add Broadleaf to an existing project

One thing that you could try is to:

1. Add broadleaf-framework-web to your dependencies
2. Add @EnableBroadleafSiteAutoConfiguration to your project. This must be on an inner static class if you're adding it to an @SpringBootApplication class
gsujeeth
@gsujeeth
Sure. Thanks. I will try to look into it
Gonçalo Silva
@goncalosamuel_gitlab
Hi. I've cloned the Demo Project and ran it successfully ( both admin, api and site ) with success localy.
I was now trying to run it ( site ) using docker. Everything seems ok till the point tomcat just shutdown. I can give more info if anyone has the will to help, but i was also wondering if anyone tried to run a broadleaf project using docker. BR
The docker file i'm keeping it very simple, just add the jar file in a jdk8-alpine image
exposing the needed ports and then running: ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","-Dspring.profiles.active=default","-Xmx1536M","-javaagent:/spring-instrument.jar","/ROOT.jar"]
Phillip Verheyden
@phillipuniverse
@goncalosamuel_gitlab what version of Java were you baking in there? and yes, we've got some installations running Docker. What message are you getting back on shutdown?
Gonçalo Silva
@goncalosamuel_gitlab

Hello @phillipuniverse , thanks for you reply.
Java version? I'm using java 8 as you can see in my Dockerfile

FROM openjdk:8-jdk-alpine
VOLUME /tmp
COPY target/ROOT.jar ROOT.jar
EXPOSE 8080 8443 8983
ENTRYPOINT ["java","-jar","-Dspring.profiles.active=default","-Xmx1536M","-javaagent:spring-instrument.jar","-Djava.security.egd=file:/dev/./urandom","ROOT.jar"]

I already faced different error messages, but they seem related with Solr.
Now i get the following exception trace:

Bean [com.community.core.service.search.SolrIndexCleanupServiceImpl$EnhancerBySpringCGLIB$3a9487b4]
Method [public void com.community.core.service.search.SolrIndexCleanupServiceImpl.rebuildIndexAtStartupIfNecessary() throws org.broadleafcommerce.common.exception.ServiceException,java.io.IOException]
...
Caused by: org.broadleafcommerce.common.exception.ServiceException: Could not delete documents
...
Caused by: org.apache.http.conn.HttpHostConnectException: Connect to localhost:8983 [localhost/127.0.0.1] failed: Connection refused (Connection refused)

So it seems that the embedded solr cannot be reached.
I can try to use docker-compose and provide a solr server, but for now i just wanted to run broadleaf.

Gonçalo Silva
@goncalosamuel_gitlab
I was now able to reach solr, i used compose to separate the Solr container from the broadleaf-site container. Now i get a 404 inside the site container, probably i'm missing some configuration both in solr and broadleaf.
org.apache.solr.client.solrj.impl.HttpSolrClient\$RemoteSolrException: Error from server at http://solr:8983/solr/catalog_reindex: Expected mime type application/octet-stream but got text/html. <html>
...
<body><h2>HTTP ERROR 404</h2>
danielcolgrove
@danielcolgrove
Gonçalo Silva
@goncalosamuel_gitlab
Thanks @danielcolgrove it's working now. to anyone reading this, just remind to copy the files using the group and user that the solr-docker image uses. In my case i used this in the dockerfile : " COPY --chown=solr:solr solrhome /opt/solr/server/solr/ "
linuxidefix
@linuxidefix
Hello. A quick question about how blc:bundle works. For example, in the online demo, how or where in the code "1567097619" is generated in the https://demo.broadleafcommerce.org/css/style-1567097619.css ? I was wondering if I could use a file hash instead of this value. If you could just point me a class name ... Thanks !
Jay Aisenbrey
@cja769
@linuxidefix The blc:bundle processor is called ResourceBundleProcessor. The part where the name is generated is in ResourceBundlingServiceImpl. I believe specifically in the method resolveBundleResourceName. It looks like that number is generated by taking the absolute value of the hashcode of all of the file names combined out of box.
linuxidefix
@linuxidefix
Hi. In the DemoSite , the ApiApplication is annotated with @EnableBroadleafSiteRootAutoConfiguration. By using this annotation it will load all my site components and specially site controllers I defined in /blc-config/site/bl-*-applicationContext.xml. And I have to add any dependencies required by the site components which I don't need and I don't want my site controllers to be created or exposed. Do you think it's a good idea to handle that with an new annotation EnableBroadleafApiRootAutoConfiguration ? It will allow blc users to separate site,admin,api and common contexts. And maybe to add it to BLC ? I can do a PR if it is worthwhile.
linuxidefix
@linuxidefix
Responding to myself, I am doing it wrong :-) my bl-*-applicationContext.xml should not scan (site) controller components . Should be in dedicatedbl-*-applicationContext-servlet.xml.
aarthisha
@aarthisha
Hi, is there a way to differentiate navigations like when we click on a lookup and navigate to a page and while we click on left menu and navigate to a tab.
I have overridden the modifyEntityForm method in the BIWAdminCategoryController to add the class lookup so that the audit tab headers do not get duplicated while I navigate to the category page audit tab by clicking on the parent category lookup in the product page.
aarthisha
@aarthisha
The above fix impacts while I navigate from the category menu in the left nav-->select categories-->click on edit and if I click on the products tab. The class lookup gets added here and it throws a script error and due to this the products do not get displayed.
Anuj Bhatnagar
@bonjour-anuj
Hi,
Does broadleaf community edition provide market place feature?
I can't find the relevant documentation. Demo site is B2C.
danielcolgrove
@danielcolgrove
The Marketplace feature is an extension of the Enterprise Edition. It is not available in the Community Edition.
Anuj Bhatnagar
@bonjour-anuj
@danielcolgrove According to https://www.broadleafcommerce.com/editions/overview under marketplace column I see community license row. What is that about?
danielcolgrove
@danielcolgrove
Good question. I'll get clarification from the Marketing/Sales team on the intent of that association on the Editions Overview page.
Anuj Bhatnagar
@bonjour-anuj

@danielcolgrove Thanks, I will wait for your reply. It's critical for us "Social Alpha https://socialalpha.org" to know as we are building an open source platform in India for elderly people.

An additional question if you can provide an answer to:
As I mentioned we are building a open source platform for elderly care, being a non-profit organization, can we expect to get a community version of broadleaf with market place extension?

danielcolgrove
@danielcolgrove
@bonjour-anuj I did confirm that Marketplace is not available as part of the Community License. The Editions page has been corrected. If you have additional questions regarding the feature, licensing, and cost of each edition, please feel free to reach out to our "information" channel where our sale team can review and respond - info@broadleafcommerce.com.
Anuj Bhatnagar
@bonjour-anuj
@danielcolgrove Sure, thanks for your prompt replies.
Nataly Tsarkevich
@NafanyaVictorovna
Hi. I'm trying to see hibernate queries on debug state, added
<property name="hibernate.show_sql" value="true"/>
to persistence-core file, but it doesn't work. Do I have to add smth else?
danielcolgrove
@danielcolgrove
Hi @NafanyaVictorovna If you are using Broadleaf 5.2 or 6.0, you can add logging to the logback-spring.xml file:
    <logger name="org.hibernate.SQL" level="DEBUG" />
<logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="TRACE" />
Nataly Tsarkevich
@NafanyaVictorovna
@danielcolgrove I haven't that file, only Config class in the included framework's library
Phillip Verheyden
@phillipuniverse

@NafanyaVictorovna sure enough, that logging configuration file is not included in our base. You can add those lines into a file as documented in the Spring Boot docs.

Your specific question was about hibernate.show_sql. The reason this gets clobbered is a we have a class called JPAPropertiesPersistenceUnitPostProcessor. This allows us to override some persistence.xml values from the Spring Environment (properties files).

Sooooo, in your case, you are trying to set hibernate.show_sql. Instead, you can set blPU.hibernate.show_sql in your Spring properties files (application.yml, runtime-properties/development.properties, etc). You can see that it's overridden in the DemoSite project here to be false.

You might want to review the JPAPropertiesPersistenceUnitPostProcessor to see the other properties that can be set via environment properties instead of persistence.xml.

Nataly Tsarkevich
@NafanyaVictorovna
@phillipuniverse
Thank you, for your advices. I found all that files, and yes, I see that line in the common-shared.properties file in the core module and found that property, chaned and it works as I expected! Thank you
Phillip Verheyden
@phillipuniverse
great!
Vojko Kercan
@Dhimahi_gitlab
Hi. I am trying to find a product roadmap for BroadLeaf Commerce. Specifically, I am interested if BroadLeaf Commerce v4 will continue to receive security patches and if so, until when? Does anybody have or know where to find this information? Contacted BroadLeaf, but no reply yet.
linuxidefix
@linuxidefix
Hi ! Does anybody have org.broadleafcommerce.common.i18n.domain.Translation in the column BLC_ADMIN_SECTION.Ceiling_entity ? SELECT count(*) FROM BLC_ADMIN_SECTION where CEILING_ENTITY like 'org.broadleafcommerce.common.i18n.domain.Translation%' ;
linuxidefix
@linuxidefix
Ok, respondind to myself : entity is not there by default. That causes a NPE. Hopefully this has been fixed by Broadleaf :-) https://github.com/BroadleafCommerce/BroadleafCommerce/commit/a58199f0c39e59fc656117a62267d2746e38a330#diff-49c9a8f83589dfb81af884d8a51a7b41
ancileddu
@ancileddu
good morning!
ancileddu
@ancileddu

I have a problem with adding a FacetSearch on BroadLeaf. I need to add an additional filter on product research that is not based on the solr index but goes straight on the db. It is a filter on product availability (AVAILABLE / NOT AVAILABLE). Has such a thing ever been implemented? Alternatively, it was decided to act on the field of the quantityAvailable index and re-index every few hours. In this case, however, trying to define the ranges in this way:

0 TO 1
1 TO *

but only 1 TO * is displayed, even if there are actually products with availability 0. A possible problem is that we had to set the field availability to double and not int in the scheme because, with int it generated a cast error since in the range the values ​​are numeric and therefore, for example, 0.0000. Do you have a possible idea on how to solve this problem? My field in schema is this:

<field name="it_quantityAvailable_i" type="double" indexed="true" stored="true"/>

linuxidefix
@linuxidefix
@ancileddu Not sure too understand all correctly. To do that on my side, I decided to create a property (int) available 0/1 , and index/re-index periodically. When I do search, I modify the broadleaf request to solr to exclude automatically non-available items. I used a filterQuery. org.broadleafcommerce.core.search.service.solr.AbstractSolrSearchServiceExtensionHandler#modifySolrQuery(org.apache.solr.client.solrj.SolrQuery, java.lang.String, java.util.List<org.broadleafcommerce.core.search.domain.SearchFacetDTO>, org.broadleafcommerce.core.search.domain.SearchCriteria, java.lang.String)
query.addFilterQuery(IS_STOCK_AVAILABLE_PROPERTY_NAME+"_i:(\"1\")");
But I dont see how to do this without doing a request to Solr and doint tricky stuff
linuxidefix
@linuxidefix
( You could do JS script to remove/display out of stock items, but should also update search results accordingly)
xbitlabs
@xbitlabs
In the Demo site admin product list, drag the scroll bar to the bottom of the list, click the last day record to enter the edit page, and then click the return arrow of the edit page to return to the product list page. At this time, the page will load indefinitely
xbitlabs
@xbitlabs