Page 1 of 1

Structured content not showing in admin

Posted: Sat Oct 27, 2012 5:49 am
by om.singh
I created custom BLC_FLD_GROUP to support new content type

Code: Select all

INSERT INTO BLC_FLD_GROUP(FLD_GROUP_ID, NAME, INIT_COLLAPSED_FLAG) VALUES (7, 'New Content', false);
INSERT INTO BLC_FLD_DEF(FLD_DEF_ID, NAME, FRIENDLY_NAME, FLD_TYPE, SECURITY_LEVEL, HIDDEN_FLAG, VLDTN_REGEX, VLDTN_ERROR_MSSG_KEY, MAX_LENGTH, COLUMN_WIDTH, TEXT_AREA_FLAG, FLD_ENUM_ID, ALLOW_MULTIPLES, FLD_GROUP_ID, FLD_ORDER) VALUES (101, 'heading', 'Heading ', 'STRING', NULL, false, null, null, null, '*', false, NULL, false, 7, 0);
INSERT INTO BLC_FLD_DEF(FLD_DEF_ID, NAME, FRIENDLY_NAME, FLD_TYPE, SECURITY_LEVEL, HIDDEN_FLAG, VLDTN_REGEX, VLDTN_ERROR_MSSG_KEY, MAX_LENGTH, COLUMN_WIDTH, TEXT_AREA_FLAG, FLD_ENUM_ID, ALLOW_MULTIPLES, FLD_GROUP_ID, FLD_ORDER) VALUES (102, 'introduction', 'Introduction', 'HTML', NULL, false, null, null, null, '*', false, NULL, false, 7, 1);
INSERT INTO BLC_FLD_DEF(FLD_DEF_ID, NAME, FRIENDLY_NAME, FLD_TYPE, SECURITY_LEVEL, HIDDEN_FLAG, VLDTN_REGEX, VLDTN_ERROR_MSSG_KEY, MAX_LENGTH, COLUMN_WIDTH, TEXT_AREA_FLAG, FLD_ENUM_ID, ALLOW_MULTIPLES, FLD_GROUP_ID, FLD_ORDER) VALUES (103, 'date', 'Creation Date', 'DATE', NULL, false, null, null, null, '*', false, NULL, false, 7, 2);
INSERT INTO BLC_FLD_DEF(FLD_DEF_ID, NAME, FRIENDLY_NAME, FLD_TYPE, SECURITY_LEVEL, HIDDEN_FLAG, VLDTN_REGEX, VLDTN_ERROR_MSSG_KEY, MAX_LENGTH, COLUMN_WIDTH, TEXT_AREA_FLAG, FLD_ENUM_ID, ALLOW_MULTIPLES, FLD_GROUP_ID, FLD_ORDER) VALUES (104, 'imageUrl', 'Image URL', 'STRING', NULL, false, null, null, 150, 200, false, NULL, false, 7, 3);
INSERT INTO BLC_FLD_DEF(FLD_DEF_ID, NAME, FRIENDLY_NAME, FLD_TYPE, SECURITY_LEVEL, HIDDEN_FLAG, VLDTN_REGEX, VLDTN_ERROR_MSSG_KEY, MAX_LENGTH, COLUMN_WIDTH, TEXT_AREA_FLAG, FLD_ENUM_ID, ALLOW_MULTIPLES, FLD_GROUP_ID, FLD_ORDER) VALUES (105, 'body', 'Body', 'HTML', NULL, false, null, null, null, '*', false, NULL, false, 7, 4);


following this I have created insert script to supply content.

Code: Select all

INSERT INTO BLC_PAGE (PAGE_ID, DESCRIPTION, PAGE_TMPLT_ID, FULL_URL, ARCHIVED_FLAG, DELETED_FLAG) VALUES (11,'this is the solar energy page template',5,'/content/solar',FALSE,FALSE);
INSERT INTO BLC_PAGE_FLD (PAGE_FLD_ID, FLD_KEY, PAGE_ID, LOB_VALUE) VALUES(10000,'body',11,'<p>Solar power is energy from the sun and without its presence all life on earth would end. Solar energy has been looked upon as a serious source of energy for many years because of the vast amounts of energy that are made freely available, if harnessed by modern technology.</p><p>A simple example of the power of the sun can be seen by using a magnifying glass to focus the suns rays on a piece of paper. Before long the paper ignites into flames.</p><p>');
INSERT INTO BLC_PAGE_FLD (PAGE_FLD_ID, FLD_KEY, PAGE_ID, VALUE) VALUES(10001,'imageUrl',11,'/images/cms/solar-panels-for-home-790384.jpg');
INSERT INTO BLC_PAGE_FLD (PAGE_FLD_ID, FLD_KEY, PAGE_ID, VALUE) VALUES(10002,'date',11,'2012.03.07 00:00:00');
INSERT INTO BLC_PAGE_FLD (PAGE_FLD_ID, FLD_KEY, PAGE_ID, VALUE) VALUES(10003,'introduction',11,'Solar water heating, where heat from the Sun is used to heat water in a glass panels on your roof.');
INSERT INTO BLC_PAGE_FLD (PAGE_FLD_ID, FLD_KEY, PAGE_ID, VALUE) VALUES(10004,'heading',11,'Energy from the sun');
INSERT INTO BLC_PAGE_FLD_MAP(PAGE_FLD_ID, PAGE_ID,MAP_KEY) VALUES(10000,11,'body');
INSERT INTO BLC_PAGE_FLD_MAP(PAGE_FLD_ID, PAGE_ID,MAP_KEY) VALUES(10001,11,'imageUrl');
INSERT INTO BLC_PAGE_FLD_MAP(PAGE_FLD_ID, PAGE_ID,MAP_KEY) VALUES(10002,11,'date');
INSERT INTO BLC_PAGE_FLD_MAP(PAGE_FLD_ID, PAGE_ID,MAP_KEY) VALUES(10003,11,'introduction');
INSERT INTO BLC_PAGE_FLD_MAP(PAGE_FLD_ID, PAGE_ID,MAP_KEY) VALUES(10004,11,'heading');


In the admin screen - this is not showing up though I can see the field for the content type, also in the database - i can see the content getting added correctly.

Also the default content for about us , faq from the demo application shows up fine.

This was working on the previous version of broadleaf(1.5GA) but not working with 2.0.0-M1-5.

Any suggestion.

Regards
Om

Re: Structured content not showing in admin

Posted: Mon Oct 29, 2012 3:07 pm
by phillipuniverse
I believe in that version of the admin demo site there is caching enabled. This should be turned off in the admin. The easy fix would be to move the bl-override-ehcache.xml file away from site and into core that has caching disabled. Then you just need the bean declaration in applicationContext-admin.xml:

Code: Select all

    <bean id="blMergedCacheConfigLocations" class="org.springframework.beans.factory.config.ListFactoryBean">
        <property name="sourceList">
            <list>
                <value>classpath:bl-override-ehcache.xml</value>
            </list>
        </property>
    </bean>


It's also possible that you want different caching strategies for site and admin. I would say this is the normal use case; you want caching on the frontend but don't care about caching on the backend. In this case you would have similar changes but would keep the one ehcache override in site and copy it over to admin to make whatever changes you need.