code: public void updateRelationsForResource(CmsRequestContext context, CmsResource resource, List<CmsLink> relations)
      throws CmsException {
  
          CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
          try {
              m_driverManager.updateRelationsForResource(dbc, resource, relations);
          } catch (Exception e) {
              dbc.report(
                  null,
                  Messages.get().container(Messages.ERR_UPDATE_RELATIONS_1, dbc.removeSiteRoot(resource.getRootPath())),
                  e);
          } finally {
              dbc.clear();
          }
      }
docs: Updates/Creates the relations for the given resource.<p>
  
  @param context the current user context
  @param resource the resource to update the relations for
  @param relations the relations to update
  
  @throws CmsException if something goes wrong
  
  @see CmsDriverManager#updateRelationsForResource(CmsDbContext, CmsResource, List)