com.github.dynamicextensionsalfresco.controlpanel.template.TemplateWebScript Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of control-panel Show documentation
Show all versions of control-panel Show documentation
Adds an OSGi container to alfresco repository supporting dynamic code reloading, classpath isolation and a bunch of other useful features
package com.github.dynamicextensionsalfresco.controlpanel.template;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import com.github.dynamicextensionsalfresco.webscripts.AnnotationWebScript;
import org.springframework.extensions.webscripts.WebScript;
import org.springframework.util.Assert;
import org.springframework.util.ClassUtils;
public class TemplateWebScript {
private final WebScript webScript;
public TemplateWebScript(final WebScript webScript) {
Assert.notNull(webScript);
this.webScript = webScript;
}
public String getMethod() {
return webScript.getDescription().getMethod();
}
public List getUris() {
return Arrays.asList(webScript.getDescription().getURIs());
}
public String getHandler() {
if (webScript instanceof AnnotationWebScript) {
final Method uriMethod = ((AnnotationWebScript) webScript).getHandlerMethods().getUriMethod();
return ClassUtils.getQualifiedMethodName(uriMethod);
} else {
return null;
}
}
public Set getFamilys() {
return webScript.getDescription().getFamilys();
}
public String getDescription() {
return webScript.getDescription().getDescription();
}
public String getDefaultFormat() {
return webScript.getDescription().getDefaultFormat();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy