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 taxonomies related to RNA seqence runs. #69

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 taxonomies 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 taxonomies 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.taxonomy
  • The Java class name will be: TaxonomyPageGen
  • The path to the Java class will be: /usr/local/src/serratus-api/src/main/java/io/serratus/api/enus/model/taxonomy/TaxonomyPageGen.java
  • The Java class will extend: TaxonomyGenPage
package io.serratus.api.enus.model.taxonomy;

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.serratus.api.enus.model.taxonomy.TaxonomyGenPage;
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 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 TaxonomyPageGen<DEV> extends TaxonomyGenPage {
}

Create the LOG field inside the TaxonomyPageGen class

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

Create the promiseDeepTaxonomyPage method inside the TaxonomyPageGen class

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

Create the promiseDeepTaxonomyPage method inside the TaxonomyPageGen class

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

Create the promiseTaxonomyPage method inside the TaxonomyPageGen class

	public Future<Void> promiseTaxonomyPage(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 TaxonomyPageGen class

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

Create the siteRequestTaxonomyPage method inside the TaxonomyPageGen class

	public void siteRequestTaxonomyPage(SiteRequestEnUS siteRequest_) {
			super.siteRequestTaxonomyGenPage(siteRequest_);
	}

Create the siteRequestForClass method inside the TaxonomyPageGen class

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

Create the obtainForClass method inside the TaxonomyPageGen class

	public Object obtainForClass(String var) {
		String[] vars = StringUtils.split(var, ".");
		Object o = null;
		for(String v : vars) {
			if(o == null)
				o = obtainTaxonomyPage(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 obtainTaxonomyPage method inside the TaxonomyPageGen class

	public Object obtainTaxonomyPage(String var) {
		TaxonomyPage oTaxonomyPage = (TaxonomyPage)this;
		switch(var) {
			default:
				return super.obtainTaxonomyGenPage(var);
		}
	}

Create the relateForClass method inside the TaxonomyPageGen class

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

Create the relateTaxonomyPage method inside the TaxonomyPageGen class

	public Object relateTaxonomyPage(String var, Object val) {
		TaxonomyPage oTaxonomyPage = (TaxonomyPage)this;
		switch(var) {
			default:
				return super.relateTaxonomyGenPage(var, val);
		}
	}

Create the staticSetForClass method inside the TaxonomyPageGen class

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

Create the staticSetTaxonomyPage method inside the TaxonomyPageGen class

	public static Object staticSetTaxonomyPage(String entityVar, SiteRequestEnUS siteRequest_, String o) {
		switch(entityVar) {
			default:
				return TaxonomyGenPage.staticSetTaxonomyGenPage(entityVar,  siteRequest_, o);
		}
	}

Create the staticSolrForClass method inside the TaxonomyPageGen class

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

Create the staticSolrTaxonomyPage method inside the TaxonomyPageGen class

	public static Object staticSolrTaxonomyPage(String entityVar, SiteRequestEnUS siteRequest_, Object o) {
		switch(entityVar) {
			default:
				return TaxonomyGenPage.staticSolrTaxonomyGenPage(entityVar,  siteRequest_, o);
		}
	}

Create the staticSolrStrForClass method inside the TaxonomyPageGen class

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

Create the staticSolrStrTaxonomyPage method inside the TaxonomyPageGen class

	public static String staticSolrStrTaxonomyPage(String entityVar, SiteRequestEnUS siteRequest_, Object o) {
		switch(entityVar) {
			default:
				return TaxonomyGenPage.staticSolrStrTaxonomyGenPage(entityVar,  siteRequest_, o);
		}
	}

Create the staticSolrFqForClass method inside the TaxonomyPageGen class

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

Create the staticSolrFqTaxonomyPage method inside the TaxonomyPageGen class

	public static String staticSolrFqTaxonomyPage(String entityVar, SiteRequestEnUS siteRequest_, String o) {
		switch(entityVar) {
			default:
				return TaxonomyGenPage.staticSolrFqTaxonomyGenPage(entityVar,  siteRequest_, o);
		}
	}

Create the defineForClass method inside the TaxonomyPageGen 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 = defineTaxonomyPage(v, val);
				else if(o instanceof BaseModel) {
					BaseModel oBaseModel = (BaseModel)o;
					o = oBaseModel.defineForClass(v, val);
				}
			}
		}
		return o != null;
	}

Create the defineTaxonomyPage method inside the TaxonomyPageGen class

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

Create the apiRequestTaxonomyPage method inside the TaxonomyPageGen class

	public void apiRequestTaxonomyPage() {
		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 TaxonomyPage) {
			TaxonomyPage original = (TaxonomyPage)o;
			super.apiRequestTaxonomyGenPage();
		}
	}

Create the toString method inside the TaxonomyPageGen 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