private String getDynamicAttributeValue(
        CmsFile file,
        I_CmsXmlContentValue value,
        String attributeName,
        CmsEntity editedLocalEntity) {

        if ((null != editedLocalEntity) && (editedLocalEntity.getAttribute(attributeName) != null)) {
            getSessionCache().setDynamicValue(
                attributeName,
                editedLocalEntity.getAttribute(attributeName).getSimpleValue());
        }
        String currentValue = getSessionCache().getDynamicValue(attributeName);
        if (null != currentValue) {
            return currentValue;
        }
        if (null != file) {
            if (value.getTypeName().equals(CmsXmlDynamicCategoryValue.TYPE_NAME)) {
                List<CmsCategory> categories = new ArrayList<CmsCategory>(0);
                try {
                    categories = CmsCategoryService.getInstance().readResourceCategories(getCmsObject(), file);
                } catch (CmsException e) {
                    LOG.error(Messages.get().getBundle().key(Messages.ERROR_FAILED_READING_CATEGORIES_1), e);
                }
                I_CmsWidget widget = null;
                widget = CmsWidgetUtil.collectWidgetInfo(value).getWidget();
                if ((null != widget) && (widget instanceof CmsCategoryWidget)) {
                    String mainCategoryPath = ((CmsCategoryWidget)widget).getStartingCategory(
                        getCmsObject(),
                        getCmsObject().getSitePath(file));
                    StringBuffer pathes = new StringBuffer();
                    for (CmsCategory category : categories) {
                        if (category.getPath().startsWith(mainCategoryPath)) {
                            String path = category.getBasePath() + category.getPath();
                            path = getCmsObject().getRequestContext().removeSiteRoot(path);
                            pathes.append(path).append(',');
                        }
                    }
                    String dynamicConfigString = pathes.length() > 0 ? pathes.substring(0, pathes.length() - 1) : "";
                    getSessionCache().setDynamicValue(attributeName, dynamicConfigString);
                    return dynamicConfigString;
                }
            }
        }
        return "";

    }
private String getDynamicAttributeValue ( CmsFile file , I_CmsXmlContentValue value , String attributeName , CmsEntity editedLocalEntity ) { if ( ( null != editedLocalEntity ) && ( editedLocalEntity . getAttribute ( attributeName ) != null ) ) { getSessionCache ( ) . setDynamicValue ( attributeName , editedLocalEntity . getAttribute ( attributeName ) . getSimpleValue ( ) ) ; } String currentValue = getSessionCache ( ) . getDynamicValue ( attributeName ) ; if ( null != currentValue ) { return currentValue ; } if ( null != file ) { if ( value . getTypeName ( ) . equals ( CmsXmlDynamicCategoryValue . TYPE_NAME ) ) { List < CmsCategory > categories = new ArrayList < CmsCategory > ( 0 ) ; try { categories = CmsCategoryService . getInstance ( ) . readResourceCategories ( getCmsObject ( ) , file ) ; } catch ( CmsException e ) { LOG . error ( Messages . get ( ) . getBundle ( ) . key ( Messages . ERROR_FAILED_READING_CATEGORIES_1 ) , e ) ; } I_CmsWidget widget = null ; widget = CmsWidgetUtil . collectWidgetInfo ( value ) . getWidget ( ) ; if ( ( null != widget ) && ( widget instanceof CmsCategoryWidget ) ) { String mainCategoryPath = ( ( CmsCategoryWidget ) widget ) . getStartingCategory ( getCmsObject ( ) , getCmsObject ( ) . getSitePath ( file ) ) ; StringBuffer pathes = new StringBuffer ( ) ; for ( CmsCategory category : categories ) { if ( category . getPath ( ) . startsWith ( mainCategoryPath ) ) { String path = category . getBasePath ( ) + category . getPath ( ) ; path = getCmsObject ( ) . getRequestContext ( ) . removeSiteRoot ( path ) ; pathes . append ( path ) . append ( ',' ) ; } } String dynamicConfigString = pathes . length ( ) > 0 ? pathes . substring ( 0 , pathes . length ( ) - 1 ) : "" ; getSessionCache ( ) . setDynamicValue ( attributeName , dynamicConfigString ) ; return dynamicConfigString ; } } } return "" ; }
Returns the value that has to be set for the dynamic attribute.

@param file the file where the current content is stored
@param value the content value that is represented by the attribute
@param attributeName the attribute's name
@param editedLocalEntity the entities that where edited last
@return the value that has to be set for the dynamic attribute.