code: protected static String replaceProjectPattern(CmsUUID projectId, String query) {
  
          // make the statement project dependent
          String replacePattern = ((projectId == null) || projectId.equals(CmsProject.ONLINE_PROJECT_ID))
          ? "_ONLINE_"
          : "_OFFLINE_";
          return CmsStringUtil.substitute(query, QUERY_PROJECT_SEARCH_PATTERN, replacePattern);
      }
docs: Replaces the project search pattern in SQL queries by the pattern _ONLINE_ or _OFFLINE_ depending on the
  specified project ID.<p>
  
  @param projectId the ID of the current project
  @param query the SQL query
  @return String the SQL query with the table key search pattern replaced