package org.openntf.xrest.xsp.model;

import org.openntf.xrest.xsp.model.strategy.AllByKey;
import org.openntf.xrest.xsp.model.strategy.AllByView;
import org.openntf.xrest.xsp.model.strategy.GetByFT;
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_FORMULA(GetBySelect.class), SELECT_ALL_DOCUMENTS_BY_VIEW(AllByView.class), SELECT_ALL_DOCUMENTS_FROM_VIEW_BY_KEY(AllByKey.class),
	SELECT_ATTACHMENT(SelectAttachment.class);
	
	private final Class<? extends StrategyModel<?>> strategyClass;
	
	private Strategy(Class<? extends StrategyModel<?>> cl ) {
		this.strategyClass = cl;
	}
	
	public StrategyModel<?> constructModel() throws InstantiationException, IllegalAccessException {
		return strategyClass.newInstance();
	}
}

@@ -140,16 +140,76 @@
 ByView;%0A
+import org.openntf.xrest.xsp.model.strategy.AllByViewPaged;%0A
 import o
@@ -606,33 +606,34 @@
 GetByKey.class),
- 
+%0A%09
 SELECT_DOCUMENT_
@@ -649,33 +649,34 @@
 etByUNID.class),
- 
+%0A%09
 SELECT_DOCUMENTS
@@ -700,25 +700,26 @@
 ByFT.class),
- 
+%0A%09
 SELECT_DOCUM
@@ -745,33 +745,34 @@
 BySelect.class),
- 
+%0A%09
 SELECT_ALL_DOCUM
@@ -801,17 +801,77 @@
 .class),
- 
+%0A%09SELECT_ALL_DOCUMENTS_BY_VIEW_PAGED(AllByViewPaged.class),%0A%09
 SELECT_A
@@ -959,19 +959,19 @@
 t.class)
+,
 ;%0A
-%09
 %0A%09privat
@@ -1027,17 +1027,16 @@
 yClass;%0A
-%09
 %0A%09privat
@@ -1046,16 +1046,22 @@
 trategy(
+final 
 Class%3C? 
@@ -1088,17 +1088,16 @@
 l%3C?%3E%3E cl
- 
 ) %7B%0A%09%09th
@@ -1122,17 +1122,16 @@
  cl;%0A%09%7D%0A
-%09
 %0A%09public

add new strategy implemented in AllByViewPaged