Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

to create the a new Java backend class to render the page for BioSamples related to RNA seqence runs. #65

Open
computate opened this issue Oct 21, 2021 · 0 comments

Comments

@computate
Copy link
Member

computate commented Oct 21, 2021

Mission to create the a new Java backend class to render the page for BioSamples related to RNA seqence runs.

Mission

Your mission, should you choose to accept it, is to create the a new Java backend class to render the page for BioSamples related to RNA seqence runs. .

The day of the operation is October 26th, 2021

You will have 4 hours to complete your mission.

An open science project to uncover the planetary virome, freely and openly

You will be joining a team of the boldest

of all Red Hatters for this mission, who will be at your service developing the code and automating the deployment to OpenShift.

  • Should you, or any of your force be taken or compromised that day, you must report back as many changes as you have made, and any knowledge of your actions, by pull request or comments on the issue on the board.

How to get started:

Follow the instructions here to setup the project: https://github.com/team19hackathon2021/serratus-api/

The details of your mission:

  • The Java package name will be: io.serratus.api.enus.model.biosample
  • The Java class name will be: BioSamplePageGen
  • The path to the Java class will be: /usr/local/src/serratus-api/src/main/java/io/serratus/api/enus/model/biosample/BioSamplePageGen.java
  • The Java class will extend: BioSampleGenPage
package io.serratus.api.enus.model.biosample;

import io.serratus.api.enus.request.SiteRequestEnUS;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Arrays;
import io.serratus.api.enus.java.LocalDateSerializer;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.slf4j.LoggerFactory;
import java.util.HashMap;
import org.apache.commons.lang3.StringUtils;
import java.text.NumberFormat;
import java.util.ArrayList;
import io.serratus.api.enus.config.ConfigKeys;
import org.apache.commons.collections.CollectionUtils;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.serratus.api.enus.request.api.ApiRequest;
import io.serratus.api.enus.java.ZonedDateTimeDeserializer;
import java.math.RoundingMode;
import org.slf4j.Logger;
import io.serratus.api.enus.writer.AllWriter;
import java.math.MathContext;
import io.vertx.core.Promise;
import org.apache.commons.text.StringEscapeUtils;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.vertx.core.Future;
import java.util.Objects;
import io.vertx.core.json.JsonArray;
import io.serratus.api.enus.base.BaseModel;
import io.serratus.api.enus.java.ZonedDateTimeSerializer;
import io.serratus.api.enus.model.biosample.BioSampleGenPage;
import org.apache.commons.lang3.math.NumberUtils;
import io.serratus.api.enus.wrap.Wrap;
import java.util.Optional;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;

/**
 **/

public abstract class BioSamplePageGen<DEV> extends BioSampleGenPage {
}

Create the LOG field inside the BioSamplePageGen class

	protected static final Logger LOG = LoggerFactory.getLogger(BioSamplePage.class);

Create the promiseDeepBioSamplePage method inside the BioSamplePageGen class

	public Future<Void> promiseDeepBioSamplePage(SiteRequestEnUS siteRequest_) {
		setSiteRequest_(siteRequest_);
		return promiseDeepBioSamplePage();
	}

Create the promiseDeepBioSamplePage method inside the BioSamplePageGen class

	public Future<Void> promiseDeepBioSamplePage() {
		Promise<Void> promise = Promise.promise();
		Promise<Void> promise2 = Promise.promise();
		promiseBioSamplePage(promise2);
		promise2.future().onSuccess(a -> {
			super.promiseDeepBioSampleGenPage(siteRequest_).onSuccess(b -> {
				promise.complete();
			}).onFailure(ex -> {
				promise.fail(ex);
			});
		}).onFailure(ex -> {
			promise.fail(ex);
		});
		return promise.future();
	}

Create the promiseBioSamplePage method inside the BioSamplePageGen class

	public Future<Void> promiseBioSamplePage(Promise<Void> promise) {
		Future.future(a -> a.complete()).compose(a -> {
			Promise<Void> promise2 = Promise.promise();
			try {
				promise2.complete();
			} catch(Exception ex) {
				promise2.fail(ex);
			}
			return promise2.future();
		}).onSuccess(a -> {
			promise.complete();
		}).onFailure(ex -> {
			promise.fail(ex);
		});
		return promise.future();
	}

Create the promiseDeepForClass method inside the BioSamplePageGen class

	public Future<Void> promiseDeepForClass(SiteRequestEnUS siteRequest_) {
		return promiseDeepBioSamplePage(siteRequest_);
	}

Create the siteRequestBioSamplePage method inside the BioSamplePageGen class

	public void siteRequestBioSamplePage(SiteRequestEnUS siteRequest_) {
			super.siteRequestBioSampleGenPage(siteRequest_);
	}

Create the siteRequestForClass method inside the BioSamplePageGen class

	public void siteRequestForClass(SiteRequestEnUS siteRequest_) {
		siteRequestBioSamplePage(siteRequest_);
	}

Create the obtainForClass method inside the BioSamplePageGen class

	public Object obtainForClass(String var) {
		String[] vars = StringUtils.split(var, ".");
		Object o = null;
		for(String v : vars) {
			if(o == null)
				o = obtainBioSamplePage(v);
			else if(o instanceof BaseModel) {
				BaseModel baseModel = (BaseModel)o;
				o = baseModel.obtainForClass(v);
			}
			else if(o instanceof Map) {
				Map<?, ?> map = (Map<?, ?>)o;
				o = map.get(v);
			}
		}
		return o;
	}

