code: protected void addOrReplaceUrlNameMapping(
          CmsDbContext dbc,
          String name,
          CmsUUID structureId,
          String locale,
          boolean replaceOnPublish)
      throws CmsDataAccessException {
  
          getVfsDriver(dbc).deleteUrlNameMappingEntries(
              dbc,
              false,
              CmsUrlNameMappingFilter.ALL.filterStructureId(structureId).filterLocale(locale).filterStates(
                  CmsUrlNameMappingEntry.MAPPING_STATUS_NEW,
                  CmsUrlNameMappingEntry.MAPPING_STATUS_REPLACE_ON_PUBLISH));
          CmsUrlNameMappingEntry newEntry = new CmsUrlNameMappingEntry(
              name,
              structureId,
              replaceOnPublish
              ? CmsUrlNameMappingEntry.MAPPING_STATUS_REPLACE_ON_PUBLISH
              : CmsUrlNameMappingEntry.MAPPING_STATUS_NEW,
              System.currentTimeMillis(),
              locale);
          getVfsDriver(dbc).addUrlNameMappingEntry(dbc, false, newEntry);
      }
docs: Adds or replaces a new url name mapping in the offline project.<p>
  
  @param dbc the current database context
  @param name the URL name of the mapping
  @param structureId the structure id of the mapping
  @param locale the locale of the mapping
  @param replaceOnPublish if the mapping shoudl replace previous URL name mappings when published
  
  @throws CmsDataAccessException if something goes wrong