Page 1 of 1

Question about StructuredContent

Posted: Thu Mar 28, 2013 8:52 am
by staleks
Hi,

I've got an issue from client to add banners on certain pages. I found most suitable to do so using StructuredContent, specially since it would be almost as it is "Advert Banner Right Handside banner" in Demo Application.

I've examined Admn and CMS module, (see link http://docs.broadleafcommerce.org/current/CMS-Structured-Content.html) and I've added data in appropriate tables. I can tell you that I've managed to show banner on FrontEnd.

But I am facing other type of a problem :(

When I want to change data for that banner, I am not able to do so, since I am getting strange exception:

Code: Select all

[ERROR] 14:09:27 StructuredContentCustomPersistenceHandler - Unable to execute persistence activity
javax.persistence.PersistenceException: org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before calling save(): org.broadleafcommerce.common.currency.domain.BroadleafCurrencyImpl
   at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1389)
   at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1317)
   at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1323)
   at org.hibernate.ejb.AbstractEntityManagerImpl.merge(AbstractEntityManagerImpl.java:862)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:601)
   at org.springframework.orm.jpa.ExtendedEntityManagerCreator$ExtendedEntityManagerInvocationHandler.invoke(ExtendedEntityManagerCreator.java:365)
   at com.sun.proxy.$Proxy227.merge(Unknown Source)



Again to stress this situation, when I do change values in DB directly, updates are visible on front end.

As I see from BLC framework domains, currency doesn't have sequence generator and must have prepopulated ID. At least it seems like that is the error.

In admin module, when defining banner I've noticed "Currency section". It is empty in my case.
See attached screen.
Can this be a problem? And if it is can you please direct me what I am missing?

Anyhow how the banner field is in relation with currency? I can't see it from UML diagram that is given on mentioned URL.


Thank You

CMS-AdBanner.png
CMS-AdBanner.png (78.93 KiB) Viewed 15855 times

Re: Question about StructuredContent

Posted: Thu Mar 28, 2013 9:16 am
by staleks
Hi,

when I've added value for column CURRENCY_CODE in table BLC_LOCALE, I've got those fields populated, and was able to change values in:
- image URL and
- target URL
input fields without exception.

Anyway I would like to have info how are Ad banner and currency correlated.

One more thing that I've noticed is that even I change values, update doesn't occur at once. I have to stop and restart application in order that changes to take effect. I would guess that you have some mechanism to "promote"/"approve" changes? Am I right?
If so, can you please point me how to do that?

Thank You

Re: Question about StructuredContent

Posted: Thu Mar 28, 2013 9:20 am
by staleks
Update:

I've noticed that change took place once SOLR rebuildIndex took place? Is this true?

Re: Question about StructuredContent

Posted: Thu Mar 28, 2013 10:16 am
by phillipuniverse
Looks like a bug to me. What version of BLC are you on?

Re: Question about StructuredContent

Posted: Thu Mar 28, 2013 10:28 am
by staleks
I've recently switched from BLC 2.0.1.GA -> BLC 2.2.0.GA

Re: Question about StructuredContent

Posted: Thu Mar 28, 2013 10:38 am
by phillipuniverse
This is being tracked in Jira at http://jira.broadleafcommerce.org/browse/BLC-824

Re: Question about StructuredContent

Posted: Thu Mar 28, 2013 10:46 am
by staleks
Ok.

So it shouldn't show, as I understood ?

Anyway what about other stuff/questions?

Re: Question about StructuredContent

Posted: Thu Mar 28, 2013 10:55 am
by phillipuniverse
Correct, should not show. Once this doesn't show up, it should resolve the error that you are having.

The reason that the banner and currency are correlated is via locale. StructuredContent has a Locale, which in turn has a BroadleafCurrency.

There is no mechanism to promote/approve changes at the moment; that is provided in a separate module called ChangeSets which is a commercial module that will operate on our entire domain (think approval process/sandbox for both CMS and Catalog). If you do not see the changes immediately on the frontend, you might have some caching enabled somewhere. Caching is configured in bl-override-ehcache.xml in the 'cmsStructuredContentCache' region.

Re: Question about StructuredContent

Posted: Thu Mar 28, 2013 10:58 am
by phillipuniverse
This is now resolved and pushed (http://git.io/GrWnpQ) and is available in 2.2.1-SNAPSHOT.