001/**
002 *
003 * Copyright (c) 2014, the Railo Company Ltd. All rights reserved.
004 *
005 * This library is free software; you can redistribute it and/or
006 * modify it under the terms of the GNU Lesser General Public
007 * License as published by the Free Software Foundation; either 
008 * version 2.1 of the License, or (at your option) any later version.
009 * 
010 * This library is distributed in the hope that it will be useful,
011 * but WITHOUT ANY WARRANTY; without even the implied warranty of
012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013 * Lesser General Public License for more details.
014 * 
015 * You should have received a copy of the GNU Lesser General Public 
016 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
017 * 
018 **/
019package lucee.runtime;
020 
021import java.io.IOException;
022import java.io.OutputStream;
023import java.util.Locale;
024import java.util.TimeZone;
025
026import javax.servlet.ServletException;
027import javax.servlet.http.HttpServletRequest;
028import javax.servlet.http.HttpServletResponse;
029import javax.servlet.jsp.JspException;
030import javax.servlet.jsp.JspWriter;
031import javax.servlet.jsp.tagext.BodyTag;
032import javax.servlet.jsp.tagext.Tag;
033
034import lucee.commons.io.res.Resource;
035import lucee.runtime.config.ConfigWeb;
036import lucee.runtime.db.DataSourceManager;
037import lucee.runtime.debug.Debugger;
038import lucee.runtime.err.ErrorPage;
039import lucee.runtime.exp.PageException;
040import lucee.runtime.listener.ApplicationContext;
041import lucee.runtime.net.ftp.FTPPool;
042import lucee.runtime.query.QueryCache;
043import lucee.runtime.security.Credential;
044import lucee.runtime.type.Array;
045import lucee.runtime.type.Collection;
046import lucee.runtime.type.Iterator;
047import lucee.runtime.type.Query;
048import lucee.runtime.type.UDF;
049import lucee.runtime.type.ref.Reference;
050import lucee.runtime.type.scope.Application;
051import lucee.runtime.type.scope.Argument;
052import lucee.runtime.type.scope.CGI;
053import lucee.runtime.type.scope.Client;
054import lucee.runtime.type.scope.Cluster;
055import lucee.runtime.type.scope.Cookie;
056import lucee.runtime.type.scope.Form;
057import lucee.runtime.type.scope.Local;
058import lucee.runtime.type.scope.Request;
059import lucee.runtime.type.scope.Scope;
060import lucee.runtime.type.scope.Server;
061import lucee.runtime.type.scope.Session;
062import lucee.runtime.type.scope.Threads;
063import lucee.runtime.type.scope.URL;
064import lucee.runtime.type.scope.URLForm;
065import lucee.runtime.type.scope.Undefined;
066import lucee.runtime.type.scope.Variables;
067import lucee.runtime.util.VariableUtil;
068
069/**
070 * page context for every page object. 
071 * the PageContext is a jsp page context expanded by CFML functionality.
072 * for example you have the method getSession to get jsp combatible session object (HTTPSession)
073 *  and with sessionScope() you get CFML combatible session object (Struct,Scope).
074 */
075public abstract class PageContext extends javax.servlet.jsp.PageContext {
076 
077    /**
078     * returns matching scope
079     * @return scope matching to defined scope definition
080     * @param type type of scope (Scope.xx)
081     * @throws PageException
082     */
083        public abstract Scope scope(int type) throws PageException;
084
085    /**
086     * @return undefined scope, undefined scope is a placeholder for the scopecascading
087     */
088    public abstract Undefined undefinedScope();
089
090    /**
091     * @return variables scope
092     */
093    public abstract Variables variablesScope();
094
095    /**
096     * @return url scope
097     */
098    public abstract URL urlScope();
099
100    /**
101     * @return form scope
102     */
103    public abstract Form formScope();
104
105    /**
106     * @return scope mixed url and scope
107     */
108    public abstract URLForm urlFormScope();
109
110    /**
111     * @return request scope
112     */
113    public abstract Request requestScope();
114
115    /**
116     * @return request scope
117     */
118    public abstract CGI cgiScope();
119    
120    /**
121     * @return application scope
122     * @throws PageException
123     */
124    public abstract Application applicationScope() throws PageException;
125
126    /**
127     * @return arguments scope
128     */
129    public abstract Argument argumentsScope();
130
131    /** 
132     * return the argument scope 
133     * @param bind indicate that the Argument Scope is binded for using outsite of the udf
134     * @return Argument Scope 
135     */
136    public abstract Argument argumentsScope(boolean bind);
137
138    /**
139     * @return arguments scope
140     */
141    public abstract Local localScope();
142    
143    public abstract Local localScope(boolean bind);
144    
145    public abstract Object localGet() throws PageException;
146    
147    public abstract Object localGet(boolean bind) throws PageException;
148
149    public abstract Object localTouch() throws PageException;
150    
151    public abstract Object localTouch(boolean bind) throws PageException;
152
153    /**
154     * @return session scope
155     * @throws PageException
156     */
157    public abstract Session sessionScope() throws PageException;
158    
159    public abstract void setFunctionScopes(Local local,Argument argument);
160
161    /**
162     * @return server scope
163     * @throws PageException
164     */
165    public abstract Server serverScope() throws PageException;
166
167    /**
168     * @return cookie scope
169     */
170    public abstract Cookie cookieScope();
171
172    /**
173     * @return cookie scope
174     * @throws PageException
175     */
176    public abstract Client clientScope() throws PageException;
177    
178
179    public abstract Client clientScopeEL();
180    
181    /**
182     * @return cluster scope
183     * @throws PageException
184     */
185    public abstract Cluster clusterScope() throws PageException;
186
187    /**
188     * cluster scope
189     * @param create return null when false and scope does not exist
190     * @return cluster scope or null
191     * @throws PageException
192     */
193    public abstract Cluster clusterScope(boolean create) throws PageException;
194    
195    
196    /**
197     * set property at a collection object 
198     * @param coll Collection Object (Collection, HashMap aso.)
199     * @param key key of the new value
200     * @param value new Value
201     * @return value setted
202     * @throws PageException
203     * @deprecated use instead <code>{@link #set(Object, lucee.runtime.type.Collection.Key, Object)}</code>
204         */
205    public abstract Object set(Object coll, String key, Object value) throws PageException;
206
207    /**
208     * set property at a collection object 
209     * @param coll Collection Object (Collection, HashMap aso.)
210     * @param key key of the new value
211     * @param value new Value
212     * @return value setted
213     * @throws PageException
214     */
215    public abstract Object set(Object coll, Collection.Key key, Object value) throws PageException;
216
217    /**
218     * touch a new property, if property doesn't existset a Struct, otherwise do nothing
219     * @param coll Collection Object
220     * @param key key to touch
221     * @return Property
222     * @throws PageException
223     * @deprecated use instead <code>{@link #touch(Object, lucee.runtime.type.Collection.Key)}</code>
224         */
225    public abstract Object touch(Object coll, String key) throws PageException;
226
227    /**
228     * touch a new property, if property doesn't existset a Struct, otherwise do nothing
229     * @param coll Collection Object
230     * @param key key to touch
231     * @return Property
232     * @throws PageException
233     */
234    public abstract Object touch(Object coll, Collection.Key key) throws PageException;
235
236  
237    /**
238     * same like getProperty but return a collection object (QueryColumn) if return object is a Query
239     * @param coll Collection Object
240     * @param key key to touch
241     * @return Property or QueryColumn
242     * @throws PageException
243     * @deprecated use instead <code>{@link #getCollection(Object, lucee.runtime.type.Collection.Key, Object)}</code>
244         */
245    public abstract Object getCollection(Object coll, String key)
246            throws PageException;
247
248  
249    /**
250     * same like getProperty but return a collection object (QueryColumn) if return object is a Query
251     * @param coll Collection Object
252     * @param key key to touch
253     * @return Property or QueryColumn
254     * @throws PageException
255     */
256    public abstract Object getCollection(Object coll, Collection.Key key)
257            throws PageException;
258
259    /**
260     * same like getProperty but return a collection object (QueryColumn) if return object is a Query
261     * @param coll Collection Object
262     * @param key key to touch
263     * @return Property or QueryColumn
264     * @deprecated use instead <code>{@link #getCollection(Object, lucee.runtime.type.Collection.Key, Object)}</code>
265         */
266    public abstract Object getCollection(Object coll, String key, Object defaultValue);
267
268    /**
269     * same like getProperty but return a collection object (QueryColumn) if return object is a Query
270     * @param coll Collection Object
271     * @param key key to touch
272     * @return Property or QueryColumn
273     */
274    public abstract Object getCollection(Object coll, Collection.Key key, Object defaultValue);
275
276    /**
277     * 
278     * @param coll Collection to get value
279     * @param key key of the value
280     * @return return value of a Collection, throws Exception if value doesn't exist
281     * @throws PageException
282     * @deprecated use instead <code>{@link #get(Object, lucee.runtime.type.Collection.Key)}</code>
283         */
284    public abstract Object get(Object coll, String key) throws PageException;
285
286    /**
287     * 
288     * @param coll Collection to get value
289     * @param key key of the value
290     * @return return value of a Collection, throws Exception if value doesn't exist
291     * @throws PageException
292     */
293    public abstract Object get(Object coll, Collection.Key key) throws PageException;
294
295    /**
296     * 
297     * @param coll Collection to get value
298     * @param key key of the value
299     * @return return value of a Collection, throws Exception if value doesn't exist
300     * @throws PageException
301     * @deprecated use instead <code>{@link #getReference(Object, lucee.runtime.type.Collection.Key)}</code>
302         */
303    public abstract Reference getReference(Object coll, String key) throws PageException;
304
305    /**
306     * 
307     * @param coll Collection to get value
308     * @param key key of the value
309     * @return return value of a Collection, throws Exception if value doesn't exist
310     * @throws PageException
311         */
312    public abstract Reference getReference(Object coll, Collection.Key key) throws PageException;
313    
314    /* *
315     * get data from a scope
316     * @param scope
317     * @param key1
318     * @param key2
319     * @return
320     * @throws PageException
321     * /
322    public abstract Object get(Scope scope, String key1, String key2) throws PageException;
323    */
324    /* *
325     * get data from a scope
326     * @param scope
327     * @param key1
328     * @param key2
329     * @param key3
330     * @return
331     * @throws PageException
332     * /
333    public abstract Object get(Scope scope, String key1, String key2, String key3) throws PageException;
334    */
335    /* *
336     * get data from a scope
337     * @param scope
338     * @param key1
339     * @param key2
340     * @param key3
341     * @param key4
342     * @return
343     * @throws PageException
344     * /
345    public abstract Object get(Scope scope, String key1, String key2, String key3, String key4) throws PageException;
346    */
347    /* *
348     * get data from a scope
349     * @param scope
350     * @param key1
351     * @param key2
352     * @param key3
353     * @param key4
354     * @param key5
355     * @return
356     * @throws PageException
357     * /
358    public abstract Object get(Scope scope, String key1, String key2, String key3, String key4, String key5) throws PageException;
359    */
360    /* *
361     * get data from a scope
362     * @param scope
363     * @param key1
364     * @param key2
365     * @param key3
366     * @param key4
367     * @param key5
368     * @param key6
369     * @return
370     * @throws PageException
371     * /
372    public abstract Object get(Scope scope, String key1, String key2, String key3, String key4, String key5, String key6) throws PageException;
373*/
374    
375    
376    
377    
378    
379    
380    
381    
382    
383    
384    
385    /* *
386     * set data from a scope
387     * @param scope
388     * @param key1
389     * @param key2
390     * @return
391     * @throws PageException
392     * /
393    public abstract Object set(Scope scope, String key1, String key2, Object value) throws PageException;
394    */
395    /* *
396     * set data from a scope
397     * @param scope
398     * @param key1
399     * @param key2
400     * @param key3
401     * @return
402     * @throws PageException
403     * /
404    public abstract Object set(Scope scope, String key1, String key2, String key3, Object value) throws PageException;
405    */
406    /* *
407     * set data from a scope
408     * @param scope
409     * @param key1
410     * @param key2
411     * @param key3
412     * @param key4
413     * @return
414     * @throws PageException
415     * /
416    public abstract Object set(Scope scope, String key1, String key2, String key3, String key4, Object value) throws PageException;
417    */
418    /* *
419     * set data from a scope
420     * @param scope
421     * @param key1
422     * @param key2
423     * @param key3
424     * @param key4
425     * @param key5
426     * @return
427     * @throws PageException
428     * /
429    public abstract Object set(Scope scope, String key1, String key2, String key3, String key4, String key5, Object value) throws PageException;
430    */
431    /* *
432     * set data from a scope
433     * @param scope
434     * @param key1
435     * @param key2
436     * @param key3
437     * @param key4
438     * @param key5
439     * @param key6
440     * @return
441     * @throws PageException
442     * /
443    public abstract Object set(Scope scope, String key1, String key2, String key3, String key4, String key5, String key6, Object value) throws PageException;
444*/
445    
446
447    
448    /**
449     * 
450     * @param coll Collection to get value
451     * @param key key of the value
452     * @return return value of a Collection, return null if value not exist
453     * @deprecated use instead <code>{@link #get(Object, lucee.runtime.type.Collection.Key, Object)}</code>
454         */
455    public abstract Object get(Object coll, String key, Object defaultValue);
456    
457    /**
458     * 
459     * @param coll Collection to get value
460     * @param key key of the value
461     * @return return value of a Collection, return null if value not exist
462     */
463    public abstract Object get(Object coll, Collection.Key key, Object defaultValue);
464
465    /**
466     * sets a value by string syntax ("scopename.key.key" -> "url.name")
467     * @param var Variable String name to set
468     * @param value value to set
469     * @return setted value
470     * @throws PageException
471     */
472    public abstract Object setVariable(String var, Object value)
473            throws PageException;
474
475    /**
476     * 
477     * @param var variable name to get
478     * @return return a value by string syntax ("scopename.key.key" -> "url.name")
479     * @throws PageException
480     **/
481    public abstract Object getVariable(String var) throws PageException;
482
483    /**
484     * evaluate given expression
485     * @param expression expression to evaluate
486     * @return return value generated by expression or null
487     * @throws PageException
488     **/
489    public abstract Object evaluate(String expression) throws PageException;
490    
491    public abstract String serialize(Object expression) throws PageException;
492
493    /**
494     * 
495     * @param var variable name to get
496     * @return return a value by string syntax ("scopename.key.key" -> "url.name")
497     * @throws PageException
498     */
499    public abstract Object removeVariable(String var) throws PageException;
500
501    /**
502     * get variable from string definition and cast it to a Query Object
503     * @param key Variable Name to get
504     * @return Query
505     * @throws PageException
506     */
507    public abstract Query getQuery(String key) throws PageException;
508
509
510    public abstract Query getQuery(Object value) throws PageException;
511    
512    /**
513     * write a value to the header of the response
514     * @param name name of the value to set
515     * @param value value to set
516     */
517    public abstract void setHeader(String name, String value);
518
519    /**
520     * @return returns the cfid of the actuell user
521     */
522    public abstract String getCFID();
523
524    /**
525     * @return returns the actuell cftoken of the user 
526     */
527    public abstract String getCFToken();
528
529    
530    /**
531     * @return return the session id
532     */
533    public abstract String getJSessionId();
534    
535    /**
536     * @return returns the urltoken of the actuell user
537     */
538    public abstract String getURLToken();
539
540    /**
541     * @return returns the page context id
542     */
543    public abstract int getId();
544    
545    public abstract JspWriter getRootWriter();
546
547    /**
548     * @return Returns the locale.
549     */
550    public abstract Locale getLocale();
551    
552    /**
553     * @param strLocale The locale to set as String.
554     */
555    public abstract void setLocale(Locale locale);
556    
557    /**
558     * @param strLocale The locale to set as String.
559     * @throws PageException
560     * @deprecated use instead <code>{@link #setLocale(Locale)}</code> 
561     */
562    public abstract void setLocale(String strLocale) throws PageException;
563    
564    /**
565     * @return Returns the Config Object of the PageContext.
566     */
567    public abstract ConfigWeb getConfig();
568    
569    /**
570     * return HttpServletRequest, getRequest only returns ServletRequest
571     * @return HttpServletRequest
572     */
573    public abstract HttpServletRequest getHttpServletRequest();
574
575    /**
576     * return HttpServletResponse, getResponse only returns ServletResponse
577     * @return HttpServletResponse
578     */
579    public abstract HttpServletResponse getHttpServletResponse();
580    
581    public abstract OutputStream getResponseStream() throws IOException;
582    
583    /**
584     * returns the tag that is in use
585     * @return Returns the currentTag.
586     */
587    public abstract Tag getCurrentTag();
588
589    /**
590     * @return Returns the applicationContext.
591     */
592    public abstract ApplicationContext getApplicationContext();
593    
594
595    /**
596     * Writes a String to the Response Buffer
597     * @param str
598     * @throws IOException
599     */
600    public abstract void write(String str) throws IOException ;
601    
602    /**
603     * Writes a String to the Response Buffer,also when cfoutputonly is true and execution 
604     * is outside of a cfoutput
605     * @param str
606     * @throws IOException
607     */
608    public abstract void forceWrite(String str) throws IOException;
609    
610    /**
611     * Writes a String to the Response Buffer,also when cfoutputonly is true and execution is outside of a cfoutput
612     * @param o
613     * @throws IOException
614     * @throws PageException 
615     */
616    public abstract void writePSQ(Object o) throws IOException, PageException ;
617    
618
619    /**
620     * @return the current template PageSource
621     */
622    public abstract PageSource getCurrentPageSource(); // FUTURE deprecated
623    // FUTURE public abstract PageSource getCurrentPageSource(PageSource defaultValue);
624    
625    
626    /**
627     * @return the current template PageSource
628     */
629    public abstract PageSource getCurrentTemplatePageSource();
630    
631    /**
632     * @return base template file
633     */
634    public abstract PageSource getBasePageSource();
635    
636    /**
637     * sets the pagecontext silent
638     * @return  return setting that was before
639     */
640    public abstract boolean setSilent();
641    
642    /**
643     * unsets the pagecontext silent
644     * @return return setting that was before
645     */
646    public abstract boolean unsetSilent();
647    
648
649    /**
650     * return debugger of the page Context
651     * @return debugger
652     */
653    public abstract Debugger getDebugger();
654    
655
656    /**
657     * @return Returns the executionTime.
658     */
659    public abstract int getExecutionTime();
660
661    /**
662     * @param executionTime The executionTime to set.
663     */
664    public abstract void setExecutionTime(int executionTime);
665    
666
667    /**
668     * @return Returns the remoteUser.
669     * @throws PageException
670     */
671    public abstract Credential getRemoteUser() throws PageException;
672    
673    /**
674     * clear the remote user
675     */
676    public abstract void clearRemoteUser();
677    
678    /**
679     * @param remoteUser The remoteUser to set.
680     */
681    public abstract void setRemoteUser(Credential remoteUser);
682    
683    /**
684     * array of current template stack
685     * @return array
686     * @throws PageException 
687     */
688    public abstract Array getTemplatePath() throws PageException;
689    
690    /**
691     * returns the current level, how deep is the page stack
692     * @return level
693     */
694    public abstract int getCurrentLevel();
695
696    /**
697     * @return Returns the variableUtil.
698     */
699    public abstract VariableUtil getVariableUtil();
700    
701    
702    /**
703     * @param applicationContext The applicationContext to set.
704     */
705    public abstract void setApplicationContext(ApplicationContext applicationContext);
706    
707    
708        public abstract PageSource toPageSource(Resource res, PageSource defaultValue);
709
710    /**
711     * set a other variable scope
712     * @param scope
713     */
714    public abstract void setVariablesScope(Variables scope);
715    
716
717    /**  
718     * includes a path from a absolute path
719     * @param source absolute path as file object
720     * @throws ServletException
721     * @deprecated use other doInclude methods
722     */
723    public abstract void doInclude(PageSource source) throws  PageException;
724
725    /**  
726     * includes a path from a absolute path
727     * @param source absolute path as file object
728     * @param runOnce include only once per request
729     * @throws ServletException
730     */
731    public abstract void doInclude(PageSource[] source, boolean runOnce) throws  PageException;
732    
733    /**  
734     * includes a path from a absolute path
735     * @param source absolute path as file object
736     * @throws ServletException
737     * @Deprecated used <code> doInclude(String source, boolean runOnce)</code> instead.
738     */
739    public abstract void doInclude(String source) throws  PageException;
740    
741    
742    /**  
743     * includes a path from a absolute path
744     * @param source absolute path as file object
745     * @param runOnce include only once per request
746     * @throws ServletException
747     */
748    public abstract void doInclude(String source, boolean runOnce) throws  PageException;
749    
750    
751    /**
752     * clear the actuell output buffer
753     */
754    public abstract void clear();
755
756    /**
757     * @return returns the ftp pool
758     */
759    public abstract FTPPool getFTPPool();
760
761    /**
762     * @return return the request timeout for this pagecontext in milli seconds
763     */
764    public abstract long getRequestTimeout();
765    
766
767    /**
768     * @return returns the query cache
769     */
770    public abstract QueryCache getQueryCache();
771    
772    /**
773     * @param requestTimeout The requestTimeout to set.
774     */
775    public abstract void setRequestTimeout(long requestTimeout);
776    
777    /**
778     * sets state of cfoutput only
779     * @param boolEnablecfoutputonly
780     */
781    public abstract void setCFOutputOnly(boolean boolEnablecfoutputonly);
782    
783    /**
784     * returns if single quotes will be preserved inside a query tag (psq=preserve single quote)
785     * @return preserve single quote
786     */
787    public abstract boolean getPsq();
788    
789    /**
790     * Close the response stream.
791     */
792    public abstract void close();
793    
794    /**
795     * adds a PageSource
796     * @param ps
797     * @param alsoInclude 
798     */
799    public abstract void addPageSource(PageSource ps, boolean alsoInclude);
800    /**
801     * clear all catches
802     */
803    public abstract void clearCatch();
804    
805    /**
806     * execute a request n the pageConext
807     * @param relPath
808     * @throws PageException 
809     * @throws IOException
810     */
811    public abstract void execute(String relPath, boolean throwException) throws PageException;
812    
813    public abstract void executeRest(String relPath, boolean throwException) throws PageException;
814    
815    /**
816     * Flush Content of buffer to the response stream of the Socket.
817     */
818    public abstract void flush();
819    
820    /**
821     * call a UDF Function and return "return value" of the function
822     * @param coll Collection of the UDF Function
823     * @param key name of the function
824     * @param args arguments to call the function
825     * @return return value of the function
826     * @throws PageException
827     */
828    public abstract Object getFunction(Object coll, String key, Object[] args) throws PageException;
829    
830    /**
831     * call a UDF Function and return "return value" of the function
832     * @param coll Collection of the UDF Function
833     * @param key name of the function
834     * @param args arguments to call the function
835     * @return return value of the function
836     * @throws PageException
837     */
838    public abstract Object getFunction(Object coll, Collection.Key key, Object[] args) throws PageException;
839    
840    
841    /**
842     * call a UDF Function and return "return value" of the function
843     * @param coll Collection of the UDF Function
844     * @param key name of the function
845     * @param args arguments to call the function
846     * @return return value of the function
847     * @throws PageException
848     */
849    public abstract Object getFunctionWithNamedValues(Object coll, String key, Object[] args) throws PageException;
850    
851    
852    /**
853     * call a UDF Function and return "return value" of the function
854     * @param coll Collection of the UDF Function
855     * @param key name of the function
856     * @param args arguments to call the function
857     * @return return value of the function
858     * @throws PageException
859     */
860    public abstract Object getFunctionWithNamedValues(Object coll, Collection.Key key, Object[] args) throws PageException;
861
862    /**
863     * get variable from string definition and cast it to a Iterator Object
864     * @param key Variable Name to get
865     * @return Iterator
866     * @throws PageException
867     */
868    public abstract Iterator getIterator(String key) throws PageException;
869     
870    /**
871     * @return directory of root template file
872     */
873    public abstract Resource getRootTemplateDirectory();
874    
875    /**
876     * @return Returns the startTime.
877     */
878    public abstract long getStartTime();
879    
880
881    /**
882     * @return Returns the thread.
883     */
884    public abstract Thread getThread();
885    
886    /**
887     * specialised method for handlePageException with argument Exception or Throwable
888     * @param pe Page Exception
889     */
890    public abstract void handlePageException(PageException pe);
891    
892    /* *
893     * @param applicationFile
894     * @throws ServletException
895     */
896    //public abstract void includeOnRequestEnd(PageSource applicationFile) throws ServletException;
897    
898    /**
899     * ends a cfoutput block
900     */
901    public abstract void outputEnd();
902    
903    /**
904     * starts a cfoutput block
905     */
906    public abstract void outputStart();
907    
908
909    /**
910     * remove the last PageSource
911     * @param alsoInclude 
912     */
913    public abstract void removeLastPageSource(boolean alsoInclude);
914    
915    /**
916     * puts a tag back to pool
917     * @param tag tags to puts back
918     * @throws PageException
919     */
920    public abstract void reuse(Tag tag) throws PageException;
921    
922    /**
923     * sets a excption
924     * @param t
925     * @return PageExcption
926     */
927    public abstract PageException setCatch(Throwable t);
928    
929    public abstract PageException getCatch();
930
931    public abstract void setCatch(PageException pe);
932    public abstract void setCatch(PageException pe,boolean caught, boolean store);
933    
934    public abstract void exeLogStart(int position,String id);
935        public abstract void exeLogEnd(int position,String id);
936    
937    
938    /**
939     * sets state of cfoutput only
940     * @param enablecfoutputonly
941     */
942    public abstract void setCFOutputOnly(short enablecfoutputonly);
943    
944    /**
945     * sets the error page
946     * @param ep
947     */
948    public abstract void setErrorPage(ErrorPage ep);
949    
950    /**
951     * sets if inside a query tag single quote will be preserved (preserve single quote)
952     * @param psq sets preserve single quote for query
953     */
954    public abstract void setPsq(boolean psq);
955    
956    /**
957     * return throwed exception
958     * @throws PageException
959     */
960    public abstract void throwCatch() throws PageException;
961    
962    /**
963     * returns a tag from tag handler pool
964     * @param tagClass class to load from ta handler pool
965     * @return tag matching class
966     * @throws PageException
967     * @deprecated use instead <code>use(String tagClassName)</code>
968     */ 
969    public abstract Tag use(Class tagClass) throws PageException;
970    
971    /**
972     * returns a tag from tag handler pool
973     * @param tagClassName
974     * @return matching tag
975     * @throws PageException
976     */
977    public abstract Tag use(String tagClassName) throws PageException;
978    
979    /**
980     * @return undefined scope, undefined scope is a placeholder for the scopecascading
981     */
982    public abstract Undefined us();
983    
984
985    /**
986     * compile a CFML Template
987     * @param templatePath 
988     * @throws PageException 
989     * @deprecated use instead <code>compile(PageSource pageSource)</code>
990     */
991    public abstract void compile(String templatePath)throws PageException;
992    
993    /**
994     * compile a CFML Template
995     * @param pageSource 
996     * @throws PageException 
997     */
998    public abstract void compile(PageSource pageSource)throws PageException;
999    
1000    /**
1001     * init body of a tag
1002     * @param bodyTag
1003     * @param state
1004     * @throws JspException
1005     */
1006    public abstract void initBody(BodyTag bodyTag, int state) throws JspException ;
1007    
1008    /**
1009     * release body of a tag
1010     * @param bodyTag
1011     * @param state
1012     */
1013    public abstract void releaseBody(BodyTag bodyTag, int state);
1014
1015    
1016    
1017    /**
1018     * @param type
1019     * @param name
1020     * @param defaultValue
1021     * @throws PageException 
1022     */
1023    public abstract void param(String type, String name, Object defaultValue) throws PageException;
1024
1025    /**
1026     * @param type
1027     * @param name
1028     * @param defaultValue
1029     * @param maxLength
1030     * @throws PageException 
1031     */
1032    public abstract void param(String type, String name, Object defaultValue, int maxLength) throws PageException;
1033    
1034    
1035
1036    /**
1037     * @param type
1038     * @param name
1039     * @param defaultValue
1040     * @throws PageException 
1041     */
1042    public abstract void param(String type, String name, Object defaultValue, String pattern) throws PageException;
1043    /**
1044     * @param type
1045     * @param name
1046     * @param defaultValue
1047     * @throws PageException 
1048     */
1049    public abstract void param(String type, String name, Object defaultValue, double min, double max) throws PageException;
1050    
1051    //public abstract PageContext clonePageContext();
1052    
1053    public abstract boolean isCFCRequest();
1054    
1055
1056        public abstract DataSourceManager getDataSourceManager();
1057
1058        public abstract CFMLFactory getCFMLFactory();
1059        
1060        public abstract PageContext getParentPageContext();
1061
1062        /**
1063         * @param name
1064         * @return
1065         * @deprecated use instead <code>setThreadScope(Collection.Key name,Threads t)</code>
1066         */
1067        public abstract Threads getThreadScope(String name);
1068        
1069        public abstract Threads getThreadScope(Collection.Key name);
1070        
1071        /**
1072         * set a thread to the context
1073         * @param name
1074         * @param t
1075         * @deprecated use instead <code>setThreadScope(Collection.Key name,Threads t)</code>
1076         */
1077        public abstract void setThreadScope(String name,Threads t);
1078        
1079        public abstract void setThreadScope(Collection.Key name,Threads t);
1080
1081        /**
1082         * @return return a Array with names off all threads running.
1083         */
1084        public abstract String[] getThreadScopeNames();
1085        
1086        public abstract boolean hasFamily();
1087        
1088        public abstract Component loadComponent(String compPath) throws PageException;
1089
1090        //public abstract void setActiveComponent(Component component);
1091
1092    /**
1093     * @return Returns the active Component.
1094     */
1095    public abstract Component getActiveComponent();
1096
1097        public abstract UDF getActiveUDF();
1098
1099        public abstract TimeZone getTimeZone();
1100
1101        public abstract void setTimeZone(TimeZone timeZone);
1102
1103        public abstract short getSessionType();
1104
1105
1106}