code: public String writeUrlNameMapping(
          CmsRequestContext context,
          Iterator<String> nameSeq,
          CmsUUID structureId,
          String locale,
          boolean replaceOnPublish)
      throws CmsException {
  
          CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
          try {
              return m_driverManager.writeUrlNameMapping(dbc, nameSeq, structureId, locale, replaceOnPublish);
          } catch (Exception e) {
              CmsMessageContainer message = Messages.get().container(
                  Messages.ERR_ADD_URLNAME_MAPPING_2,
                  nameSeq.toString(),
                  structureId.toString());
              dbc.report(null, message, e);
              return null;
          } finally {
              dbc.clear();
          }
      }
docs: Writes a new URL name mapping for a given resource.<p>
  
  The first name from the given sequence which is not already mapped to another resource will be used for
  the URL name mapping.<p>
  
  @param context the request context
  @param nameSeq the sequence of URL name candidates
  @param structureId the structure id which should be mapped to the name
  @param locale the locale for the mapping
  @param replaceOnPublish mappings for which this is set will replace all other mappings for the same resource on publishing
  
  @return the name which was actually mapped to the structure id
  
  @throws CmsException if something goes wrong