/* * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6) * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle * * This file is part of Jalview. * * Jalview is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. * * Jalview is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with Jalview. If not, see . */ package jalview.ws.rest; import jalview.datamodel.SequenceI; import jalview.io.packed.DataProvider; import jalview.io.packed.SimpleDataProvider; import jalview.io.packed.DataProvider.JvDataType; import jalview.util.GroupUrlLink.UrlStringTooLongException; import jalview.util.Platform; import jalview.ws.rest.params.Alignment; import jalview.ws.rest.params.AnnotationFile; import jalview.ws.rest.params.SeqGroupIndexVector; import java.util.ArrayList; import java.util.HashMap; import java.util.Hashtable; import java.util.List; import java.util.Map; public class RestServiceDescription { /** * @param details * @param postUrl * @param urlSuffix * @param inputParams * @param hseparable * @param vseparable * @param gapCharacter */ public RestServiceDescription(String action,String description,String name, String postUrl, String urlSuffix, Map inputParams, boolean hseparable, boolean vseparable, char gapCharacter) { super(); this.details = new UIinfo(); details.Action= action; details.description = description; details.Name = name; this.postUrl = postUrl; this.urlSuffix = urlSuffix; this.inputParams = inputParams; this.hseparable = hseparable; this.vseparable = vseparable; this.gapCharacter = gapCharacter; } /** * Service UI Info { Action, Specific Name of Service, Brief Description } */ public class UIinfo { String Action; String Name; String description; } UIinfo details = new UIinfo(); /** Service base URL */ String postUrl; /** * suffix that should be added to any url used if it does not already end in the suffix. */ String urlSuffix; /** input info given as key/value pairs - mapped to post arguments */ Map inputParams=new HashMap(); /** * assigns the given inputType it to its corresponding input parameter token it.token * @param it */ public void setInputParam(InputType it) { inputParams.put(it.token, it); } /** * remove the given input type it from the set of service input parameters. * @param it */ public void removeInputParam(InputType it) { inputParams.remove(it.token); } /** * service requests alignment data */ boolean aligndata; /** * service requests alignment and/or seuqence annotationo data */ boolean annotdata; /** * service requests partitions defined over input (alignment) data */ boolean partitiondata; /** * process ths input data and set the appropriate shorthand flags describing the input the service wants */ public void setInvolvesFlags() { aligndata = inputInvolves(Alignment.class); annotdata = inputInvolves(AnnotationFile.class); partitiondata = inputInvolves(SeqGroupIndexVector.class); } /** Service return info { alignment, annotation file (loaded back on to alignment), tree (loaded back on to alignment), sequence annotation - loaded back on to alignment), text report, pdb structures with sequence mapping ) * */ /** Start with bare minimum: input is alignment + groups on alignment * * @author JimP * */ /** * Helper class based on the UrlLink class which enables URLs to be * constructed from sequences or IDs associated with a group of sequences. URL * definitions consist of a pipe separated string containing a