Create the obtainBioSamplePage method inside the BioSamplePageGen class

	public Object obtainBioSamplePage(String var) {
		BioSamplePage oBioSamplePage = (BioSamplePage)this;
		switch(var) {
			default:
				return super.obtainBioSampleGenPage(var);
		}
	}

Create the relateForClass method inside the BioSamplePageGen class

	public boolean relateForClass(String var, Object val) {
		String[] vars = StringUtils.split(var, ".");
		Object o = null;
		for(String v : vars) {
			if(o == null)
				o = relateBioSamplePage(v, val);
			else if(o instanceof BaseModel) {
				BaseModel baseModel = (BaseModel)o;
				o = baseModel.relateForClass(v, val);
			}
		}
		return o != null;
	}

Create the relateBioSamplePage method inside the BioSamplePageGen class

	public Object relateBioSamplePage(String var, Object val) {
		BioSamplePage oBioSamplePage = (BioSamplePage)this;
		switch(var) {
			default:
				return super.relateBioSampleGenPage(var, val);
		}
	}

Create the staticSetForClass method inside the BioSamplePageGen class

	public static Object staticSetForClass(String entityVar, SiteRequestEnUS siteRequest_, String o) {
		return staticSetBioSamplePage(entityVar,  siteRequest_, o);
	}

Create the staticSetBioSamplePage method inside the BioSamplePageGen class

	public static Object staticSetBioSamplePage(String entityVar, SiteRequestEnUS siteRequest_, String o) {
		switch(entityVar) {
			default:
				return BioSampleGenPage.staticSetBioSampleGenPage(entityVar,  siteRequest_, o);
		}
	}

Create the staticSolrForClass method inside the BioSamplePageGen class

	public static Object staticSolrForClass(String entityVar, SiteRequestEnUS siteRequest_, Object o) {
		return staticSolrBioSamplePage(entityVar,  siteRequest_, o);
	}

Create the staticSolrBioSamplePage method inside the BioSamplePageGen class

	public static Object staticSolrBioSamplePage(String entityVar, SiteRequestEnUS siteRequest_, Object o) {
		switch(entityVar) {
			default:
				return BioSampleGenPage.staticSolrBioSampleGenPage(entityVar,  siteRequest_, o);
		}
	}

Create the staticSolrStrForClass method inside the BioSamplePageGen class

	public static String staticSolrStrForClass(String entityVar, SiteRequestEnUS siteRequest_, Object o) {
		return staticSolrStrBioSamplePage(entityVar,  siteRequest_, o);
	}

Create the staticSolrStrBioSamplePage method inside the BioSamplePageGen class

	public static String staticSolrStrBioSamplePage(String entityVar, SiteRequestEnUS siteRequest_, Object o) {
		switch(entityVar) {
			default:
				return BioSampleGenPage.staticSolrStrBioSampleGenPage(entityVar,  siteRequest_, o);
		}
	}

Create the staticSolrFqForClass method inside the BioSamplePageGen class

	public static String staticSolrFqForClass(String entityVar, SiteRequestEnUS siteRequest_, String o) {
		return staticSolrFqBioSamplePage(entityVar,  siteRequest_, o);
	}

Create the staticSolrFqBioSamplePage method inside the BioSamplePageGen class

	public static String staticSolrFqBioSamplePage(String entityVar, SiteRequestEnUS siteRequest_, String o) {
		switch(entityVar) {
			default:
				return BioSampleGenPage.staticSolrFqBioSampleGenPage(entityVar,  siteRequest_, o);
		}
	}

Create the defineForClass method inside the BioSamplePageGen class

	public boolean defineForClass(String var, Object val) {
		String[] vars = StringUtils.split(var, ".");
		Object o = null;
		if(val != null) {
			for(String v : vars) {
				if(o == null)
					o = defineBioSamplePage(v, val);
				else if(o instanceof BaseModel) {
					BaseModel oBaseModel = (BaseModel)o;
					o = oBaseModel.defineForClass(v, val);
				}
			}
		}
		return o != null;
	}

Create the defineBioSamplePage method inside the BioSamplePageGen class

	public Object defineBioSamplePage(String var, Object val) {
		switch(var.toLowerCase()) {
			default:
				return super.defineBioSampleGenPage(var, val);
		}
	}

Create the apiRequestBioSamplePage method inside the BioSamplePageGen class

	public void apiRequestBioSamplePage() {
		ApiRequest apiRequest = Optional.ofNullable(siteRequest_).map(SiteRequestEnUS::getApiRequest_).orElse(null);
		Object o = Optional.ofNullable(apiRequest).map(ApiRequest::getOriginal).orElse(null);
		if(o != null && o instanceof BioSamplePage) {
			BioSamplePage original = (BioSamplePage)o;
			super.apiRequestBioSampleGenPage();
		}
	}

Create the toString method inside the BioSamplePageGen class

	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append(super.toString());
		return sb.toString();
	}

This message will not self-destruct.

This message will not self destruct, because this project is open source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant