Page 1 of 1

Admin CMS | Content type and sandbox set yp

Posted: Sun Feb 26, 2012 7:36 am
by om.singh
I have the admin configured on 1.5.1.GA release. I have few questions

1. On the cms asset tab when we upload the image - where does it physicaly load the file too. Seems the folder structure is /admin/images/cms/staticasset/ - but could not locate this folder. I am using the maven archtype to develop my project. Can we control the folder where it uploads to.

2. I am also customizing the page content entry screens. there are some content type which we can use - like HTML, STRING , I tried to use ASSET , but could not make it work. In case you have used it please let me know or point me to the documents. I am refering to org.broadleafcommerce.openadmin.client.presentation.SupportedFieldType for types.

3. Can I setup a stand along sandbox server, where is the URL actually configured in the ADMIN application.

Regards
Om

Re: Admin CMS | Content type and sandbox set yp

Posted: Mon Feb 27, 2012 12:01 pm
by jefffischer
1) The asset goes to the database as a blob. When the asset is requested (image asset), it is rendered from the database at the particular size (and any other filters requested) and saved to the temporary file system with a unique name. Henceforth, if that same asset is requested with the same treatment, then the cached, temporary version is returned, rather than going to the database again. You cannot control where this uploads to, as it is going into the database.

2) In answering this, I'm making this assumption - you're familiar with the database tables required to populate a template (this is what you're trying to customize). The /src/main/resources/archetype-resources/site-war/src/main/resources/sql/load_content_structure.sql file in the archetype shows how a sample template is created. With that in mind:
a) Assets are uploaded and managed on the asset tab in the CMS. Moving this upload functionality elsewhere is a task beyond the scope of what I can describe in this forum post.
b) If you would like to simply create a field that can be populated with the url of a file that was previously uploaded in the asset tab (presumably you would like the user to select an image from a visual list of image thumbnails), then this is possible. You'll need to set the fieldType for you FieldDefinition to ASSET_URL. This will cause the form to render a text field that allows the image search. You'll need to configure the callback for this in your presenter. Take a look at the config for "staticAssetTreeDS" in OneToOneProductSkuPresenter for an example of setting up your datasource and callback.

3) Take a look at overriding the "assetServerUrlPrefix" property of UtilityRemoteService. This service currently has the bean id of "blUtilityRemoteService"

Re: Admin CMS | Content type and sandbox set yp

Posted: Mon Feb 27, 2012 1:03 pm
by om.singh
Thanks for the details. this clarifies my doubt. I will try to work through this.