package org.openntf.xrest.xsp.model;

import org.openntf.xrest.xsp.model.strategy.AllByKey;
import org.openntf.xrest.xsp.model.strategy.AllByKeyPaged;
import org.openntf.xrest.xsp.model.strategy.AllByView;
import org.openntf.xrest.xsp.model.strategy.AllByViewPaged;
import org.openntf.xrest.xsp.model.strategy.GetByFT;
import org.openntf.xrest.xsp.model.strategy.GetByFTPaged;
import org.openntf.xrest.xsp.model.strategy.GetByKey;
import org.openntf.xrest.xsp.model.strategy.GetBySelect;
import org.openntf.xrest.xsp.model.strategy.GetByUNID;
import org.openntf.xrest.xsp.model.strategy.SelectAttachment;
import org.openntf.xrest.xsp.model.strategy.StrategyModel;

public enum Strategy {
	SELECT_DOCUMENT_FROM_VIEW_BY_KEY(GetByKey.class),
	SELECT_DOCUMENT_BY_UNID(GetByUNID.class),
	SELECT_DOCUMENTS_BY_SEARCH_FT(GetByFT.class),
	SELECT_DOCUMENTS_BY_SEARCH_FT_PAGED(GetByFTPaged.class),
	SELECT_DOCUMENTS_BY_FORMULA(GetBySelect.class),
	SELECT_ALL_DOCUMENTS_BY_VIEW(AllByView.class),
	SELECT_ALL_DOCUMENTS_BY_VIEW_PAGED(AllByViewPaged.class),
	SELECT_ALL_DOCUMENTS_FROM_VIEW_BY_KEY(AllByKey.class),
	SELECT_ALL_DOCUMENTS_FROM_VIEW_BY_KEY_PAGED(AllByKeyPaged.class),
	SELECT_ATTACHMENT(SelectAttachment.class),;

	private final Class<? extends StrategyModel<?, ?>> strategyClass;

	private Strategy(final Class<? extends StrategyModel<?, ?>> cl) {
		this.strategyClass = cl;
	}

	public StrategyModel<?, ?> constructModel() throws InstantiationException, IllegalAccessException {
		return strategyClass.newInstance();
	}
}

@@ -481,16 +481,78 @@
 Select;%0A
+import org.openntf.xrest.xsp.model.strategy.GetBySelectPaged;%0A
 import o
@@ -983,32 +983,92 @@
 ySelect.class),%0A
+%09SELECT_DOCUMENTS_BY_FORMULA_PAGED(GetBySelectPaged.class),%0A
 %09SELECT_ALL_DOCU

add new SELECT_DOCUMENTS_BY_FORMULA_PAGED strategy