public void publishUrlNameMapping(CmsDbContext dbc, CmsResource res) throws CmsDataAccessException {

        I_CmsVfsDriver vfsDriver = getVfsDriver(dbc);

        if (res.getState().isDeleted()) {
            // remove both offline and online mappings
            CmsUrlNameMappingFilter idFilter = CmsUrlNameMappingFilter.ALL.filterStructureId(res.getStructureId());
            vfsDriver.deleteUrlNameMappingEntries(dbc, true, idFilter);
            vfsDriver.deleteUrlNameMappingEntries(dbc, false, idFilter);
        } else {
            // copy the new entries to the online table
            List<CmsUrlNameMappingEntry> entries = vfsDriver.readUrlNameMappingEntries(
                dbc,
                false,
                CmsUrlNameMappingFilter.ALL.filterStructureId(res.getStructureId()).filterStates(
                    CmsUrlNameMappingEntry.MAPPING_STATUS_NEW,
                    CmsUrlNameMappingEntry.MAPPING_STATUS_REPLACE_ON_PUBLISH));

            boolean isReplaceOnPublish = false;
            for (CmsUrlNameMappingEntry entry : entries) {
                isReplaceOnPublish |= entry.getState() == CmsUrlNameMappingEntry.MAPPING_STATUS_REPLACE_ON_PUBLISH;
            }

            if (!entries.isEmpty()) {

                long now = System.currentTimeMillis();
                if (isReplaceOnPublish) {
                    vfsDriver.deleteUrlNameMappingEntries(
                        dbc,
                        true,
                        CmsUrlNameMappingFilter.ALL.filterStructureId(res.getStructureId()));
                    vfsDriver.deleteUrlNameMappingEntries(
                        dbc,
                        false,
                        CmsUrlNameMappingFilter.ALL.filterStructureId(res.getStructureId()));
                }

                for (CmsUrlNameMappingEntry entry : entries) {
                    CmsUrlNameMappingFilter nameFilter = CmsUrlNameMappingFilter.ALL.filterName(entry.getName());
                    if (!isReplaceOnPublish) { // we already handled the other case above
                        vfsDriver.deleteUrlNameMappingEntries(dbc, true, nameFilter);
                        vfsDriver.deleteUrlNameMappingEntries(dbc, false, nameFilter);
                    }
                }
                for (CmsUrlNameMappingEntry entry : entries) {
                    CmsUrlNameMappingEntry newEntry = new CmsUrlNameMappingEntry(
                        entry.getName(),
                        entry.getStructureId(),
                        entry.getState() == CmsUrlNameMappingEntry.MAPPING_STATUS_NEW
                        ? CmsUrlNameMappingEntry.MAPPING_STATUS_PUBLISHED
                        : CmsUrlNameMappingEntry.MAPPING_STATUS_REPLACE_ON_PUBLISH_PUBLISHED,
                        now,
                        entry.getLocale());
                    vfsDriver.addUrlNameMappingEntry(dbc, true, newEntry);
                    vfsDriver.addUrlNameMappingEntry(dbc, false, newEntry);
                }
            }
        }
    }
public void publishUrlNameMapping ( CmsDbContext dbc , CmsResource res ) throws CmsDataAccessException { I_CmsVfsDriver vfsDriver = getVfsDriver ( dbc ) ; if ( res . getState ( ) . isDeleted ( ) ) { CmsUrlNameMappingFilter idFilter = CmsUrlNameMappingFilter . ALL . filterStructureId ( res . getStructureId ( ) ) ; vfsDriver . deleteUrlNameMappingEntries ( dbc , true , idFilter ) ; vfsDriver . deleteUrlNameMappingEntries ( dbc , false , idFilter ) ; } else { List < CmsUrlNameMappingEntry > entries = vfsDriver . readUrlNameMappingEntries ( dbc , false , CmsUrlNameMappingFilter . ALL . filterStructureId ( res . getStructureId ( ) ) . filterStates ( CmsUrlNameMappingEntry . MAPPING_STATUS_NEW , CmsUrlNameMappingEntry . MAPPING_STATUS_REPLACE_ON_PUBLISH ) ) ; boolean isReplaceOnPublish = false ; for ( CmsUrlNameMappingEntry entry : entries ) { isReplaceOnPublish |= entry . getState ( ) == CmsUrlNameMappingEntry . MAPPING_STATUS_REPLACE_ON_PUBLISH ; } if ( ! entries . isEmpty ( ) ) { long now = System . currentTimeMillis ( ) ; if ( isReplaceOnPublish ) { vfsDriver . deleteUrlNameMappingEntries ( dbc , true , CmsUrlNameMappingFilter . ALL . filterStructureId ( res . getStructureId ( ) ) ) ; vfsDriver . deleteUrlNameMappingEntries ( dbc , false , CmsUrlNameMappingFilter . ALL . filterStructureId ( res . getStructureId ( ) ) ) ; } for ( CmsUrlNameMappingEntry entry : entries ) { CmsUrlNameMappingFilter nameFilter = CmsUrlNameMappingFilter . ALL . filterName ( entry . getName ( ) ) ; if ( ! isReplaceOnPublish ) { vfsDriver . deleteUrlNameMappingEntries ( dbc , true , nameFilter ) ; vfsDriver . deleteUrlNameMappingEntries ( dbc , false , nameFilter ) ; } } for ( CmsUrlNameMappingEntry entry : entries ) { CmsUrlNameMappingEntry newEntry = new CmsUrlNameMappingEntry ( entry . getName ( ) , entry . getStructureId ( ) , entry . getState ( ) == CmsUrlNameMappingEntry . MAPPING_STATUS_NEW ? CmsUrlNameMappingEntry . MAPPING_STATUS_PUBLISHED : CmsUrlNameMappingEntry . MAPPING_STATUS_REPLACE_ON_PUBLISH_PUBLISHED , now , entry . getLocale ( ) ) ; vfsDriver . addUrlNameMappingEntry ( dbc , true , newEntry ) ; vfsDriver . addUrlNameMappingEntry ( dbc , false , newEntry ) ; } } } }
Transfers the new URL name mappings (if any) for a given resource to the online project.<p>

@param dbc the current database context
@param res the resource whose new URL name mappings should be transferred to the online project

@throws CmsDataAccessException if something goes wrong