client/public/elements/pages/concept/rp-page-concept.js
/**
   * @method _doMainQuery
   * @param {String} id - The subject id of this page.
   * @description Retrieves the subject from the id given and saves in this.subject array
   * Called on AppStateUpdate
   * 
   * Calls the functions: this._getSubjectType(), 
   *                      this._getFullTextLinks(),
   *                      this._getRelatedSubjectsNarrow(), 
   *                      this._getRelatedSubjectsBroader()
   * @returns {Promise} AppStateModel
   */
@method _doMainQuery
@param {String} id - The subject id of this page.
@description Retrieves the subject from the id given and saves in this.subject array
Called on AppStateUpdate


@method _doMainQuery @param { String } id - The subject id of this page . @description Retrieves the subject from the id given and saves in this . subject array Called on AppStateUpdate
async _doMainQuery(id){
    let data = await this.SubjectModel.getSubject(id);
    this.subjectStatus = data.state;
    if( data.state === 'error' ) {
      return this.AppStateModel.show404Page(data);
    }
    if (data.state != 'loaded') {
      return false;
    }
    this.subject = data.payload;
    if (config.verbose) console.log("subject payload:", data);
    this.subjectType = this._getSubjectType();
    this.fullTextLinks = this._getFullTextLinks();
    this.narrowRelatedSubjects = this._getRelatedSubjectsNarrow();
    this.broadRelatedSubjects = this._getRelatedSubjectsBroader();
    if(this._isEmpty(this.narrowRelatedSubjects) && this._isEmpty(this.broadRelatedSubjects)){
      this._toggleElements("relatedSubjects", this.narrowRelatedSubjects);
    }
    return false;
  }
async _doMainQuery ( id ) { let data = await this . SubjectModel . getSubject ( id ) ; this . subjectStatus = data . state ; if ( data . state === 'error' ) { return this . AppStateModel . show404Page ( data ) ; } if ( data . state != 'loaded' ) { return false ; } this . subject = data . payload ; if ( config . verbose ) console . log ( "subject payload:" , data ) ; this . subjectType = this . _getSubjectType ( ) ; this . fullTextLinks = this . _getFullTextLinks ( ) ; this . narrowRelatedSubjects = this . _getRelatedSubjectsNarrow ( ) ; this . broadRelatedSubjects = this . _getRelatedSubjectsBroader ( ) ; if ( this . _isEmpty ( this . narrowRelatedSubjects ) && this . _isEmpty ( this . broadRelatedSubjects ) ) { this . _toggleElements ( "relatedSubjects" , this . narrowRelatedSubjects ) ; } return false ; }
@method _doMainQuery
 @param {String} id - The subject id of this page.
@method _doMainQuery @param { String } id - The subject id of this page .