Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Usama
    @usamasheikh2010_gitlab
    Hi Guys - Would it be a good idea to use broadleaf api’s and build a standalone admin SPA?
    chiranjitsaha1108
    @chiranjitsaha1108
    Hi Team, How can i create my own Address-orm.xml file. What are places I need to register for the file, in which module, under which package stucture and how to access in the service class.
    danielcolgrove
    @danielcolgrove
    Hi @chiranjitsaha1108 I assume you would create the orm.xml file and reference in your persistence-core.xml file. You would have to build your own service class(es), register them as Spring beans, and then use them through the Spring context.
    chiranjitsaha1108
    @chiranjitsaha1108
    Hi All,
    Can you please let me know the procedure for adding Apache Solr separately to the Broadleaf application. I don't want to use the embedded solr into the application and I want to integrate the apache solr server separately to the application. Please let me know the steps required to make changes to the Broadleaf Commerce framework. I'm using BLC version as 6.0.
    Kindly reply.
    chiranjitsaha1108
    @chiranjitsaha1108
    Hi @danielcolgrove ,
    Can you please let me know the procedure for adding Apache Solr separately to the Broadleaf application. I don't want to use the embedded solr into the application and I want to integrate the apache solr server separately to the application. Please let me know the steps required to make changes to the Broadleaf Commerce framework. I'm using BLC version as 6.0.
    Kindly reply.
    Cade Rea
    @cade-rea
    @chiranjitsaha1108 With how autoconfiguration works, you should be able to start an external Solr instance before you run the Broadleaf app. The Spring autoconfiguration will detect that Solr is already running and will not create its own instance. You can look at com.blcdemo.core.config.ApplicationSolrConfiguration to see the configurations for the Solr URLs for Broadleaf
    chiranjitsaha1108
    @chiranjitsaha1108
    Thanks @cade-rea
    One more question I have and it given below:
    Im working on a standalone solr for my blc application. So this is what is given in the BLC documentation " Once you have a stand-alone Solr server configured, you need to change the way that Broadleaf attempts to communicate with Solr. First, you need to navigate to site/src/main/webapp/WEB-INF/applicationContext.xml. " - If applicationContext.xml is not present then can I create a new applicationContext.xml in the same path and for that do I need to make any other changes for the newly created file "applicationContext.xml"?
    chiranjitsaha1108
    @chiranjitsaha1108
    Hi All
    One more question I have and it is given below:
    I'm working on a standalone solr for my blc application. So this is what is given in the BLC documentation " Once you have a stand-alone Solr server configured, you need to change the way that Broadleaf attempts to communicate with Solr. First, you need to navigate to site/src/main/webapp/WEB-INF/applicationContext.xml. " - If applicationContext.xml is not present then can I create a new applicationContext.xml in the same path and for that do I need to make any other changes for the newly created file "applicationContext.xml"?
    Cade Rea
    @cade-rea
    @chiranjitsaha1108 BLC 6 does not need an appliationContext.xml. Unfortunately it looks like our documentation is out of date for this. Instead of appliationContext.xml, you can use Java config files (@Configuration). Look at com.mycompany.core.config.ApplicationSolrConfiguration to see the properties that should be set for connecting to solr
    If you have created an applicationContext.xml already, put it in /resources and use @ImportResource in a config file to use it
    chiranjitsaha1108
    @chiranjitsaha1108
    Okay. @cade-rea Can you please help me once about the solr. We can connect over skype or teamviewer. My solr is not working and the indexing is not happening. Please let me know if we can connect.
    danielcolgrove
    @danielcolgrove
    @chiranjitsaha1108 You should be able to follow these instructions - https://www.broadleafcommerce.com/docs/core/6.0/broadleaf-concepts/catalog-and-search/deployment-models/stand-alone. The instructions for the 1st step (Copy the files from the resource standalone directory of the SolrStarter project resources/solr/standalone/solrhome/ into the /path/to/solr-7.3.1/server/solr) refers to resource files found in this jar http://nexus.broadleafcommerce.org/nexus/content/groups/community-source-releases/com/broadleafcommerce/broadleaf-boot-starter-solr/2.0.1-GA/broadleaf-boot-starter-solr-2.0.1-GA.jar.
    chiranjitsaha1108
    @chiranjitsaha1108

    index.png

    Thanks for the response. I did as per the document in BLC website standalone solr. Still, the indexing is working and in return, no data is fetched when the query is run . The screen shot is given above. Please let me know what needs to be done to view the products.
    Also one more question for standalone solr : Do I need to follow the steps given in the below two links.
    https://www.broadleafcommerce.com/docs/core/current/broadleaf-concepts/catalog-and-search/deployment-models/stand-alone/solr-stand-alone-index

    https://www.broadleafcommerce.com/docs/core/current/broadleaf-concepts/catalog-and-search/deployment-models/stand-alone/stand-alone-client-setup

    Just to Inform you I have follow only https://www.broadleafcommerce.com/docs/core/6.0/broadleaf-concepts/catalog-and-search/deployment-models/stand-alone.

    danielcolgrove
    @danielcolgrove
    If you have SOLR up and running and you have both collections - catalog and catalog_index - it sounds like you have it setup correctly. Are both collections empty? Have you done a reindex?
    chiranjitsaha1108
    @chiranjitsaha1108
    @danielcolgrove
    Yes both the collections are empty. Please let me know how can I perform the re-indexing?
    danielcolgrove
    @danielcolgrove
    There is a Solr Indexer option in the admin. In the Settings section in the left nav (the bottom gear icon) is the menu item "Solr Indexer". There is a Catalog reindex. This assume you have data in your database.
    chiranjitsaha1108
    @chiranjitsaha1108

    admin.png

    Hi @daniel
    as per the screen shot there is No solr indexer option present in admin panel. Please note I'm using Community edition of BLC 6.0 version. Kindly let me know if I can connect with you and share my screen to show you the exact problem. Kindly help me. Data is present in the database but still the indexing is not performed.

    danielcolgrove
    @danielcolgrove

    @chiranjitsaha1108 The "SolrIndexer" was added to Community 6.1. You can move to 6.1.3-GA or you can pull in that feature into your 6.0 project. There are two items needed: 1) update the menu/security in the database - that is controlled by this SQL script

    https://github.com/BroadleafCommerce/DemoSite/blob/broadleaf-6.1.3-GA/core/src/main/resources/sql/load_solr_reindex_community.sql

    Add the Controller in the "admin" project. That should appear in the Setting section of tha admin and allow you to kick off the reindex:

    https://github.com/BroadleafCommerce/DemoSite/blob/broadleaf-6.1.3-GA/admin/src/main/java/com/community/admin/web/AdminSolrReindexController.java

    mahesh pandey
    @mahesh99199_twitter
    Hi i am trying to add new api how can i approach?
    ReshmaSen
    @ReshmaSen

    Hi @danielcolgrove
    Currently I am using BLC version 6.0.
    Ideally on adding a new product from BLC admin, the catalog_reindex/catalog core should get updated.But in our case,whenever we are adding any new item from BLC admin, the catalog core and catalog_reindex core is not getting updated .I have clicked on Query button on Solr multiple times .The document number is not getting updated in catalog/catalog_reindex.Can you suggest me a suitable solution by which I can resolve this issue.

    Also once the catalog_reindex gets updated,do we need to manually swap the catalog and catlog_reindex or should it happen automatically?

    danielcolgrove
    @danielcolgrove
    @ReshmaSen In the community edition the Solr index does not automatically get updated as changes are made in the admin. You will have to periodically run a reindex. The reindex process is designed to prevent service disruptions. It does that using an alias swap approach. The site always used the "catalog" alias (pointing to a solr collection) when pulling category data or searching. When a reindex is triggered, the collection referenced by the "catalog_reindex" alias is getting updated. Once the reindex completes the alias references to the underlying collections are swapped. So the updated collection is then referenced by the "catalog" alias and the site begins using the newly updated collection. For example, before a reindex we may have "catalog" alias -> collection0 and "catalog_reindex" alias -> collection1. The site is using the "catalog" alias and thus collection0. After the reindex and swap we would have "catalog" alias -> collection1 and "catalog_reindex" alias -> collection0. The site still used the "catalog" alias but now collection1. This swapping process should happen automatically. So you should not have to swap them manually. As a side note, the Enterprise license does have a mechanism that does update the collection as changes are made in the admin.
    ReshmaSen
    @ReshmaSen

    image.png

    Hi @danielcolgrove .
    Thanks it helped.
    I had actually another question.For adding product feed data for production environment ,how can I add product related data?
    1.What are the sql tables I need to update, in order to push product/category/search facet related data .
    2.Is there any additional step apart from excuting the sql file and triggering reindex?

    danielcolgrove
    @danielcolgrove
    @ReshmaSen For the tables to load question I would have to say "it depends". At a minimum you have to load Product and Sku which have a unique relationship with defaultSku/defaultProduct. But you can also have alternate skus as well which would include product options/option values. Here is the data model for Product - https://www.broadleafcommerce.com/docs/core/5.2/database-model/catalog-model#. I would suggest setting up the product in the admin and then examining the tables related to Product/Sku to see what gets updated based on the use case you setup in the admin.
    mahesh pandey
    @mahesh99199_twitter
    @danielcolgrove I want to add phone no field in add customer admin page how can i add that
    danielcolgrove
    @danielcolgrove

    This would be considered a more advanced admin extension but doable. The Customer phone numbers are maintained in an associated table (separate collection). You can have more than one phone number. The modal contains just fields directly on the Customer. We would need a way to capture a phone number but then save it to the customerPhone collection when the Customer is saved.

    One possible approach is to extend the Customer entity and add a phone field (ideally a transient field). See Extending Entities.

    Then as part of the add process in a Custom Persistence Handler you would add the phone value to the customerPhone collection. See CustomerCustomPersistenceHandler).

    You want to understand CustomPersistenceHandlers (CPH) - documentation.

    One final touch would be hiding the new customer phone field on edits as that field is not needed after the original save. That would be modifying the field metadata on edit - perhaps from the Controller. See Admin Presentation.

    mahesh pandey
    @mahesh99199_twitter
    @danielcolgrove can you just help me to add new field in admin page in heatclinic 6.1.3 project
    danielcolgrove
    @danielcolgrove
    @mahesh99199_twitter I can provide guidance but I can't provide development services. If you plan to extend the base product, it is worth the investment to learn the basic extension patterns. The links I provided are specific to your question but the documentation has good information on overall platform concepts that provide a good foundation. Regarding your original question, is there not an option to just use the PhoneCollection that is already in the Customer form? The phone number would have to be added after the initial save of the Customer.
    DOS SANTOS FACAO
    @pedsf1968
    Hello, your project is very interesting and I'm offering my help to contribute for it. I'm digging in your code to find how can I improve it. I can also help you on open issues.
    mahesh pandey
    @mahesh99199_twitter
    @danielcolgrove hi i am looking to add new api endpoint in demo site how can i proceed?
    chiranjitsaha1108
    @chiranjitsaha1108
    Hi @danielcolgrove,
    Can you please give me some idea about the salePrice. How can we add a new salePrice for an item from Admin. Also in the ProductListItem.html -> How we are geting the sale price
    <span blc:price="*{salePrice}" th:if="*{onSale}" th:classappend="*{onSale}? ' price-new'" ></span>
    Please I just want to understand about the strikeThrough of the retail price to get the sale price.
    danielcolgrove
    @danielcolgrove
    @chiranjitsaha1108 Any time you see a blc:xyz in the HTML, that is calling a Thymeleaf processor. In this case, it is calling PriceDisplayProcessor. This processor gets the amount as a Money object. Then, the span tag simply has an thymeleaf "if" statement which adds "price-new" or "price-old" css classes depending on if the item is on sale.
    THEBEASTYPUNE
    @THEBEASTYPUNE
    hey all, how can I change default sorting order in admin panel ? Currently I have enabled Order's within admin panel but default sort order is oldest order to newest order and I want to reverse it. Please help me understand it
    Sunny Yu
    @SunnyYu-98

    @THEBEASTYPUNE Hi, you can do that by overriding the AdminOmsOrderController's viewEntityList. Over there you can add a new FilterAndSortCriteria to set which property you want to sort with and how you want to sort it.

    In your case, you can do something like
    FilterAndSortCriteria filterAndSortCriteria = new FilterAndSortCriteria("submitDate"); to sort by the Submit Date of the order, and then filterAndSortCriteria.setSortDirection(SortDirection.DESCENDING); to set the sort direction.
    Then, you just need to add the criteria to the model like this: model.addAttribute("orderAssignmentListGrid", getMyOrdersListGrid(Arrays.asList(filterAndSortCriteria), null, null));. The template will use the model to render the OMS accordingly.

    The FilterAndSortCriteria itself have a lot of properties you can set for filtering and sorting, but the example above should help you reverse the orders sorting

    danielcolgrove
    @danielcolgrove
    @THEBEASTYPUNE One small change to what @SunnyYu-98 stated....you would need to extend AdminOrderController and add the viewEntityList method. AdminOmsOrderController is part of the Enterprise Edition and is not available in the Community Edition.
    THEBEASTYPUNE
    @THEBEASTYPUNE
    @SunnyYu-98 @danielcolgrove Thanks for the input, i will check it
    THEBEASTYPUNE
    @THEBEASTYPUNE
    Hi @SunnyYu-98 @danielcolgrove , when I try to override viewEntityList method, I get following error
    java.lang.IllegalStateException: argument type mismatch
    HandlerMethod details:
    Controller [com.community.admin.order.controller.CustomOrderController]
    Method [public java.lang.String com.community.admin.order.controller.CustomOrderController.viewEntityList(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,org.springframework.ui.Model,java.util.Map<java.lang.String, java.lang.String>,org.springframework.util.MultiValueMap<java.lang.String, java.lang.String>) throws java.lang.Exception]
    Resolved arguments:
    [0] [type=org.broadleafcommerce.openadmin.web.compatibility.JSCompatibilityRequestWrapper] [value=FirewalledRequest[ SecurityContextHolderAwareRequestWrapper[ org.springframework.security.web.savedrequest.SavedRequestAwareWrapper@638cfd3d]]]
    [1] [type=org.springframework.security.web.header.HeaderWriterFilter$HeaderWriterResponse] [value=org.springframework.security.web.header.HeaderWriterFilter$HeaderWriterResponse@607e2b8e]
    [2] [type=org.springframework.validation.support.BindingAwareModelMap] [value={}]
    [3] [type=org.springframework.validation.support.BindingAwareModelMap] [value={}]
    [4] [type=org.springframework.validation.support.BindingAwareModelMap] [value={}]
    Sunny Yu
    @SunnyYu-98
    Hi @THEBEASTYPUNE, it looks like the method you created have a different method signature than the one you're trying to override. I would look at AdminBasicEntityController#viewEntityList's method signature and make sure that all the argument types are correct in the overriding method.
    karthik
    @karthik21091540_twitter

    Hi ALL,

    I am trying to connect the broadleaf commerce demosite with the solr cloud using external Zookeper quorum. I have followed the instructions from below document for zookeeper and solr cloud setup in my local.
    https://www.broadleafcommerce.com/docs/core/6.0/broadleaf-concepts/catalog-and-search/deployment-models/solr-cloud/client-setup.

    I am getting TimeoutException exception while running the broadleaf commerce server. All 3Zookeepers are running on their specified ports..
    Error creating bean with name 'blCatalogSolrConfiguration' defined in class path resource [com/mycompany/core/config/ApplicationSolrConfiguration.class]: Invocation of init method failed; nested exception is org.apache.solr.common.SolrException: java.util.concurrent.TimeoutException: Could not connect to ZooKeeper localhost:2181,localhost:2182,localhost:2183 within 10000 ms

    WARN 166 --- [localhost:2181)] org.apache.zookeeper.ClientCnxn : Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect

    can anyone let me know how to fix this issue.

    karthik
    @karthik21091540_twitter

    Hi ALL,

    I am trying to connect the broadleaf commerce demosite with the solr cloud using external Zookeper quorum. I have followed the instructions from below document for zookeeper and solr cloud setup in my local.
    https://www.broadleafcommerce.com/docs/core/6.0/broadleaf-concepts/catalog-and-search/deployment-models/solr-cloud/client-setup.

    I am getting TimeoutException exception while running the broadleaf commerce server. All 3Zookeepers are running on their specified ports..
    Error creating bean with name 'blCatalogSolrConfiguration' defined in class path resource [com/mycompany/core/config/ApplicationSolrConfiguration.class]: Invocation of init method failed; nested exception is org.apache.solr.common.SolrException: java.util.concurrent.TimeoutException: Could not connect to ZooKeeper localhost:2181,localhost:2182,localhost:2183 within 10000 ms

    WARN 166 --- [localhost:2181)] org.apache.zookeeper.ClientCnxn : Session 0x0 for server null, unexpected error, closing socket connection and attempting reconnect

    can anyone let me know how to fix this issue.

    Jeff Chung
    @chungchi300
    Hi everyone, The broadleaf works well in my local development environment, but when I deployed to the server, the index page return 404 error but the other page working well https://stackoverflow.com/questions/64633507/broadleaf-commerce-404-on-index-page
    in my production machine, the 8080 and 8443 port is by default empty
    I wonder where can I hire some experts to help me get the website ready and kickstart which I think it should only take 1-2 workday to do it
    chiranjitsaha1108
    @chiranjitsaha1108
    Hi @chungchi300
    We can connect and I might help you in resolving the issue. Please inbox me with the details and drop a mail to this mail id: chiranjitsaha1108@gmail.com
    Ritesh Adhikari
    @riteshadhikari17
    Hi @karthik21091540_twitter , I ran into a situation where zookeeper was not running even though CLI said it started. Could you verify it is indeed running. Try this ps -ef|grep zookeeper. In the docs where it says to put this in config, "dataDir=/$ZK_HOME/data/1", it wasn't using actual dir. I had to pass in full path.
    chiranjitsaha1108
    @chiranjitsaha1108
    Hi @danielcolgrove ,
    Can you please let me know the execution of the processors during the submit order. What are the programs or classes getting executed during the submit order and how can I inject my own component into the series of processes.
    Ritesh Adhikari
    @riteshadhikari17