code: public CmsAliasImportResult importRewriteAlias(
          CmsDbContext dbc,
          String siteRoot,
          String source,
          String target,
          CmsAliasMode mode)
      throws CmsException {
  
          I_CmsVfsDriver vfs = getVfsDriver(dbc);
          List<CmsRewriteAlias> existingAliases = vfs.readRewriteAliases(
              dbc,
              new CmsRewriteAliasFilter().setSiteRoot(siteRoot));
          CmsUUID idToDelete = null;
          for (CmsRewriteAlias alias : existingAliases) {
              if (alias.getPatternString().equals(source)) {
                  idToDelete = alias.getId();
              }
          }
          if (idToDelete != null) {
              vfs.deleteRewriteAliases(dbc, new CmsRewriteAliasFilter().setId(idToDelete));
          }
          CmsRewriteAlias alias = new CmsRewriteAlias(new CmsUUID(), siteRoot, source, target, mode);
          List<CmsRewriteAlias> aliases = new ArrayList<CmsRewriteAlias>();
          aliases.add(alias);
          getVfsDriver(dbc).insertRewriteAliases(dbc, aliases);
          CmsAliasImportResult result = new CmsAliasImportResult(
              CmsAliasImportStatus.aliasNew,
              "OK",
              source,
              target,
              mode);
          return result;
      }
docs: Imports a rewrite alias.<p>
  
  @param dbc the database context
  @param siteRoot the site root of the alias
  @param source the source of the alias
  @param target the target of the alias
  @param mode the alias mode
  
  @return the import result
  
  @throws CmsException if something goes wrong