private CmsGroupContainerBean getGroupContainerBean(
        CmsGroupContainer groupContainer,
        CmsResource containerPage,
        String locale) {

        CmsObject cms = getCmsObject();
        List<CmsContainerElementBean> elements = new ArrayList<CmsContainerElementBean>();
        for (CmsContainerElement elementData : groupContainer.getElements()) {
            try {
                if (elementData.isNew()) {
                    elementData = createNewElement(
                        containerPage.getStructureId(),
                        elementData.getClientId(),
                        elementData.getResourceType(),
                        null,
                        locale);
                }
                CmsContainerElementBean element = getCachedElement(
                    elementData.getClientId(),
                    containerPage.getRootPath());

                // make sure resource is readable,
                if (cms.existsResource(element.getId(), CmsResourceFilter.IGNORE_EXPIRATION)) {
                    elements.add(element);
                }

            } catch (Exception e) {
                log(e.getLocalizedMessage(), e);
            }
        }
        return new CmsGroupContainerBean(
            groupContainer.getTitle(),
            groupContainer.getDescription(),
            elements,
            groupContainer.getTypes());
    }
private CmsGroupContainerBean getGroupContainerBean ( CmsGroupContainer groupContainer , CmsResource containerPage , String locale ) { CmsObject cms = getCmsObject ( ) ; List < CmsContainerElementBean > elements = new ArrayList < CmsContainerElementBean > ( ) ; for ( CmsContainerElement elementData : groupContainer . getElements ( ) ) { try { if ( elementData . isNew ( ) ) { elementData = createNewElement ( containerPage . getStructureId ( ) , elementData . getClientId ( ) , elementData . getResourceType ( ) , null , locale ) ; } CmsContainerElementBean element = getCachedElement ( elementData . getClientId ( ) , containerPage . getRootPath ( ) ) ; if ( cms . existsResource ( element . getId ( ) , CmsResourceFilter . IGNORE_EXPIRATION ) ) { elements . add ( element ) ; } } catch ( Exception e ) { log ( e . getLocalizedMessage ( ) , e ) ; } } return new CmsGroupContainerBean ( groupContainer . getTitle ( ) , groupContainer . getDescription ( ) , elements , groupContainer . getTypes ( ) ) ; }
Helper method for converting a CmsGroupContainer to a CmsGroupContainerBean when saving a group container.<p>

@param groupContainer the group-container data
@param containerPage the container page
@param locale the locale to use

@return the group-container bean