Package org.broadleafcommerce.openadmin.web.form.entity

Examples of org.broadleafcommerce.openadmin.web.form.entity.Field


        saveAction.setButtonClass("translation-submit-button");
        ef.addAction(saveAction);
       
        ef.addField(getLocaleField(formProperties.getLocaleCode()));
       
        ef.addField(new Field()
            .withName("translatedValue")
            .withFieldType(formProperties.getIsRte() ? "html" : "string")
            .withFriendlyName("Translation_translatedValue")
            .withValue(formProperties.getTranslatedValue())
            .withOrder(10));
       
        ef.addHiddenField(new Field()
            .withName("ceilingEntity")
            .withValue(formProperties.getCeilingEntity()));
       
        ef.addHiddenField(new Field()
            .withName("entityId")
            .withValue(formProperties.getEntityId()));
       
        ef.addHiddenField(new Field()
            .withName("propertyName")
            .withValue(formProperties.getPropertyName()));
       
        ef.addHiddenField(new Field()
            .withName("isRte")
            .withValue(String.valueOf(formProperties.getIsRte())));
       
        return ef;
    }
View Full Code Here


    @Resource(name = "blStaticMapNamedOperationComponent")
    protected StaticMapNamedOperationComponent operationMap;
    @Override
    public void addImageThumbnailField(ListGrid listGrid, String urlField) {
        listGrid.getHeaderFields().add(new Field()
            .withName("thumbnail")
            .withFriendlyName("Asset_thumbnail")
            .withFieldType(SupportedFieldType.STRING.toString())
            .withOrder(Integer.MIN_VALUE)
            .withColumnWidth("50px")
            .withFilterSortDisabled(true));
       
        for (ListGridRecord record : listGrid.getRecords()) {
            // Get the value of the URL
            String imageUrl = record.getField(urlField).getValue();
           
            // Prepend the static asset url prefix if necessary
            String staticAssetUrlPrefix = staticAssetService.getStaticAssetUrlPrefix();
            if (staticAssetUrlPrefix != null && !staticAssetUrlPrefix.startsWith("/")) {
                staticAssetUrlPrefix = "/" + staticAssetUrlPrefix;
            }
            if (staticAssetUrlPrefix == null) {
                staticAssetUrlPrefix = "";
            } else {
                imageUrl = staticAssetUrlPrefix + imageUrl;
            }
           
            MediaField mf = (MediaField) new MediaField()
                .withName("thumbnail")
                .withFriendlyName("Asset_thumbnail")
                .withFieldType(SupportedFieldType.IMAGE.toString())
                .withOrder(Integer.MIN_VALUE)
                .withValue(imageUrl);
           
            // Add a hidden field for the large thumbnail path
            record.getHiddenFields().add(new Field()
                .withName("cmsUrlPrefix")
                .withValue(staticAssetUrlPrefix));
           
            record.getHiddenFields().add(new Field()
                .withName("thumbnailKey")
                .withValue("?smallAdminThumbnail"));
           
            record.getHiddenFields().add(new Field()
                .withName("servletContext")
                .withValue(BroadleafRequestContext.getBroadleafRequestContext().getRequest().getContextPath()));
           
            // Set the height value on this field
            mf.setHeight(operationMap.getNamedOperations().get("smallAdminThumbnail").get("resize-height-amount"));
View Full Code Here

TOP

Related Classes of org.broadleafcommerce.openadmin.web.form.entity.Field

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.