Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    danielcolgrove
    @danielcolgrove
    @chiranjitsaha1108 Let's take a step back. Are you trying to introduce a new persistence unit outside the default blPU or one of the ones that are out of the box? In most cases you only need to add to the existing blPU. This would be adding your implementation class to core/src/main/resources/META-INF/persistence-core.xml. So something like this:
    <persistence-unit name="blPU" transaction-type="RESOURCE_LOCAL">
        <non-jta-data-source>jdbc/web</non-jta-data-source>
        <class>com.blcdemo.core.domain.PDSiteImpl</class>
        <exclude-unlisted-classes/>
    </persistence-unit>
    chiranjitsaha1108
    @chiranjitsaha1108

    Hi @danielcolgrove
    I'm using the existing persistence unit. I would like to create my own MyCustomerPhone.orm.xml in the core module and I need to add the mapping file in core/src/main/resources/META-INF/persistence-core.xml. But it is unable to create the bean and it has started throwing me an error during server startup.

    Please let me know the steps for registering a new ORM file and registering it.

    danielcolgrove
    @danielcolgrove
    In the CorePersistenceConfig.java class I see that we have a PersistenceXMLLocations merge setup. I would start there and add your own to that array/list.
    @Merge(targetRef = "blMergedPersistenceXmlLocations", early = true)
    public List<String> corePersistenceXmlLocations() {
        return Arrays.asList("classpath*:/META-INF/persistence-core.xml");
    }
    chiranjitsaha1108
    @chiranjitsaha1108
    Hi @danielcolgrove
    Got the answer. Thanks a lot for the response. Can you please help me with one more thing? Can you please let me know which SQL query is firing from Broadleaf and I want to print the query into my log Or I can see the list of queries fired for the same call?
    danielcolgrove
    @danielcolgrove

    @chiranjitsaha1108,

    We are using the standard Spring logback mechanism. Having a logback.xml in the classpath is all that is needed. I went ahead and committed a beginning logback.xml file into the Demo project in the develop-6.1.x branch:

    https://github.com/BroadleafCommerce/DemoSite/tree/develop-6.1.x/core/src/main/resources

    You can enable Hibernate logging by adding the following to the logback.xml file:

    <logger name="org.hibernate.SQL" level="DEBUG" />
    <logger name="org.hibernate.type.descriptor.sql.BasicBinder" level="TRACE" />
    chiranjitsaha1108
    @chiranjitsaha1108
    @danielcolgrove
    LegacyOrderServiceImpl is now Deplocated for BLC 6.0.
    As I have updated the physical fulfilment group and need to update the order with the fulfilment group. Please let me know which implementation class do I need to use and how can I update the order by acquiring a lock on the order object.
    danielcolgrove
    @danielcolgrove

    Hi @chiranjitsaha1108 The LegacyOrderService was deprecated in 2012. See this commit - BroadleafCommerce/BroadleafCommerce@2db5e7a

    The OrderServiceImpl took it's place and that is the service in use out of the box. The implementation can be found here https://github.com/BroadleafCommerce/BroadleafCommerce/blob/develop-6.0.x/core/broadleaf-framework/src/main/java/org/broadleafcommerce/core/order/service/OrderServiceImpl.java

    There is already an OrderLock in place via the CartStateFilter. See https://github.com/BroadleafCommerce/BroadleafCommerce/blob/develop-6.0.x/core/broadleaf-framework-web/src/main/java/org/broadleafcommerce/core/web/order/security/CartStateFilter.java. In addition, there is a transaction in place which is managed in the OrderServiceImpl class.

    The code is available for these classes and you can change the implementation as needed.

    chiranjitsaha1108
    @chiranjitsaha1108

    Hi @danielcolgrove

    I would like to implement a cache in the core part . For which the cache will hold order-related information. This cache will be unique to every order. Can you please let me know the process of creating an order level cache?
    Also registering the cache in the core module.

    danielcolgrove
    @danielcolgrove

    @chiranjitsaha1108 You can register a cache in the bl-override-cache.xml file. See https://www.broadleafcommerce.com/docs/core/current/broadleaf-concepts/additional-configuration/caching-configuration. You can also see examples of cache entries in the core code - https://github.com/BroadleafCommerce/BroadleafCommerce/blob/develop-6.1.x/common/src/main/resources/bl-common-ehcache.xml

    The framework usually handles caching via Hibernate's L2 cache. This is setup on each individual domain class and in the DAOs as query hints. You can find examples in the core code. See

    OrderImpl.java (@Cache annotation)
    https://github.com/BroadleafCommerce/BroadleafCommerce/blob/82a6b4da47a69da51cb9091714c8d7779a26c362/core/broadleaf-framework/src/main/java/org/broadleafcommerce/core/order/domain/OrderImpl.java#L105

    OrderDaoImpl (query.SetHint)
    https://github.com/BroadleafCommerce/BroadleafCommerce/blob/82a6b4da47a69da51cb9091714c8d7779a26c362/core/broadleaf-framework/src/main/java/org/broadleafcommerce/core/order/dao/OrderDaoImpl.java#L131

    A second approach is manually managing the cache. This approach is less frequent but there are examples. See

    https://github.com/BroadleafCommerce/BroadleafCommerce/blob/develop-6.1.x/admin/broadleaf-contentmanagement-module/src/main/java/org/broadleafcommerce/cms/url/service/URLHandlerServiceImpl.java

    So either of the two approaches are valid. The approach depends on what your specific implementation. Note that the links above are the 6.1.x. If you are using a version < 6.1.x you should select that specific documentation set or github branch.

    chiranjitsaha1108
    @chiranjitsaha1108
    Hi @danielcolgrove
    First of all thanks a lot for the response.
    I have tried to extend OrderImpl and created my own MyOrderImpl with the same annotation and created a map . But while starting the mvn spring-boot:run it is giving me the below error :
    @javax.persistence.Cacheable or @org.hibernate.annotations.Cache used on a non-root entity:
    Class details :
    @Entity
    @EntityListeners(value = {AuditableListener.class, OrderPersistedEntityListener.class})
    @Inheritance(strategy = InheritanceType.JOINED)
    @Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE, region = "blOrderElements")
    @AdminPresentationMergeOverrides(
    {
    @AdminPresentationMergeOverride(name = "", mergeEntries =
    @AdminPresentationMergeEntry(propertyType = PropertyType.AdminPresentation.READONLY,
    booleanOverrideValue = true))
    }
    )
    @DirectCopyTransform({
    @DirectCopyTransformMember(templateTokens = DirectCopyTransformTypes.PREVIEW, skipOverlaps = true),
    @DirectCopyTransformMember(templateTokens = DirectCopyTransformTypes.MULTITENANT_SITE)
    })
    public class MyOrderImpl extends OrderImpl implements MyOrder {
    //cache code :
    @Cache(usage = CacheConcurrencyStrategy.READ_WRITE, region = "blOrderElements")
    protected Map<String, String> fulfilmentGroupDetails= new HashedMap<String, String>();
    //some code
    }
    Please let me know how can I rectify the error.
    Note : Im using BLC 6.0 and all the changes are being done in the core module.
    Also I have not done any config changes in the core module other than extending the orderImpl.
    chiranjitsaha1108
    @chiranjitsaha1108

    Hi @danielcolgrove

    kindly let me know if the above approach has any issue.

    danielcolgrove
    @danielcolgrove
    Broadleaf 6.0 uses Hibernate 5.2.17 which does not support modifying cache configurations on children entities. The root entity cache configuration should be used. You would need to just drop the @Cache annotation in your class. It appears the ability to do this was added in Hibernate 5.3 which we use in Broadleaf 6.1. The first couple links from this search had some additional information - https://www.google.com/search?ei=NJk2YPKCIsPetQWvtY-ACg&q=hibernate+Cache+used+on+a+non-root+entity&oq=hibernate+Cache+used+on+a+non-root+entity&gs_lcp=Cgdnd3Mtd2l6EAMyBAgAEB4yBggAEAgQHjIGCAAQCBAeMgYIABAIEB46BwgAEEcQsAM6BggAEAcQHjoICAAQCBAHEB5Qnx5YoSNgyyRoAXACeACAAWCIAc4EkgEBN5gBAKABAaoBB2d3cy13aXrIAQjAAQE&sclient=gws-wiz&ved=0ahUKEwjy7OjZkYPvAhVDb60KHa_aA6AQ4dUDCA0&uact=5
    chiranjitsaha1108
    @chiranjitsaha1108

    Hi @danielcolgrove

    Please tell me one scenario that is there any OOTB functionality is given that I want to hold a transient java collection variable at order level and it is valid as long as the user is Active or logged in.

    Please let me know the procedure that I need to follow to hold a transient variable in order level and it will be active throughout the session.

    danielcolgrove
    @danielcolgrove
    chiranjitsaha1108
    @chiranjitsaha1108

    Hi @danielcolgrove

    Can you please provide me an example of useing Quartz or scheduler in Broadleaf commerce. Is it we are storing the details in the DB or in memory (RAM) used to hold the information and execute the scheduler.
    Kindly provide me an example class in BLC through which I can understand more about the architecture followed in BLC.

    danielcolgrove
    @danielcolgrove
    @chiranjitsaha1108 I don't believe there is an example of using Quartz in BLC commerce edition. Quartz is a 3rd party library that you can introduce into your project and use as you see fit. There is a nice write up on the Baeldung site for implementing using Spring and even guidance for a JDBC backed implementation - https://www.baeldung.com/spring-quartz-schedule
    Parves Ahmed Moon
    @parves-ahmed
    I'm new at broadleaf commerce. I have just downloaded the community version 6.1.5 GA. By following the documentation I'm able to extend AdminAbstractController and able to render test.html page. Now the problem is that I would like to add a module and section like My custom module and custom section in Admin panel as like the documentation say so but I can't and I also can't execute the sql file as I don't know how to execute this sql file here. I know the documentation is for older version. Now Please tell me 1. how can I add a module and section in Admin 2. How the sql file is executed (Thanks in advance)
    danielcolgrove
    @danielcolgrove
    @parves-ahmed One example that you can look at is the Menu module. It has an example of using a sql file for db initialization. The sql file in that module adds admin security and an admin section. https://github.com/BroadleafCommerce/Menu
    Wasif Al Mahmud
    @wasifAL
    Is it possible to get a multi-tenant setup from the community version ? I just need a supervisor-user over the shops.
    Parves Ahmed Moon
    @parves-ahmed
    Thanks, @danielcolgrove I have done that by doing Insert operation directly to DB. But the example of the Menu is well organized.
    danielcolgrove
    @danielcolgrove
    @wasifAL There is not an out of box multi-tenant offering for the Community Edition. We have a Multi-Tenant offer on our Enterprise Edition which requires a license. Alternatively, you can look at customizations to introduce your specific requirements.
    Wasif Al Mahmud
    @wasifAL
    @danielcolgrove thank you for your response. I understand that.
    chiranjitsaha1108
    @chiranjitsaha1108

    Hi @danielcolgrove
    There is a property in BLC_SKU for QUANTITY_AVAILABLE.
    Is there any OOTB method through which I can decrease the quantity value for a SKU once the order is placed?

    Or do we need to write a custom code in the workflow to decrease the quantity once the order is placed?
    Also is it valid to update the BLC_SKU entity to decrease the value of SKU quantity manually?

    Syed Mainul Hasan
    @mainul35
    I have boot community demo project (DemoSite-broadleaf-5.2.14-GA). I have successfully run it, but now I want to change it from sauces to books. Where can I go to do this change?
    Syed Mainul Hasan
    @mainul35
    Product custom attributes are not showing in heat clinic demo application. What can I do?
    danielcolgrove
    @danielcolgrove
    @mainul35 There is an admin application that you can run that allows you to maintain the products. Regarding custom attributes, where in the heat clinic demo application are they now showing?
    saber872138
    @saber872138
    I see a lot of menus in the official admin sample. For example, "Jobs And Processes", "Scheduled-jobs", "Cart Rules", but there is no initialization script in the code, please tell me how I can configure these menus, or how to get the SQL script.
    danielcolgrove
    @danielcolgrove
    @saber872138 You are running our Community Edition. The admin sample (demo) is running our Enterprise Edition. The Enterprise Edition has a lot of functionality added on top of the Community Edition like Scheduled Jobs, Process Tracking, Cart Rules, to mention the ones you call out.
    Parves Ahmed Moon
    @parves-ahmed
    I'm using broadleaf 6.1.5 GA. I tried to configure oracle 18c with this and the JDBC version is ojdbc7 version: 12.1.0.1.0. I follow the process of the below link provided by broadleaf documentation: https://www.broadleafcommerce.com/docs/core/current/broadleaf-concepts/key-aspects-and-configuration/database-configuration/oracle-db to configure oracle database. But till now it runs on HSQLDB, doesn't find ORACLE DB. It doesn't give any error too. Where is the problem? How can I configure ORACLE DB in broadleaf now?
    danielcolgrove
    @danielcolgrove
    @parves-ahmed Broadleaf has two "database starters" that can be used. The out of box "demo" uses the "broadleaf-boot-starter-hsql-database". That database starter boots up an instance of HSQL. The "broadleaf-boot-starter-database" starter allows you to use other databases which also requires additional configuration for driver, user, password, etc. If you are still seeing the HSQL database being used on startup then your "core" pom.xml is still loading the broadleaf-boot-starter-hsql-database dependency. You will want to double check that you removed that particular database starter and used the broadleaf-boot-starter-database dependency instead.
    chiranjitsaha1108
    @chiranjitsaha1108
    @danielcolgrove
    Can you please let me know how can I push the log data to a log file in core, site, API, admin, and store the log file in my server. What are properties that I need to enable for which I can write the log data into a file and also show the same in my console. Please let me know the property name and their respective values associated with it.
    danielcolgrove
    @danielcolgrove
    @chiranjitsaha1108 Broadleaf uses the default logging capability that comes with SpringBoot. It's called LogBack. Here is a link to a basic article on it. The article has a link to a LogBack Guide which can be helpful as well. https://www.baeldung.com/spring-boot-logging
    chiranjitsaha1108
    @chiranjitsaha1108

    Hi @danielcolgrove

    For Google analytics Integration in Broadleaf 6.0, is any other step required other than the below ones:
    Generated Google Analytics Tracking Id
    placed the tracking id in the googleAnalytics.webPropertyId
    Please let me know if any other steps are required to enable the google analytics also do we need to write any separate code for enabling google analytics.

    Also please let me know how can I enable search typeahead suggestion while searching some products on Broadleaf demo site 6.0.

    danielcolgrove
    @danielcolgrove
    Hi @chiranjitsaha1108
    There are two steps.
    1) Yes, add your propertyID to the "googleAnalytics.webPropertyId" property
    2) Make sure your head.html (or equivalent html fragment) contains a reference to the google analytics thymeleaf processor:
    This is what come out of the box "<blc:google_universal_analytics ordernumber="${analyticsOrder?.orderNumber}" ></blc:google_universal_analytics>"
    chiranjitsaha1108
    @chiranjitsaha1108
    Hi @danielcolgrove
    please let me know how can I enable search typeahead suggestion while searching some products on Broadleaf demo site 6.0.
    danielcolgrove
    @danielcolgrove
    Hi @chiranjitsaha1108 The search typeahead feature is only available in the enterprise edition of the product. That feature set includes result boosting and typeahead.
    chiranjitsaha1108
    @chiranjitsaha1108

    Hi @danielcolgrove

    Can you please let me know how can I generate the sitemap.xml file. Do I need to create any folder in the core module so that the sitemap xml file will be generate. I have executed the sitemap url - sitemap.xml.
    Also please tell me if there is already default web page provided for viewing the genetated sitemap.
    Demosite 6.0 Im currently using.

    Ritesh Adhikari
    @riteshadhikari17
    Hi @chiranjitsaha1108, Daniel is on vacation. Anyway the information regarding the sitemap is here https://www.broadleafcommerce.com/docs/core/current/broadleaf-concepts/seo/sitemap
    chiranjitsaha1108
    @chiranjitsaha1108

    Hi @riteshadhikari17

    Thanks for the response and I have gone through the file already. But the problem that I'm facing currently is the sitemap is not getting generated. Do I need to create a package to any specific location with a default file. So that file will exist and it can write on the same file?
    Also how to display it in the HTML - Is there any default HTML page present to categorize the content?

    Ritesh Adhikari
    @riteshadhikari17
    I am not familiar with this so here are things I found. There is a controller in demo site/src/main/java/com/community/controller/seo/SiteMapController.java . You should be able to hit localhost like this https://test.localhost:8443/sitemap.xml
    Kartik Arora
    @akartik80
    Hi all, I am evaluating Shopizer vs Broadleaf commerce. Can anyone from Broadleaf team help why should we use Broadleaf v/s Shopizer? What are the key advantages etc?
    vkhatri87
    @vkhatri87
    Hi everyone, i am using Broadleaf 5.2 version for which i want to give the Facebook and Google sign in options. if somebody can guide me on the same. Also i am not very much clear how the current login is working also if there is developer doc for the same. Thanks in advance..
    danielcolgrove
    @danielcolgrove
    @vkhatri87 Broadleaf uses Spring Security for authentication services. Spring Security support OAuth integrations as well. We don't have specific documentation on this as we generally defer to Spring Security guides. This appears to be a decent guide on how Spring Security works - https://www.marcobehler.com/guides/spring-security We integrated the basic Authentication pretty closely to how it is described. There is also a section on OAuth integration in that article that may help.
    Md. Saju Ahmed
    @Saju77

    Hello there, I am a broadleaf 6.2v new user. For 3 days, I am trying to add my own created controller, service, dao and entity. But because of @PersistenceContext(unitName="blPU")
    protected EntityManager em;
    those lines from the 'MailInfoDaoImpl' class of 'Core', i am facing an error :


    APPLICATION FAILED TO START


    Description:
    A component required a bean named 'blPU' that could not be found.
    Action:
    Consider defining a bean named 'blPU' in your configuration.

    this kind of error but without '@PersistenceContext(unitName="blPU")'(when comment out), I am also facing an another error from 'Admin' part which is from 'MyController'[note: newly created & extends AdminAbstractController] :


    APPLICATION FAILED TO START


    Description:
    A component required a bean named 'blMailInfoService' that could not be found.
    Action:
    Consider defining a bean named 'blMailInfoService' in your configuration.
    --> This may occur because of those lines when I trying to call the service from 'Core' to 'Admin':
    @Resource(name = "blMailInfoService")
    protected MailInfoService mailInfoService;
    [Q. is any config needed in 'Admin']

    Please help me & Thanks in advance.

    Ritesh Adhikari
    @riteshadhikari17
    Hi @Saju77, are you using the community edition Demo starter project? If not I would suggest to try it out. Once you have that running, you can use it as an example or modify/change it to your needs. Here is more info https://www.broadleafcommerce.com/docs/core/current/getting-started/running-locally Then you can look into the tutorials we have for extending and adding entities and services.
    Md. Saju Ahmed
    @Saju77
    @riteshadhikari17 Thank you for your valuable reply and I want to inform you that I am using the community edition Demo starter project. So that, should I follow any another process to solve my problem? if it is, please let me know about it.
    Ritesh Adhikari
    @riteshadhikari17
    I don't have exact answer to your problem. However, we already have some support for mails [here] (https://github.com/BroadleafCommerce/BroadleafCommerce/tree/develop-6.2.x/common/src/main/java/org/broadleafcommerce/common/email). You can probably leverage those classes to customize what you need. Check EmailReportingDaoImpl or ProductDaoImpl to correctly use the EntityManager. Tutorials for services are here and More detailed info here