1 /**
2 * Copyright (C) 2005-2009 Alfresco Software Limited.
3 *
4 * This file is part of the Spring Surf Extension project.
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19 package org.springframework.extensions.webscripts.processor;
20
21 import org.springframework.extensions.surf.core.processor.ProcessorExtension;
22
23 import com.caucho.quercus.module.AbstractQuercusModule;
24
25 /**
26 *
27 *
28 * @author Roy Wetherall
29 */
30 public class PHPObjectExtension extends AbstractQuercusModule implements ProcessorExtension
31 {
32 /** The name of the extension */
33 protected String extensionName;
34
35 /** The PHP processor */
36 protected PHPTemplateProcessor phpProcessor;
37
38 /** The extension implementation class */
39 protected String extensionClass;
40
41 /**
42 * Sets the extension name
43 *
44 * @param extensionName the extension name
45 */
46 public void setExtensionName(String extensionName)
47 {
48 this.extensionName = extensionName;
49 }
50
51 /**
52 * @see org.alfresco.service.cmr.repository.ProcessorExtension#getExtensionName()
53 */
54 public String getExtensionName()
55 {
56 return this.extensionName;
57 }
58
59 /**
60 * Sets the extension class name
61 *
62 * @param extensionClass the extension class name
63 */
64 public void setExtensionClass(String extensionClass)
65 {
66 this.extensionClass = extensionClass;
67 }
68
69 /**
70 * Get the extension class
71 *
72 * @return String the extension class
73 */
74 public String getExtensionClass()
75 {
76 return extensionClass;
77 }
78
79 /**
80 * Sets the PHP Processor
81 *
82 * @param phpProcessor the PHP processor
83 */
84 public void setPhpProcessor(PHPTemplateProcessor phpProcessor)
85 {
86 this.phpProcessor = phpProcessor;
87 }
88
89 /**
90 * Register the method extension with the PHP processor.
91 */
92 @SuppressWarnings("unchecked")
93 public void register()
94 {
95 this.phpProcessor.registerProcessorExtension(this);
96 }
97 }