Page 1 of 2

How to debug the demo project?

Posted: Sun Jan 13, 2013 7:16 am
by Jerry
Hi Guys,
The demo site is running good with Jetty now but, I want to develop something based on the demo site.
I run the Tomcat in jdpa remote debug mode and debug the broadleaf site project which Running as a remote application.
Tomcat successfully started up but I didn't know how to access the demo site in my browser....
When I access the URL http://localhost:8080 , I get the tomcat main page but not the page which I get by running the ant task.

How do your guys debug the project? any suggestions will be very appreciated.

Regards,
Jerry

Re: How to debug the demo project?

Posted: Sun Jan 13, 2013 11:27 am
by phillipuniverse
Unless you changed the .war that the demo site builds, it will be called mycompany.war. If you then just took this and put it in the Tomcat webapps directory, it will deploy into a 'mycompany' folder, meaning that you can access it via localhost:8080/mycompany (the 'mycompany' part is the Tomcat context).

If you want to instead access it on localhost:8080, you need to build it as ROOT.war. To do this automatically (so you don't have to rename it after you build) you can change the 'finalName' value in the <build> section in the 'site' project's pom.xml.

Re: How to debug the demo project?

Posted: Thu Jan 17, 2013 3:39 am
by Jerry
Thanks a lot.

Re: How to debug the demo project?

Posted: Fri Aug 01, 2014 10:24 pm
by kushagrajain
Hi phillipunivers,

Incase if I am using Jetty server only, then how I can debug my html file located under the /template directory of DemoSite project? I have configured the Debug configuration but as you know, in html files we cannot enable breakpoints! So how to know the values of variables like ${customer.anonymous}, say as example. Also, I really am not able to figure out from where this customer variable value is coming from? Please assist!

Would be highly grateful to you phillipunivers.

Regards,
Kushagra

Re: How to debug the demo project?

Posted: Sat Aug 02, 2014 12:56 pm
by phillipuniverse
As far as I know, you cannot set breakpoints in Thymeleaf templates. I don't think this will be possible with Thymeleaf at all since the templates are interpreted rather that compiled (as opposed to JSP which I believe is compiled into actual Java bytecode).

Thymeleaf makes all request attributes available in the template files as normal variables. 'customer' is a request attribute, put on the request by the CustomerStateRequestFilter.

Re: How to debug the demo project?

Posted: Sun Aug 03, 2014 12:13 pm
by kushagrajain
phillipunivers, got your point! Really, I must admit that the support and explanation to queries from all broadleaf team members is awesome! Hats off!

One more thing, though I should raise this as a seperate topic but I checked I don't have the permission for it, that if I wish
to upload my large list of products through excel into broadleaf, then how will it be feasible?

I feel even if I will make it as a separate program that parses the excel data columns and feed it into the database tables accordingly, there would be two concerns:

Firstly, the mapping of all other dependent tables need to be taken care of. Populating those as well, but how?

Secondly and most concerned, if I provide the path of media, that is, product image as a column into my excel so that it goes to corresponding column of BLC_STATIC_ASSET, then behind the scene, how will it create the required folder and copies image to it for rendering?

Hope I am able explain my view like you all! Great Team!

Thanks once again :)

Regards

Re: How to debug the demo project?

Posted: Fri Aug 08, 2014 2:47 pm
by daniel_locious
Interesting topic.

I actually got a similar question. When I program/debug the html - that is, thymeleaf template, everytime I modified the content in the template, I have to restart the jetty server to apply the changes. The restart command is in ant command, my understanding is it forced a recompile of the project.

SO, how can we avoid to recompile in this case, directly apply the change to, say, a temp folder (is there such a thing?), so that we can see the changes immediately? Then later I can move my change back to the source html template.

Ideally, if we can change the source html template and apply the change while the project is running; is it possible?

Regards,

Dan

Re: How to debug the demo project?

Posted: Fri Aug 08, 2014 5:28 pm
by phillipuniverse
Dan,

You should be able to do that by simply ensuring that Thymeleaf caching is disabled. This is controlled via the cache.page.templates system property. This defaults to 'true'. If you change this to false (like in development-shared.properties) then when Eclipse/IntelliJ rebuilds your project then it will copy the template files into the exploded war directory (in target) which is what the ant task uses with Jetty.

So try setting cache.page.templates=false and see if that has the correct result. We use JRebel for hot-deploys so that might have been reloading them for us all along without us realizing it.

Re: How to debug the demo project?

Posted: Fri Aug 08, 2014 11:51 pm
by daniel_locious
That's cool, Phill.

I tested it and it works as charming as it is.

Thanks a lot.

Re: How to debug the demo project?

Posted: Mon Aug 11, 2014 12:24 am
by kushagrajain
Hi Phill,

Looking for your help regarding my last reply for importing products through excel into our system, especially managing media(as mentioned in my last post)?