// Path: src/main/java/uk/bl/odin/orcid/domain/SearchType.java
// public enum SearchType {
// 	PREFIX("prefix"), SOLR("solr"), EXACT("exact");
// 
// 	private final String stringValue;
// 
// 	private SearchType(final String s) {
// 		stringValue = s;
// 	}
// 
// 	public String toString() {
// 		return stringValue;
// 	}
// 
// 	public static SearchType fromString(String text) {
// 		if (text != null) {
// 			for (SearchType b : SearchType.values()) {
// 				if (text.equals(b.toString())) {
// 					return b;
// 				}
// 			}
// 		}
// 		throw new IllegalArgumentException("Invalid identifier type");
// 	}
// 
// }
// 
// Path: src/main/java/uk/bl/odin/orcid/guice/SelfInjectingServerResource.java
// public abstract class SelfInjectingServerResource extends ServerResource {
// 
// 	/**
// 	 * Implemented by DI framework-specific code. For example, with Guice, the
// 	 * statically-injected MembersInjector just calls
// 	 * {@code injector.injectMembers(object)}.
// 	 */
// 	public interface MembersInjector {
// 		void injectMembers(Object object);
// 	}
// 
// 	/**
// 	 * Subclasseses overriding this method must call {@code super.doInit()}
// 	 * first.
// 	 */
// 	protected void doInit() {
// 		ensureInjected(theMembersInjector);
// 	}
// 
// 	@Inject
// 	private void injected() { // NOPMD
// 		injected.set(true);
// 	}
// 
// 	void ensureInjected(MembersInjector membersInjector) {
// 		if (injected.compareAndSet(false, true)) {
// 			membersInjector.injectMembers(this);
// 		}
// 	}
// 
// 	/**
// 	 * Whether we've been injected yet. This protects against multiple injection
// 	 * of a subclass that gets injected before doInit is called.
// 	 */
// 	private final AtomicBoolean injected = new AtomicBoolean(false);
// 
// 	/**
// 	 * Must be statically injected by DI framework.
// 	 */
// 	@Inject
// 	private static volatile MembersInjector theMembersInjector;
// }


import java.util.ArrayList;
import java.util.List;
import org.restlet.data.Status;
import org.restlet.resource.Get;
import uk.bl.odin.orcid.client.constants.OrcidExternalIdentifierType;
import uk.bl.odin.orcid.client.constants.OrcidSearchField;
import uk.bl.odin.orcid.client.constants.OrcidWorkType;
import uk.bl.odin.orcid.domain.SearchType;
import uk.bl.odin.orcid.guice.SelfInjectingServerResource;
package uk.bl.odin.orcid.rest;




/**
 * Returns an enumerated list for an identifier type.
 * 
 * Supported types are "external" OrcidExternalIdentifierType "worktype"
 * OrcidWorkType "searchfield" OrcidSearchField "searchtype" SearchType
 * 
 * @author tom
 * 
 */
public class OrcidIdentifierResource extends SelfInjectingServerResource {

	@Get("json")
	public List<String> getIdentifierList() {
		List<String> ids = new ArrayList<String>();
		if (getAttribute("type").equals("external")) {
			for (OrcidExternalIdentifierType type : OrcidExternalIdentifierType.values()) {
				ids.add(type.toString());
			}
		} else if (getAttribute("type").equals("worktype")) {
			for (OrcidWorkType type : OrcidWorkType.values()) {
				ids.add(type.toString());
			}
		} else if (getAttribute("type").equals("searchfield")) {
			for (OrcidSearchField type : OrcidSearchField.values()) {
				ids.add(type.toString());
			}
		} else if (getAttribute("type").equals("searchtype")) {
// Path: src/main/java/uk/bl/odin/orcid/domain/SearchType.java
// public enum SearchType {
// 	PREFIX("prefix"), SOLR("solr"), EXACT("exact");
// 
// 	private final String stringValue;
// 
// 	private SearchType(final String s) {
// 		stringValue = s;
// 	}
// 
// 	public String toString() {
// 		return stringValue;
// 	}
// 
// 	public static SearchType fromString(String text) {
// 		if (text != null) {
// 			for (SearchType b : SearchType.values()) {
// 				if (text.equals(b.toString())) {
// 					return b;
// 				}
// 			}
// 		}
// 		throw new IllegalArgumentException("Invalid identifier type");
// 	}
// 
// }
// 
// Path: src/main/java/uk/bl/odin/orcid/guice/SelfInjectingServerResource.java
// public abstract class SelfInjectingServerResource extends ServerResource {
// 
// 	/**
// 	 * Implemented by DI framework-specific code. For example, with Guice, the
// 	 * statically-injected MembersInjector just calls
// 	 * {@code injector.injectMembers(object)}.
// 	 */
// 	public interface MembersInjector {
// 		void injectMembers(Object object);
// 	}
// 
// 	/**
// 	 * Subclasseses overriding this method must call {@code super.doInit()}
// 	 * first.
// 	 */
// 	protected void doInit() {
// 		ensureInjected(theMembersInjector);
// 	}
// 
// 	@Inject
// 	private void injected() { // NOPMD
// 		injected.set(true);
// 	}
// 
// 	void ensureInjected(MembersInjector membersInjector) {
// 		if (injected.compareAndSet(false, true)) {
// 			membersInjector.injectMembers(this);
// 		}
// 	}
// 
// 	/**
// 	 * Whether we've been injected yet. This protects against multiple injection
// 	 * of a subclass that gets injected before doInit is called.
// 	 */
// 	private final AtomicBoolean injected = new AtomicBoolean(false);
// 
// 	/**
// 	 * Must be statically injected by DI framework.
// 	 */
// 	@Inject
// 	private static volatile MembersInjector theMembersInjector;
// }


// Path: src/main/java/uk/bl/odin/orcid/rest/OrcidIdentifierResource.java
import java.util.ArrayList;
import java.util.List;
import org.restlet.data.Status;
import org.restlet.resource.Get;
import uk.bl.odin.orcid.client.constants.OrcidExternalIdentifierType;
import uk.bl.odin.orcid.client.constants.OrcidSearchField;
import uk.bl.odin.orcid.client.constants.OrcidWorkType;
import uk.bl.odin.orcid.domain.SearchType;
import uk.bl.odin.orcid.guice.SelfInjectingServerResource;

package uk.bl.odin.orcid.rest;




/**
 * Returns an enumerated list for an identifier type.
 * 
 * Supported types are "external" OrcidExternalIdentifierType "worktype"
 * OrcidWorkType "searchfield" OrcidSearchField "searchtype" SearchType
 * 
 * @author tom
 * 
 */
public class OrcidIdentifierResource extends SelfInjectingServerResource {

	@Get("json")
	public List<String> getIdentifierList() {
		List<String> ids = new ArrayList<String>();
		if (getAttribute("type").equals("external")) {
			for (OrcidExternalIdentifierType type : OrcidExternalIdentifierType.values()) {
				ids.add(type.toString());
			}
		} else if (getAttribute("type").equals("worktype")) {
			for (OrcidWorkType type : OrcidWorkType.values()) {
				ids.add(type.toString());
			}
		} else if (getAttribute("type").equals("searchfield")) {
			for (OrcidSearchField type : OrcidSearchField.values()) {
				ids.add(type.toString());
			}
		} else if (getAttribute("type").equals("searchtype")) {
			for (SearchType type : SearchType.values()) {