mirror of
https://github.com/apache/struts.git
synced 2026-08-06 07:06:58 +00:00
Moves deprecated plugins to struts-archive repo
This commit is contained in:
@@ -1,72 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<version>2.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>struts2-codebehind-plugin</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
<name>Struts 2 Codebehind Plugin</name>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>struts2-junit-plugin</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mockobjects</groupId>
|
||||
<artifactId>mockobjects-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>jsp-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
</project>
|
||||
-281
@@ -1,281 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.codebehind;
|
||||
|
||||
import com.opensymphony.xwork2.Action;
|
||||
import com.opensymphony.xwork2.ActionContext;
|
||||
import com.opensymphony.xwork2.ObjectFactory;
|
||||
import com.opensymphony.xwork2.Result;
|
||||
import com.opensymphony.xwork2.UnknownHandler;
|
||||
import com.opensymphony.xwork2.XWorkException;
|
||||
import com.opensymphony.xwork2.config.Configuration;
|
||||
import com.opensymphony.xwork2.config.ConfigurationException;
|
||||
import com.opensymphony.xwork2.config.entities.ActionConfig;
|
||||
import com.opensymphony.xwork2.config.entities.InterceptorLocator;
|
||||
import com.opensymphony.xwork2.config.entities.PackageConfig;
|
||||
import com.opensymphony.xwork2.config.entities.ResultConfig;
|
||||
import com.opensymphony.xwork2.config.entities.ResultTypeConfig;
|
||||
import com.opensymphony.xwork2.config.providers.InterceptorBuilder;
|
||||
import com.opensymphony.xwork2.inject.Inject;
|
||||
import com.opensymphony.xwork2.util.ClassLoaderUtil;
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.Collections;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Uses code-behind conventions to solve the two unknown problems.
|
||||
*/
|
||||
public class CodebehindUnknownHandler implements UnknownHandler {
|
||||
|
||||
protected String defaultPackageName;
|
||||
protected ServletContext servletContext;
|
||||
protected Map<String,ResultTypeConfig> resultsByExtension;
|
||||
protected String templatePathPrefix;
|
||||
protected Configuration configuration;
|
||||
protected ObjectFactory objectFactory;
|
||||
|
||||
protected static final Logger LOG = LoggerFactory.getLogger(CodebehindUnknownHandler.class);
|
||||
|
||||
@Inject
|
||||
public CodebehindUnknownHandler(@Inject("struts.codebehind.defaultPackage") String defaultPackage,
|
||||
@Inject Configuration configuration) {
|
||||
|
||||
this.configuration = configuration;
|
||||
this.defaultPackageName = defaultPackage;
|
||||
resultsByExtension = new LinkedHashMap<String,ResultTypeConfig>();
|
||||
PackageConfig parentPackage = configuration.getPackageConfig(defaultPackageName);
|
||||
if (parentPackage == null) {
|
||||
throw new ConfigurationException("Unknown parent package: "+parentPackage);
|
||||
}
|
||||
Map<String,ResultTypeConfig> results = parentPackage.getAllResultTypeConfigs();
|
||||
|
||||
resultsByExtension.put("jsp", results.get("dispatcher"));
|
||||
resultsByExtension.put("vm", results.get("velocity"));
|
||||
resultsByExtension.put("ftl", results.get("freemarker"));
|
||||
|
||||
}
|
||||
|
||||
@Inject("struts.codebehind.pathPrefix")
|
||||
public void setPathPrefix(String prefix) {
|
||||
this.templatePathPrefix=prefix;
|
||||
}
|
||||
|
||||
@Inject
|
||||
public void setServletContext(ServletContext servletContext) {
|
||||
this.servletContext = servletContext;
|
||||
}
|
||||
|
||||
@Inject
|
||||
public void setObjectFactory(ObjectFactory objectFactory) {
|
||||
this.objectFactory = objectFactory;
|
||||
}
|
||||
|
||||
public ActionConfig handleUnknownAction(String namespace, String actionName)
|
||||
throws XWorkException {
|
||||
String pathPrefix = determinePath(templatePathPrefix, namespace);
|
||||
ActionConfig actionConfig = null;
|
||||
for (String ext : resultsByExtension.keySet()) {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Trying to locate unknown action template with extension ."+ext+" in directory "+pathPrefix);
|
||||
}
|
||||
String path = string(pathPrefix, actionName, "." , ext);
|
||||
try {
|
||||
if (locateTemplate(path) != null) {
|
||||
actionConfig = buildActionConfig(path, namespace, actionName, resultsByExtension.get(ext));
|
||||
break;
|
||||
}
|
||||
} catch (MalformedURLException e) {
|
||||
LOG.warn("Unable to parse template path: "+path+", skipping...");
|
||||
}
|
||||
}
|
||||
return actionConfig;
|
||||
}
|
||||
|
||||
/** Create a new ActionConfig in the default package, with the default interceptor stack and a single result */
|
||||
protected ActionConfig buildActionConfig(String path, String namespace, String actionName, ResultTypeConfig resultTypeConfig) {
|
||||
final PackageConfig pkg = configuration.getPackageConfig(defaultPackageName);
|
||||
return new ActionConfig.Builder(defaultPackageName, "execute", pkg.getDefaultClassRef())
|
||||
.addInterceptors(InterceptorBuilder.constructInterceptorReference(new InterceptorLocator() {
|
||||
public Object getInterceptorConfig(String name) {
|
||||
return pkg.getAllInterceptorConfigs().get(name); // recurse package hiearchy
|
||||
}
|
||||
}, pkg.getFullDefaultInterceptorRef(),
|
||||
Collections.EMPTY_MAP, null, objectFactory))
|
||||
.addResultConfig(new ResultConfig.Builder(Action.SUCCESS, resultTypeConfig.getClassName())
|
||||
.addParams(resultTypeConfig.getParams())
|
||||
.addParam(resultTypeConfig.getDefaultResultParam(), path)
|
||||
.build())
|
||||
.build();
|
||||
}
|
||||
|
||||
public Result handleUnknownResult(ActionContext actionContext, String actionName,
|
||||
ActionConfig actionConfig, String resultCode) throws XWorkException {
|
||||
|
||||
Result result = null;
|
||||
PackageConfig pkg = configuration.getPackageConfig(actionConfig.getPackageName());
|
||||
String ns = pkg.getNamespace();
|
||||
String pathPrefix = determinePath(templatePathPrefix, ns);
|
||||
|
||||
for (String ext : resultsByExtension.keySet()) {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Trying to locate result with extension ."+ext+" in directory "+pathPrefix);
|
||||
}
|
||||
String path = string(pathPrefix, actionName, "-", resultCode, "." , ext);
|
||||
try {
|
||||
if (locateTemplate(path) != null) {
|
||||
result = buildResult(path, resultCode, resultsByExtension.get(ext), actionContext);
|
||||
break;
|
||||
}
|
||||
} catch (MalformedURLException e) {
|
||||
LOG.warn("Unable to parse template path: "+path+", skipping...");
|
||||
}
|
||||
|
||||
path = string(pathPrefix, actionName, "." , ext);
|
||||
try {
|
||||
if (locateTemplate(path) != null) {
|
||||
result = buildResult(path, resultCode, resultsByExtension.get(ext), actionContext);
|
||||
break;
|
||||
}
|
||||
} catch (MalformedURLException e) {
|
||||
LOG.warn("Unable to parse template path: "+path+", skipping...");
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
protected Result buildResult(String path, String resultCode, ResultTypeConfig config, ActionContext invocationContext) {
|
||||
ResultConfig resultConfig = new ResultConfig.Builder(resultCode, config.getClassName())
|
||||
.addParams(config.getParams())
|
||||
.addParam(config.getDefaultResultParam(), path)
|
||||
.build();
|
||||
try {
|
||||
return objectFactory.buildResult(resultConfig, invocationContext.getContextMap());
|
||||
} catch (Exception e) {
|
||||
throw new XWorkException("Unable to build codebehind result", e, resultConfig);
|
||||
}
|
||||
}
|
||||
|
||||
protected String string(String... parts) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
for (String part : parts) {
|
||||
sb.append(part);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
protected String joinPaths(boolean leadingSlash, boolean trailingSlash, String... parts) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if (leadingSlash) {
|
||||
sb.append("/");
|
||||
}
|
||||
for (String part : parts) {
|
||||
if (sb.length() > 0 && sb.charAt(sb.length()-1) != '/') {
|
||||
sb.append("/");
|
||||
}
|
||||
sb.append(stripSlashes(part));
|
||||
}
|
||||
if (trailingSlash) {
|
||||
if (sb.length() > 0 && sb.charAt(sb.length()-1) != '/') {
|
||||
sb.append("/");
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
protected String determinePath(String prefix, String ns) {
|
||||
return joinPaths(true, true, prefix, ns);
|
||||
}
|
||||
|
||||
protected String stripLeadingSlash(String path) {
|
||||
String result;
|
||||
if (path != null) {
|
||||
if (path.length() > 0) {
|
||||
if (path.charAt(0) == '/') {
|
||||
result = path.substring(1);
|
||||
} else {
|
||||
result = path;
|
||||
}
|
||||
} else {
|
||||
result = path;
|
||||
}
|
||||
} else {
|
||||
result = "";
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
protected String stripTrailingSlash(String path) {
|
||||
String result;
|
||||
|
||||
if (path != null) {
|
||||
if (path.length() > 0) {
|
||||
if (path.charAt(path.length() - 1) == '/') {
|
||||
result = path.substring(0, path.length()-1);
|
||||
} else {
|
||||
result = path;
|
||||
}
|
||||
} else {
|
||||
result = path;
|
||||
}
|
||||
} else {
|
||||
result = "";
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
protected String stripSlashes(String path) {
|
||||
return stripLeadingSlash(stripTrailingSlash(path));
|
||||
}
|
||||
|
||||
URL locateTemplate(String path) throws MalformedURLException {
|
||||
URL template = servletContext.getResource(path);
|
||||
if (template != null) {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Loaded template '" + path + "' from servlet context.");
|
||||
}
|
||||
} else {
|
||||
template = ClassLoaderUtil.getResource(stripLeadingSlash(path), getClass());
|
||||
if (template != null && LOG.isDebugEnabled()) {
|
||||
LOG.debug("Loaded template '" + stripLeadingSlash(path) + "' from class path.");
|
||||
}
|
||||
}
|
||||
return template;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Not used
|
||||
*/
|
||||
public Object handleUnknownActionMethod(Object action, String methodName) throws NoSuchMethodException {
|
||||
throw new NoSuchMethodException();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.config;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface Action {
|
||||
public static final String DEFAULT_NAMESPACE = "__default_namespace__";
|
||||
String namespace() default DEFAULT_NAMESPACE;
|
||||
String name();
|
||||
}
|
||||
-761
@@ -1,761 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.config;
|
||||
|
||||
import com.opensymphony.xwork2.Action;
|
||||
import com.opensymphony.xwork2.config.Configuration;
|
||||
import com.opensymphony.xwork2.config.ConfigurationException;
|
||||
import com.opensymphony.xwork2.config.PackageProvider;
|
||||
import com.opensymphony.xwork2.config.entities.ActionConfig;
|
||||
import com.opensymphony.xwork2.config.entities.PackageConfig;
|
||||
import com.opensymphony.xwork2.config.entities.ResultConfig;
|
||||
import com.opensymphony.xwork2.config.entities.ResultTypeConfig;
|
||||
import com.opensymphony.xwork2.inject.Inject;
|
||||
import com.opensymphony.xwork2.util.ClassLoaderUtil;
|
||||
import com.opensymphony.xwork2.util.ResolverUtil;
|
||||
import com.opensymphony.xwork2.util.ResolverUtil.ClassTest;
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import java.lang.reflect.Modifier;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* ClasspathPackageProvider loads the configuration
|
||||
* by scanning the classpath or selected packages for Action classes.
|
||||
* <p>
|
||||
* This provider is only invoked if one or more action packages are passed to the dispatcher,
|
||||
* usually from the web.xml.
|
||||
* Configurations are created for objects that either implement Action or have classnames that end with "Action".
|
||||
*/
|
||||
public class ClasspathPackageProvider implements PackageProvider {
|
||||
|
||||
/**
|
||||
* The default page prefix (or "path").
|
||||
* Some applications may place pages under "/WEB-INF" as an extreme security precaution.
|
||||
*/
|
||||
protected static final String DEFAULT_PAGE_PREFIX = "struts.configuration.classpath.defaultPagePrefix";
|
||||
|
||||
/**
|
||||
* The default page prefix (none).
|
||||
*/
|
||||
private String defaultPagePrefix = "";
|
||||
|
||||
/**
|
||||
* The default page extension, to use in place of ".jsp".
|
||||
*/
|
||||
protected static final String DEFAULT_PAGE_EXTENSION = "struts.configuration.classpath.defaultPageExtension";
|
||||
|
||||
/**
|
||||
* The defacto default page extension, usually associated with JavaServer Pages.
|
||||
*/
|
||||
private String defaultPageExtension = ".jsp";
|
||||
|
||||
/**
|
||||
* A setting to indicate a custom default parent package,
|
||||
* to use in place of "struts-default".
|
||||
*/
|
||||
protected static final String DEFAULT_PARENT_PACKAGE = "struts.configuration.classpath.defaultParentPackage";
|
||||
|
||||
/**
|
||||
* A setting to disable action scanning.
|
||||
*/
|
||||
protected static final String DISABLE_ACTION_SCANNING = "struts.configuration.classpath.disableActionScanning";
|
||||
|
||||
/**
|
||||
* Name of the framework's default configuration package,
|
||||
* that application configuration packages automatically inherit.
|
||||
*/
|
||||
private String defaultParentPackage = "struts-default";
|
||||
|
||||
/**
|
||||
* The default page prefix (or "path").
|
||||
* Some applications may place pages under "/WEB-INF" as an extreme security precaution.
|
||||
*/
|
||||
protected static final String FORCE_LOWER_CASE = "struts.configuration.classpath.forceLowerCase";
|
||||
|
||||
/**
|
||||
* Whether to use a lowercase letter as the initial letter of an action.
|
||||
* If false, actions will retain the initial uppercase letter from the Action class.
|
||||
* (<code>view.action</code> (true) versus <code>View.action</code> (false)).
|
||||
*/
|
||||
private boolean forceLowerCase = true;
|
||||
|
||||
protected static final String CLASS_SUFFIX = "struts.codebehind.classSuffix";
|
||||
/**
|
||||
* Default suffix that can be used to indicate POJO "Action" classes.
|
||||
*/
|
||||
protected String classSuffix = "Action";
|
||||
|
||||
protected static final String CHECK_IMPLEMENTS_ACTION = "struts.codebehind.checkImplementsAction";
|
||||
|
||||
/**
|
||||
* When testing a class, check that it implements Action
|
||||
*/
|
||||
protected boolean checkImplementsAction = true;
|
||||
|
||||
protected static final String CHECK_ANNOTATION = "struts.codebehind.checkAnnotation";
|
||||
|
||||
/**
|
||||
* When testing a class, check that it has an @Action annotation
|
||||
*/
|
||||
protected boolean checkAnnotation = true;
|
||||
|
||||
/**
|
||||
* Helper class to scan class path for server pages.
|
||||
*/
|
||||
private PageLocator pageLocator = new ClasspathPageLocator();
|
||||
|
||||
/**
|
||||
* Flag to indicate the packages have been loaded.
|
||||
*
|
||||
* @see #loadPackages
|
||||
* @see #needsReload
|
||||
*/
|
||||
private boolean initialized = false;
|
||||
|
||||
private boolean disableActionScanning = false;
|
||||
|
||||
private PackageLoader packageLoader;
|
||||
|
||||
/**
|
||||
* Logging instance for this class.
|
||||
*/
|
||||
private static final Logger LOG = LoggerFactory.getLogger(ClasspathPackageProvider.class);
|
||||
|
||||
/**
|
||||
* The XWork Configuration for this application.
|
||||
*
|
||||
* @see #init
|
||||
*/
|
||||
private Configuration configuration;
|
||||
|
||||
private String actionPackages;
|
||||
|
||||
private ServletContext servletContext;
|
||||
|
||||
public ClasspathPackageProvider() {
|
||||
}
|
||||
|
||||
/**
|
||||
* PageLocator defines a locate method that can be used to discover server pages.
|
||||
*/
|
||||
public static interface PageLocator {
|
||||
public URL locate(String path);
|
||||
}
|
||||
|
||||
/**
|
||||
* ClasspathPathLocator searches the classpath for server pages.
|
||||
*/
|
||||
public static class ClasspathPageLocator implements PageLocator {
|
||||
public URL locate(String path) {
|
||||
return ClassLoaderUtil.getResource(path, getClass());
|
||||
}
|
||||
}
|
||||
|
||||
@Inject("actionPackages")
|
||||
public void setActionPackages(String packages) {
|
||||
this.actionPackages = packages;
|
||||
}
|
||||
|
||||
public void setServletContext(ServletContext ctx) {
|
||||
this.servletContext = ctx;
|
||||
}
|
||||
|
||||
/**
|
||||
* Disables action scanning.
|
||||
*
|
||||
* @param disableActionScanning True to disable
|
||||
*/
|
||||
@Inject(value=DISABLE_ACTION_SCANNING, required=false)
|
||||
public void setDisableActionScanning(String disableActionScanning) {
|
||||
this.disableActionScanning = "true".equals(disableActionScanning);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check that the class implements Action
|
||||
*
|
||||
* @param checkImplementsAction True to check
|
||||
*/
|
||||
@Inject(value=CHECK_IMPLEMENTS_ACTION, required=false)
|
||||
public void setCheckImplementsAction(String checkImplementsAction) {
|
||||
this.checkImplementsAction = "true".equals(checkImplementsAction);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check that the class has an @Action annotation
|
||||
*
|
||||
* @param checkImplementsAction True to check
|
||||
*/
|
||||
@Inject(value=CHECK_ANNOTATION, required=false)
|
||||
public void setCheckAnnotation(String checkAnnotation) {
|
||||
this.checkAnnotation = "true".equals(checkAnnotation);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a default parent package for the actions.
|
||||
*
|
||||
* @param defaultParentPackage the new defaultParentPackage
|
||||
*/
|
||||
@Inject(value=DEFAULT_PARENT_PACKAGE, required=false)
|
||||
public void setDefaultParentPackage(String defaultParentPackage) {
|
||||
this.defaultParentPackage = defaultParentPackage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a default page extension to use when locating pages.
|
||||
*
|
||||
* @param defaultPageExtension the new defaultPageExtension
|
||||
*/
|
||||
@Inject(value=DEFAULT_PAGE_EXTENSION, required=false)
|
||||
public void setDefaultPageExtension(String defaultPageExtension) {
|
||||
this.defaultPageExtension = defaultPageExtension;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reigster a default page prefix to use when locating pages.
|
||||
*
|
||||
* @param defaultPagePrefix the defaultPagePrefix to set
|
||||
*/
|
||||
@Inject(value=DEFAULT_PAGE_PREFIX, required=false)
|
||||
public void setDefaultPagePrefix(String defaultPagePrefix) {
|
||||
this.defaultPagePrefix = defaultPagePrefix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Default suffix that can be used to indicate POJO "Action" classes.
|
||||
*
|
||||
* @param classSuffix the classSuffix to set
|
||||
*/
|
||||
@Inject(value=CLASS_SUFFIX, required=false)
|
||||
public void setClassSuffix(String classSuffix) {
|
||||
this.classSuffix = classSuffix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether to use a lowercase letter as the initial letter of an action.
|
||||
*
|
||||
* @param force If false, actions will retain the initial uppercase letter from the Action class.
|
||||
* (<code>view.action</code> (true) versus <code>View.action</code> (false)).
|
||||
*/
|
||||
@Inject(value=FORCE_LOWER_CASE, required=false)
|
||||
public void setForceLowerCase(String force) {
|
||||
this.forceLowerCase = "true".equals(force);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a PageLocation to use to scan for server pages.
|
||||
*
|
||||
* @param locator
|
||||
*/
|
||||
public void setPageLocator(PageLocator locator) {
|
||||
this.pageLocator = locator;
|
||||
}
|
||||
|
||||
/**
|
||||
* Scan a list of packages for Action classes.
|
||||
*
|
||||
* This method loads classes that implement the Action interface
|
||||
* or have a class name that ends with the letters "Action".
|
||||
*
|
||||
* @param pkgs A list of packages to load
|
||||
* @see #processActionClass
|
||||
*/
|
||||
protected void loadPackages(String[] pkgs) {
|
||||
|
||||
packageLoader = new PackageLoader();
|
||||
ResolverUtil<Class> resolver = new ResolverUtil<Class>();
|
||||
resolver.find(createActionClassTest(), pkgs);
|
||||
|
||||
Set<? extends Class<? extends Class>> actionClasses = resolver.getClasses();
|
||||
for (Object obj : actionClasses) {
|
||||
Class cls = (Class) obj;
|
||||
if (!Modifier.isAbstract(cls.getModifiers())) {
|
||||
processActionClass(cls, pkgs);
|
||||
}
|
||||
}
|
||||
|
||||
for (PackageConfig config : packageLoader.createPackageConfigs()) {
|
||||
configuration.addPackageConfig(config.getName(), config);
|
||||
}
|
||||
}
|
||||
|
||||
protected ClassTest createActionClassTest() {
|
||||
return new ClassTest() {
|
||||
// Match Action implementations and classes ending with "Action"
|
||||
public boolean matches(Class type) {
|
||||
// TODO: should also find annotated classes
|
||||
return ((checkImplementsAction && Action.class.isAssignableFrom(type)) ||
|
||||
type.getSimpleName().endsWith(getClassSuffix()) ||
|
||||
(checkAnnotation && type.getAnnotation(org.apache.struts2.config.Action.class) != null));
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
protected String getClassSuffix() {
|
||||
return classSuffix;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a default action mapping for a class instance.
|
||||
*
|
||||
* The namespace annotation is honored, if found, otherwise
|
||||
* the Java package is converted into the namespace
|
||||
* by changing the dots (".") to slashes ("/").
|
||||
*
|
||||
* @param cls Action or POJO instance to process
|
||||
* @param pkgs List of packages that were scanned for Actions
|
||||
*/
|
||||
protected void processActionClass(Class<?> cls, String[] pkgs) {
|
||||
String name = cls.getName();
|
||||
String actionPackage = cls.getPackage().getName();
|
||||
String actionNamespace = null;
|
||||
String actionName = null;
|
||||
|
||||
org.apache.struts2.config.Action actionAnn =
|
||||
(org.apache.struts2.config.Action) cls.getAnnotation(org.apache.struts2.config.Action.class);
|
||||
if (actionAnn != null) {
|
||||
actionName = actionAnn.name();
|
||||
if (actionAnn.namespace().equals(org.apache.struts2.config.Action.DEFAULT_NAMESPACE)) {
|
||||
actionNamespace = "";
|
||||
} else {
|
||||
actionNamespace = actionAnn.namespace();
|
||||
}
|
||||
} else {
|
||||
for (String pkg : pkgs) {
|
||||
if (name.startsWith(pkg)) {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("ClasspathPackageProvider: Processing class "+name);
|
||||
}
|
||||
name = name.substring(pkg.length() + 1);
|
||||
|
||||
actionNamespace = "";
|
||||
actionName = name;
|
||||
int pos = name.lastIndexOf('.');
|
||||
if (pos > -1) {
|
||||
actionNamespace = "/" + name.substring(0, pos).replace('.','/');
|
||||
actionName = name.substring(pos+1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
// Truncate Action suffix if found
|
||||
if (actionName.endsWith(getClassSuffix())) {
|
||||
actionName = actionName.substring(0, actionName.length() - getClassSuffix().length());
|
||||
}
|
||||
|
||||
// Force initial letter of action to lowercase, if desired
|
||||
if ((forceLowerCase) && (actionName.length() > 1)) {
|
||||
int lowerPos = actionName.lastIndexOf('/') + 1;
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(actionName.substring(0, lowerPos));
|
||||
sb.append(Character.toLowerCase(actionName.charAt(lowerPos)));
|
||||
sb.append(actionName.substring(lowerPos + 1));
|
||||
actionName = sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
PackageConfig.Builder pkgConfig = loadPackageConfig(actionNamespace, actionPackage, cls);
|
||||
|
||||
// In case the package changed due to namespace annotation processing
|
||||
if (!actionPackage.equals(pkgConfig.getName())) {
|
||||
actionPackage = pkgConfig.getName();
|
||||
}
|
||||
|
||||
List<PackageConfig> parents = findAllParentPackages(cls);
|
||||
if (parents.size() > 0) {
|
||||
pkgConfig.addParents(parents);
|
||||
|
||||
// Try to guess the namespace from the first package
|
||||
PackageConfig firstParent = parents.get(0);
|
||||
if (StringUtils.isEmpty(pkgConfig.getNamespace()) && StringUtils.isNotEmpty(firstParent.getNamespace())) {
|
||||
pkgConfig.namespace(firstParent.getNamespace());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ResultTypeConfig defaultResultType = packageLoader.getDefaultResultType(pkgConfig);
|
||||
ActionConfig actionConfig = new ActionConfig.Builder(actionPackage, actionName, cls.getName())
|
||||
.addResultConfigs(new ResultMap<String,ResultConfig>(cls, actionName, defaultResultType))
|
||||
.build();
|
||||
pkgConfig.addActionConfig(actionName, actionConfig);
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds all parent packages by first looking at the ParentPackage annotation on the package, then the class
|
||||
* @param cls The action class
|
||||
* @return A list of unique packages to add
|
||||
*/
|
||||
private List<PackageConfig> findAllParentPackages(Class<?> cls) {
|
||||
|
||||
List<PackageConfig> parents = new ArrayList<PackageConfig>();
|
||||
// Favor parent package annotations from the package
|
||||
Set<String> parentNames = new LinkedHashSet<String>();
|
||||
ParentPackage annotation = cls.getPackage().getAnnotation(ParentPackage.class);
|
||||
if (annotation != null) {
|
||||
parentNames.addAll(Arrays.asList(annotation.value()));
|
||||
}
|
||||
annotation = cls.getAnnotation(ParentPackage.class);
|
||||
if (annotation != null) {
|
||||
parentNames.addAll(Arrays.asList(annotation.value()));
|
||||
}
|
||||
if (parentNames.size() > 0) {
|
||||
for (String parent : parentNames) {
|
||||
PackageConfig parentPkg = configuration.getPackageConfig(parent);
|
||||
if (parentPkg == null) {
|
||||
throw new ConfigurationException("ClasspathPackageProvider: Unable to locate parent package "+parent, annotation);
|
||||
}
|
||||
parents.add(parentPkg);
|
||||
}
|
||||
}
|
||||
return parents;
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds or creates the package configuration for an Action class.
|
||||
*
|
||||
* The namespace annotation is honored, if found,
|
||||
* and the namespace is checked for a parent configuration.
|
||||
*
|
||||
* @param actionNamespace The configuration namespace
|
||||
* @param actionPackage The Java package containing our Action classes
|
||||
* @param actionClass The Action class instance
|
||||
* @return PackageConfig object for the Action class
|
||||
*/
|
||||
protected PackageConfig.Builder loadPackageConfig(String actionNamespace, String actionPackage, Class actionClass) {
|
||||
PackageConfig.Builder parent = null;
|
||||
|
||||
// Check for the @Namespace annotation
|
||||
if (actionClass != null) {
|
||||
Namespace ns = (Namespace) actionClass.getAnnotation(Namespace.class);
|
||||
if (ns != null) {
|
||||
parent = loadPackageConfig(actionNamespace, actionPackage, null);
|
||||
actionNamespace = ns.value();
|
||||
actionPackage = actionClass.getName();
|
||||
|
||||
// See if the namespace has been overridden by the @Action annotation
|
||||
} else {
|
||||
org.apache.struts2.config.Action actionAnn =
|
||||
(org.apache.struts2.config.Action) actionClass.getAnnotation(org.apache.struts2.config.Action.class);
|
||||
if (actionAnn != null && !actionAnn.DEFAULT_NAMESPACE.equals(actionAnn.namespace())) {
|
||||
// we pass null as the namespace in case the parent package hasn't been loaded yet
|
||||
parent = loadPackageConfig(null, actionPackage, null);
|
||||
actionPackage = actionClass.getName();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PackageConfig.Builder pkgConfig = packageLoader.getPackage(actionPackage);
|
||||
if (pkgConfig == null) {
|
||||
pkgConfig = new PackageConfig.Builder(actionPackage);
|
||||
|
||||
pkgConfig.namespace(actionNamespace);
|
||||
if (parent == null) {
|
||||
PackageConfig cfg = configuration.getPackageConfig(defaultParentPackage);
|
||||
if (cfg != null) {
|
||||
pkgConfig.addParent(cfg);
|
||||
} else {
|
||||
throw new ConfigurationException("ClasspathPackageProvider: Unable to locate default parent package: " +
|
||||
defaultParentPackage);
|
||||
}
|
||||
}
|
||||
|
||||
packageLoader.registerPackage(pkgConfig);
|
||||
|
||||
// if the parent package was first created by a child, ensure the namespace is correct
|
||||
} else if (pkgConfig.getNamespace() == null) {
|
||||
pkgConfig.namespace(actionNamespace);
|
||||
}
|
||||
|
||||
if (parent != null) {
|
||||
packageLoader.registerChildToParent(pkgConfig, parent);
|
||||
}
|
||||
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("class:"+actionClass+" parent:"+parent+" current:"+(pkgConfig != null ? pkgConfig.getName() : ""));
|
||||
}
|
||||
|
||||
return pkgConfig;
|
||||
}
|
||||
|
||||
/**
|
||||
* Default destructor. Override to provide behavior.
|
||||
*/
|
||||
public void destroy() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Register this application's configuration.
|
||||
*
|
||||
* @param config The configuration for this application.
|
||||
*/
|
||||
public void init(Configuration config) {
|
||||
this.configuration = config;
|
||||
}
|
||||
|
||||
/**
|
||||
* Clears and loads the list of packages registered at construction.
|
||||
*
|
||||
* @throws ConfigurationException
|
||||
*/
|
||||
public void loadPackages() throws ConfigurationException {
|
||||
if (actionPackages != null && !disableActionScanning) {
|
||||
String[] names = actionPackages.split("\\s*[,]\\s*");
|
||||
// Initialize the classloader scanner with the configured packages
|
||||
if (names.length > 0) {
|
||||
setPageLocator(new ServletContextPageLocator(servletContext));
|
||||
}
|
||||
loadPackages(names);
|
||||
}
|
||||
initialized = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether the packages have been initialized.
|
||||
*
|
||||
* @return True if the packages have been initialized
|
||||
*/
|
||||
public boolean needsReload() {
|
||||
return !initialized;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates ResultConfig objects from result annotations,
|
||||
* and if a result isn't found, creates it on the fly.
|
||||
*/
|
||||
class ResultMap<K,V> extends HashMap<K,V> {
|
||||
private Class actionClass;
|
||||
private String actionName;
|
||||
private ResultTypeConfig defaultResultType;
|
||||
|
||||
public ResultMap(Class actionClass, String actionName, ResultTypeConfig defaultResultType) {
|
||||
this.actionClass = actionClass;
|
||||
this.actionName = actionName;
|
||||
this.defaultResultType = defaultResultType;
|
||||
|
||||
// check if any annotations are around
|
||||
while (!actionClass.getName().equals(Object.class.getName())) {
|
||||
//noinspection unchecked
|
||||
Results results = (Results) actionClass.getAnnotation(Results.class);
|
||||
if (results != null) {
|
||||
// first check here...
|
||||
for (int i = 0; i < results.value().length; i++) {
|
||||
Result result = results.value()[i];
|
||||
ResultConfig config = createResultConfig(result);
|
||||
if (!containsKey((K)config.getName())) {
|
||||
put((K)config.getName(), (V)config);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// what about a single Result annotation?
|
||||
Result result = (Result) actionClass.getAnnotation(Result.class);
|
||||
if (result != null) {
|
||||
ResultConfig config = createResultConfig(result);
|
||||
if (!containsKey((K)config.getName())) {
|
||||
put((K)config.getName(), (V)config);
|
||||
}
|
||||
}
|
||||
|
||||
actionClass = actionClass.getSuperclass();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Extracts result name and value and calls {@link #createResultConfig}.
|
||||
*
|
||||
* @param result Result annotation reference representing result type to create
|
||||
* @return New or cached ResultConfig object for result
|
||||
*/
|
||||
protected ResultConfig createResultConfig(Result result) {
|
||||
Class<? extends Object> cls = result.type();
|
||||
if (cls == NullResult.class) {
|
||||
cls = null;
|
||||
}
|
||||
return createResultConfig(result.name(), cls, result.value(), createParameterMap(result.params()));
|
||||
}
|
||||
|
||||
protected Map<String, String> createParameterMap(String[] parms) {
|
||||
Map<String, String> map = new HashMap<String, String>();
|
||||
int subtract = parms.length % 2;
|
||||
if(subtract != 0) {
|
||||
LOG.warn("Odd number of result parameters key/values specified. The final one will be ignored.");
|
||||
}
|
||||
for (int i = 0; i < parms.length - subtract; i++) {
|
||||
String key = parms[i++];
|
||||
String value = parms[i];
|
||||
map.put(key, value);
|
||||
if(LOG.isDebugEnabled()) {
|
||||
LOG.debug("Adding parmeter["+key+":"+value+"] to result.");
|
||||
}
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a default ResultConfig,
|
||||
* using either the resultClass or the default ResultType for configuration package
|
||||
* associated this ResultMap class.
|
||||
*
|
||||
* @param key The result type name
|
||||
* @param resultClass The class for the result type
|
||||
* @param location Path to the resource represented by this type
|
||||
* @return A ResultConfig for key mapped to location
|
||||
*/
|
||||
private ResultConfig createResultConfig(Object key, Class<? extends Object> resultClass,
|
||||
String location,
|
||||
Map<? extends Object,? extends Object > configParams) {
|
||||
if (resultClass == null) {
|
||||
configParams = defaultResultType.getParams();
|
||||
String className = defaultResultType.getClassName();
|
||||
try {
|
||||
resultClass = ClassLoaderUtil.loadClass(className, getClass());
|
||||
} catch (ClassNotFoundException ex) {
|
||||
throw new ConfigurationException("ClasspathPackageProvider: Unable to locate result class "+className, actionClass);
|
||||
}
|
||||
}
|
||||
|
||||
String defaultParam;
|
||||
try {
|
||||
defaultParam = (String) resultClass.getField("DEFAULT_PARAM").get(null);
|
||||
} catch (Exception e) {
|
||||
// not sure why this happened, but let's just use a sensible choice
|
||||
defaultParam = "location";
|
||||
}
|
||||
|
||||
HashMap params = new HashMap();
|
||||
if (configParams != null) {
|
||||
params.putAll(configParams);
|
||||
}
|
||||
|
||||
params.put(defaultParam, location);
|
||||
return new ResultConfig.Builder((String) key, resultClass.getName()).addParams(params).build();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Search classpath for a page.
|
||||
*/
|
||||
private final class ServletContextPageLocator implements PageLocator {
|
||||
private final ServletContext context;
|
||||
private ClasspathPageLocator classpathPageLocator = new ClasspathPageLocator();
|
||||
|
||||
private ServletContextPageLocator(ServletContext context) {
|
||||
this.context = context;
|
||||
}
|
||||
|
||||
public URL locate(String path) {
|
||||
URL url = null;
|
||||
try {
|
||||
url = context.getResource(path);
|
||||
if (url == null) {
|
||||
url = classpathPageLocator.locate(path);
|
||||
}
|
||||
} catch (MalformedURLException e) {
|
||||
if (LOG.isDebugEnabled()) {
|
||||
LOG.debug("Unable to resolve path "+path+" against the servlet context");
|
||||
}
|
||||
}
|
||||
return url;
|
||||
}
|
||||
}
|
||||
|
||||
private static class PackageLoader {
|
||||
|
||||
/**
|
||||
* The package configurations for scanned Actions.
|
||||
*/
|
||||
private Map<String,PackageConfig.Builder> packageConfigBuilders = new HashMap<String,PackageConfig.Builder>();
|
||||
|
||||
private Map<PackageConfig.Builder,PackageConfig.Builder> childToParent = new HashMap<PackageConfig.Builder,PackageConfig.Builder>();
|
||||
|
||||
public PackageConfig.Builder getPackage(String name) {
|
||||
return packageConfigBuilders.get(name);
|
||||
}
|
||||
|
||||
public void registerChildToParent(PackageConfig.Builder child, PackageConfig.Builder parent) {
|
||||
childToParent.put(child, parent);
|
||||
}
|
||||
|
||||
public void registerPackage(PackageConfig.Builder builder) {
|
||||
packageConfigBuilders.put(builder.getName(), builder);
|
||||
}
|
||||
|
||||
public Collection<PackageConfig> createPackageConfigs() {
|
||||
Map<String, PackageConfig> configs = new HashMap<String, PackageConfig>();
|
||||
|
||||
Set<PackageConfig.Builder> builders;
|
||||
while ((builders = findPackagesWithNoParents()).size() > 0) {
|
||||
for (PackageConfig.Builder parent : builders) {
|
||||
PackageConfig config = parent.build();
|
||||
configs.put(config.getName(), config);
|
||||
packageConfigBuilders.remove(config.getName());
|
||||
|
||||
for (Iterator<Map.Entry<PackageConfig.Builder,PackageConfig.Builder>> i = childToParent.entrySet().iterator(); i.hasNext(); ) {
|
||||
Map.Entry<PackageConfig.Builder,PackageConfig.Builder> entry = i.next();
|
||||
if (entry.getValue() == parent) {
|
||||
entry.getKey().addParent(config);
|
||||
i.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return configs.values();
|
||||
}
|
||||
|
||||
Set<PackageConfig.Builder> findPackagesWithNoParents() {
|
||||
Set<PackageConfig.Builder> builders = new HashSet<PackageConfig.Builder>();
|
||||
for (PackageConfig.Builder child : packageConfigBuilders.values()) {
|
||||
if (!childToParent.containsKey(child)) {
|
||||
builders.add(child);
|
||||
}
|
||||
}
|
||||
return builders;
|
||||
}
|
||||
|
||||
public ResultTypeConfig getDefaultResultType(PackageConfig.Builder pkgConfig) {
|
||||
PackageConfig.Builder parent;
|
||||
PackageConfig.Builder current = pkgConfig;
|
||||
|
||||
while ((parent = childToParent.get(current)) != null) {
|
||||
current = parent;
|
||||
}
|
||||
return current.getResultType(current.getFullDefaultResultType());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.config;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
||||
/**
|
||||
* Allows an action class to specify its namespace
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
public @interface Namespace {
|
||||
String value();
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.config;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
||||
/**
|
||||
* Allows an action class or package to specify an xwork package to inherit
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target({ElementType.TYPE, ElementType.PACKAGE})
|
||||
public @interface ParentPackage {
|
||||
String[] value();
|
||||
}
|
||||
@@ -1,41 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.config;
|
||||
|
||||
import com.opensymphony.xwork2.Action;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Defines an XWork Result
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
public @interface Result {
|
||||
String name() default Action.SUCCESS;
|
||||
Class<? extends com.opensymphony.xwork2.Result> type() default NullResult.class;
|
||||
String value();
|
||||
String[] params() default {};
|
||||
}
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.config;
|
||||
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
||||
/**
|
||||
* Defines multiple XWork Results
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
public @interface Results {
|
||||
Result[] value();
|
||||
}
|
||||
@@ -1,174 +0,0 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
@@ -1,5 +0,0 @@
|
||||
Apache Struts
|
||||
Copyright 2000-2011 The Apache Software Foundation
|
||||
|
||||
This product includes software developed by
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
@@ -1,38 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!--
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<!DOCTYPE struts PUBLIC
|
||||
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
|
||||
"http://struts.apache.org/dtds/struts-2.3.dtd">
|
||||
|
||||
<struts>
|
||||
<bean type="com.opensymphony.xwork2.UnknownHandler" class="org.apache.struts2.codebehind.CodebehindUnknownHandler" />
|
||||
<bean type="com.opensymphony.xwork2.config.PackageProvider" name="codebehind" class="org.apache.struts2.config.ClasspathPackageProvider" />
|
||||
|
||||
<constant name="struts.codebehind.pathPrefix" value="/"/>
|
||||
<constant name="struts.codebehind.defaultPackage" value="codebehind-default"/>
|
||||
<constant name="struts.mapper.alwaysSelectFullNamespace" value="true" />
|
||||
|
||||
<package name="codebehind-default" extends="struts-default">
|
||||
</package>
|
||||
</struts>
|
||||
@@ -1,57 +0,0 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!--
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<project name="Struts 2">
|
||||
<skin>
|
||||
<groupId>org.apache.maven.skins</groupId>
|
||||
<artifactId>maven-fluido-skin</artifactId>
|
||||
<version>1.3.1</version>
|
||||
</skin>
|
||||
<bannerLeft>
|
||||
<name>Apache Software Foundation</name>
|
||||
<src>http://www.apache.org/images/asf-logo.gif</src>
|
||||
<href>http://www.apache.org/</href>
|
||||
</bannerLeft>
|
||||
<bannerRight>
|
||||
<name>Apache Struts</name>
|
||||
<src>http://struts.apache.org/img/struts-logo.svg</src>
|
||||
<href>http://struts.apache.org/</href>
|
||||
</bannerRight>
|
||||
<publishDate position="none"/>
|
||||
<version position="none"/>
|
||||
<body>
|
||||
<links>
|
||||
<item name="Apache" href="http://www.apache.org/"/>
|
||||
<item name="Struts" href="http://struts.apache.org/"/>
|
||||
</links>
|
||||
|
||||
<menu ref="parent"/>
|
||||
<menu ref="reports"/>
|
||||
|
||||
<footer>
|
||||
<div class="row span12">
|
||||
Apache Struts, Struts, Apache, the Apache feather logo, and the Apache Struts
|
||||
project logos are trademarks of The Apache Software Foundation.
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
</body>
|
||||
</project>
|
||||
-137
@@ -1,137 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.codebehind;
|
||||
|
||||
import com.mockobjects.dynamic.C;
|
||||
import com.mockobjects.dynamic.Mock;
|
||||
import com.opensymphony.xwork2.*;
|
||||
import com.opensymphony.xwork2.config.entities.ActionConfig;
|
||||
import com.opensymphony.xwork2.config.entities.ResultTypeConfig;
|
||||
import com.opensymphony.xwork2.util.XWorkTestCaseHelper;
|
||||
import org.apache.struts2.StrutsTestCase;
|
||||
import org.apache.struts2.dispatcher.ServletDispatcherResult;
|
||||
import org.springframework.mock.web.MockServletContext;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
|
||||
public class CodebehindUnknownHandlerTest extends StrutsTestCase {
|
||||
|
||||
CodebehindUnknownHandler handler;
|
||||
Mock mockServletContext;
|
||||
|
||||
public void setUp() throws Exception {
|
||||
configurationManager = XWorkTestCaseHelper.setUp();
|
||||
configuration = configurationManager.getConfiguration();
|
||||
container = configuration.getContainer();
|
||||
actionProxyFactory = container.getInstance(ActionProxyFactory.class);
|
||||
servletContext = new MockServletContext();
|
||||
initDispatcher(Collections.singletonMap("actionPackages", "foo.bar"));
|
||||
mockServletContext = new Mock(ServletContext.class);
|
||||
handler = new CodebehindUnknownHandler("codebehind-default", configuration);
|
||||
handler.setPathPrefix("/");
|
||||
handler.setObjectFactory(container.getInstance(ObjectFactory.class));
|
||||
handler.setServletContext((ServletContext)mockServletContext.proxy());
|
||||
}
|
||||
|
||||
public void testBuildResult() {
|
||||
ActionContext ctx = new ActionContext(new HashMap());
|
||||
ResultTypeConfig config = new ResultTypeConfig.Builder("null", SomeResult.class.getName()).defaultResultParam("location").build();
|
||||
|
||||
Result result = handler.buildResult("/foo.jsp", "success", config, ctx);
|
||||
assertNotNull(result);
|
||||
assertTrue(result instanceof SomeResult);
|
||||
assertEquals("/foo.jsp", ((SomeResult) result).location);
|
||||
|
||||
}
|
||||
|
||||
public void testString() {
|
||||
assertEquals("foo.bar.jim", handler.string("foo", ".", "bar", ".", "jim"));
|
||||
}
|
||||
|
||||
public void testDeterminePath() {
|
||||
assertEquals("/", handler.determinePath("/", ""));
|
||||
assertEquals("/", handler.determinePath("/", null));
|
||||
assertEquals("/", handler.determinePath("/", "/"));
|
||||
assertEquals("/foo/", handler.determinePath("/", "/foo"));
|
||||
assertEquals("/foo/", handler.determinePath("/", "/foo/"));
|
||||
assertEquals("/foo/", handler.determinePath("/", "foo"));
|
||||
assertEquals("/", handler.determinePath("", ""));
|
||||
assertEquals("/foo/", handler.determinePath("", "foo"));
|
||||
assertEquals("/foo/", handler.determinePath("", "/foo/"));
|
||||
}
|
||||
|
||||
public void testLocateTemplate() throws MalformedURLException {
|
||||
URL url = new URL("file:/foo.xml");
|
||||
mockServletContext.expectAndReturn("getResource", C.args(C.eq("/foo.xml")), url);
|
||||
assertEquals(url, handler.locateTemplate("/foo.xml"));
|
||||
mockServletContext.verify();
|
||||
|
||||
}
|
||||
|
||||
public void testLocateTemplateFromClasspath() throws MalformedURLException {
|
||||
mockServletContext.expectAndReturn("getResource", C.args(C.eq("struts-plugin.xml")), null);
|
||||
URL url = handler.locateTemplate("struts-plugin.xml");
|
||||
assertNotNull(url);
|
||||
assertTrue(url.toString().endsWith("struts-plugin.xml"));
|
||||
mockServletContext.verify();
|
||||
}
|
||||
|
||||
/**
|
||||
* Assert that an unknown action like /foo maps to ActionSupport with a ServletDispatcherResult to /foo.jsp
|
||||
*/
|
||||
public void testBuildActionConfigForUnknownAction() throws MalformedURLException {
|
||||
URL url = new URL("file:/foo.jsp");
|
||||
mockServletContext.expectAndReturn("getResource", C.args(C.eq("/foo.jsp")), url);
|
||||
ActionConfig actionConfig = handler.handleUnknownAction("/", "foo");
|
||||
// we need a package
|
||||
assertEquals("codebehind-default", actionConfig.getPackageName());
|
||||
// a non-empty interceptor stack
|
||||
assertTrue(actionConfig.getInterceptors().size() > 0);
|
||||
// ActionSupport as the implementation
|
||||
assertEquals(ActionSupport.class.getName(), actionConfig.getClassName());
|
||||
// with one result
|
||||
assertEquals(1, actionConfig.getResults().size());
|
||||
// named success
|
||||
assertNotNull(actionConfig.getResults().get("success"));
|
||||
// of ServletDispatcherResult type
|
||||
assertEquals(ServletDispatcherResult.class.getName(), actionConfig.getResults().get("success").getClassName());
|
||||
// and finally pointing to foo.jsp!
|
||||
assertEquals("/foo.jsp", actionConfig.getResults().get("success").getParams().get("location"));
|
||||
}
|
||||
|
||||
public static class SomeResult implements Result {
|
||||
|
||||
public String location;
|
||||
public void setLocation(String loc) {
|
||||
this.location = loc;
|
||||
}
|
||||
|
||||
public void execute(ActionInvocation invocation) throws Exception {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.config;
|
||||
|
||||
@Action(name="myaction",namespace="/foo")
|
||||
public class AnnotatedAction {
|
||||
|
||||
}
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.config;
|
||||
|
||||
@Action(name="myaction2")
|
||||
public class AnotherAnnotatedObject {
|
||||
|
||||
}
|
||||
-166
@@ -1,166 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.config;
|
||||
|
||||
import com.opensymphony.xwork2.config.Configuration;
|
||||
import com.opensymphony.xwork2.config.entities.ActionConfig;
|
||||
import com.opensymphony.xwork2.config.entities.PackageConfig;
|
||||
import com.opensymphony.xwork2.config.entities.ResultTypeConfig;
|
||||
import com.opensymphony.xwork2.config.impl.DefaultConfiguration;
|
||||
import junit.framework.TestCase;
|
||||
import org.apache.struts2.dispatcher.ServletDispatcherResult;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class ClasspathPackageProviderTest extends TestCase {
|
||||
|
||||
ClasspathPackageProvider provider;
|
||||
Configuration config;
|
||||
|
||||
public void setUp() throws Exception {
|
||||
provider = new ClasspathPackageProvider();
|
||||
provider.setActionPackages("org.apache.struts2.config");
|
||||
config = createNewConfiguration();
|
||||
provider.init(config);
|
||||
provider.loadPackages();
|
||||
}
|
||||
|
||||
private Configuration createNewConfiguration() {
|
||||
Configuration config = new DefaultConfiguration();
|
||||
PackageConfig strutsDefault = new PackageConfig.Builder("struts-default")
|
||||
.addResultTypeConfig(new ResultTypeConfig.Builder("dispatcher", ServletDispatcherResult.class.getName())
|
||||
.defaultResultParam("location")
|
||||
.build())
|
||||
.defaultResultType("dispatcher")
|
||||
.build();
|
||||
config.addPackageConfig("struts-default", strutsDefault);
|
||||
PackageConfig customPackage = new PackageConfig.Builder("custom-package")
|
||||
.namespace("/custom")
|
||||
.build();
|
||||
config.addPackageConfig("custom-package", customPackage);
|
||||
return config;
|
||||
}
|
||||
|
||||
public void tearDown() throws Exception {
|
||||
provider = null;
|
||||
config = null;
|
||||
}
|
||||
|
||||
public void testFoundRootPackages() {
|
||||
assertEquals(7, config.getPackageConfigs().size());
|
||||
PackageConfig pkg = config.getPackageConfig("org.apache.struts2.config");
|
||||
assertNotNull(pkg);
|
||||
Map configs = pkg.getActionConfigs();
|
||||
assertNotNull(configs);
|
||||
// assertEquals(1, configs.size());
|
||||
ActionConfig actionConfig = (ActionConfig) configs.get("customParentPackage");
|
||||
assertNotNull(actionConfig);
|
||||
}
|
||||
|
||||
public void testDisableScanning() {
|
||||
provider = new ClasspathPackageProvider();
|
||||
provider.setActionPackages("org.apache.struts2.config");
|
||||
provider.setDisableActionScanning("true");
|
||||
config = new DefaultConfiguration();
|
||||
provider.init(config);
|
||||
provider.loadPackages();
|
||||
|
||||
assertEquals(0, config.getPackageConfigs().size());
|
||||
}
|
||||
|
||||
public void testParentPackage() {
|
||||
PackageConfig pkg = config.getPackageConfig("org.apache.struts2.config");
|
||||
// assertEquals(2, pkg.getParents().size());
|
||||
Map configs = pkg.getActionConfigs();
|
||||
ActionConfig config = (ActionConfig) configs.get("customParentPackage");
|
||||
assertNotNull(config);
|
||||
assertEquals("/custom", pkg.getNamespace());
|
||||
}
|
||||
|
||||
public void testParentPackageOnPackage() {
|
||||
provider = new ClasspathPackageProvider();
|
||||
provider.setActionPackages("org.apache.struts2.config.parenttest");
|
||||
provider.init(createNewConfiguration());
|
||||
provider.loadPackages();
|
||||
|
||||
|
||||
PackageConfig pkg = config.getPackageConfig("org.apache.struts2.config.parenttest");
|
||||
// assertEquals(2, pkg.getParents().size());
|
||||
assertNotNull(pkg);
|
||||
|
||||
assertEquals("custom-package", pkg.getParents().get(0).getName());
|
||||
Map configs = pkg.getActionConfigs();
|
||||
ActionConfig config = (ActionConfig) configs.get("some");
|
||||
assertNotNull(config);
|
||||
}
|
||||
|
||||
public void testCustomNamespace() {
|
||||
PackageConfig pkg = config.getPackageConfig("org.apache.struts2.config.CustomNamespaceAction");
|
||||
Map configs = pkg.getAllActionConfigs();
|
||||
// assertEquals(2, configs.size());
|
||||
ActionConfig config = (ActionConfig) configs.get("customNamespace");
|
||||
assertEquals(config.getPackageName(), pkg.getName());
|
||||
assertEquals(1, pkg.getParents().size());
|
||||
assertNotNull(config);
|
||||
assertEquals("/mynamespace", pkg.getNamespace());
|
||||
ActionConfig ac = (ActionConfig) configs.get("customParentPackage");
|
||||
assertNotNull(ac);
|
||||
}
|
||||
|
||||
public void testCustomActionAnnotation() {
|
||||
PackageConfig pkg = config.getPackageConfig("org.apache.struts2.config.AnnotatedAction");
|
||||
Map configs = pkg.getAllActionConfigs();
|
||||
// assertEquals(2, configs.size());
|
||||
ActionConfig config = (ActionConfig) configs.get("myaction");
|
||||
assertNotNull(config);
|
||||
}
|
||||
|
||||
public void testCustomActionAnnotationOfAnyName() {
|
||||
PackageConfig pkg = config.getPackageConfig("org.apache.struts2.config");
|
||||
Map configs = pkg.getAllActionConfigs();
|
||||
// assertEquals(2, configs.size());
|
||||
ActionConfig config = (ActionConfig) configs.get("myaction2");
|
||||
assertNotNull(config);
|
||||
}
|
||||
|
||||
public void testResultAnnotations() {
|
||||
PackageConfig pkg = config.getPackageConfig("org.apache.struts2.config.cltest");
|
||||
assertEquals("/cltest", pkg.getNamespace());
|
||||
ActionConfig acfg = pkg.getActionConfigs().get("twoResult");
|
||||
assertNotNull(acfg);
|
||||
assertEquals(2, acfg.getResults().size());
|
||||
assertEquals("input.jsp", acfg.getResults().get("input").getParams().get("location"));
|
||||
assertEquals("bob", acfg.getResults().get("chain").getParams().get("location"));
|
||||
|
||||
acfg = pkg.getActionConfigs().get("oneResult");
|
||||
assertNotNull(acfg);
|
||||
assertEquals(1, acfg.getResults().size());
|
||||
assertEquals("input-parent.jsp", acfg.getResults().get("input").getParams().get("location"));
|
||||
}
|
||||
|
||||
public void testActionImplementation() {
|
||||
PackageConfig pkg = config.getPackageConfig("org.apache.struts2.config.cltest");
|
||||
assertEquals("/cltest", pkg.getNamespace());
|
||||
ActionConfig acfg = pkg.getActionConfigs().get("actionImpl");
|
||||
assertNotNull(acfg);
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.config;
|
||||
|
||||
@Namespace("/mynamespace")
|
||||
public class CustomNamespaceAction {
|
||||
|
||||
}
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.config;
|
||||
|
||||
@ParentPackage("custom-package")
|
||||
public class CustomParentPackageAction {
|
||||
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.config.cltest;
|
||||
|
||||
import com.opensymphony.xwork2.Action;
|
||||
|
||||
public class ActionImpl implements Action {
|
||||
|
||||
public String execute() throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.config.cltest;
|
||||
|
||||
import org.apache.struts2.config.Result;
|
||||
|
||||
@Result(name="input", value="input-parent.jsp")
|
||||
public class OneResultAction {
|
||||
|
||||
}
|
||||
-35
@@ -1,35 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.config.cltest;
|
||||
|
||||
import org.apache.struts2.config.Result;
|
||||
import org.apache.struts2.config.Results;
|
||||
import org.apache.struts2.dispatcher.ServletDispatcherResult;
|
||||
|
||||
|
||||
@Results({
|
||||
@Result(name="chain", value="bob", type=ServletDispatcherResult.class),
|
||||
@Result(name="input", value="input.jsp")
|
||||
})
|
||||
public class TwoResultAction extends OneResultAction {
|
||||
|
||||
}
|
||||
@@ -1,30 +0,0 @@
|
||||
/*
|
||||
* $Id: ParentPackage.java 651946 2008-04-27 13:41:38Z apetrelli $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.struts2.config.parenttest;
|
||||
|
||||
import com.opensymphony.xwork2.Action;
|
||||
|
||||
public class SomeAction implements Action {
|
||||
|
||||
public String execute() throws Exception {
|
||||
return null; //To change body of implemented methods use File | Settings | File Templates.
|
||||
}
|
||||
}
|
||||
-24
@@ -1,24 +0,0 @@
|
||||
/*
|
||||
* $Id: ParentPackage.java 651946 2008-04-27 13:41:38Z apetrelli $
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
@ParentPackage("custom-package")
|
||||
package org.apache.struts2.config.parenttest;
|
||||
|
||||
import org.apache.struts2.config.ParentPackage;
|
||||
@@ -1,240 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
-->
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<parent>
|
||||
<artifactId>struts2-plugins</artifactId>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<version>2.5-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>struts2-dojo-plugin</artifactId>
|
||||
<name>Struts 2 Dojo Plugin</name>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>release</id>
|
||||
<activation>
|
||||
<property>
|
||||
<name>release</name>
|
||||
</property>
|
||||
</activation>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>rat-maven-plugin</artifactId>
|
||||
<version>1.0-alpha-2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>check</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<addDefaultLicenseMatchers>false</addDefaultLicenseMatchers>
|
||||
<licenseMatchers>
|
||||
<classNames>
|
||||
<className>rat.analysis.license.ApacheSoftwareLicense20</className>
|
||||
</classNames>
|
||||
</licenseMatchers>
|
||||
<includes>
|
||||
<include>pom.xml</include>
|
||||
<include>src/**</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>src/main/resources/org/apache/struts2/static/dojo/nls/**</exclude>
|
||||
<exclude>src/main/resources/org/apache/struts2/static/dojo/src/**</exclude>
|
||||
<exclude>src/main/resources/org/apache/struts2/static/dojo/*</exclude>
|
||||
<exclude>src/test/resources/org/apache/struts2/dojo/views/jsp/ui/**</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</profile>
|
||||
</profiles>
|
||||
|
||||
<properties>
|
||||
<tlib.version>2.2</tlib.version>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
</properties>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.myfaces.tobago</groupId>
|
||||
<artifactId>maven-apt-plugin</artifactId>
|
||||
<version>1.0.15</version>
|
||||
<configuration>
|
||||
<A>
|
||||
uri=/struts-dojo-tags,tlibVersion=${tlib.version},jspVersion=2.0,shortName=sx,
|
||||
displayName="Struts Dojo Tags",
|
||||
outFile=${basedir}/target/classes/META-INF/struts-dojo-tags.tld,
|
||||
description="Struts AJAX tags based on Dojo.",
|
||||
outTemplatesDir=${basedir}/../../core/src/site/resources/tags/ajax
|
||||
</A>
|
||||
<resourceTargetPath>target</resourceTargetPath>
|
||||
<fork>false</fork>
|
||||
<force>true</force>
|
||||
<nocompile>true</nocompile>
|
||||
<showWarnings>true</showWarnings>
|
||||
<factory>
|
||||
org.apache.struts.annotations.taglib.apt.TLDAnnotationProcessorFactory
|
||||
</factory>
|
||||
<target>1.5</target>
|
||||
<includes>
|
||||
<include>**/*.java</include>
|
||||
</includes>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>execute</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<!-- JSP API -->
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>jsp-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- Velocity -->
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<artifactId>velocity</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
|
||||
<!-- Test dependencies -->
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>struts2-junit-plugin</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jmock</groupId>
|
||||
<artifactId>jmock</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.easymock</groupId>
|
||||
<artifactId>easymock</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>jmock</groupId>
|
||||
<artifactId>jmock-cglib</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>mockobjects</groupId>
|
||||
<artifactId>mockobjects-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>mockobjects</groupId>
|
||||
<artifactId>mockobjects-jdk1.3</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>mockobjects</groupId>
|
||||
<artifactId>mockobjects-alt-jdk1.3</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>mockobjects</groupId>
|
||||
<artifactId>mockobjects-alt-jdk1.3-j2ee1.3</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>mockobjects</groupId>
|
||||
<artifactId>mockobjects-jdk1.3-j2ee1.3</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- Mocks for unit testing (by Spring) -->
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-core</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
<!-- struts-annotations must be in compile scope for maven-apt-plugin to
|
||||
function correctly. Marking it optional to exclude it from transitive
|
||||
dependency resolution -->
|
||||
<dependency>
|
||||
<groupId>org.apache.struts</groupId>
|
||||
<artifactId>struts-annotations</artifactId>
|
||||
<scope>compile</scope>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<reporting>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>rat-maven-plugin</artifactId>
|
||||
<version>1.0-alpha-2</version>
|
||||
<configuration>
|
||||
<includes>
|
||||
<include>pom.xml</include>
|
||||
<include>src/**</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>src/main/resources/org/apache/struts2/static/dojo/nls/**</exclude>
|
||||
<exclude>src/main/resources/org/apache/struts2/static/dojo/src/**</exclude>
|
||||
<exclude>src/main/resources/org/apache/struts2/static/dojo/*</exclude>
|
||||
<exclude>src/test/resources/org/apache/struts2/dojo/views/jsp/ui/**</exclude>
|
||||
</excludes>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
</project>
|
||||
-268
@@ -1,268 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.components;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.ClosingUIBean;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
import org.apache.struts2.views.annotations.StrutsTagSkipInheritance;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* AbstractRemoteCallUIBean is superclass for all components dealing with remote
|
||||
* calls.
|
||||
*/
|
||||
public abstract class AbstractRemoteBean extends ClosingUIBean implements RemoteBean {
|
||||
|
||||
final private static transient Random RANDOM = new Random();
|
||||
|
||||
protected String href;
|
||||
protected String errorText;
|
||||
protected String executeScripts;
|
||||
protected String loadingText;
|
||||
protected String listenTopics;
|
||||
protected String handler;
|
||||
protected String formId;
|
||||
protected String formFilter;
|
||||
protected String notifyTopics;
|
||||
protected String showErrorTransportText;
|
||||
protected String indicator;
|
||||
protected String showLoadingText;
|
||||
protected String beforeNotifyTopics;
|
||||
protected String afterNotifyTopics;
|
||||
protected String errorNotifyTopics;
|
||||
protected String highlightColor;
|
||||
protected String highlightDuration;
|
||||
protected String separateScripts;
|
||||
protected String transport;
|
||||
protected String parseContent;
|
||||
|
||||
public AbstractRemoteBean(ValueStack stack, HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
super(stack, request, response);
|
||||
}
|
||||
|
||||
public void evaluateExtraParams() {
|
||||
super.evaluateExtraParams();
|
||||
|
||||
if (href != null)
|
||||
addParameter("href", findString(href));
|
||||
if (errorText != null)
|
||||
addParameter("errorText", findString(errorText));
|
||||
if (loadingText != null)
|
||||
addParameter("loadingText", findString(loadingText));
|
||||
if (executeScripts != null)
|
||||
addParameter("executeScripts", findValue(executeScripts, Boolean.class));
|
||||
if (listenTopics != null)
|
||||
addParameter("listenTopics", findValue(listenTopics, String.class));
|
||||
if (notifyTopics != null)
|
||||
addParameter("notifyTopics", findValue(notifyTopics, String.class));
|
||||
if (handler != null)
|
||||
addParameter("handler", findString(handler));
|
||||
if (formId != null)
|
||||
addParameter("formId", findString(formId));
|
||||
if (formFilter != null)
|
||||
addParameter("formFilter", findString(formFilter));
|
||||
if (indicator != null)
|
||||
addParameter("indicator", findString(indicator));
|
||||
if (showErrorTransportText != null)
|
||||
addParameter("showErrorTransportText", findValue(showErrorTransportText, Boolean.class));
|
||||
else
|
||||
addParameter("showErrorTransportText", true);
|
||||
if (showLoadingText != null)
|
||||
addParameter("showLoadingText", findString(showLoadingText));
|
||||
if (beforeNotifyTopics != null)
|
||||
addParameter("beforeNotifyTopics", findString(beforeNotifyTopics));
|
||||
if (afterNotifyTopics != null)
|
||||
addParameter("afterNotifyTopics", findString(afterNotifyTopics));
|
||||
if (errorNotifyTopics != null)
|
||||
addParameter("errorNotifyTopics", findString(errorNotifyTopics));
|
||||
if (highlightColor != null)
|
||||
addParameter("highlightColor", findString(highlightColor));
|
||||
if (highlightDuration != null)
|
||||
addParameter("highlightDuration", findString(highlightDuration));
|
||||
if (separateScripts != null)
|
||||
addParameter("separateScripts", findValue(separateScripts, Boolean.class));
|
||||
if (transport != null)
|
||||
addParameter("transport", findString(transport));
|
||||
if (parseContent != null)
|
||||
addParameter("parseContent", findValue(parseContent, Boolean.class));
|
||||
else
|
||||
addParameter("parseContent", true);
|
||||
|
||||
// generate a random ID if not explicitly set and not parsing the content
|
||||
Boolean parseContent = (Boolean)stack.getContext().get(Head.PARSE_CONTENT);
|
||||
boolean generateId = (parseContent != null ? !parseContent : true);
|
||||
|
||||
addParameter("pushId", generateId);
|
||||
if ((this.id == null || this.id.length() == 0) && generateId) {
|
||||
// resolves Math.abs(Integer.MIN_VALUE) issue reported by FindBugs
|
||||
// http://findbugs.sourceforge.net/bugDescriptions.html#RV_ABSOLUTE_VALUE_OF_RANDOM_INT
|
||||
int nextInt = RANDOM.nextInt();
|
||||
nextInt = nextInt == Integer.MIN_VALUE ? Integer.MAX_VALUE : Math.abs(nextInt);
|
||||
this.id = "widget_" + String.valueOf(nextInt);
|
||||
addParameter("id", this.id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@StrutsTagSkipInheritance
|
||||
public void setTheme(String theme) {
|
||||
super.setTheme(theme);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTheme() {
|
||||
return "ajax";
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Topic that will trigger the remote call")
|
||||
public void setListenTopics(String listenTopics) {
|
||||
this.listenTopics = listenTopics;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The URL to call to obtain the content. Note: If used with ajax context, the value must be set as an url tag value.")
|
||||
public void setHref(String href) {
|
||||
this.href = href;
|
||||
}
|
||||
|
||||
|
||||
@StrutsTagAttribute(description="The text to display to the user if the is an error fetching the content")
|
||||
public void setErrorText(String errorText) {
|
||||
this.errorText = errorText;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Javascript code in the fetched content will be executed", type="Boolean", defaultValue="false")
|
||||
public void setExecuteScripts(String executeScripts) {
|
||||
this.executeScripts = executeScripts;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Text to be shown while content is being fetched", defaultValue="Loading...")
|
||||
public void setLoadingText(String loadingText) {
|
||||
this.loadingText = loadingText;
|
||||
}
|
||||
|
||||
|
||||
@StrutsTagAttribute(description="Javascript function name that will make the request")
|
||||
public void setHandler(String handler) {
|
||||
this.handler = handler;
|
||||
}
|
||||
|
||||
|
||||
@StrutsTagAttribute(description="Function name used to filter the fields of the form.")
|
||||
public void setFormFilter(String formFilter) {
|
||||
this.formFilter = formFilter;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Form id whose fields will be serialized and passed as parameters")
|
||||
public void setFormId(String formId) {
|
||||
this.formId = formId;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Comma delimmited list of topics that will published before and after the request, and on errors")
|
||||
public void setNotifyTopics(String notifyTopics) {
|
||||
this.notifyTopics = notifyTopics;
|
||||
}
|
||||
|
||||
|
||||
@StrutsTagAttribute(description="Set whether errors will be shown or not", type="Boolean", defaultValue="true")
|
||||
public void setShowErrorTransportText(String showError) {
|
||||
this.showErrorTransportText = showError;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Id of element that will be shown while making request")
|
||||
public void setIndicator(String indicator) {
|
||||
this.indicator = indicator;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Show loading text on targets", type="Boolean", defaultValue="false")
|
||||
public void setShowLoadingText(String showLoadingText) {
|
||||
this.showLoadingText = showLoadingText;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The css class to use for element")
|
||||
public void setCssClass(String cssClass) {
|
||||
super.setCssClass(cssClass);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The css style to use for element")
|
||||
public void setCssStyle(String cssStyle) {
|
||||
super.setCssStyle(cssStyle);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The id to use for the element")
|
||||
public void setId(String id) {
|
||||
super.setId(id);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The name to set for element")
|
||||
public void setName(String name) {
|
||||
super.setName(name);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Comma delimmited list of topics that will published after the request(if the request succeeds)")
|
||||
public void setAfterNotifyTopics(String afterNotifyTopics) {
|
||||
this.afterNotifyTopics = afterNotifyTopics;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Comma delimmited list of topics that will published before the request")
|
||||
public void setBeforeNotifyTopics(String beforeNotifyTopics) {
|
||||
this.beforeNotifyTopics = beforeNotifyTopics;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Comma delimmited list of topics that will published after the request(if the request fails)")
|
||||
public void setErrorNotifyTopics(String errorNotifyTopics) {
|
||||
this.errorNotifyTopics = errorNotifyTopics;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description = "Color used to perform a highlight effect on the elements specified in the 'targets' attribute",
|
||||
defaultValue = "none")
|
||||
public void setHighlightColor(String highlightColor) {
|
||||
this.highlightColor = highlightColor;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description = "Duration of highlight effect in milliseconds. Only valid if 'highlightColor' attribute is set",
|
||||
defaultValue = "2000", type="Integer")
|
||||
public void setHighlightDuration(String highlightDuration) {
|
||||
this.highlightDuration = highlightDuration;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Run scripts in a separate scope, unique for each tag", defaultValue="true")
|
||||
public void setSeparateScripts(String separateScripts) {
|
||||
this.separateScripts = separateScripts;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Transport used by Dojo to make the request", defaultValue="XMLHTTPTransport")
|
||||
public void setTransport(String transport) {
|
||||
this.transport = transport;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Parse returned HTML for Dojo widgets", defaultValue="true", type="Boolean")
|
||||
public void setParseContent(String parseContent) {
|
||||
this.parseContent = parseContent;
|
||||
}
|
||||
}
|
||||
-67
@@ -1,67 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.components;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Form;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* Base class for tags that perform AJAX validation
|
||||
*/
|
||||
public abstract class AbstractValidateBean extends AbstractRemoteBean {
|
||||
protected String validate;
|
||||
protected String ajaxAfterValidation;
|
||||
|
||||
public AbstractValidateBean(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
|
||||
super(stack, request, response);
|
||||
}
|
||||
|
||||
public void evaluateExtraParams() {
|
||||
super.evaluateExtraParams();
|
||||
|
||||
if (validate != null)
|
||||
addParameter("validate", findValue(validate, Boolean.class));
|
||||
if (ajaxAfterValidation != null)
|
||||
addParameter("ajaxAfterValidation", findValue(ajaxAfterValidation, Boolean.class));
|
||||
|
||||
Form form = (Form) findAncestor(Form.class);
|
||||
if (form != null)
|
||||
addParameter("parentTheme", form.getTheme());
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description = "Perform Ajax validation. 'ajaxValidation' interceptor must be applied to action", type="Boolean",
|
||||
defaultValue = "false")
|
||||
public void setValidate(String validate) {
|
||||
this.validate = validate;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description = "Make an asynchronous request if validation succeeds. Only valid if 'validate' is 'true'", type="Boolean",
|
||||
defaultValue = "false")
|
||||
public void setAjaxAfterValidation(String ajaxAfterValidation) {
|
||||
this.ajaxAfterValidation = ajaxAfterValidation;
|
||||
}
|
||||
}
|
||||
@@ -1,143 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.components;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
import org.apache.struts2.views.annotations.StrutsTagSkipInheritance;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* <p>
|
||||
* A tag that creates an HTML <a/> element, that when clicked makes an asynchronous request(XMLHttpRequest). The url
|
||||
* attribute must be build using the <s:url/> tag.
|
||||
* </p>
|
||||
* <!-- END SNIPPET: javadoc -->
|
||||
* <p>Examples</p>
|
||||
*
|
||||
* <!-- START SNIPPET: example1 -->
|
||||
* <div id="div1">Div 1</div>
|
||||
* <s:url id="ajaxTest" value="/AjaxTest.action"/>
|
||||
*
|
||||
* <sx:a id="link1" href="%{ajaxTest}" target="div1">
|
||||
* Update Content
|
||||
* </sx:a>
|
||||
* <!-- END SNIPPET: example1 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example2 -->
|
||||
* <s:form id="form" action="AjaxTest">
|
||||
* <input type="textbox" name="data">
|
||||
* <sx:a>Submit form</sx:a>
|
||||
* </s:form>
|
||||
* <!-- END SNIPPET: example2 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example3 -->
|
||||
* <s:form id="form" action="AjaxTest">
|
||||
* <input type="textbox" name="data">
|
||||
* </s:form>
|
||||
*
|
||||
* <sx:a formId="form">Submit form</sx:a>
|
||||
* <!-- END SNIPPET: example3 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example4 -->
|
||||
* <script type="text/javascript">
|
||||
* dojo.event.topic.subscribe("/before", function(event, widget){
|
||||
* alert('inside a topic event. before request');
|
||||
* //event: set event.cancel = true, to cancel request
|
||||
* //widget: widget that published the topic
|
||||
* });
|
||||
* </script>
|
||||
*
|
||||
* <sx:a beforeNotifyTopics="/before">Publish topics</sx:a>
|
||||
* <!-- END SNIPPET: example4 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example5 -->
|
||||
* <script type="text/javascript">
|
||||
* dojo.event.topic.subscribe("/after", function(data, request, widget){
|
||||
* alert('inside a topic event. after request');
|
||||
* //data : text returned from request(the html)
|
||||
* //request: XMLHttpRequest object
|
||||
* //widget: widget that published the topic
|
||||
* });
|
||||
* </script>
|
||||
*
|
||||
* <sx:a afterNotifyTopics="/after" highlightColor="red" href="%{#ajaxTest}">Publish topics</sx:a>
|
||||
* <!-- END SNIPPET: example5 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example6 -->
|
||||
* <script type="text/javascript">
|
||||
* dojo.event.topic.subscribe("/error", function(error, request, widget){
|
||||
* alert('inside a topic event. on error');
|
||||
* //error : error object (error.message has the error message)
|
||||
* //request: XMLHttpRequest object
|
||||
* //widget: widget that published the topic
|
||||
* });
|
||||
* </script>
|
||||
*
|
||||
* <img id="ind1" src="${pageContext.request.contextPath}/images/indicator.gif" style="display:none"/>
|
||||
* <sx:a errorNotifyTopics="/error" indicator="ind1" href="%{#ajaxTest}">Publish topics</sx:a>
|
||||
* <!-- END SNIPPET: example6 -->
|
||||
*/
|
||||
@StrutsTag(name="a", tldTagClass="org.apache.struts2.dojo.views.jsp.ui.AnchorTag", description="Renders an HTML anchor element that when clicked calls a URL via remote XMLHttpRequest and updates " +
|
||||
"its targets content")
|
||||
public class Anchor extends AbstractValidateBean {
|
||||
public static final String OPEN_TEMPLATE = "a";
|
||||
public static final String TEMPLATE = "a-close";
|
||||
public static final String COMPONENT_NAME = Anchor.class.getName();
|
||||
|
||||
protected String targets;
|
||||
|
||||
public Anchor(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
|
||||
super(stack, request, response);
|
||||
}
|
||||
|
||||
public String getDefaultOpenTemplate() {
|
||||
return OPEN_TEMPLATE;
|
||||
}
|
||||
|
||||
protected String getDefaultTemplate() {
|
||||
return TEMPLATE;
|
||||
}
|
||||
|
||||
public void evaluateExtraParams() {
|
||||
super.evaluateExtraParams();
|
||||
|
||||
if (targets != null)
|
||||
addParameter("targets", findString(targets));
|
||||
}
|
||||
|
||||
@Override
|
||||
@StrutsTagSkipInheritance
|
||||
public void setTheme(String theme) {
|
||||
super.setTheme(theme);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Comma delimited list of ids of the elements whose content will be updated")
|
||||
public void setTargets(String targets) {
|
||||
this.targets = targets;
|
||||
}
|
||||
}
|
||||
@@ -1,528 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.components;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.ComboBox;
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
import org.apache.struts2.views.annotations.StrutsTagSkipInheritance;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* <p>The autocomplete tag is a combobox that can autocomplete text entered on the input box. If an action
|
||||
* is used to populate the autocompleter, the output of the action must be a well formed JSON string. </p>
|
||||
* <p>The autocompleter follows this rule to find its datasource:<p>
|
||||
* <p>1. If the response is an array, assume that it contains 2-dimension array elements, like:
|
||||
* <pre>
|
||||
* [
|
||||
* ["Alabama", "AL"],
|
||||
* ["Alaska", "AK"]
|
||||
* ]
|
||||
* </pre>
|
||||
* <p>2. If a value is specified in the "dataFieldName" attribute, and the response has a field with that
|
||||
* name, assume that's the datasource, which can be an array of 2-dimension array elements, or a map,
|
||||
* like (assuming dataFieldName="state"):</p>
|
||||
* <pre>
|
||||
* {
|
||||
* "state" : [
|
||||
* ["Alabama","AL"],
|
||||
* ["Alaska","AK"]
|
||||
* ]
|
||||
* }
|
||||
* or
|
||||
* {
|
||||
* "state" : {
|
||||
* "Alabama" : "AL",
|
||||
* "Alaska" : "AK"
|
||||
* }
|
||||
* }
|
||||
* </pre>
|
||||
* </pre>
|
||||
* <p>3. If there is a field that starts with the value specified on the "name" attribute, assume
|
||||
* that's the datasource, like (assuming name="state"):</p>
|
||||
* <pre>
|
||||
* {
|
||||
* "states" : [
|
||||
* ["Alabama","AL"],
|
||||
* ["Alaska","AK"]
|
||||
* ]
|
||||
* }
|
||||
* </pre>
|
||||
* <p>4. Use first array that is found, like:<p>
|
||||
* <pre>
|
||||
* {
|
||||
* "anything" : [
|
||||
* ["Alabama", "AL"],
|
||||
* ["Alaska", "AK"]
|
||||
* ]
|
||||
* }
|
||||
* <p>5. If the response is a map, use it (recommended as it is the easiest one to generate):
|
||||
* <pre>
|
||||
* {
|
||||
* "Alabama" : "AL",
|
||||
* "Alaska" : "AK"
|
||||
* }
|
||||
* </pre>
|
||||
* <!-- END SNIPPET: javadoc -->
|
||||
* <p>Examples</p>
|
||||
* <!-- START SNIPPET: example1 -->
|
||||
* <sx:autocompleter name="autocompleter1" href="%{jsonList}"/>
|
||||
* <!-- END SNIPPET: example1 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example2 -->
|
||||
* <s:autocompleter name="test" list="{'apple','banana','grape','pear'}" autoComplete="false"/>
|
||||
* <!-- END SNIPPET: example2 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example3 -->
|
||||
* <sx:autocompleter name="mvc" href="%{jsonList}" loadOnTextChange="true" loadMinimumCount="3"/>
|
||||
*
|
||||
* The text entered on the autocompleter is passed as a parameter to the url specified in "href", like (text is "struts"):
|
||||
*
|
||||
* http://host/example/myaction.do?mvc=struts
|
||||
* <!-- END SNIPPET: example3 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example4 -->
|
||||
* <form id="selectForm">
|
||||
* <sx:autocompleter name="select" list="{'fruits','colors'}" valueNotifyTopics="/changed" />
|
||||
* </form>
|
||||
* <sx:autocompleter href="%{jsonList}" formId="selectForm" listenTopics="/changed"/>
|
||||
* <!-- END SNIPPET: example4 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example5 -->
|
||||
* <sx:autocompleter href="%{jsonList}" id="auto"/>
|
||||
* <script type="text/javascript">
|
||||
* function getValues() {
|
||||
* var autoCompleter = dojo.widget.byId("auto");
|
||||
*
|
||||
* //key (in the states example above, "AL")
|
||||
* var key = autoCompleter.getSelectedKey();
|
||||
* alert(key);
|
||||
*
|
||||
* //value (in the states example above, "Alabama")
|
||||
* var value = autoCompleter.getSelectedValue();
|
||||
* alert(value);
|
||||
*
|
||||
* //text currently on the textbox (anything the user typed)
|
||||
* var text = autoCompleter.getText();
|
||||
* alert(text);
|
||||
* }
|
||||
*
|
||||
* function setValues() {
|
||||
* var autoCompleter = dojo.widget.byId("auto");
|
||||
*
|
||||
* //key (key will be set to "AL" and value to "Alabama")
|
||||
* autoCompleter.setSelectedKey("AL");
|
||||
*
|
||||
* //value (key will be set to "AL" and value to "Alabama")
|
||||
* autoCompleter.setAllValues("AL", "Alabama");
|
||||
* }
|
||||
* </script>
|
||||
* <!-- END SNIPPET: example5 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example6 -->
|
||||
* <script type="text/javascript">
|
||||
* dojo.event.topic.subscribe("/before", function(event, widget){
|
||||
* alert('inside a topic event. before request');
|
||||
* //event: set event.cancel = true, to cancel request
|
||||
* //widget: widget that published the topic
|
||||
* });
|
||||
* </script>
|
||||
*
|
||||
* <sx:autocompleter beforeNotifyTopics="/before" href="%{#ajaxTest} />
|
||||
* <!-- END SNIPPET: example6 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example7 -->
|
||||
* <script type="text/javascript">
|
||||
* dojo.event.topic.subscribe("/after", function(data, request, widget){
|
||||
* alert('inside a topic event. after request');
|
||||
* //data : JavaScript object from parsing response
|
||||
* //request: XMLHttpRequest object
|
||||
* //widget: widget that published the topic
|
||||
* });
|
||||
* </script>
|
||||
*
|
||||
* <sx:autocompleter afterNotifyTopics="/after" href="%{#ajaxTest}" />
|
||||
* <!-- END SNIPPET: example7 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example8-->
|
||||
* <script type="text/javascript">
|
||||
* dojo.event.topic.subscribe("/error", function(error, request, widget){
|
||||
* alert('inside a topic event. on error');
|
||||
* //error : error object (error.message has the error message)
|
||||
* //request: XMLHttpRequest object
|
||||
* //widget: widget that published the topic
|
||||
* });
|
||||
* </script>
|
||||
*
|
||||
* <sx:autocompleter errorNotifyTopics="/error" href="%{#ajaxTest}" />
|
||||
* <!-- END SNIPPET: example8 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example9 -->
|
||||
* <script type="text/javascript">
|
||||
* dojo.event.topic.subscribe("/value", function(value, key, text, widget){
|
||||
* alert('inside a topic event. after value changed');
|
||||
* //value : selected value (like "Florida" in example above)
|
||||
* //key: selected key (like "FL" in example above)
|
||||
* //text: text typed into textbox
|
||||
* //widget: widget that published the topic
|
||||
* });
|
||||
* </script>
|
||||
*
|
||||
* <sx:autocompleter valueNotifyTopics="/value" href="%{#ajaxTest}" />
|
||||
* <!-- END SNIPPET: example9 -->
|
||||
*/
|
||||
@StrutsTag(name="autocompleter", tldTagClass="org.apache.struts2.dojo.views.jsp.ui.AutocompleterTag", description="Renders a combobox with autocomplete and AJAX capabilities")
|
||||
public class Autocompleter extends ComboBox {
|
||||
public static final String TEMPLATE = "autocompleter";
|
||||
final private static String COMPONENT_NAME = Autocompleter.class.getName();
|
||||
private final static transient Random RANDOM = new Random();
|
||||
|
||||
protected String forceValidOption;
|
||||
protected String searchType;
|
||||
protected String autoComplete;
|
||||
protected String delay;
|
||||
protected String disabled;
|
||||
protected String href;
|
||||
protected String dropdownWidth;
|
||||
protected String dropdownHeight;
|
||||
protected String formId;
|
||||
protected String formFilter;
|
||||
protected String listenTopics;
|
||||
protected String notifyTopics;
|
||||
protected String indicator;
|
||||
protected String loadOnTextChange;
|
||||
protected String loadMinimumCount;
|
||||
protected String showDownArrow;
|
||||
protected String templateCssPath;
|
||||
protected String iconPath;
|
||||
protected String keyName;
|
||||
protected String dataFieldName;
|
||||
protected String beforeNotifyTopics;
|
||||
protected String afterNotifyTopics;
|
||||
protected String errorNotifyTopics;
|
||||
protected String valueNotifyTopics;
|
||||
protected String resultsLimit;
|
||||
protected String transport;
|
||||
protected String preload;
|
||||
protected String keyValue;
|
||||
|
||||
public Autocompleter(ValueStack stack, HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
super(stack, request, response);
|
||||
}
|
||||
|
||||
protected String getDefaultTemplate() {
|
||||
return TEMPLATE;
|
||||
}
|
||||
|
||||
public String getComponentName() {
|
||||
return COMPONENT_NAME;
|
||||
}
|
||||
|
||||
|
||||
public void evaluateExtraParams() {
|
||||
super.evaluateExtraParams();
|
||||
|
||||
if (forceValidOption != null)
|
||||
addParameter("forceValidOption", findValue(forceValidOption,
|
||||
Boolean.class));
|
||||
if (searchType != null) {
|
||||
String type = findString(searchType);
|
||||
if(type != null)
|
||||
addParameter("searchType", type.toUpperCase());
|
||||
}
|
||||
if (autoComplete != null)
|
||||
addParameter("autoComplete", findValue(autoComplete, Boolean.class));
|
||||
if (delay != null)
|
||||
addParameter("delay", findValue(delay, Integer.class));
|
||||
if (disabled != null)
|
||||
addParameter("disabled", findValue(disabled, Boolean.class));
|
||||
if (href != null) {
|
||||
addParameter("href", findString(href));
|
||||
addParameter("mode", "remote");
|
||||
}
|
||||
if (dropdownHeight != null)
|
||||
addParameter("dropdownHeight", findValue(dropdownHeight, Integer.class));
|
||||
if (dropdownWidth != null)
|
||||
addParameter("dropdownWidth", findValue(dropdownWidth, Integer.class));
|
||||
if (formFilter != null)
|
||||
addParameter("formFilter", findString(formFilter));
|
||||
if (formId != null)
|
||||
addParameter("formId", findString(formId));
|
||||
if (listenTopics != null)
|
||||
addParameter("listenTopics", findString(listenTopics));
|
||||
if (notifyTopics != null)
|
||||
addParameter("notifyTopics", findString(notifyTopics));
|
||||
if (indicator != null)
|
||||
addParameter("indicator", findString(indicator));
|
||||
if (loadOnTextChange != null)
|
||||
addParameter("loadOnTextChange", findValue(loadOnTextChange, Boolean.class));
|
||||
if (loadMinimumCount != null)
|
||||
addParameter("loadMinimumCount", findValue(loadMinimumCount, Integer.class));
|
||||
if (showDownArrow != null)
|
||||
addParameter("showDownArrow", findValue(showDownArrow, Boolean.class));
|
||||
else
|
||||
addParameter("showDownArrow", Boolean.TRUE);
|
||||
if (templateCssPath != null)
|
||||
addParameter("templateCssPath", findString(templateCssPath));
|
||||
if (iconPath != null)
|
||||
addParameter("iconPath", findString(iconPath));
|
||||
if (dataFieldName != null)
|
||||
addParameter("dataFieldName", findString(dataFieldName));
|
||||
if (keyName != null)
|
||||
addParameter("keyName", findString(keyName));
|
||||
else {
|
||||
keyName = name + "Key";
|
||||
addParameter("keyName", findString(keyName));
|
||||
}
|
||||
if (transport != null)
|
||||
addParameter("transport", findString(transport));
|
||||
if (preload != null)
|
||||
addParameter("preload", findValue(preload, Boolean.class));
|
||||
|
||||
if (keyValue != null)
|
||||
addParameter("nameKeyValue", findString(keyValue));
|
||||
else {
|
||||
String keyNameExpr = "%{" + keyName + "}";
|
||||
addParameter("nameKeyValue", findString(keyNameExpr));
|
||||
}
|
||||
|
||||
|
||||
if (beforeNotifyTopics != null)
|
||||
addParameter("beforeNotifyTopics", findString(beforeNotifyTopics));
|
||||
if (afterNotifyTopics != null)
|
||||
addParameter("afterNotifyTopics", findString(afterNotifyTopics));
|
||||
if (errorNotifyTopics != null)
|
||||
addParameter("errorNotifyTopics", findString(errorNotifyTopics));
|
||||
if (valueNotifyTopics != null)
|
||||
addParameter("valueNotifyTopics", findString(valueNotifyTopics));
|
||||
if (resultsLimit != null)
|
||||
addParameter("searchLimit", findString(resultsLimit));
|
||||
|
||||
// generate a random ID if not explicitly set and not parsing the content
|
||||
Boolean parseContent = (Boolean)stack.getContext().get(Head.PARSE_CONTENT);
|
||||
boolean generateId = (parseContent != null ? !parseContent : true);
|
||||
|
||||
addParameter("pushId", generateId);
|
||||
if ((this.id == null || this.id.length() == 0) && generateId) {
|
||||
// resolves Math.abs(Integer.MIN_VALUE) issue reported by FindBugs
|
||||
// http://findbugs.sourceforge.net/bugDescriptions.html#RV_ABSOLUTE_VALUE_OF_RANDOM_INT
|
||||
int nextInt = RANDOM.nextInt();
|
||||
nextInt = nextInt == Integer.MIN_VALUE ? Integer.MAX_VALUE : Math.abs(nextInt);
|
||||
this.id = "widget_" + String.valueOf(nextInt);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@StrutsTagSkipInheritance
|
||||
public void setTheme(String theme) {
|
||||
super.setTheme(theme);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTheme() {
|
||||
return "ajax";
|
||||
}
|
||||
|
||||
protected Object findListValue() {
|
||||
return (list != null) ? findValue(list, Object.class) : null;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Whether autocompleter should make suggestion on the textbox", type="Boolean", defaultValue="false")
|
||||
public void setAutoComplete(String autoComplete) {
|
||||
this.autoComplete = autoComplete;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Enable or disable autocompleter", type="Boolean", defaultValue="false")
|
||||
public void setDisabled(String disabled) {
|
||||
this.disabled = disabled;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Force selection to be one of the options", type="Boolean", defaultValue="false")
|
||||
public void setForceValidOption(String forceValidOption) {
|
||||
this.forceValidOption = forceValidOption;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The URL used to load the options")
|
||||
public void setHref(String href) {
|
||||
this.href = href;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Delay before making the search", type="Integer", defaultValue="100")
|
||||
public void setDelay(String searchDelay) {
|
||||
this.delay = searchDelay;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="how the search must be performed, options are: 'startstring', 'startword' " +
|
||||
"and 'substring'", defaultValue="stringstart")
|
||||
public void setSearchType(String searchType) {
|
||||
this.searchType = searchType;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Dropdown's height in pixels", type="Integer", defaultValue="120")
|
||||
public void setDropdownHeight(String height) {
|
||||
this.dropdownHeight = height;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Dropdown's width", type="Integer", defaultValue="same as textbox")
|
||||
public void setDropdownWidth(String width) {
|
||||
this.dropdownWidth = width;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Function name used to filter the fields of the form")
|
||||
public void setFormFilter(String formFilter) {
|
||||
this.formFilter = formFilter;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Form id whose fields will be serialized and passed as parameters")
|
||||
public void setFormId(String formId) {
|
||||
this.formId = formId;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Topic that will trigger a reload")
|
||||
public void setListenTopics(String listenTopics) {
|
||||
this.listenTopics = listenTopics;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Topics that will be published when content is reloaded")
|
||||
public void setNotifyTopics(String onValueChangedPublishTopic) {
|
||||
this.notifyTopics = onValueChangedPublishTopic;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Id of element that will be shown while request is made")
|
||||
public void setIndicator(String indicator) {
|
||||
this.indicator = indicator;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Minimum number of characters that will force the content to be loaded", type="Integer", defaultValue="3")
|
||||
public void setLoadMinimumCount(String loadMinimumCount) {
|
||||
this.loadMinimumCount = loadMinimumCount;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Options will be reloaded everytime a character is typed on the textbox", type="Boolean", defaultValue="true")
|
||||
public void setLoadOnTextChange(String loadOnType) {
|
||||
this.loadOnTextChange = loadOnType;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Show or hide the down arrow button", type="Boolean", defaultValue="true")
|
||||
public void setShowDownArrow(String showDownArrow) {
|
||||
this.showDownArrow = showDownArrow;
|
||||
}
|
||||
|
||||
// Override as not required
|
||||
@StrutsTagAttribute(description="Iteratable source to populate from.")
|
||||
public void setList(String list) {
|
||||
super.setList(list);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Template css path")
|
||||
public void setTemplateCssPath(String templateCssPath) {
|
||||
this.templateCssPath = templateCssPath;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Path to icon used for the dropdown")
|
||||
public void setIconPath(String iconPath) {
|
||||
this.iconPath = iconPath;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Name of the field to which the selected key will be assigned")
|
||||
public void setKeyName(String keyName) {
|
||||
this.keyName = keyName;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Name of the field in the returned JSON object that contains the data array", defaultValue="Value specified in 'name'")
|
||||
public void setDataFieldName(String dataFieldName) {
|
||||
this.dataFieldName = dataFieldName;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The css class to use for element")
|
||||
public void setCssClass(String cssClass) {
|
||||
super.setCssClass(cssClass);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The css style to use for element")
|
||||
public void setCssStyle(String cssStyle) {
|
||||
super.setCssStyle(cssStyle);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The id to use for the element")
|
||||
public void setId(String id) {
|
||||
super.setId(id);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The name to set for element")
|
||||
public void setName(String name) {
|
||||
super.setName(name);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Preset the value of input element")
|
||||
public void setValue(String arg0) {
|
||||
super.setValue(arg0);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Comma delimmited list of topics that will published after the request(if the request succeeds)")
|
||||
public void setAfterNotifyTopics(String afterNotifyTopics) {
|
||||
this.afterNotifyTopics = afterNotifyTopics;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Comma delimmited list of topics that will published before the request")
|
||||
public void setBeforeNotifyTopics(String beforeNotifyTopics) {
|
||||
this.beforeNotifyTopics = beforeNotifyTopics;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Comma delimmited list of topics that will published after the request(if the request fails)")
|
||||
public void setErrorNotifyTopics(String errorNotifyTopics) {
|
||||
this.errorNotifyTopics = errorNotifyTopics;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Comma delimmited list of topics that will published when a value is selected")
|
||||
public void setValueNotifyTopics(String valueNotifyTopics) {
|
||||
this.valueNotifyTopics = valueNotifyTopics;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Limit how many results are shown as autocompletion options, set to -1 for unlimited results", defaultValue="30", type = "Integer")
|
||||
public void setResultsLimit(String resultsLimit) {
|
||||
this.resultsLimit = resultsLimit;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Transport used by Dojo to make the request", defaultValue="XMLHTTPTransport")
|
||||
public void setTransport(String transport) {
|
||||
this.transport = transport;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Load options when page is loaded", type="Boolean", defaultValue="true")
|
||||
public void setPreload(String preload) {
|
||||
this.preload = preload;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Initial key value")
|
||||
public void setKeyValue(String keyValue) {
|
||||
this.keyValue = keyValue;
|
||||
}
|
||||
}
|
||||
@@ -1,295 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.components;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
import org.apache.struts2.views.annotations.StrutsTagSkipInheritance;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* <p>
|
||||
* This tag will generate event listeners for multiple events on multiple sources,
|
||||
* making an asynchronous request to the specified href, and updating multiple targets.
|
||||
* </p>
|
||||
* <!-- END SNIPPET: javadoc -->
|
||||
*
|
||||
* <p>Examples</p>
|
||||
*
|
||||
* <!-- START SNIPPET: example0 -->
|
||||
* <sx:bind href="%{#ajaxTest}" listenTopics="/makecall"/>
|
||||
* <s:submit onclick="dojo.event.topic.publish('/makecall')"/>
|
||||
* <!-- END SNIPPET: example0 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example1 -->
|
||||
* <img id="indicator" src="${pageContext.request.contextPath}/images/indicator.gif" alt="Loading..." style="display:none"/>
|
||||
* <sx:bind id="ex1" href="%{#ajaxTest}" sources="button" targets="div1" events="onclick" indicator="indicator" />
|
||||
* <s:submit theme="simple" type="submit" value="submit" id="button"/>
|
||||
* <!-- END SNIPPET: example1 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example2 -->
|
||||
* <sx:bind id="ex3" href="%{#ajaxTest}" sources="chk1" targets="div1" events="onchange" formId="form1" />
|
||||
* <form id="form1">
|
||||
* <s:checkbox name="data" label="Hit me" id="chk1"/>
|
||||
* </form>
|
||||
* <!-- END SNIPPET: example2 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example4 -->
|
||||
* <script type="text/javascript">
|
||||
* dojo.event.topic.subscribe("/before", function(event, widget){
|
||||
* alert('inside a topic event. before request');
|
||||
* //event: set event.cancel = true, to cancel request
|
||||
* //widget: widget that published the topic
|
||||
* });
|
||||
* </script>
|
||||
*
|
||||
* <input type="button" id="button">
|
||||
* <sx:bind id="ex1" href="%{#ajaxTest}" beforeNotifyTopics="/before" sources="button" events="onclick"/>
|
||||
* <!-- END SNIPPET: example4 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example5 -->
|
||||
* <script type="text/javascript">
|
||||
* dojo.event.topic.subscribe("/after", function(data, request, widget){
|
||||
* alert('inside a topic event. after request');
|
||||
* //data : text returned from request(the html)
|
||||
* //request: XMLHttpRequest object
|
||||
* //widget: widget that published the topic
|
||||
* });
|
||||
* </script>
|
||||
*
|
||||
* <input type="button" id="button">
|
||||
* <sx:bind id="ex1" href="%{#ajaxTest}" highlightColor="red" afterNotifyTopics="/after" sources="button" events="onclick"/>
|
||||
* <!-- END SNIPPET: example5 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example6 -->
|
||||
* <script type="text/javascript">
|
||||
* dojo.event.topic.subscribe("/error", function(error, request, widget){
|
||||
* alert('inside a topic event. on error');
|
||||
* //error : error object (error.message has the error message)
|
||||
* //request: XMLHttpRequest object
|
||||
* //widget: widget that published the topic
|
||||
* });
|
||||
* </script>
|
||||
*
|
||||
* <input type="button" id="button">
|
||||
* <img id="ind1" src="${pageContext.request.contextPath}/images/indicator.gif" style="display:none"/>
|
||||
* <sx:bind href="%{#ajaxTest}" indicator="ind1" errorNotifyTopics="/error" sources="button" events="onclick"/>
|
||||
* <!-- END SNIPPET: example6 -->
|
||||
*/
|
||||
@StrutsTag(name="bind", tldTagClass="org.apache.struts2.dojo.views.jsp.ui.BindTag", description="Attach event listeners to elements to make AJAX calls")
|
||||
@StrutsTagSkipInheritance
|
||||
public class Bind extends AbstractValidateBean {
|
||||
public static final String TEMPLATE = "bind-close";
|
||||
public static final String OPEN_TEMPLATE = "bind";
|
||||
|
||||
protected String targets;
|
||||
protected String sources;
|
||||
protected String events;
|
||||
|
||||
public Bind(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
|
||||
super(stack, request, response);
|
||||
}
|
||||
|
||||
public String getDefaultOpenTemplate() {
|
||||
return OPEN_TEMPLATE;
|
||||
}
|
||||
|
||||
protected String getDefaultTemplate() {
|
||||
return TEMPLATE;
|
||||
}
|
||||
|
||||
public void evaluateExtraParams() {
|
||||
super.evaluateExtraParams();
|
||||
|
||||
if (targets != null)
|
||||
addParameter("targets", findString(targets));
|
||||
if (sources != null)
|
||||
addParameter("sources", findString(sources));
|
||||
if (events != null)
|
||||
addParameter("events", findString(events));
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Comma delimited list of event names to attach to")
|
||||
public void setEvents(String events) {
|
||||
this.events = events;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Comma delimited list of ids of the elements to attach to")
|
||||
public void setSources(String sources) {
|
||||
this.sources = sources;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Comma delimited list of ids of the elements whose content will be updated")
|
||||
public void setTargets(String targets) {
|
||||
this.targets = targets;
|
||||
}
|
||||
|
||||
@Override
|
||||
@StrutsTagSkipInheritance
|
||||
public void setTheme(String theme) {
|
||||
super.setTheme(theme);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTheme() {
|
||||
return "ajax";
|
||||
}
|
||||
|
||||
//these attributes are overwritten here just for the TLD generation
|
||||
|
||||
@StrutsTagAttribute(description="Topic that will trigger the remote call")
|
||||
public void setListenTopics(String listenTopics) {
|
||||
this.listenTopics = listenTopics;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The URL to call to obtain the content. Note: If used with ajax context, the value must be set as an url tag value.")
|
||||
public void setHref(String href) {
|
||||
this.href = href;
|
||||
}
|
||||
|
||||
|
||||
@StrutsTagAttribute(description="The text to display to the user if the is an error fetching the content")
|
||||
public void setErrorText(String errorText) {
|
||||
this.errorText = errorText;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Javascript code in the fetched content will be executed", type="Boolean", defaultValue="false")
|
||||
public void setExecuteScripts(String executeScripts) {
|
||||
this.executeScripts = executeScripts;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Text to be shown while content is being fetched", defaultValue="Loading...")
|
||||
public void setLoadingText(String loadingText) {
|
||||
this.loadingText = loadingText;
|
||||
}
|
||||
|
||||
|
||||
@StrutsTagAttribute(description="Javascript function name that will make the request")
|
||||
public void setHandler(String handler) {
|
||||
this.handler = handler;
|
||||
}
|
||||
|
||||
|
||||
@StrutsTagAttribute(description="Function name used to filter the fields of the form.")
|
||||
public void setFormFilter(String formFilter) {
|
||||
this.formFilter = formFilter;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Form id whose fields will be serialized and passed as parameters")
|
||||
public void setFormId(String formId) {
|
||||
this.formId = formId;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Comma delimmited list of topics that will published before and after the request, and on errors")
|
||||
public void setNotifyTopics(String notifyTopics) {
|
||||
this.notifyTopics = notifyTopics;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Set whether errors will be shown or not", type="Boolean", defaultValue="true")
|
||||
public void setShowErrorTransportText(String showError) {
|
||||
this.showErrorTransportText = showError;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Id of element that will be shown while making request")
|
||||
public void setIndicator(String indicator) {
|
||||
this.indicator = indicator;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Show loading text on targets", type="Boolean", defaultValue="false")
|
||||
public void setShowLoadingText(String showLoadingText) {
|
||||
this.showLoadingText = showLoadingText;
|
||||
}
|
||||
|
||||
@StrutsTagSkipInheritance
|
||||
public void setCssClass(String cssClass) {
|
||||
super.setCssClass(cssClass);
|
||||
}
|
||||
|
||||
@StrutsTagSkipInheritance
|
||||
public void setCssStyle(String cssStyle) {
|
||||
super.setCssStyle(cssStyle);
|
||||
}
|
||||
|
||||
@StrutsTagSkipInheritance
|
||||
public void setName(String name) {
|
||||
super.setName(name);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Comma delimmited list of topics that will published after the request(if the request succeeds)")
|
||||
public void setAfterNotifyTopics(String afterNotifyTopics) {
|
||||
this.afterNotifyTopics = afterNotifyTopics;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Comma delimmited list of topics that will published before the request")
|
||||
public void setBeforeNotifyTopics(String beforeNotifyTopics) {
|
||||
this.beforeNotifyTopics = beforeNotifyTopics;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Comma delimmited list of topics that will published after the request(if the request fails)")
|
||||
public void setErrorNotifyTopics(String errorNotifyTopics) {
|
||||
this.errorNotifyTopics = errorNotifyTopics;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The id to use for the element")
|
||||
public void setId(String id) {
|
||||
super.setId(id);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description = "Color used to perform a highlight effect on the elements specified in the 'targets' attribute",
|
||||
defaultValue = "none")
|
||||
public void setHighlightColor(String highlightColor) {
|
||||
this.highlightColor = highlightColor;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description = "Duration of highlight effect in milliseconds. Only valid if 'highlightColor' attribute is set",
|
||||
defaultValue = "2000", type="Integer")
|
||||
public void setHighlightDuration(String highlightDuration) {
|
||||
this.highlightDuration = highlightDuration;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description = "Perform Ajax validation. 'ajaxValidation' interceptor must be applied to action", type="Boolean",
|
||||
defaultValue = "false")
|
||||
public void setValidate(String validate) {
|
||||
this.validate = validate;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description = "Make an asynchronous request if validation succeeds. Only valid is 'validate' is 'true'", type="Boolean",
|
||||
defaultValue = "false")
|
||||
public void setAjaxAfterValidation(String ajaxAfterValidation) {
|
||||
this.ajaxAfterValidation = ajaxAfterValidation;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Run scripts in a separate scope, unique for each tag", defaultValue="true")
|
||||
public void setSeparateScripts(String separateScripts) {
|
||||
this.separateScripts = separateScripts;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Transport used by Dojo to make the request", defaultValue="XMLHTTPTransport")
|
||||
public void setTransport(String transport) {
|
||||
this.transport = transport;
|
||||
}
|
||||
}
|
||||
@@ -1,435 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.components;
|
||||
|
||||
import java.text.DateFormat;
|
||||
import java.text.Format;
|
||||
import java.text.MessageFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.UIBean;
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
import org.apache.struts2.views.annotations.StrutsTagSkipInheritance;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* <p>
|
||||
* Renders a date/time picker in a dropdown container.
|
||||
* </p>
|
||||
* <p>
|
||||
* A stand-alone DateTimePicker widget that makes it easy to select a date/time, or increment by week, month,
|
||||
* and/or year.
|
||||
* </p>
|
||||
*
|
||||
* <p>
|
||||
* It is possible to customize the user-visible formatting with either the
|
||||
* 'formatLength' (long, short, medium or full) or 'displayFormat' attributes. By defaulty current
|
||||
* locale will be used.</p>
|
||||
* </p>
|
||||
*
|
||||
* Syntax supported by 'displayFormat' is (http://www.unicode.org/reports/tr35/tr35-4.html#Date_Format_Patterns):-
|
||||
* <table border="1">
|
||||
* <tr>
|
||||
* <td>Format</td>
|
||||
* <td>Description</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>d</td>
|
||||
* <td>Day of the month</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>D</td>
|
||||
* <td>Day of year</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>M</td>
|
||||
* <td>Month - Use one or two for the numerical month, three for the abbreviation, or four for the full name, or 5 for the narrow name.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>y</td>
|
||||
* <td>Year</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>h</td>
|
||||
* <td>Hour [1-12].</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>H</td>
|
||||
* <td>Hour [0-23].</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>m</td>
|
||||
* <td>Minute. Use one or two for zero padding.</td>
|
||||
* </tr>
|
||||
* <tr>
|
||||
* <td>s</td>
|
||||
* <td>Second. Use one or two for zero padding.</td>
|
||||
* </tr>
|
||||
* </table>
|
||||
*
|
||||
* <p>
|
||||
* The value sent to the server is a locale-independent value, in a hidden field as defined
|
||||
* by the name attribute. The value will be formatted conforming to RFC3 339
|
||||
* (yyyy-MM-dd'T'HH:mm:ss)
|
||||
* </p>
|
||||
* <p>
|
||||
* The following formats(in order) will be used to parse the values of the attributes 'value',
|
||||
* 'startDate' and 'endDate':
|
||||
* </p>
|
||||
* <ul>
|
||||
* <li>SimpleDateFormat built using RFC 3339 (yyyy-MM-dd'T'HH:mm:ss)
|
||||
* <li>SimpleDateFormat.getTimeInstance(DateFormat.SHORT)
|
||||
* <li>SimpleDateFormat.getDateInstance(DateFormat.SHORT)
|
||||
* <li>SimpleDateFormat.getDateInstance(DateFormat.MEDIUM)
|
||||
* <li>SimpleDateFormat.getDateInstance(DateFormat.FULL)
|
||||
* <li>SimpleDateFormat.getDateInstance(DateFormat.LONG)
|
||||
* <li>SimpleDateFormat built using the value of the 'displayFormat' attribute(if any)
|
||||
* </ul>
|
||||
* <!-- END SNIPPET: javadoc -->
|
||||
*
|
||||
* <b>Examples</b>
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example1 -->
|
||||
* <sx:datetimepicker name="order.date" label="Order Date" />
|
||||
* <sx:datetimepicker name="delivery.date" label="Delivery Date" displayFormat="yyyy-MM-dd" />
|
||||
* <sx:datetimepicker name="delivery.date" label="Delivery Date" value="%{date}" />
|
||||
* <sx:datetimepicker name="delivery.date" label="Delivery Date" value="%{'2007-01-01'}" />
|
||||
* <sx:datetimepicker name="order.date" label="Order Date" value="%{'today'}"/>
|
||||
* <!-- END SNIPPET: example1 -->
|
||||
* </pre>
|
||||
*
|
||||
* <!-- START SNIPPET: example2 -->
|
||||
* <sx:datetimepicker id="picker" label="Order Date" />
|
||||
* <script type="text/javascript">
|
||||
* function setValue() {
|
||||
* var picker = dojo.widget.byId("picker");
|
||||
*
|
||||
* //string value
|
||||
* picker.setValue('2007-01-01');
|
||||
*
|
||||
* //Date value
|
||||
* picker.setValue(new Date());
|
||||
* }
|
||||
*
|
||||
* function showValue() {
|
||||
* var picker = dojo.widget.byId("picker");
|
||||
*
|
||||
* //string value
|
||||
* var stringValue = picker.getValue();
|
||||
* alert(stringValue);
|
||||
*
|
||||
* //date value
|
||||
* var dateValue = picker.getDate();
|
||||
* alert(dateValue);
|
||||
* }
|
||||
* </script>
|
||||
* <!-- END SNIPPET: example2 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example3 -->
|
||||
* <sx:datetimepicker id="picker" label="Order Date" valueNotifyTopics="/value"/>
|
||||
*
|
||||
* <script type="text/javascript">
|
||||
* dojo.event.topic.subscribe("/value", function(textEntered, date, widget){
|
||||
* alert('value changed');
|
||||
* //textEntered: String enetered in the textbox
|
||||
* //date: JavaScript Date object with the value selected
|
||||
* //widet: widget that published the topic
|
||||
* });
|
||||
* </script>
|
||||
* <!-- END SNIPPET: example3 -->
|
||||
*/
|
||||
@StrutsTag(name="datetimepicker", tldTagClass="org.apache.struts2.dojo.views.jsp.ui.DateTimePickerTag", description="Render datetimepicker")
|
||||
public class DateTimePicker extends UIBean {
|
||||
|
||||
final public static String TEMPLATE = "datetimepicker";
|
||||
// SimpleDateFormat is not thread-safe see:
|
||||
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6231579
|
||||
// http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6178997
|
||||
// solution is to use stateless MessageFormat instead:
|
||||
final private static String RFC3339_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";
|
||||
final private static String RFC3339_PATTERN = "{0,date," + RFC3339_FORMAT + "}";
|
||||
final protected static Logger LOG = LoggerFactory.getLogger(DateTimePicker.class);
|
||||
final private static transient Random RANDOM = new Random();
|
||||
|
||||
protected String iconPath;
|
||||
protected String formatLength;
|
||||
protected String displayFormat;
|
||||
protected String toggleType;
|
||||
protected String toggleDuration;
|
||||
protected String type;
|
||||
|
||||
protected String displayWeeks;
|
||||
protected String adjustWeeks;
|
||||
protected String startDate;
|
||||
protected String endDate;
|
||||
protected String weekStartsOn;
|
||||
protected String staticDisplay;
|
||||
protected String dayWidth;
|
||||
protected String language;
|
||||
protected String templateCssPath;
|
||||
protected String valueNotifyTopics;
|
||||
|
||||
public DateTimePicker(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
|
||||
super(stack, request, response);
|
||||
}
|
||||
|
||||
protected String getDefaultTemplate() {
|
||||
return TEMPLATE;
|
||||
}
|
||||
|
||||
public void evaluateParams() {
|
||||
super.evaluateParams();
|
||||
|
||||
if(displayFormat != null)
|
||||
addParameter("displayFormat", findString(displayFormat));
|
||||
if(displayWeeks != null)
|
||||
addParameter("displayWeeks", findString(displayWeeks));
|
||||
if(adjustWeeks != null)
|
||||
addParameter("adjustWeeks", findValue(adjustWeeks, Boolean.class));
|
||||
|
||||
if(disabled != null)
|
||||
addParameter("disabled", findValue(disabled, Boolean.class));
|
||||
|
||||
if(startDate != null)
|
||||
addParameter("startDate", format(findValue(startDate)));
|
||||
if(endDate != null)
|
||||
addParameter("endDate", format(findValue(endDate)));
|
||||
if(weekStartsOn != null)
|
||||
addParameter("weekStartsOn", findString(weekStartsOn));
|
||||
if(staticDisplay != null)
|
||||
addParameter("staticDisplay", findValue(staticDisplay, Boolean.class));
|
||||
if(dayWidth != null)
|
||||
addParameter("dayWidth", findValue(dayWidth, Integer.class));
|
||||
if(language != null)
|
||||
addParameter("language", findString(language));
|
||||
if(value != null)
|
||||
addParameter("value", format(findValue(value)));
|
||||
|
||||
if(iconPath != null)
|
||||
addParameter("iconPath", findString(iconPath));
|
||||
if(formatLength != null)
|
||||
addParameter("formatLength", findString(formatLength));
|
||||
if(toggleType != null)
|
||||
addParameter("toggleType", findString(toggleType));
|
||||
if(toggleDuration != null)
|
||||
addParameter("toggleDuration", findValue(toggleDuration,
|
||||
Integer.class));
|
||||
if(type != null)
|
||||
addParameter("type", findString(type));
|
||||
else
|
||||
addParameter("type", "date");
|
||||
if(templateCssPath != null)
|
||||
addParameter("templateCssPath", findString(templateCssPath));
|
||||
if(valueNotifyTopics != null)
|
||||
addParameter("valueNotifyTopics", findString(valueNotifyTopics));
|
||||
|
||||
// format the value to RFC 3399
|
||||
if(parameters.containsKey("value")) {
|
||||
addParameter("nameValue", parameters.get("value"));
|
||||
} else {
|
||||
if(parameters.containsKey("name")) {
|
||||
addParameter("nameValue", format(findValue((String)parameters.get("name"))));
|
||||
}
|
||||
}
|
||||
|
||||
// generate a random ID if not explicitly set and not parsing the content
|
||||
Boolean parseContent = (Boolean)stack.getContext().get(Head.PARSE_CONTENT);
|
||||
boolean generateId = (parseContent != null ? !parseContent : true);
|
||||
|
||||
addParameter("pushId", generateId);
|
||||
if ((this.id == null || this.id.length() == 0) && generateId) {
|
||||
// resolves Math.abs(Integer.MIN_VALUE) issue reported by FindBugs
|
||||
// http://findbugs.sourceforge.net/bugDescriptions.html#RV_ABSOLUTE_VALUE_OF_RANDOM_INT
|
||||
int nextInt = RANDOM.nextInt();
|
||||
nextInt = nextInt == Integer.MIN_VALUE ? Integer.MAX_VALUE : Math.abs(nextInt);
|
||||
this.id = "widget_" + String.valueOf(nextInt);
|
||||
addParameter("id", this.id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@StrutsTagSkipInheritance
|
||||
public void setTheme(String theme) {
|
||||
super.setTheme(theme);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTheme() {
|
||||
return "ajax";
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="If true, weekly size of calendar changes to acomodate the month if false," +
|
||||
" 42 day format is used", type="Boolean", defaultValue="false")
|
||||
public void setAdjustWeeks(String adjustWeeks) {
|
||||
this.adjustWeeks = adjustWeeks;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="How to render the names of the days in the header(narrow, abbr or wide)", defaultValue="narrow")
|
||||
public void setDayWidth(String dayWidth) {
|
||||
this.dayWidth = dayWidth;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Total weeks to display", type="Integer", defaultValue="6")
|
||||
public void setDisplayWeeks(String displayWeeks) {
|
||||
this.displayWeeks = displayWeeks;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Last available date in the calendar set", type="Date", defaultValue="2941-10-12")
|
||||
public void setEndDate(String endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="First available date in the calendar set", type="Date", defaultValue="1492-10-12")
|
||||
public void setStartDate(String startDate) {
|
||||
this.startDate = startDate;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Disable all incremental controls, must pick a date in the current display", type="Boolean", defaultValue="false")
|
||||
public void setStaticDisplay(String staticDisplay) {
|
||||
this.staticDisplay = staticDisplay;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Adjusts the first day of the week 0==Sunday..6==Saturday", type="Integer", defaultValue="0")
|
||||
public void setWeekStartsOn(String weekStartsOn) {
|
||||
this.weekStartsOn = weekStartsOn;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Language to display this widget in", defaultValue="brower's specified preferred language")
|
||||
public void setLanguage(String language) {
|
||||
this.language = language;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="A pattern used for the visual display of the formatted date, e.g. dd/MM/yyyy")
|
||||
public void setDisplayFormat(String displayFormat) {
|
||||
this.displayFormat = displayFormat;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Type of formatting used for visual display. Possible values are " +
|
||||
"long, short, medium or full", defaultValue="short")
|
||||
public void setFormatLength(String formatLength) {
|
||||
this.formatLength = formatLength;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Path to icon used for the dropdown")
|
||||
public void setIconPath(String iconPath) {
|
||||
this.iconPath = iconPath;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Duration of toggle in milliseconds", type="Integer", defaultValue="100")
|
||||
public void setToggleDuration(String toggleDuration) {
|
||||
this.toggleDuration = toggleDuration;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Defines the type of the picker on the dropdown. Possible values are 'date'" +
|
||||
" for a DateTimePicker, and 'time' for a timePicker", defaultValue="date")
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="oggle type of the dropdown. Possible values are plain,wipe,explode,fade", defaultValue="plain")
|
||||
public void setToggleType(String toggleType) {
|
||||
this.toggleType = toggleType;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Template css path")
|
||||
public void setTemplateCssPath(String templateCssPath) {
|
||||
this.templateCssPath = templateCssPath;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Preset the value of input element")
|
||||
public void setValue(String arg0) {
|
||||
super.setValue(arg0);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Comma delimmited list of topics that will published when a value is selected")
|
||||
public void setValueNotifyTopics(String valueNotifyTopics) {
|
||||
this.valueNotifyTopics = valueNotifyTopics;
|
||||
}
|
||||
|
||||
private String format(Object obj) {
|
||||
if(obj == null)
|
||||
return null;
|
||||
|
||||
if(obj instanceof Date) {
|
||||
return MessageFormat.format(RFC3339_PATTERN, (Date) obj);
|
||||
} else if(obj instanceof Calendar) {
|
||||
return MessageFormat.format(RFC3339_PATTERN, ((Calendar) obj).getTime());
|
||||
}
|
||||
else {
|
||||
// try to parse a date
|
||||
String dateStr = obj.toString();
|
||||
if(dateStr.equalsIgnoreCase("today"))
|
||||
return MessageFormat.format(RFC3339_PATTERN, new Date());
|
||||
|
||||
|
||||
Date date = null;
|
||||
//formats used to parse the date
|
||||
List<DateFormat> formats = new ArrayList<DateFormat>();
|
||||
formats.add(new SimpleDateFormat(RFC3339_FORMAT));
|
||||
formats.add(SimpleDateFormat.getTimeInstance(DateFormat.SHORT));
|
||||
formats.add(SimpleDateFormat.getDateInstance(DateFormat.SHORT));
|
||||
formats.add(SimpleDateFormat.getDateInstance(DateFormat.MEDIUM));
|
||||
formats.add(SimpleDateFormat.getDateInstance(DateFormat.FULL));
|
||||
formats.add(SimpleDateFormat.getDateInstance(DateFormat.LONG));
|
||||
if (this.displayFormat != null) {
|
||||
try {
|
||||
SimpleDateFormat displayFormat = new SimpleDateFormat(
|
||||
(String) getParameters().get("displayFormat"));
|
||||
formats.add(displayFormat);
|
||||
} catch (Exception e) {
|
||||
// don't use it then (this attribute is used by Dojo, not java code)
|
||||
LOG.error("Cannot use attribute", e);
|
||||
}
|
||||
}
|
||||
|
||||
for (DateFormat format : formats) {
|
||||
try {
|
||||
date = format.parse(dateStr);
|
||||
if (date != null)
|
||||
return MessageFormat.format(RFC3339_PATTERN, date);
|
||||
} catch (Exception e) {
|
||||
//keep going
|
||||
}
|
||||
}
|
||||
|
||||
// last resource, assume already in correct/default format
|
||||
if (LOG.isDebugEnabled())
|
||||
LOG.debug("Unable to parse date " + dateStr);
|
||||
return dateStr;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,176 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.components;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* <p>
|
||||
* This tag generates an HTML div that loads its content using an XMLHttpRequest call, via
|
||||
* the dojo framework. When the "updateFreq" is set the built in timer will start automatically and
|
||||
* reload the div content with the value of "updateFreq" as the refresh period(in milliseconds).
|
||||
* Topics can be used to stop(stopTimerListenTopics) and start(startTimerListenTopics) this timer.
|
||||
* </p>
|
||||
* <p>
|
||||
* When used inside a "tabbedpanel" tag, each div becomes a tab. Some attributes are specific
|
||||
* to this use case, like:
|
||||
* <ul>
|
||||
* <li>refreshOnShow: div content is realoded when tab is selected</li>
|
||||
* <li>closable: Tab will have close button</li>
|
||||
* <li>preload: load div content after page is loaded</li>
|
||||
* </ul>
|
||||
* </p>
|
||||
* <!-- END SNIPPET: javadoc -->
|
||||
*
|
||||
* <p>Examples</p>
|
||||
* <!-- START SNIPPET: example1 -->
|
||||
* <sx:div href="%{#url}">Initial Content</sx:div>
|
||||
* <!-- END SNIPPET: example1 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example2 -->
|
||||
* <img id="indicator" src="${pageContext.request.contextPath}/images/indicator.gif" style="display:none"/>
|
||||
* <sx:div href="%{#url}" updateFreq="2000" indicator="indicator">
|
||||
* Initial Content
|
||||
* </sx:div>
|
||||
* <!-- END SNIPPET: example2 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example3 -->
|
||||
* <form id="form">
|
||||
* <label for="textInput">Text to be submited when div reloads</label>
|
||||
* <input type=textbox id="textInput" name="data">
|
||||
* </form>
|
||||
* <sx:div
|
||||
* href="%{#url}"
|
||||
* updateFreq="3000"
|
||||
* listenTopics="/refresh"
|
||||
* startTimerListenTopics="/startTimer"
|
||||
* stopTimerListenTopics="/stopTimer"
|
||||
* highlightColor="red"
|
||||
* formId="form">
|
||||
* Initial Content
|
||||
* </sx:div>
|
||||
* <!-- END SNIPPET: example3 -->
|
||||
*/
|
||||
@StrutsTag(name="div", tldTagClass="org.apache.struts2.dojo.views.jsp.ui.DivTag", description="Render HTML div providing content from remote call via AJAX")
|
||||
public class Div extends AbstractRemoteBean {
|
||||
|
||||
public static final String TEMPLATE = "div";
|
||||
public static final String TEMPLATE_CLOSE = "div-close";
|
||||
public static final String COMPONENT_NAME = Div.class.getName();
|
||||
|
||||
protected String updateFreq;
|
||||
protected String autoStart;
|
||||
protected String delay;
|
||||
protected String startTimerListenTopics;
|
||||
protected String stopTimerListenTopics;
|
||||
protected String refreshOnShow;
|
||||
protected String closable;
|
||||
protected String preload;
|
||||
|
||||
public Div(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
|
||||
super(stack, request, response);
|
||||
}
|
||||
|
||||
public String getDefaultOpenTemplate() {
|
||||
return TEMPLATE;
|
||||
}
|
||||
|
||||
protected String getDefaultTemplate() {
|
||||
return TEMPLATE_CLOSE;
|
||||
}
|
||||
|
||||
public void evaluateExtraParams() {
|
||||
super.evaluateExtraParams();
|
||||
|
||||
if (updateFreq != null)
|
||||
addParameter("updateFreq", findValue(updateFreq, Integer.class));
|
||||
if (autoStart != null)
|
||||
addParameter("autoStart", findValue(autoStart, Boolean.class));
|
||||
if (refreshOnShow != null)
|
||||
addParameter("refreshOnShow", findValue(refreshOnShow, Boolean.class));
|
||||
if (delay != null)
|
||||
addParameter("delay", findValue(delay, Integer.class));
|
||||
if (startTimerListenTopics != null)
|
||||
addParameter("startTimerListenTopics", findString(startTimerListenTopics));
|
||||
if (stopTimerListenTopics != null)
|
||||
addParameter("stopTimerListenTopics", findString(stopTimerListenTopics));
|
||||
if (separateScripts != null)
|
||||
addParameter("separateScripts", findValue(separateScripts, Boolean.class));
|
||||
if (closable != null)
|
||||
addParameter("closable", findValue(closable, Boolean.class));
|
||||
if (preload != null)
|
||||
addParameter("preload", findValue(preload, Boolean.class));
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Start timer automatically", type="Boolean", defaultValue="true")
|
||||
public void setAutoStart(String autoStart) {
|
||||
this.autoStart = autoStart;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="How long to wait before fetching the content (in milliseconds)", type="Integer")
|
||||
public void setDelay(String delay) {
|
||||
this.delay = delay;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="How often to reload the content (in milliseconds)", type="Integer")
|
||||
public void setUpdateFreq(String updateInterval) {
|
||||
this.updateFreq = updateInterval;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Topics that will start the timer (for autoupdate)")
|
||||
public void setStartTimerListenTopics(String startTimerListenTopic) {
|
||||
this.startTimerListenTopics = startTimerListenTopic;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Topics that will stop the timer (for autoupdate)")
|
||||
public void setStopTimerListenTopics(String stopTimerListenTopic) {
|
||||
this.stopTimerListenTopics = stopTimerListenTopic;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Content will be loaded when div becomes visible, used only inside the tabbedpanel tag", type="Boolean", defaultValue="false")
|
||||
public void setRefreshOnShow(String refreshOnShow) {
|
||||
this.refreshOnShow = refreshOnShow;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Show a close button when the div is inside a 'tabbedpanel'", defaultValue="false")
|
||||
public void setClosable(String closable) {
|
||||
this.closable = closable;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Load content when page is loaded", type="Boolean", defaultValue="true")
|
||||
public void setPreload(String preload) {
|
||||
this.preload = preload;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description = "Color used to perform a highlight effect on this element",
|
||||
defaultValue = "none")
|
||||
public void setHighlightColor(String highlightColor) {
|
||||
this.highlightColor = highlightColor;
|
||||
}
|
||||
}
|
||||
@@ -1,218 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.components;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
import org.apache.struts2.views.annotations.StrutsTagSkipInheritance;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: notice -->
|
||||
* The "head" tag renders required JavaScript code to configure Dojo and is required in order to use
|
||||
* any of the tags included in the Dojo plugin.</p>
|
||||
* <!-- END SNIPPET: notice -->
|
||||
*
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* <p></p>
|
||||
*
|
||||
* <p>To debug javascript errors set the "debug" attribute to true, which will display Dojo
|
||||
* (and Struts) warning and error messages at the bottom of the page. Core Dojo files are by default
|
||||
* compressed, to improve loading time, which makes them very hard to read. To debug Dojo and Struts
|
||||
* widgets, set the "compressed" attribute to true. Make sure to turn this option off before
|
||||
* moving your project into production, as uncompressed files will take longer to download.
|
||||
* </p>
|
||||
* <p>For troubleshooting javascript problems the following configuration is recommended:</p>
|
||||
* <pre>
|
||||
* <sx:head debug="true" cache="false" compressed="false" />
|
||||
* </pre>
|
||||
*
|
||||
* <p>Dojo files are loaded as required by the Dojo loading mechanism. The problem with this
|
||||
* approach is that the files are not cached by the browser, so reloading a page or navigating
|
||||
* to a different page that uses the same widgets will cause the files to be reloaded. To solve
|
||||
* this problem a custom Dojo profile is distributed with the Dojo plugin. This profile contains
|
||||
* the files required by the tags in the Dojo plugin, all in one file (524Kb), which is cached
|
||||
* by the browser. This file will take longer to load by the browser but it will be downloaded
|
||||
* only once. By default the "cache" attribute is set to false.</p>
|
||||
*
|
||||
* <p>Some tags like the "datetimepicker" can use different locales, to use a locale
|
||||
* that is different from the request locale, it must be specified on the "extraLocales"
|
||||
* attribute. This attribute can contain a comma separated list of locale names. From
|
||||
* Dojo's documentation:</p>
|
||||
*
|
||||
* <p>
|
||||
* The locale is a short string, defined by the host environment, which conforms to RFC 3066
|
||||
* (http://www.ietf.org/rfc/rfc3066.txt) used in the HTML specification.
|
||||
* It consists of short identifiers, typically two characters
|
||||
* long which are case-insensitive. Note that Dojo uses dash separators, not underscores like
|
||||
* Java (e.g. "en-us", not "en_US"). Typically country codes are used in the optional second
|
||||
* identifier, and additional variants may be specified. For example, Japanese is "ja";
|
||||
* Japanese in Japan is "ja-jp". Notice that the lower case is intentional -- while Dojo
|
||||
* will often convert all locales to lowercase to normalize them, it is the lowercase that
|
||||
* must be used when defining your resources.
|
||||
* </p>
|
||||
*
|
||||
* <p>The "locale" attribute configures Dojo's locale:</p>
|
||||
*
|
||||
* <p>"The locale Dojo uses on a page may be overridden by setting djConfig.locale. This may be
|
||||
* done to accomodate applications with a known user profile or server pages which do manual
|
||||
* assembly and assume a certain locale. You may also set djConfig.extraLocale to load
|
||||
* localizations in addition to your own, in case you want to specify a particular
|
||||
* translation or have multiple languages appear on your page."</p>
|
||||
*
|
||||
* <p>To improve loading time, the property "parseContent" is set to false by default. This property will
|
||||
* instruct Dojo to only build widgets using specific element ids. If the property is set to true
|
||||
* Dojo will scan the whole document looking for widgets.</p>
|
||||
*
|
||||
* <p>Dojo 0.4.3 is distributed with the Dojo plugin, to use a different Dojo version, the
|
||||
* "baseRelativePath" attribute can be set to the URL of the Dojo root folder on your application.
|
||||
* </p>
|
||||
* <!-- END SNIPPET: javadoc -->
|
||||
*
|
||||
* <p/> <b>Examples</b>
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example1 -->
|
||||
* <%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
|
||||
* <head>
|
||||
* <title>My page</title>
|
||||
* <sx:head/>
|
||||
* </head>
|
||||
* <!-- END SNIPPET: example1 -->
|
||||
* </pre>
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example3 -->
|
||||
* <%@ taglib prefix="sx" uri="/struts-dojo-tags" %>
|
||||
* <head>
|
||||
* <title>My page</title>
|
||||
* <sx:head debug="true" extraLocales="en-us,nl-nl,de-de"/>
|
||||
* </head>
|
||||
* <!-- END SNIPPET: example3 -->
|
||||
* </pre>
|
||||
*
|
||||
*/
|
||||
@StrutsTag(name="head", tldBodyContent="empty", tldTagClass="org.apache.struts2.dojo.views.jsp.ui.HeadTag",
|
||||
description="Render a chunk of HEAD for your HTML file")
|
||||
@StrutsTagSkipInheritance
|
||||
public class Head extends org.apache.struts2.components.Head {
|
||||
public static final String TEMPLATE = "head";
|
||||
public static final String PARSE_CONTENT = "struts.dojo.head.parseContent";
|
||||
|
||||
private String debug;
|
||||
private String compressed;
|
||||
private String baseRelativePath;
|
||||
private String extraLocales;
|
||||
private String locale;
|
||||
private String cache;
|
||||
private String parseContent;
|
||||
|
||||
public Head(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
|
||||
super(stack, request, response);
|
||||
}
|
||||
|
||||
protected String getDefaultTemplate() {
|
||||
return TEMPLATE;
|
||||
}
|
||||
|
||||
public void evaluateParams() {
|
||||
super.evaluateParams();
|
||||
|
||||
if (this.debug != null)
|
||||
addParameter("debug", findValue(this.debug, Boolean.class));
|
||||
if (this.compressed != null)
|
||||
addParameter("compressed", findValue(this.compressed, Boolean.class));
|
||||
if (this.baseRelativePath != null)
|
||||
addParameter("baseRelativePath", findString(this.baseRelativePath));
|
||||
if (this.extraLocales != null) {
|
||||
String locales = findString(this.extraLocales);
|
||||
addParameter("extraLocales", locales.split(","));
|
||||
}
|
||||
if (this.locale != null)
|
||||
addParameter("locale", findString(this.locale));
|
||||
if (this.cache != null)
|
||||
addParameter("cache", findValue(this.cache, Boolean.class));
|
||||
if (this.parseContent != null) {
|
||||
Boolean shouldParseContent = (Boolean) findValue(this.parseContent, Boolean.class);
|
||||
addParameter("parseContent", shouldParseContent);
|
||||
stack.getContext().put(PARSE_CONTENT, shouldParseContent);
|
||||
} else {
|
||||
addParameter("parseContent", false);
|
||||
stack.getContext().put(PARSE_CONTENT, false);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@StrutsTagSkipInheritance
|
||||
public void setTheme(String theme) {
|
||||
super.setTheme(theme);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTheme() {
|
||||
return "ajax";
|
||||
}
|
||||
|
||||
public boolean isDebug() {
|
||||
return debug != null && Boolean.parseBoolean(debug);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Enable Dojo debug messages", defaultValue="false", type="Boolean")
|
||||
public void setDebug(String debug) {
|
||||
this.debug = debug;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Use compressed version of dojo.js", defaultValue="true", type="Boolean")
|
||||
public void setCompressed(String compressed) {
|
||||
this.compressed = compressed;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Context relative path of Dojo distribution folder", defaultValue="/struts/dojo")
|
||||
public void setBaseRelativePath(String baseRelativePath) {
|
||||
this.baseRelativePath = baseRelativePath;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Comma separated list of locale names to be loaded by Dojo, locale names must be specified as in RFC3066")
|
||||
public void setExtraLocales(String extraLocales) {
|
||||
this.extraLocales = extraLocales;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Default locale to be used by Dojo, locale name must be specified as in RFC3066")
|
||||
public void setLocale(String locale) {
|
||||
this.locale = locale;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Use Struts Dojo profile, which contains all Struts widgets in one file, making it possible to be chached by " +
|
||||
"the browser", defaultValue="true", type="Boolean")
|
||||
public void setCache(String cache) {
|
||||
this.cache = cache;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Parse the whole document for widgets", defaultValue="false", type="Boolean")
|
||||
public void setParseContent(String parseContent) {
|
||||
this.parseContent = parseContent;
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.components;
|
||||
|
||||
|
||||
public interface RemoteBean {
|
||||
|
||||
void setListenTopics(String topics);
|
||||
|
||||
void setNotifyTopics(String topics);
|
||||
|
||||
void setHref(String href);
|
||||
|
||||
void setErrorText(String errorText);
|
||||
|
||||
void setAfterNotifyTopics(String afterNotifyTopics);
|
||||
|
||||
void setBeforeNotifyTopics(String beforeNotifyTopics);
|
||||
|
||||
void setErrorNotifyTopics(String errorNotifyTopics);
|
||||
|
||||
void setExecuteScripts(String executeScripts);
|
||||
|
||||
void setLoadingText(String loadingText);
|
||||
|
||||
void setHandler(String handler);
|
||||
|
||||
void setFormFilter(String formFilter);
|
||||
|
||||
void setFormId(String formId);
|
||||
|
||||
void setShowErrorTransportText(String showError);
|
||||
|
||||
void setShowLoadingText(String showLoadingText);
|
||||
|
||||
void setIndicator(String indicator);
|
||||
|
||||
void setName(String name);
|
||||
|
||||
void setCssStyle(String style);
|
||||
|
||||
void setCssClass(String cssClass);
|
||||
|
||||
void setHighlightColor(String color);
|
||||
|
||||
void setHighlightDuration(String color);
|
||||
|
||||
void setSeparateScripts(String separateScripts);
|
||||
|
||||
void setTransport(String transport);
|
||||
|
||||
void setParseContent(String parseContent);
|
||||
}
|
||||
@@ -1,465 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.components;
|
||||
|
||||
import java.io.Writer;
|
||||
import java.util.Random;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Form;
|
||||
import org.apache.struts2.components.FormButton;
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
import org.apache.struts2.views.annotations.StrutsTagSkipInheritance;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
import com.opensymphony.xwork2.util.logging.Logger;
|
||||
import com.opensymphony.xwork2.util.logging.LoggerFactory;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* Renders a submit button that can submit a form asynchronously.
|
||||
* The submit can have three different types of rendering:
|
||||
* <ul>
|
||||
* <li>input: renders as html <input type="submit"...></li>
|
||||
* <li>image: renders as html <input type="image"...></li>
|
||||
* <li>button: renders as html <button type="submit"...></li>
|
||||
* </ul>
|
||||
* Please note that the button type has advantages by adding the possibility to seperate the submitted value from the
|
||||
* text shown on the button face, but has issues with Microsoft Internet Explorer at least up to 6.0
|
||||
* <!-- END SNIPPET: javadoc -->
|
||||
*
|
||||
* <p>Examples</p>
|
||||
* <!-- START SNIPPET: example1 -->
|
||||
* <sx:submit value="%{'Submit'}" />
|
||||
* <!-- END SNIPPET: example1 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example2 -->
|
||||
* <sx:submit type="image" value="%{'Submit'}" label="Submit the form" src="submit.gif"/>
|
||||
* <!-- END SNIPPET: example2 -->
|
||||
|
||||
* <!-- START SNIPPET: example3 -->
|
||||
* <sx:submit type="button" value="%{'Submit'}" label="Submit the form"/>
|
||||
* <!-- END SNIPPET: example3 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example4 -->
|
||||
* <div id="div1">Div 1</div>
|
||||
* <s:url id="ajaxTest" value="/AjaxTest.action"/>
|
||||
*
|
||||
* <sx:submit id="link1" href="%{ajaxTest}" target="div1" />
|
||||
* <!-- END SNIPPET: example4 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example5 -->
|
||||
* <s:form id="form" action="AjaxTest">
|
||||
* <input type="textbox" name="data">
|
||||
* <sx:submit />
|
||||
* </s:form>
|
||||
* <!-- END SNIPPET: example5 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example6 -->
|
||||
* <s:form id="form" action="AjaxTest">
|
||||
* <input type="textbox" name="data">
|
||||
* </s:form>
|
||||
*
|
||||
* <sx:submit formId="form" />
|
||||
* <!-- END SNIPPET: example6 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example7 -->
|
||||
* <script type="text/javascript">
|
||||
* dojo.event.topic.subscribe("/before", function(event, widget){
|
||||
* alert('inside a topic event. before request');
|
||||
* //event: set event.cancel = true, to cancel request
|
||||
* //widget: widget that published the topic
|
||||
* });
|
||||
* </script>
|
||||
*
|
||||
* <sx:submit beforeNotifyTopics="/before" />
|
||||
* <!-- END SNIPPET: example7 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example8 -->
|
||||
* <script type="text/javascript">
|
||||
* dojo.event.topic.subscribe("/after", function(data, request, widget){
|
||||
* alert('inside a topic event. after request');
|
||||
* //data : text returned from request(the html)
|
||||
* //request: XMLHttpRequest object
|
||||
* //widget: widget that published the topic
|
||||
* });
|
||||
* </script>
|
||||
*
|
||||
* <sx:submit afterNotifyTopics="/after" highlightColor="red" href="%{#ajaxTest}" />
|
||||
* <!-- END SNIPPET: example8 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example9 -->
|
||||
* <script type="text/javascript">
|
||||
* dojo.event.topic.subscribe("/error", function(error, request, widget){
|
||||
* alert('inside a topic event. on error');
|
||||
* //error : error object (error.message has the error message)
|
||||
* //request: XMLHttpRequest object
|
||||
* //widget: widget that published the topic
|
||||
* });
|
||||
* </script>
|
||||
*
|
||||
* <img id="ind1" src="${pageContext.request.contextPath}/images/indicator.gif" style="display:none"/>
|
||||
* <sx:submit errorNotifyTopics="/error" indicator="ind1" href="%{#ajaxTest}" />
|
||||
* <!-- END SNIPPET: example9 -->
|
||||
*/
|
||||
@StrutsTag(name="submit", tldTagClass="org.apache.struts2.dojo.views.jsp.ui.SubmitTag", description="Render a submit button")
|
||||
public class Submit extends FormButton implements RemoteBean {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(Submit.class);
|
||||
private final static transient Random RANDOM = new Random();
|
||||
|
||||
final public static String OPEN_TEMPLATE = "submit";
|
||||
final public static String TEMPLATE = "submit-close";
|
||||
|
||||
protected String href;
|
||||
protected String errorText;
|
||||
protected String executeScripts;
|
||||
protected String loadingText;
|
||||
protected String listenTopics;
|
||||
protected String handler;
|
||||
protected String formId;
|
||||
protected String formFilter;
|
||||
protected String src;
|
||||
protected String notifyTopics;
|
||||
protected String showErrorTransportText;
|
||||
protected String indicator;
|
||||
protected String showLoadingText;
|
||||
protected String targets;
|
||||
protected String beforeNotifyTopics;
|
||||
protected String afterNotifyTopics;
|
||||
protected String errorNotifyTopics;
|
||||
protected String highlightColor;
|
||||
protected String highlightDuration;
|
||||
protected String validate;
|
||||
protected String ajaxAfterValidation;
|
||||
protected String separateScripts;
|
||||
protected String transport;
|
||||
protected String parseContent;
|
||||
|
||||
public Submit(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
|
||||
super(stack, request, response);
|
||||
}
|
||||
|
||||
protected String getDefaultTemplate() {
|
||||
return TEMPLATE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDefaultOpenTemplate() {
|
||||
return OPEN_TEMPLATE;
|
||||
}
|
||||
|
||||
public void evaluateParams() {
|
||||
if ((key == null) && (value == null)) {
|
||||
value = "Submit";
|
||||
}
|
||||
|
||||
if (((key != null)) && (value == null)) {
|
||||
this.value = "%{getText('"+key +"')}";
|
||||
}
|
||||
|
||||
super.evaluateParams();
|
||||
}
|
||||
|
||||
public void evaluateExtraParams() {
|
||||
super.evaluateExtraParams();
|
||||
|
||||
if (href != null)
|
||||
addParameter("href", findString(href));
|
||||
if (errorText != null)
|
||||
addParameter("errorText", findString(errorText));
|
||||
if (loadingText != null)
|
||||
addParameter("loadingText", findString(loadingText));
|
||||
if (executeScripts != null)
|
||||
addParameter("executeScripts", findValue(executeScripts, Boolean.class));
|
||||
if (listenTopics != null)
|
||||
addParameter("listenTopics", findString(listenTopics));
|
||||
if (notifyTopics != null)
|
||||
addParameter("notifyTopics", findString(notifyTopics));
|
||||
if (handler != null)
|
||||
addParameter("handler", findString(handler));
|
||||
if (formId != null)
|
||||
addParameter("formId", findString(formId));
|
||||
if (formFilter != null)
|
||||
addParameter("formFilter", findString(formFilter));
|
||||
if (src != null)
|
||||
addParameter("src", findString(src));
|
||||
if (indicator != null)
|
||||
addParameter("indicator", findString(indicator));
|
||||
if (targets != null)
|
||||
addParameter("targets", findString(targets));
|
||||
if (showLoadingText != null)
|
||||
addParameter("showLoadingText", findString(showLoadingText));
|
||||
if (showLoadingText != null)
|
||||
addParameter("showLoadingText", findString(showLoadingText));
|
||||
if (beforeNotifyTopics != null)
|
||||
addParameter("beforeNotifyTopics", findString(beforeNotifyTopics));
|
||||
if (afterNotifyTopics != null)
|
||||
addParameter("afterNotifyTopics", findString(afterNotifyTopics));
|
||||
if (errorNotifyTopics != null)
|
||||
addParameter("errorNotifyTopics", findString(errorNotifyTopics));
|
||||
if (highlightColor != null)
|
||||
addParameter("highlightColor", findString(highlightColor));
|
||||
if (highlightDuration != null)
|
||||
addParameter("highlightDuration", findString(highlightDuration));
|
||||
if (separateScripts != null)
|
||||
addParameter("separateScripts", findValue(separateScripts, Boolean.class));
|
||||
if (transport != null)
|
||||
addParameter("transport", findString(transport));
|
||||
if (parseContent != null)
|
||||
addParameter("parseContent", findValue(parseContent, Boolean.class));
|
||||
|
||||
Boolean validateValue = false;
|
||||
if (validate != null) {
|
||||
validateValue = (Boolean) findValue(validate, Boolean.class);
|
||||
addParameter("validate", validateValue);
|
||||
}
|
||||
|
||||
Form form = (Form) findAncestor(Form.class);
|
||||
if (form != null)
|
||||
addParameter("parentTheme", form.getTheme());
|
||||
|
||||
if (ajaxAfterValidation != null)
|
||||
addParameter("ajaxAfterValidation", findValue(ajaxAfterValidation, Boolean.class));
|
||||
|
||||
// generate a random ID if not explicitly set and not parsing the content
|
||||
Boolean parseContent = (Boolean)stack.getContext().get(Head.PARSE_CONTENT);
|
||||
boolean generateId = (parseContent != null ? !parseContent : true);
|
||||
|
||||
addParameter("pushId", generateId);
|
||||
if ((this.id == null || this.id.length() == 0) && generateId) {
|
||||
// resolves Math.abs(Integer.MIN_VALUE) issue reported by FindBugs
|
||||
// http://findbugs.sourceforge.net/bugDescriptions.html#RV_ABSOLUTE_VALUE_OF_RANDOM_INT
|
||||
int nextInt = RANDOM.nextInt();
|
||||
nextInt = nextInt == Integer.MIN_VALUE ? Integer.MAX_VALUE : Math.abs(nextInt);
|
||||
this.id = "widget_" + String.valueOf(nextInt);
|
||||
addParameter("id", this.id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@StrutsTagSkipInheritance
|
||||
public void setTheme(String theme) {
|
||||
super.setTheme(theme);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTheme() {
|
||||
return "ajax";
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicate whether the concrete button supports the type "image".
|
||||
*
|
||||
* @return <tt>true</tt> to indicate type image is supported.
|
||||
*/
|
||||
protected boolean supportsImageType() {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Overrides to be able to render body in a template rather than always before the template
|
||||
*/
|
||||
public boolean end(Writer writer, String body) {
|
||||
evaluateParams();
|
||||
try {
|
||||
addParameter("body", body);
|
||||
|
||||
mergeTemplate(writer, buildTemplateName(template, getDefaultTemplate()));
|
||||
} catch (Exception e) {
|
||||
LOG.error("error when rendering", e);
|
||||
}
|
||||
finally {
|
||||
popComponentStack();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Topic that will trigger the remote call")
|
||||
public void setListenTopics(String listenTopics) {
|
||||
this.listenTopics = listenTopics;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The URL to call to obtain the content. Note: If used with ajax context, the value must be set as an url tag value.")
|
||||
public void setHref(String href) {
|
||||
this.href = href;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The text to display to the user if the is an error fetching the content")
|
||||
public void setErrorText(String errorText) {
|
||||
this.errorText = errorText;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Javascript code in the fetched content will be executed", type="Boolean", defaultValue="false")
|
||||
public void setExecuteScripts(String executeScripts) {
|
||||
this.executeScripts = executeScripts;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Text to be shown while content is being fetched", defaultValue="Loading...")
|
||||
public void setLoadingText(String loadingText) {
|
||||
this.loadingText = loadingText;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Javascript function name that will make the request")
|
||||
public void setHandler(String handler) {
|
||||
this.handler = handler;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Function name used to filter the fields of the form.")
|
||||
public void setFormFilter(String formFilter) {
|
||||
this.formFilter = formFilter;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Form id whose fields will be serialized and passed as parameters")
|
||||
public void setFormId(String formId) {
|
||||
this.formId = formId;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Supply an image src for <i>image</i> type submit button. Will have no effect for types <i>input</i> and <i>button</i>.")
|
||||
public void setSrc(String src) {
|
||||
this.src = src;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Comma delimited list of ids of the elements whose content will be updated")
|
||||
public void setTargets(String targets) {
|
||||
this.targets = targets;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Comma delimmited list of topics that will published before and after the request, and on errors")
|
||||
public void setNotifyTopics(String notifyTopics) {
|
||||
this.notifyTopics = notifyTopics;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Set whether errors will be shown or not", type="Boolean", defaultValue="true")
|
||||
public void setShowErrorTransportText(String showErrorTransportText) {
|
||||
this.showErrorTransportText = showErrorTransportText;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Set indicator")
|
||||
public void setIndicator(String indicator) {
|
||||
this.indicator = indicator;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Show loading text on targets", type="Boolean", defaultValue="false")
|
||||
public void setShowLoadingText(String showLoadingText) {
|
||||
this.showLoadingText = showLoadingText;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The css class to use for element")
|
||||
public void setCssClass(String cssClass) {
|
||||
super.setCssClass(cssClass);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The css style to use for element")
|
||||
public void setCssStyle(String cssStyle) {
|
||||
super.setCssStyle(cssStyle);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The id to use for the element")
|
||||
public void setId(String id) {
|
||||
super.setId(id);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The name to set for element")
|
||||
public void setName(String name) {
|
||||
super.setName(name);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The type of submit to use. Valid values are <i>input</i>, " +
|
||||
"<i>button</i> and <i>image</i>.", defaultValue="input")
|
||||
public void setType(String type) {
|
||||
super.setType(type);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Preset the value of input element.")
|
||||
public void setValue(String value) {
|
||||
super.setValue(value);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Label expression used for rendering a element specific label")
|
||||
public void setLabel(String label) {
|
||||
super.setLabel(label);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Comma delimmited list of topics that will published after the request(if the request succeeds)")
|
||||
public void setAfterNotifyTopics(String afterNotifyTopics) {
|
||||
this.afterNotifyTopics = afterNotifyTopics;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Comma delimmited list of topics that will published before the request")
|
||||
public void setBeforeNotifyTopics(String beforeNotifyTopics) {
|
||||
this.beforeNotifyTopics = beforeNotifyTopics;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Comma delimmited list of topics that will published after the request(if the request fails)")
|
||||
public void setErrorNotifyTopics(String errorNotifyTopics) {
|
||||
this.errorNotifyTopics = errorNotifyTopics;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description = "Color used to perform a highlight effect on the elements specified in the 'targets' attribute",
|
||||
defaultValue = "none")
|
||||
public void setHighlightColor(String highlightColor) {
|
||||
this.highlightColor = highlightColor;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description = "Duration of highlight effect in milliseconds. Only valid if 'highlightColor' attribute is set",
|
||||
defaultValue = "1000")
|
||||
public void setHighlightDuration(String highlightDuration) {
|
||||
this.highlightDuration = highlightDuration;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description = "Perform Ajax validation. 'ajaxValidation' interceptor must be applied to action", type="Boolean",
|
||||
defaultValue = "false")
|
||||
public void setValidate(String validate) {
|
||||
this.validate = validate;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description = "Make an asynchronous request if validation succeeds. Only valid if 'validate' is 'true'", type="Boolean",
|
||||
defaultValue = "false")
|
||||
public void setAjaxAfterValidation(String ajaxAfterValidation) {
|
||||
this.ajaxAfterValidation = ajaxAfterValidation;
|
||||
}
|
||||
|
||||
@StrutsTagSkipInheritance
|
||||
public void setAction(String action) {
|
||||
super.setAction(action);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Run scripts in a separate scope, unique for each tag", defaultValue="true")
|
||||
public void setSeparateScripts(String separateScripts) {
|
||||
this.separateScripts = separateScripts;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Transport used by Dojo to make the request", defaultValue="XMLHTTPTransport")
|
||||
public void setTransport(String transport) {
|
||||
this.transport = transport;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Parse returned HTML for Dojo widgets", defaultValue="true", type="Boolean")
|
||||
public void setParseContent(String parseContent) {
|
||||
this.parseContent = parseContent;
|
||||
}
|
||||
}
|
||||
@@ -1,223 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.components;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
import org.apache.struts2.components.ClosingUIBean;
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
import org.apache.struts2.views.annotations.StrutsTagSkipInheritance;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* The tabbedpanel widget is primarily an AJAX component, where each tab can either be local content or remote
|
||||
* content (refreshed each time the user selects that tab).</p>
|
||||
* If the useSelectedTabCookie attribute is set to true, the id of the selected tab is saved in a cookie on activation.
|
||||
* When coming back to this view, the cookie is read and the tab will be activated again, unless an actual value for the
|
||||
* selectedTab attribute is specified.</p>
|
||||
* If you want to use the cookie feature, please be sure that you provide a unique id for your tabbedpanel component,
|
||||
* since this will also be the identifying name component of the stored cookie.</p>
|
||||
* <!-- END SNIPPET: javadoc -->
|
||||
*
|
||||
* <p/> <b>Examples</b>
|
||||
* <p/>
|
||||
*
|
||||
* <!-- START SNIPPET: example1 -->
|
||||
* <sx:head />
|
||||
* <sx:tabbedpanel id="test" >
|
||||
* <sx:div id="one" label="one" theme="ajax" labelposition="top" >
|
||||
* This is the first pane<br/>
|
||||
* <s:form>
|
||||
* <s:textfield name="tt" label="Test Text"/> <br/>
|
||||
* <s:textfield name="tt2" label="Test Text2"/>
|
||||
* </s:form>
|
||||
* </sx:div>
|
||||
* <sx:div id="three" label="remote" theme="ajax" href="/AjaxTest.action" >
|
||||
* This is the remote tab
|
||||
* </sx:div>
|
||||
* </sx:tabbedpanel>
|
||||
* <!-- END SNIPPET: example1 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example2 -->
|
||||
* <sx:head />
|
||||
* <script type="text/javascript">
|
||||
* dojo.event.topic.subscribe("/beforeSelect", function(event, tab, tabContainer){
|
||||
* event.cancel = true;
|
||||
* });
|
||||
* </script>
|
||||
*
|
||||
* <sx:tabbedpanel id="test" beforeSelectTabNotifyTopics="/beforeSelect">
|
||||
* <sx:div id="three" label="remote" theme="ajax" href="/AjaxTest.action" >
|
||||
* One Tab
|
||||
* </sx:div>
|
||||
* <sx:div id="three" label="remote" theme="ajax" href="/AjaxTest.action" >
|
||||
* Another tab
|
||||
* </sx:div>
|
||||
* </sx:tabbedpanel>
|
||||
* <!-- END SNIPPET: example2 -->
|
||||
*/
|
||||
@StrutsTag(name="tabbedpanel", tldTagClass="org.apache.struts2.dojo.views.jsp.ui.TabbedPanelTag", description="Render a tabbedPanel widget.")
|
||||
public class TabbedPanel extends ClosingUIBean {
|
||||
public static final String TEMPLATE = "tabbedpanel";
|
||||
public static final String TEMPLATE_CLOSE = "tabbedpanel-close";
|
||||
final private static String COMPONENT_NAME = TabbedPanel.class.getName();
|
||||
private final static transient Random RANDOM = new Random();
|
||||
|
||||
protected String selectedTab;
|
||||
protected String closeButton;
|
||||
protected String doLayout ;
|
||||
protected String templateCssPath;
|
||||
protected String beforeSelectTabNotifyTopics;
|
||||
protected String afterSelectTabNotifyTopics;
|
||||
protected String disabledTabCssClass;
|
||||
protected String useSelectedTabCookie;
|
||||
|
||||
public TabbedPanel(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
|
||||
super(stack, request, response);
|
||||
}
|
||||
|
||||
|
||||
protected void evaluateExtraParams() {
|
||||
super.evaluateExtraParams();
|
||||
|
||||
if (selectedTab != null)
|
||||
addParameter("selectedTab", findString(selectedTab));
|
||||
if (closeButton != null)
|
||||
addParameter("closeButton", findString(closeButton));
|
||||
addParameter("doLayout", doLayout != null ? findValue(doLayout, Boolean.class) : Boolean.FALSE);
|
||||
if (labelPosition != null) {
|
||||
//dojo has some weird name for label positions
|
||||
if(labelPosition.equalsIgnoreCase("left"))
|
||||
labelPosition = "left-h";
|
||||
if(labelPosition.equalsIgnoreCase("right"))
|
||||
labelPosition = "right-h";
|
||||
addParameter("labelPosition", null);
|
||||
addParameter("labelPosition", labelPosition);
|
||||
}
|
||||
if (templateCssPath != null)
|
||||
addParameter("templateCssPath", findString(templateCssPath));
|
||||
if (beforeSelectTabNotifyTopics!= null)
|
||||
addParameter("beforeSelectTabNotifyTopics", findString(beforeSelectTabNotifyTopics));
|
||||
if (afterSelectTabNotifyTopics!= null)
|
||||
addParameter("afterSelectTabNotifyTopics", findString(afterSelectTabNotifyTopics));
|
||||
if (disabledTabCssClass!= null)
|
||||
addParameter("disabledTabCssClass", findString(disabledTabCssClass));
|
||||
if(useSelectedTabCookie != null) {
|
||||
addParameter("useSelectedTabCookie", findString(useSelectedTabCookie));
|
||||
}
|
||||
|
||||
// generate a random ID if not explicitly set and not parsing the content
|
||||
Boolean parseContent = (Boolean)stack.getContext().get(Head.PARSE_CONTENT);
|
||||
boolean generateId = (parseContent != null ? !parseContent : true);
|
||||
|
||||
addParameter("pushId", generateId);
|
||||
if ((this.id == null || this.id.length() == 0) && generateId) {
|
||||
// resolves Math.abs(Integer.MIN_VALUE) issue reported by FindBugs
|
||||
// http://findbugs.sourceforge.net/bugDescriptions.html#RV_ABSOLUTE_VALUE_OF_RANDOM_INT
|
||||
int nextInt = RANDOM.nextInt();
|
||||
nextInt = nextInt == Integer.MIN_VALUE ? Integer.MAX_VALUE : Math.abs(nextInt);
|
||||
this.id = "widget_" + String.valueOf(nextInt);
|
||||
addParameter("id", this.id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@StrutsTagSkipInheritance
|
||||
public void setTheme(String theme) {
|
||||
super.setTheme(theme);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTheme() {
|
||||
return "ajax";
|
||||
}
|
||||
|
||||
public String getDefaultOpenTemplate() {
|
||||
return TEMPLATE;
|
||||
}
|
||||
|
||||
protected String getDefaultTemplate() {
|
||||
return TEMPLATE_CLOSE;
|
||||
}
|
||||
|
||||
public String getComponentName() {
|
||||
return COMPONENT_NAME;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The id to assign to the component.", required=true)
|
||||
public void setId(String id) {
|
||||
// This is required to override tld generation attributes to required=true
|
||||
super.setId(id);
|
||||
}
|
||||
|
||||
|
||||
@StrutsTagAttribute(description=" The id of the tab that will be selected by default")
|
||||
public void setSelectedTab(String selectedTab) {
|
||||
this.selectedTab = selectedTab;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Deprecated. Use 'closable' on each div(tab)")
|
||||
public void setCloseButton(String closeButton) {
|
||||
this.closeButton = closeButton;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="If doLayout is false, the tab container's height equals the height of the currently selected tab", type="Boolean", defaultValue="false")
|
||||
public void setDoLayout(String doLayout) {
|
||||
this.doLayout = doLayout;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Template css path")
|
||||
public void setTemplateCssPath(String templateCssPath) {
|
||||
this.templateCssPath = templateCssPath;
|
||||
}
|
||||
|
||||
|
||||
@StrutsTagAttribute(description="Comma separated list of topics to be published when a tab is clicked on (before it is selected)" +
|
||||
"The tab container widget will be passed as the first argument to the topic. The second parameter is the tab widget." +
|
||||
"The event can be cancelled setting to 'true' the 'cancel' property " +
|
||||
"of the third parameter passed to the topics.")
|
||||
public void setBeforeSelectTabNotifyTopics(String selectedTabNotifyTopics) {
|
||||
this.beforeSelectTabNotifyTopics = selectedTabNotifyTopics;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Comma separated list of topics to be published when a tab is clicked on (after it is selected)." +
|
||||
"The tab container widget will be passed as the first argument to the topic. The second parameter is the tab widget.")
|
||||
public void setAfterSelectTabNotifyTopics(String afterSelectTabNotifyTopics) {
|
||||
this.afterSelectTabNotifyTopics = afterSelectTabNotifyTopics;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Css class to be applied to the tab button of disabled tabs", defaultValue="strutsDisabledTab")
|
||||
public void setDisabledTabCssClass(String disabledTabCssClass) {
|
||||
this.disabledTabCssClass = disabledTabCssClass;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(required = false, defaultValue = "false", description = "If set to true, the id of the last selected " +
|
||||
"tab will be stored in cookie. If the view is rendered, it will be tried to read this cookie and activate " +
|
||||
"the corresponding tab on success, unless overridden by the selectedTab attribute. The cookie name is \"Struts2TabbedPanel_selectedTab_\"+id.")
|
||||
public void setUseSelectedTabCookie( String useSelectedTabCookie ) {
|
||||
this.useSelectedTabCookie = useSelectedTabCookie;
|
||||
}
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.components;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
* Render Dojo Editor2 widget
|
||||
* <!-- END SNIPPET: javadoc -->
|
||||
*
|
||||
*/
|
||||
@StrutsTag(name="textarea", tldTagClass="org.apache.struts2.dojo.views.jsp.ui.TextareaTag", description="Renders Dojo Editor2 widget")
|
||||
public class TextArea extends org.apache.struts2.components.TextArea {
|
||||
private final static transient Random RANDOM = new Random();
|
||||
|
||||
public TextArea(ValueStack stack, HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
super(stack, request, response);
|
||||
}
|
||||
|
||||
public void evaluateExtraParams() {
|
||||
super.evaluateExtraParams();
|
||||
|
||||
// generate a random ID if not explicitly set and not parsing the content
|
||||
Boolean parseContent = (Boolean)stack.getContext().get(Head.PARSE_CONTENT);
|
||||
boolean generateId = (parseContent != null ? !parseContent : true);
|
||||
|
||||
addParameter("pushId", generateId);
|
||||
if ((this.id == null || this.id.length() == 0) && generateId) {
|
||||
// resolves Math.abs(Integer.MIN_VALUE) issue reported by FindBugs
|
||||
// http://findbugs.sourceforge.net/bugDescriptions.html#RV_ABSOLUTE_VALUE_OF_RANDOM_INT
|
||||
int nextInt = RANDOM.nextInt();
|
||||
nextInt = nextInt == Integer.MIN_VALUE ? Integer.MAX_VALUE : Math.abs(nextInt);
|
||||
this.id = "widget_" + String.valueOf(nextInt);
|
||||
addParameter("id", this.id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTheme() {
|
||||
return "ajax";
|
||||
}
|
||||
}
|
||||
@@ -1,551 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.components;
|
||||
|
||||
import java.io.Writer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.ClosingUIBean;
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
import org.apache.struts2.views.annotations.StrutsTagSkipInheritance;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
*
|
||||
* Renders a tree widget with AJAX support.<p/>
|
||||
*
|
||||
* The "id "attribute is normally specified(recommended), such that it could be looked up using
|
||||
* javascript if necessary. The "id" attribute is required if the "selectedNotifyTopic" or the
|
||||
* "href" attributes are going to be used.<p/>
|
||||
*
|
||||
* <!-- END SNIPPET: javadoc -->
|
||||
*
|
||||
* <!-- START SNIPPET: example1 -->
|
||||
* <s:tree id="..." label="...">
|
||||
* <s:treenode id="..." label="..." />
|
||||
* <s:treenode id="..." label="...">
|
||||
* <s:treenode id="..." label="..." />
|
||||
* <s:treenode id="..." label="..." />
|
||||
* </s:treenode>
|
||||
* <s:treenode id="..." label="..." />
|
||||
* </s:tree>
|
||||
* <!-- END SNIPPET: example1 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example2 -->
|
||||
* <s:tree
|
||||
* id="..."
|
||||
* rootNode="..."
|
||||
* nodeIdProperty="..."
|
||||
* nodeTitleProperty="..."
|
||||
* childCollectionProperty="..." />
|
||||
* <!-- END SNIPPET: example2 -->
|
||||
*
|
||||
* <!-- START SNIPPET: example3 -->
|
||||
* <s:url id="nodesUrl" namespace="/nodecorate" action="getNodes" />
|
||||
* <div style="float:left; margin-right: 50px;">
|
||||
* <sx:tree id="tree" href="%{#nodesUrl}" />
|
||||
* </div>
|
||||
*
|
||||
* On this example the url specified on the "href" attibute will be called to load
|
||||
* the elements on the root. The response is expected to be a JSON array of objects like:
|
||||
* [
|
||||
* {
|
||||
* label: "Node 1",
|
||||
* hasChildren: false,
|
||||
* id: "Node1"
|
||||
* },
|
||||
* {
|
||||
* label: "Node 2",
|
||||
* hasChildren: true,
|
||||
* id: "Node2"
|
||||
* },
|
||||
* ]
|
||||
*
|
||||
* "label" is the text that will be displayed for the node. "hasChildren" marks the node has
|
||||
* having children or not (if true, a plus icon will be assigned to the node so it can be
|
||||
* expanded). The "id" attribute will be used to load the children of the node, when the node
|
||||
* is expanded. When a node is expanded a request will be made to the url in the "href" attribute
|
||||
* and the node's "id" will be passed in the parameter "nodeId".
|
||||
*
|
||||
* The children collection for a node will be loaded only once, to reload the children of a
|
||||
* node, use the "reload()" function of the treenode widget. To reload the children nodes of "Node1"
|
||||
* from the example above use the following javascript:
|
||||
*
|
||||
* dojo.widget.byId("Node1").reload();
|
||||
* <!-- END SNIPPET: example3 -->
|
||||
*/
|
||||
@StrutsTag(name="tree", tldTagClass="org.apache.struts2.dojo.views.jsp.ui.TreeTag", description="Render a tree widget.")
|
||||
public class Tree extends ClosingUIBean {
|
||||
|
||||
private static final String TEMPLATE = "tree-close";
|
||||
private static final String OPEN_TEMPLATE = "tree";
|
||||
private final static transient Random RANDOM = new Random();
|
||||
|
||||
protected String toggle;
|
||||
protected String selectedNotifyTopics;
|
||||
protected String expandedNotifyTopics;
|
||||
protected String collapsedNotifyTopics;
|
||||
protected String rootNodeAttr;
|
||||
protected String childCollectionProperty;
|
||||
protected String nodeTitleProperty;
|
||||
protected String nodeIdProperty;
|
||||
protected String showRootGrid;
|
||||
|
||||
protected String showGrid;
|
||||
protected String blankIconSrc;
|
||||
protected String gridIconSrcL;
|
||||
protected String gridIconSrcV;
|
||||
protected String gridIconSrcP;
|
||||
protected String gridIconSrcC;
|
||||
protected String gridIconSrcX;
|
||||
protected String gridIconSrcY;
|
||||
protected String expandIconSrcPlus;
|
||||
protected String expandIconSrcMinus;
|
||||
protected String iconWidth;
|
||||
protected String iconHeight;
|
||||
protected String toggleDuration;
|
||||
protected String templateCssPath;
|
||||
protected String href;
|
||||
protected String errorNotifyTopics;
|
||||
|
||||
private List<String> childrenIds;
|
||||
|
||||
public Tree(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
|
||||
super(stack, request, response);
|
||||
}
|
||||
|
||||
public boolean start(Writer writer) {
|
||||
boolean result = super.start(writer);
|
||||
|
||||
if (this.label == null && (href == null)) {
|
||||
if ((rootNodeAttr == null)
|
||||
|| (childCollectionProperty == null)
|
||||
|| (nodeTitleProperty == null)
|
||||
|| (nodeIdProperty == null)) {
|
||||
fieldError("label","The TreeTag requires either a value for 'label' or 'href' or ALL of 'rootNode', " +
|
||||
"'childCollectionProperty', 'nodeTitleProperty', and 'nodeIdProperty'", null);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
protected void evaluateExtraParams() {
|
||||
super.evaluateExtraParams();
|
||||
|
||||
if (toggle != null) {
|
||||
addParameter("toggle", findString(toggle));
|
||||
} else {
|
||||
addParameter("toggle", "fade");
|
||||
}
|
||||
|
||||
if (selectedNotifyTopics != null) {
|
||||
addParameter("selectedNotifyTopics", findString(selectedNotifyTopics));
|
||||
}
|
||||
|
||||
if (expandedNotifyTopics != null) {
|
||||
addParameter("expandedNotifyTopics", findString(expandedNotifyTopics));
|
||||
}
|
||||
|
||||
if (collapsedNotifyTopics != null) {
|
||||
addParameter("collapsedNotifyTopics", findString(collapsedNotifyTopics));
|
||||
}
|
||||
|
||||
if (rootNodeAttr != null) {
|
||||
addParameter("rootNode", findValue(rootNodeAttr));
|
||||
}
|
||||
|
||||
if (childCollectionProperty != null) {
|
||||
addParameter("childCollectionProperty", findString(childCollectionProperty));
|
||||
}
|
||||
|
||||
if (nodeTitleProperty != null) {
|
||||
addParameter("nodeTitleProperty", findString(nodeTitleProperty));
|
||||
}
|
||||
|
||||
if (nodeIdProperty != null) {
|
||||
addParameter("nodeIdProperty", findString(nodeIdProperty));
|
||||
}
|
||||
|
||||
if (showRootGrid != null) {
|
||||
addParameter("showRootGrid", findValue(showRootGrid, Boolean.class));
|
||||
}
|
||||
|
||||
|
||||
if (showGrid != null) {
|
||||
addParameter("showGrid", findValue(showGrid, Boolean.class));
|
||||
}
|
||||
|
||||
if (blankIconSrc != null) {
|
||||
addParameter("blankIconSrc", findString(blankIconSrc));
|
||||
}
|
||||
|
||||
if (gridIconSrcL != null) {
|
||||
addParameter("gridIconSrcL", findString(gridIconSrcL));
|
||||
}
|
||||
|
||||
if (gridIconSrcV != null) {
|
||||
addParameter("gridIconSrcV", findString(gridIconSrcV));
|
||||
}
|
||||
|
||||
if (gridIconSrcP != null) {
|
||||
addParameter("gridIconSrcP", findString(gridIconSrcP));
|
||||
}
|
||||
|
||||
if (gridIconSrcC != null) {
|
||||
addParameter("gridIconSrcC", findString(gridIconSrcC));
|
||||
}
|
||||
|
||||
if (gridIconSrcX != null) {
|
||||
addParameter("gridIconSrcX", findString(gridIconSrcX));
|
||||
}
|
||||
|
||||
if (gridIconSrcY != null) {
|
||||
addParameter("gridIconSrcY", findString(gridIconSrcY));
|
||||
}
|
||||
|
||||
if (expandIconSrcPlus != null) {
|
||||
addParameter("expandIconSrcPlus", findString(expandIconSrcPlus));
|
||||
}
|
||||
|
||||
if (expandIconSrcMinus != null) {
|
||||
addParameter("expandIconSrcMinus", findString(expandIconSrcMinus));
|
||||
}
|
||||
|
||||
if (iconWidth != null) {
|
||||
addParameter("iconWidth", findValue(iconWidth, Integer.class));
|
||||
}
|
||||
if (iconHeight != null) {
|
||||
addParameter("iconHeight", findValue(iconHeight, Integer.class));
|
||||
}
|
||||
if (toggleDuration != null) {
|
||||
addParameter("toggleDuration", findValue(toggleDuration, Integer.class));
|
||||
}
|
||||
if (templateCssPath != null) {
|
||||
addParameter("templateCssPath", findString(templateCssPath));
|
||||
}
|
||||
if (href != null)
|
||||
addParameter("href", findString(href));
|
||||
if (errorNotifyTopics != null)
|
||||
addParameter("errorNotifyTopics", findString(errorNotifyTopics));
|
||||
|
||||
// generate a random ID if not explicitly set and not parsing the content
|
||||
Boolean parseContent = (Boolean)stack.getContext().get(Head.PARSE_CONTENT);
|
||||
boolean generateId = (parseContent != null ? !parseContent : true);
|
||||
|
||||
addParameter("pushId", generateId);
|
||||
if ((this.id == null || this.id.length() == 0) && generateId) {
|
||||
// resolves Math.abs(Integer.MIN_VALUE) issue reported by FindBugs
|
||||
// http://findbugs.sourceforge.net/bugDescriptions.html#RV_ABSOLUTE_VALUE_OF_RANDOM_INT
|
||||
int nextInt = RANDOM.nextInt();
|
||||
nextInt = nextInt == Integer.MIN_VALUE ? Integer.MAX_VALUE : Math.abs(nextInt);
|
||||
this.id = "widget_" + String.valueOf(nextInt);
|
||||
addParameter("id", this.id);
|
||||
}
|
||||
|
||||
if (this.childrenIds != null)
|
||||
addParameter("childrenIds", this.childrenIds);
|
||||
}
|
||||
|
||||
public void addChildrenId(String id) {
|
||||
if (this.childrenIds == null)
|
||||
this.childrenIds = new ArrayList<String>();
|
||||
this.childrenIds.add(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
@StrutsTagSkipInheritance
|
||||
public void setTheme(String theme) {
|
||||
super.setTheme(theme);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTheme() {
|
||||
return "ajax";
|
||||
}
|
||||
|
||||
public String getDefaultOpenTemplate() {
|
||||
return OPEN_TEMPLATE;
|
||||
}
|
||||
|
||||
protected String getDefaultTemplate() {
|
||||
return TEMPLATE;
|
||||
}
|
||||
|
||||
public String getToggle() {
|
||||
return toggle;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The toggle property (either 'explode' or 'fade')", defaultValue="fade")
|
||||
public void setToggle(String toggle) {
|
||||
this.toggle = toggle;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Deprecated. Use 'selectedNotifyTopics' instead.")
|
||||
public void setTreeSelectedTopic(String selectedNotifyTopic) {
|
||||
this.selectedNotifyTopics = selectedNotifyTopic;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Deprecated. Use 'expandedNotifyTopics' instead.")
|
||||
public void setTreeExpandedTopics(String expandedNotifyTopic) {
|
||||
this.expandedNotifyTopics = expandedNotifyTopic;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Deprecated. Use 'collapsedNotifyTopics' instead.")
|
||||
public void setTreeCollapsedTopics(String collapsedNotifyTopic) {
|
||||
this.collapsedNotifyTopics = collapsedNotifyTopic;
|
||||
}
|
||||
|
||||
public String getRootNode() {
|
||||
return rootNodeAttr;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The rootNode property.")
|
||||
public void setRootNode(String rootNode) {
|
||||
this.rootNodeAttr = rootNode;
|
||||
}
|
||||
|
||||
public String getChildCollectionProperty() {
|
||||
return childCollectionProperty;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The childCollectionProperty property.")
|
||||
public void setChildCollectionProperty(String childCollectionProperty) {
|
||||
this.childCollectionProperty = childCollectionProperty;
|
||||
}
|
||||
|
||||
public String getNodeTitleProperty() {
|
||||
return nodeTitleProperty;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The nodeTitleProperty property.")
|
||||
public void setNodeTitleProperty(String nodeTitleProperty) {
|
||||
this.nodeTitleProperty = nodeTitleProperty;
|
||||
}
|
||||
|
||||
public String getNodeIdProperty() {
|
||||
return nodeIdProperty;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The nodeIdProperty property.")
|
||||
public void setNodeIdProperty(String nodeIdProperty) {
|
||||
this.nodeIdProperty = nodeIdProperty;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The showRootGrid property (default true).")
|
||||
public void setShowRootGrid(String showRootGrid) {
|
||||
this.showRootGrid = showRootGrid;
|
||||
}
|
||||
|
||||
public String getShowRootGrid() {
|
||||
return showRootGrid;
|
||||
}
|
||||
|
||||
public String getBlankIconSrc() {
|
||||
return blankIconSrc;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Blank icon image source.")
|
||||
public void setBlankIconSrc(String blankIconSrc) {
|
||||
this.blankIconSrc = blankIconSrc;
|
||||
}
|
||||
|
||||
public String getExpandIconSrcMinus() {
|
||||
return expandIconSrcMinus;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Expand icon (-) image source.")
|
||||
public void setExpandIconSrcMinus(String expandIconSrcMinus) {
|
||||
this.expandIconSrcMinus = expandIconSrcMinus;
|
||||
}
|
||||
|
||||
public String getExpandIconSrcPlus() {
|
||||
return expandIconSrcPlus;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Expand Icon (+) image source.")
|
||||
public void setExpandIconSrcPlus(String expandIconSrcPlus) {
|
||||
this.expandIconSrcPlus = expandIconSrcPlus;
|
||||
}
|
||||
|
||||
public String getGridIconSrcC() {
|
||||
return gridIconSrcC;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Image source for under child item child icons.")
|
||||
public void setGridIconSrcC(String gridIconSrcC) {
|
||||
this.gridIconSrcC = gridIconSrcC;
|
||||
}
|
||||
|
||||
public String getGridIconSrcL() {
|
||||
return gridIconSrcL;
|
||||
}
|
||||
|
||||
|
||||
@StrutsTagAttribute(description=" Image source for last child grid.")
|
||||
public void setGridIconSrcL(String gridIconSrcL) {
|
||||
this.gridIconSrcL = gridIconSrcL;
|
||||
}
|
||||
|
||||
public String getGridIconSrcP() {
|
||||
return gridIconSrcP;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Image source for under parent item child icons.")
|
||||
public void setGridIconSrcP(String gridIconSrcP) {
|
||||
this.gridIconSrcP = gridIconSrcP;
|
||||
}
|
||||
|
||||
public String getGridIconSrcV() {
|
||||
return gridIconSrcV;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Image source for vertical line.")
|
||||
public void setGridIconSrcV(String gridIconSrcV) {
|
||||
this.gridIconSrcV = gridIconSrcV;
|
||||
}
|
||||
|
||||
public String getGridIconSrcX() {
|
||||
return gridIconSrcX;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Image source for grid for sole root item.")
|
||||
public void setGridIconSrcX(String gridIconSrcX) {
|
||||
this.gridIconSrcX = gridIconSrcX;
|
||||
}
|
||||
|
||||
public String getGridIconSrcY() {
|
||||
return gridIconSrcY;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Image source for grid for last root item.")
|
||||
public void setGridIconSrcY(String gridIconSrcY) {
|
||||
this.gridIconSrcY = gridIconSrcY;
|
||||
}
|
||||
|
||||
public String getIconHeight() {
|
||||
return iconHeight;
|
||||
}
|
||||
|
||||
|
||||
@StrutsTagAttribute(description="Icon height", defaultValue="18px")
|
||||
public void setIconHeight(String iconHeight) {
|
||||
this.iconHeight = iconHeight;
|
||||
}
|
||||
|
||||
public String getIconWidth() {
|
||||
return iconWidth;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Icon width", defaultValue="19px")
|
||||
public void setIconWidth(String iconWidth) {
|
||||
this.iconWidth = iconWidth;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getTemplateCssPath() {
|
||||
return templateCssPath;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Template css path", defaultValue="{contextPath}/struts/tree.css.")
|
||||
public void setTemplateCssPath(String templateCssPath) {
|
||||
this.templateCssPath = templateCssPath;
|
||||
}
|
||||
|
||||
public String getToggleDuration() {
|
||||
return toggleDuration;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Toggle duration in milliseconds", defaultValue="150")
|
||||
public void setToggleDuration(String toggleDuration) {
|
||||
this.toggleDuration = toggleDuration;
|
||||
}
|
||||
|
||||
public String getShowGrid() {
|
||||
return showGrid;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Show grid", type="Boolean", defaultValue="true")
|
||||
public void setShowGrid(String showGrid) {
|
||||
this.showGrid = showGrid;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The css class to use for element")
|
||||
public void setCssClass(String cssClass) {
|
||||
super.setCssClass(cssClass);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The css style to use for element")
|
||||
public void setCssStyle(String cssStyle) {
|
||||
super.setCssStyle(cssStyle);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The id to use for the element")
|
||||
public void setId(String id) {
|
||||
super.setId(id);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The name to set for element")
|
||||
public void setName(String name) {
|
||||
super.setName(name);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Comma separated lis of topics to be published when a node" +
|
||||
" is collapsed. An object with a 'node' property will be passed as parameter to the topics.")
|
||||
public void setCollapsedNotifyTopics(String collapsedNotifyTopics) {
|
||||
this.collapsedNotifyTopics = collapsedNotifyTopics;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Comma separated lis of topics to be published when a node" +
|
||||
" is expanded. An object with a 'node' property will be passed as parameter to the topics.")
|
||||
public void setExpandedNotifyTopics(String expandedNotifyTopics) {
|
||||
this.expandedNotifyTopics= expandedNotifyTopics;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Comma separated lis of topics to be published when a node" +
|
||||
" is selected. An object with a 'node' property will be passed as parameter to the topics.")
|
||||
public void setSelectedNotifyTopics(String selectedNotifyTopics) {
|
||||
this.selectedNotifyTopics = selectedNotifyTopics;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Url used to load the list of children nodes for an specific node, whose id will be " +
|
||||
"passed as a parameter named 'nodeId' (empty for root)")
|
||||
public void setHref(String href) {
|
||||
this.href = href;
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Comma delimmited list of topics that will published after the request(if the request fails)." +
|
||||
"Only valid if 'href' is set")
|
||||
public void setErrorNotifyTopics(String errorNotifyTopics) {
|
||||
this.errorNotifyTopics = errorNotifyTopics;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,161 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.components;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.ClosingUIBean;
|
||||
import org.apache.struts2.views.annotations.StrutsTag;
|
||||
import org.apache.struts2.views.annotations.StrutsTagAttribute;
|
||||
import org.apache.struts2.views.annotations.StrutsTagSkipInheritance;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* <!-- START SNIPPET: javadoc -->
|
||||
*
|
||||
* Renders a tree node within a tree widget with AJAX support.<p/>
|
||||
*
|
||||
* Either of the following combinations should be used depending on if the tree
|
||||
* is to be constructed dynamically or statically. <p/>
|
||||
*
|
||||
* <b>Dynamically:</b>
|
||||
* <ul>
|
||||
* <li>id - id of this tree node</li>
|
||||
* <li>title - label to be displayed for this tree node</li>
|
||||
* </ul>
|
||||
*
|
||||
* <b>Statically:</b>
|
||||
* <ul>
|
||||
* <li>rootNode - the parent node of which this tree is derived from</li>
|
||||
* <li>nodeIdProperty - property to obtained this current tree node's id</li>
|
||||
* <li>nodeTitleProperty - property to obtained this current tree node's title</li>
|
||||
* <li>childCollectionProperty - property that returnds this current tree node's children</li>
|
||||
* </ul>
|
||||
*
|
||||
* <!-- END SNIPPET: javadoc -->
|
||||
*
|
||||
* <p/> <b>Examples</b>
|
||||
*
|
||||
* <pre>
|
||||
* <!-- START SNIPPET: example -->
|
||||
*
|
||||
* <-- Creating tree statically using hard-coded data. -->
|
||||
* <s:tree id="..." label="...">
|
||||
* <s:treenode id="..." label="..." />
|
||||
* <s:treenode id="..." label="...">
|
||||
* <s:treenode id="..." label="..." />
|
||||
* <s:treenode id="..." label="..." />
|
||||
* </s:treenode>
|
||||
* <s:treenode id="..." label="..." />
|
||||
* </s:tree>
|
||||
*
|
||||
* <-- Creating tree dynamically using data from backing action. -->
|
||||
* <s:tree
|
||||
* id="..."
|
||||
* rootNode="..."
|
||||
* nodeIdProperty="..."
|
||||
* nodeTitleProperty="..."
|
||||
* childCollectionProperty="..." />
|
||||
*
|
||||
* <!-- END SNIPPET: example -->
|
||||
* </pre>
|
||||
*
|
||||
*/
|
||||
@StrutsTag(name="treenode", tldTagClass="org.apache.struts2.dojo.views.jsp.ui.TreeNodeTag", description="Render a tree node within a tree widget.")
|
||||
public class TreeNode extends ClosingUIBean {
|
||||
private static final String TEMPLATE = "treenode-close";
|
||||
private static final String OPEN_TEMPLATE = "treenode";
|
||||
private final static transient Random RANDOM = new Random();
|
||||
|
||||
public TreeNode(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
|
||||
super(stack, request, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
@StrutsTagSkipInheritance
|
||||
public void setTheme(String theme) {
|
||||
super.setTheme(theme);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTheme() {
|
||||
return "ajax";
|
||||
}
|
||||
|
||||
public String getDefaultOpenTemplate() {
|
||||
return OPEN_TEMPLATE;
|
||||
}
|
||||
|
||||
protected String getDefaultTemplate() {
|
||||
return TEMPLATE;
|
||||
}
|
||||
|
||||
protected void evaluateExtraParams() {
|
||||
super.evaluateExtraParams();
|
||||
|
||||
// generate a random ID if not explicitly set and not parsing the content
|
||||
Boolean parseContent = (Boolean)stack.getContext().get(Head.PARSE_CONTENT);
|
||||
boolean generateId = (parseContent != null ? !parseContent : true);
|
||||
|
||||
addParameter("pushId", generateId);
|
||||
if ((this.id == null || this.id.length() == 0) && generateId) {
|
||||
// resolves Math.abs(Integer.MIN_VALUE) issue reported by FindBugs
|
||||
// http://findbugs.sourceforge.net/bugDescriptions.html#RV_ABSOLUTE_VALUE_OF_RANDOM_INT
|
||||
int nextInt = RANDOM.nextInt();
|
||||
nextInt = nextInt == Integer.MIN_VALUE ? Integer.MAX_VALUE : Math.abs(nextInt);
|
||||
this.id = "widget_" + String.valueOf(nextInt);
|
||||
addParameter("id", this.id);
|
||||
}
|
||||
|
||||
Tree parentTree = (Tree) findAncestor(Tree.class);
|
||||
parentTree.addChildrenId(this.id);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="Label expression used for rendering tree node label.", required=true)
|
||||
public void setLabel(String label) {
|
||||
super.setLabel(label);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The css class to use for element")
|
||||
public void setCssClass(String cssClass) {
|
||||
super.setCssClass(cssClass);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The css style to use for element")
|
||||
public void setCssStyle(String cssStyle) {
|
||||
super.setCssStyle(cssStyle);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The id to use for the element")
|
||||
public void setId(String id) {
|
||||
super.setId(id);
|
||||
}
|
||||
|
||||
@StrutsTagAttribute(description="The name to set for element")
|
||||
public void setName(String name) {
|
||||
super.setName(name);
|
||||
}
|
||||
}
|
||||
@@ -1,71 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.dojo.views.freemarker.tags.DojoModels;
|
||||
import org.apache.struts2.dojo.views.velocity.components.AnchorDirective;
|
||||
import org.apache.struts2.dojo.views.velocity.components.AutocompleterDirective;
|
||||
import org.apache.struts2.dojo.views.velocity.components.BindDirective;
|
||||
import org.apache.struts2.dojo.views.velocity.components.DateTimePickerDirective;
|
||||
import org.apache.struts2.dojo.views.velocity.components.DivDirective;
|
||||
import org.apache.struts2.dojo.views.velocity.components.HeadDirective;
|
||||
import org.apache.struts2.dojo.views.velocity.components.SubmitDirective;
|
||||
import org.apache.struts2.dojo.views.velocity.components.TabbedPanelDirective;
|
||||
import org.apache.struts2.dojo.views.velocity.components.TextAreaDirective;
|
||||
import org.apache.struts2.dojo.views.velocity.components.TreeDirective;
|
||||
import org.apache.struts2.dojo.views.velocity.components.TreeNodeDirective;
|
||||
import org.apache.struts2.views.TagLibraryDirectiveProvider;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
import org.apache.struts2.views.TagLibraryModelProvider;
|
||||
|
||||
public class DojoTagLibrary implements TagLibraryDirectiveProvider, TagLibraryModelProvider {
|
||||
|
||||
public Object getModels(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
|
||||
return new DojoModels(stack, req, res);
|
||||
}
|
||||
|
||||
public List<Class> getDirectiveClasses() {
|
||||
Class[] directives = new Class[] {
|
||||
DateTimePickerDirective.class,
|
||||
DivDirective.class,
|
||||
AutocompleterDirective.class,
|
||||
AnchorDirective.class,
|
||||
SubmitDirective.class,
|
||||
TabbedPanelDirective.class,
|
||||
TreeDirective.class,
|
||||
TreeNodeDirective.class,
|
||||
HeadDirective.class,
|
||||
BindDirective.class,
|
||||
TextAreaDirective.class
|
||||
};
|
||||
return Arrays.asList(directives);
|
||||
}
|
||||
|
||||
}
|
||||
-47
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.freemarker.tags;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.Anchor;
|
||||
import org.apache.struts2.views.freemarker.tags.TagModel;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* @see Anchor
|
||||
*/
|
||||
public class AnchorModel extends TagModel {
|
||||
|
||||
public AnchorModel(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
super(stack, req, res);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Component getBean() {
|
||||
return new Anchor(stack, req, res);
|
||||
}
|
||||
|
||||
}
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.freemarker.tags;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.Autocompleter;
|
||||
import org.apache.struts2.views.freemarker.tags.TagModel;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* @see Autocompleter
|
||||
*/
|
||||
public class AutocompleterModel extends TagModel {
|
||||
|
||||
public AutocompleterModel(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
super(stack, req, res);
|
||||
}
|
||||
|
||||
protected Component getBean() {
|
||||
return new Autocompleter(stack, req, res);
|
||||
}
|
||||
}
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.freemarker.tags;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.Bind;
|
||||
import org.apache.struts2.views.freemarker.tags.TagModel;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* @see Bind
|
||||
*/
|
||||
public class BindModel extends TagModel {
|
||||
public BindModel(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
super(stack, req, res);
|
||||
}
|
||||
|
||||
protected Component getBean() {
|
||||
return new Bind(stack, req, res);
|
||||
}
|
||||
}
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.freemarker.tags;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.DateTimePicker;
|
||||
import org.apache.struts2.views.freemarker.tags.TextFieldModel;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* @see DropdownDateTimePicker
|
||||
*/
|
||||
public class DateTimePickerModel extends TextFieldModel {
|
||||
|
||||
public DateTimePickerModel(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
super(stack, req, res);
|
||||
}
|
||||
|
||||
protected Component getBean() {
|
||||
return new DateTimePicker(stack, req, res);
|
||||
}
|
||||
}
|
||||
-48
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.freemarker.tags;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.Div;
|
||||
import org.apache.struts2.views.freemarker.tags.TagModel;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
|
||||
/**
|
||||
* @see Div
|
||||
*/
|
||||
public class DivModel extends TagModel {
|
||||
|
||||
public DivModel(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
super(stack, req, res);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Component getBean() {
|
||||
return new Div(stack, req, res);
|
||||
}
|
||||
|
||||
}
|
||||
-137
@@ -1,137 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.freemarker.tags;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
public class DojoModels {
|
||||
protected DateTimePickerModel dateTimePicker;
|
||||
protected TabbedPanelModel tabbedPanel;
|
||||
protected TreeModel treeModel;
|
||||
protected TreeNodeModel treenodeModel;
|
||||
protected AutocompleterModel autocompleter;
|
||||
protected DivModel div;
|
||||
protected AnchorModel a;
|
||||
protected SubmitModel submit;
|
||||
protected BindModel bind;
|
||||
protected HeadModel head;
|
||||
protected TextAreaModel textarea;
|
||||
|
||||
private ValueStack stack;
|
||||
private HttpServletRequest req;
|
||||
private HttpServletResponse res;
|
||||
|
||||
public DojoModels(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
this.stack = stack;
|
||||
this.req = req;
|
||||
this.res = res;
|
||||
}
|
||||
|
||||
public BindModel getBind() {
|
||||
if (bind == null) {
|
||||
bind = new BindModel(stack, req, res);
|
||||
}
|
||||
|
||||
return bind;
|
||||
}
|
||||
|
||||
public TextAreaModel getTextarea() {
|
||||
if (textarea == null) {
|
||||
textarea = new TextAreaModel(stack, req, res);
|
||||
}
|
||||
|
||||
return textarea;
|
||||
}
|
||||
|
||||
public HeadModel getHead() {
|
||||
if (head == null) {
|
||||
head = new HeadModel(stack, req, res);
|
||||
}
|
||||
|
||||
return head;
|
||||
}
|
||||
|
||||
public DateTimePickerModel getDatetimepicker() {
|
||||
if (dateTimePicker == null) {
|
||||
dateTimePicker = new DateTimePickerModel(stack, req, res);
|
||||
}
|
||||
|
||||
return dateTimePicker;
|
||||
}
|
||||
|
||||
public AutocompleterModel getAutocompleter() {
|
||||
if (autocompleter == null) {
|
||||
autocompleter = new AutocompleterModel(stack, req, res);
|
||||
}
|
||||
|
||||
return autocompleter;
|
||||
}
|
||||
|
||||
public TabbedPanelModel getTabbedpanel() {
|
||||
if (tabbedPanel == null) {
|
||||
tabbedPanel = new TabbedPanelModel(stack, req, res);
|
||||
}
|
||||
|
||||
return tabbedPanel;
|
||||
}
|
||||
|
||||
public TreeModel getTree() {
|
||||
if (treeModel == null) {
|
||||
treeModel = new TreeModel(stack,req, res);
|
||||
}
|
||||
return treeModel;
|
||||
}
|
||||
|
||||
public TreeNodeModel getTreenode() {
|
||||
if (treenodeModel == null) {
|
||||
treenodeModel = new TreeNodeModel(stack, req, res);
|
||||
}
|
||||
return treenodeModel;
|
||||
}
|
||||
|
||||
public DivModel getDiv() {
|
||||
if (div == null) {
|
||||
div = new DivModel(stack, req, res);
|
||||
}
|
||||
|
||||
return div;
|
||||
}
|
||||
|
||||
public AnchorModel getA() {
|
||||
if (a == null) {
|
||||
a = new AnchorModel(stack, req, res);
|
||||
}
|
||||
|
||||
return a;
|
||||
}
|
||||
|
||||
public SubmitModel getSubmit() {
|
||||
if (submit == null) {
|
||||
submit = new SubmitModel(stack, req, res);
|
||||
}
|
||||
|
||||
return submit;
|
||||
}
|
||||
}
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.freemarker.tags;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.Head;
|
||||
import org.apache.struts2.views.freemarker.tags.TagModel;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* @see Head
|
||||
*/
|
||||
public class HeadModel extends TagModel {
|
||||
public HeadModel(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
super(stack, req, res);
|
||||
}
|
||||
|
||||
protected Component getBean() {
|
||||
return new Head(stack, req, res);
|
||||
}
|
||||
}
|
||||
-47
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.freemarker.tags;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.Submit;
|
||||
import org.apache.struts2.views.freemarker.tags.TagModel;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* @see Submit
|
||||
*/
|
||||
public class SubmitModel extends TagModel {
|
||||
|
||||
public SubmitModel(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
super(stack, req, res);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Component getBean() {
|
||||
return new Submit(stack, req, res);
|
||||
}
|
||||
|
||||
}
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.freemarker.tags;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.TabbedPanel;
|
||||
import org.apache.struts2.views.freemarker.tags.TagModel;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* @see TabbedPanel
|
||||
*/
|
||||
public class TabbedPanelModel extends TagModel {
|
||||
public TabbedPanelModel(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
super(stack, req, res);
|
||||
}
|
||||
|
||||
protected Component getBean() {
|
||||
return new TabbedPanel(stack, req, res);
|
||||
}
|
||||
}
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.freemarker.tags;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.TextArea;
|
||||
import org.apache.struts2.views.freemarker.tags.TagModel;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* @see TextArea
|
||||
*/
|
||||
public class TextAreaModel extends TagModel {
|
||||
public TextAreaModel(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
super(stack, req, res);
|
||||
}
|
||||
|
||||
protected Component getBean() {
|
||||
return new TextArea(stack, req, res);
|
||||
}
|
||||
}
|
||||
-46
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.freemarker.tags;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.Tree;
|
||||
import org.apache.struts2.views.freemarker.tags.TagModel;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* TreeModel
|
||||
* @see Tree
|
||||
*
|
||||
*/
|
||||
public class TreeModel extends TagModel {
|
||||
public TreeModel(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
super(stack, req, res);
|
||||
}
|
||||
|
||||
protected Component getBean() {
|
||||
return new Tree(stack,req,res);
|
||||
}
|
||||
}
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.freemarker.tags;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.TreeNode;
|
||||
import org.apache.struts2.views.freemarker.tags.TagModel;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* TreeNodeModel
|
||||
* @see TreeNode
|
||||
*/
|
||||
public class TreeNodeModel extends TagModel {
|
||||
public TreeNodeModel(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
super(stack, req, res);
|
||||
}
|
||||
|
||||
protected Component getBean() {
|
||||
return new TreeNode(stack,req,res);
|
||||
}
|
||||
}
|
||||
-155
@@ -1,155 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.jsp.ui;
|
||||
|
||||
import org.apache.struts2.dojo.components.RemoteBean;
|
||||
import org.apache.struts2.views.jsp.ui.AbstractClosingTag;
|
||||
|
||||
public abstract class AbstractRemoteTag extends AbstractClosingTag {
|
||||
|
||||
protected String href;
|
||||
protected String listenTopics;
|
||||
protected String notifyTopics;
|
||||
protected String loadingText;
|
||||
protected String errorText;
|
||||
protected String executeScripts;
|
||||
protected String handler;
|
||||
protected String formId;
|
||||
protected String formFilter;
|
||||
protected String showErrorTransportText;
|
||||
protected String indicator;
|
||||
protected String showLoadingText;
|
||||
protected String beforeNotifyTopics;
|
||||
protected String afterNotifyTopics;
|
||||
protected String errorNotifyTopics;
|
||||
protected String highlightColor;
|
||||
protected String highlightDuration;
|
||||
protected String separateScripts;
|
||||
protected String transport;
|
||||
protected String parseContent;
|
||||
|
||||
protected void populateParams() {
|
||||
super.populateParams();
|
||||
|
||||
RemoteBean remote = (RemoteBean) component;
|
||||
remote.setHref(href);
|
||||
remote.setListenTopics(listenTopics);
|
||||
remote.setLoadingText(loadingText);
|
||||
remote.setErrorText(errorText);
|
||||
remote.setExecuteScripts(executeScripts);
|
||||
remote.setHandler(handler);
|
||||
remote.setFormFilter(formFilter);
|
||||
remote.setFormId(formId);
|
||||
remote.setNotifyTopics(notifyTopics);
|
||||
remote.setShowErrorTransportText(showErrorTransportText);
|
||||
remote.setIndicator(indicator);
|
||||
remote.setShowLoadingText(showLoadingText);
|
||||
remote.setAfterNotifyTopics(afterNotifyTopics);
|
||||
remote.setBeforeNotifyTopics(beforeNotifyTopics);
|
||||
remote.setErrorNotifyTopics(errorNotifyTopics);
|
||||
remote.setHighlightColor(highlightColor);
|
||||
remote.setHighlightDuration(highlightDuration);
|
||||
remote.setSeparateScripts(separateScripts);
|
||||
remote.setTransport(transport);
|
||||
remote.setParseContent(parseContent);
|
||||
}
|
||||
|
||||
public void setHref(String href) {
|
||||
this.href = href;
|
||||
}
|
||||
|
||||
public void setErrorText(String errorText) {
|
||||
this.errorText = errorText;
|
||||
}
|
||||
|
||||
public void setLoadingText(String loadingText) {
|
||||
this.loadingText = loadingText;
|
||||
}
|
||||
|
||||
public void setListenTopics(String listenTopics) {
|
||||
this.listenTopics = listenTopics;
|
||||
}
|
||||
|
||||
public void setExecuteScripts(String executeScripts) {
|
||||
this.executeScripts = executeScripts;
|
||||
}
|
||||
|
||||
public void setHandler(String handler) {
|
||||
this.handler = handler;
|
||||
}
|
||||
|
||||
public void setFormFilter(String formFilter) {
|
||||
this.formFilter = formFilter;
|
||||
}
|
||||
|
||||
public void setFormId(String formId) {
|
||||
this.formId = formId;
|
||||
}
|
||||
|
||||
public void setNotifyTopics(String notifyTopics) {
|
||||
this.notifyTopics = notifyTopics;
|
||||
}
|
||||
|
||||
public void setShowErrorTransportText(String showErrorTransportText) {
|
||||
this.showErrorTransportText = showErrorTransportText;
|
||||
}
|
||||
|
||||
public void setIndicator(String indicator) {
|
||||
this.indicator = indicator;
|
||||
}
|
||||
|
||||
public void setShowLoadingText(String showLoadingText) {
|
||||
this.showLoadingText = showLoadingText;
|
||||
}
|
||||
|
||||
public void setAfterNotifyTopics(String afterNotifyTopics) {
|
||||
this.afterNotifyTopics = afterNotifyTopics;
|
||||
}
|
||||
|
||||
public void setBeforeNotifyTopics(String beforeNotifyTopics) {
|
||||
this.beforeNotifyTopics = beforeNotifyTopics;
|
||||
}
|
||||
|
||||
public void setErrorNotifyTopics(String errorNotifyTopics) {
|
||||
this.errorNotifyTopics = errorNotifyTopics;
|
||||
}
|
||||
|
||||
public void setHighlightColor(String highlightColor) {
|
||||
this.highlightColor = highlightColor;
|
||||
}
|
||||
|
||||
public void setHighlightDuration(String highlightDuration) {
|
||||
this.highlightDuration = highlightDuration;
|
||||
}
|
||||
|
||||
public void setSeparateScripts(String separateScripts) {
|
||||
this.separateScripts = separateScripts;
|
||||
}
|
||||
|
||||
public void setTransport(String transport) {
|
||||
this.transport = transport;
|
||||
}
|
||||
|
||||
public void setParseContent(String parseContent) {
|
||||
this.parseContent = parseContent;
|
||||
}
|
||||
}
|
||||
-49
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.jsp.ui;
|
||||
|
||||
import org.apache.struts2.dojo.components.AbstractValidateBean;
|
||||
|
||||
/**
|
||||
* @see AbstractValidateTag
|
||||
*/
|
||||
public abstract class AbstractValidateTag extends AbstractRemoteTag {
|
||||
protected String validate;
|
||||
protected String ajaxAfterValidation;
|
||||
|
||||
protected void populateParams() {
|
||||
super.populateParams();
|
||||
|
||||
AbstractValidateBean validateBean = (AbstractValidateBean) component;
|
||||
validateBean.setValidate(validate);
|
||||
validateBean.setAjaxAfterValidation(ajaxAfterValidation);
|
||||
}
|
||||
|
||||
public void setAjaxAfterValidation(String ajaxAfterValidation) {
|
||||
this.ajaxAfterValidation = ajaxAfterValidation;
|
||||
}
|
||||
|
||||
public void setValidate(String validate) {
|
||||
this.validate = validate;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.jsp.ui;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.Anchor;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* @see Anchor
|
||||
*/
|
||||
public class AnchorTag extends AbstractValidateTag {
|
||||
|
||||
private static final long serialVersionUID = -1034616578492431113L;
|
||||
|
||||
protected String targets;
|
||||
|
||||
public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
return new Anchor(stack, req, res);
|
||||
}
|
||||
|
||||
protected void populateParams() {
|
||||
super.populateParams();
|
||||
|
||||
Anchor link = (Anchor) component;
|
||||
link.setTargets(targets);
|
||||
link.setValidate(validate);
|
||||
}
|
||||
|
||||
public void setTargets(String targets) {
|
||||
this.targets = targets;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-221
@@ -1,221 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.jsp.ui;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.Autocompleter;
|
||||
import org.apache.struts2.views.jsp.ui.ComboBoxTag;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* @see Autocompleter
|
||||
*/
|
||||
public class AutocompleterTag extends ComboBoxTag {
|
||||
private static final long serialVersionUID = -1112470447573172581L;
|
||||
|
||||
protected String forceValidOption;
|
||||
protected String searchType;
|
||||
protected String autoComplete;
|
||||
protected String delay;
|
||||
protected String disabled;
|
||||
protected String href;
|
||||
protected String dropdownWidth;
|
||||
protected String dropdownHeight;
|
||||
protected String formId;
|
||||
protected String formFilter;
|
||||
protected String listenTopics;
|
||||
protected String notifyTopics;
|
||||
protected String indicator;
|
||||
protected String loadOnTextChange;
|
||||
protected String loadMinimumCount;
|
||||
protected String showDownArrow;
|
||||
protected String templateCssPath;
|
||||
protected String iconPath;
|
||||
protected String keyName;
|
||||
protected String dataFieldName;
|
||||
protected String beforeNotifyTopics;
|
||||
protected String afterNotifyTopics;
|
||||
protected String errorNotifyTopics;
|
||||
protected String valueNotifyTopics;
|
||||
protected String resultsLimit;
|
||||
protected String transport;
|
||||
protected String preload;
|
||||
protected String keyValue;
|
||||
|
||||
public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
return new Autocompleter(stack, req, res);
|
||||
}
|
||||
|
||||
protected void populateParams() {
|
||||
super.populateParams();
|
||||
|
||||
Autocompleter autocompleter = (Autocompleter) component;
|
||||
autocompleter.setAutoComplete(autoComplete);
|
||||
autocompleter.setDisabled(disabled);
|
||||
autocompleter.setForceValidOption(forceValidOption);
|
||||
autocompleter.setHref(href);
|
||||
autocompleter.setDelay(delay);
|
||||
autocompleter.setSearchType(searchType);
|
||||
autocompleter.setDropdownHeight(dropdownHeight);
|
||||
autocompleter.setDropdownWidth(dropdownWidth);
|
||||
autocompleter.setFormFilter(formFilter);
|
||||
autocompleter.setFormId(formId);
|
||||
autocompleter.setListenTopics(listenTopics);
|
||||
autocompleter.setNotifyTopics(notifyTopics);
|
||||
autocompleter.setIndicator(indicator);
|
||||
autocompleter.setLoadMinimumCount(loadMinimumCount);
|
||||
autocompleter.setLoadOnTextChange(loadOnTextChange);
|
||||
autocompleter.setShowDownArrow(showDownArrow);
|
||||
autocompleter.setTemplateCssPath(templateCssPath);
|
||||
autocompleter.setIconPath(iconPath);
|
||||
autocompleter.setKeyName(keyName);
|
||||
autocompleter.setDataFieldName(dataFieldName);
|
||||
autocompleter.setAfterNotifyTopics(afterNotifyTopics);
|
||||
autocompleter.setBeforeNotifyTopics(beforeNotifyTopics);
|
||||
autocompleter.setErrorNotifyTopics(errorNotifyTopics);
|
||||
autocompleter.setValueNotifyTopics(valueNotifyTopics);
|
||||
autocompleter.setResultsLimit(resultsLimit);
|
||||
autocompleter.setTransport(transport);
|
||||
autocompleter.setPreload(preload);
|
||||
autocompleter.setKeyValue(keyValue);
|
||||
}
|
||||
|
||||
public void setAutoComplete(String autoComplete) {
|
||||
this.autoComplete = autoComplete;
|
||||
}
|
||||
|
||||
public void setDisabled(String disabled) {
|
||||
this.disabled = disabled;
|
||||
}
|
||||
|
||||
public void setForceValidOption(String forceValidOption) {
|
||||
this.forceValidOption = forceValidOption;
|
||||
}
|
||||
|
||||
public void setHref(String href) {
|
||||
this.href = href;
|
||||
}
|
||||
|
||||
public void setDelay(String searchDelay) {
|
||||
this.delay = searchDelay;
|
||||
}
|
||||
|
||||
public void setSearchType(String searchType) {
|
||||
this.searchType = searchType;
|
||||
}
|
||||
|
||||
public void setDropdownHeight(String height) {
|
||||
this.dropdownHeight = height;
|
||||
}
|
||||
|
||||
public void setDropdownWidth(String width) {
|
||||
this.dropdownWidth = width;
|
||||
}
|
||||
|
||||
public void setFormFilter(String formFilter) {
|
||||
this.formFilter = formFilter;
|
||||
}
|
||||
|
||||
public void setFormId(String formId) {
|
||||
this.formId = formId;
|
||||
}
|
||||
|
||||
public void setListenTopics(String listenTopics) {
|
||||
this.listenTopics = listenTopics;
|
||||
}
|
||||
|
||||
public void setNotifyTopics(String onValueChangedPublishTopic) {
|
||||
this.notifyTopics = onValueChangedPublishTopic;
|
||||
}
|
||||
|
||||
public void setIndicator(String indicator) {
|
||||
this.indicator = indicator;
|
||||
}
|
||||
|
||||
public void setLoadMinimumCount(String loadMinimumCount) {
|
||||
this.loadMinimumCount = loadMinimumCount;
|
||||
}
|
||||
|
||||
public String getLoadMinimumCount() {
|
||||
return loadMinimumCount;
|
||||
}
|
||||
|
||||
public void setLoadOnTextChange(String loadOnTextChange) {
|
||||
this.loadOnTextChange = loadOnTextChange;
|
||||
}
|
||||
|
||||
public void setShowDownArrow(String showDownArrow) {
|
||||
this.showDownArrow = showDownArrow;
|
||||
}
|
||||
|
||||
public void setTemplateCssPath(String templateCssPath) {
|
||||
this.templateCssPath = templateCssPath;
|
||||
}
|
||||
|
||||
public void setIconPath(String iconPath) {
|
||||
this.iconPath = iconPath;
|
||||
}
|
||||
|
||||
public void setKeyName(String keyName) {
|
||||
this.keyName = keyName;
|
||||
}
|
||||
|
||||
public void setDataFieldName(String dataFieldName) {
|
||||
this.dataFieldName = dataFieldName;
|
||||
}
|
||||
|
||||
public void setAfterNotifyTopics(String afterNotifyTopics) {
|
||||
this.afterNotifyTopics = afterNotifyTopics;
|
||||
}
|
||||
|
||||
public void setBeforeNotifyTopics(String beforeNotifyTopics) {
|
||||
this.beforeNotifyTopics = beforeNotifyTopics;
|
||||
}
|
||||
|
||||
public void setErrorNotifyTopics(String errorNotifyTopics) {
|
||||
this.errorNotifyTopics = errorNotifyTopics;
|
||||
}
|
||||
|
||||
public void setValueNotifyTopics(String valueNotifyTopics) {
|
||||
this.valueNotifyTopics = valueNotifyTopics;
|
||||
}
|
||||
|
||||
public void setResultsLimit(String resultsLimit) {
|
||||
this.resultsLimit = resultsLimit;
|
||||
}
|
||||
|
||||
public void setTransport(String transport) {
|
||||
this.transport = transport;
|
||||
}
|
||||
|
||||
public void setPreload(String preload) {
|
||||
this.preload = preload;
|
||||
}
|
||||
|
||||
public void setKeyValue(String keyValue) {
|
||||
this.keyValue = keyValue;
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.jsp.ui;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.Bind;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
public class BindTag extends AbstractValidateTag {
|
||||
protected String targets;
|
||||
protected String sources;
|
||||
protected String events;
|
||||
|
||||
public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
return new Bind(stack, req, res);
|
||||
}
|
||||
|
||||
protected void populateParams() {
|
||||
super.populateParams();
|
||||
|
||||
Bind bind = (Bind) component;
|
||||
bind.setTargets(targets);
|
||||
bind.setSources(sources);
|
||||
bind.setEvents(events);
|
||||
}
|
||||
|
||||
public void setEvents(String events) {
|
||||
this.events = events;
|
||||
}
|
||||
|
||||
public void setSources(String sources) {
|
||||
this.sources = sources;
|
||||
}
|
||||
|
||||
public void setTargets(String targets) {
|
||||
this.targets = targets;
|
||||
}
|
||||
}
|
||||
-148
@@ -1,148 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.jsp.ui;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.DateTimePicker;
|
||||
import org.apache.struts2.views.jsp.ui.AbstractUITag;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* @see DateTimePicker
|
||||
*/
|
||||
public class DateTimePickerTag extends AbstractUITag {
|
||||
|
||||
private static final long serialVersionUID = 4054114507143447232L;
|
||||
|
||||
protected String displayWeeks;
|
||||
protected String adjustWeeks;
|
||||
protected String startDate;
|
||||
protected String endDate;
|
||||
protected String weekStartsOn;
|
||||
protected String staticDisplay;
|
||||
protected String dayWidth;
|
||||
protected String language;
|
||||
|
||||
protected String iconPath;
|
||||
protected String formatLength;
|
||||
protected String displayFormat;
|
||||
protected String toggleType;
|
||||
protected String toggleDuration;
|
||||
protected String type;
|
||||
protected String templateCssPath;
|
||||
protected String valueNotifyTopics;
|
||||
|
||||
public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
return new DateTimePicker(stack, req, res);
|
||||
}
|
||||
|
||||
protected void populateParams() {
|
||||
super.populateParams();
|
||||
|
||||
final DateTimePicker dateTimePicker = (DateTimePicker) component;
|
||||
dateTimePicker.setAdjustWeeks(adjustWeeks);
|
||||
dateTimePicker.setDayWidth(dayWidth);
|
||||
dateTimePicker.setDisplayWeeks(displayWeeks);
|
||||
dateTimePicker.setEndDate(endDate);
|
||||
dateTimePicker.setStartDate(startDate);
|
||||
dateTimePicker.setStaticDisplay(staticDisplay);
|
||||
dateTimePicker.setWeekStartsOn(weekStartsOn);
|
||||
dateTimePicker.setLanguage(language);
|
||||
dateTimePicker.setIconPath(iconPath);
|
||||
dateTimePicker.setFormatLength(formatLength);
|
||||
dateTimePicker.setDisplayFormat(displayFormat);
|
||||
dateTimePicker.setToggleType(toggleType);
|
||||
dateTimePicker.setToggleDuration(toggleDuration);
|
||||
dateTimePicker.setType(type);
|
||||
dateTimePicker.setTemplateCssPath(templateCssPath);
|
||||
dateTimePicker.setValueNotifyTopics(valueNotifyTopics);
|
||||
dateTimePicker.setDisabled(disabled);
|
||||
}
|
||||
|
||||
public void setAdjustWeeks(String adjustWeeks) {
|
||||
this.adjustWeeks = adjustWeeks;
|
||||
}
|
||||
|
||||
public void setDayWidth(String dayWidth) {
|
||||
this.dayWidth = dayWidth;
|
||||
}
|
||||
|
||||
public void setDisplayWeeks(String displayWeeks) {
|
||||
this.displayWeeks = displayWeeks;
|
||||
}
|
||||
|
||||
public void setEndDate(String endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public void setStartDate(String startDate) {
|
||||
this.startDate = startDate;
|
||||
}
|
||||
|
||||
public void setStaticDisplay(String staticDisplay) {
|
||||
this.staticDisplay = staticDisplay;
|
||||
}
|
||||
|
||||
public void setWeekStartsOn(String weekStartsOn) {
|
||||
this.weekStartsOn = weekStartsOn;
|
||||
}
|
||||
|
||||
public void setLanguage(String language) {
|
||||
this.language = language;
|
||||
}
|
||||
|
||||
public void setDisplayFormat(String displayFormat) {
|
||||
this.displayFormat = displayFormat;
|
||||
}
|
||||
|
||||
public void setFormatLength(String formatLength) {
|
||||
this.formatLength = formatLength;
|
||||
}
|
||||
|
||||
public void setIconPath(String iconPath) {
|
||||
this.iconPath = iconPath;
|
||||
}
|
||||
|
||||
public void setToggleDuration(String toggleDuration) {
|
||||
this.toggleDuration = toggleDuration;
|
||||
}
|
||||
|
||||
public void setToggleType(String toggleType) {
|
||||
this.toggleType = toggleType;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public void setTemplateCssPath(String templateCssPath) {
|
||||
this.templateCssPath = templateCssPath;
|
||||
}
|
||||
|
||||
public void setValueNotifyTopics(String valueNotifyTopics) {
|
||||
this.valueNotifyTopics = valueNotifyTopics;
|
||||
}
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.jsp.ui;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.Div;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
public class DivTag extends AbstractRemoteTag {
|
||||
|
||||
private static final long serialVersionUID = 5309231035916461758L;
|
||||
|
||||
protected String updateFreq;
|
||||
protected String autoStart;
|
||||
protected String delay;
|
||||
protected String startTimerListenTopics;
|
||||
protected String stopTimerListenTopics;
|
||||
protected String refreshOnShow;
|
||||
protected String separateScripts;
|
||||
protected String closable;
|
||||
protected String preload;
|
||||
|
||||
public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
return new Div(stack, req, res);
|
||||
}
|
||||
|
||||
protected void populateParams() {
|
||||
super.populateParams();
|
||||
|
||||
Div div = (Div) component;
|
||||
div.setUpdateFreq(updateFreq);
|
||||
div.setAutoStart(autoStart);
|
||||
div.setDelay(delay);
|
||||
div.setStartTimerListenTopics(startTimerListenTopics);
|
||||
div.setStopTimerListenTopics(stopTimerListenTopics);
|
||||
div.setRefreshOnShow(refreshOnShow);
|
||||
div.setSeparateScripts(separateScripts);
|
||||
div.setClosable(closable);
|
||||
div.setPreload(preload);
|
||||
}
|
||||
|
||||
public void setAutoStart(String autoStart) {
|
||||
this.autoStart = autoStart;
|
||||
}
|
||||
|
||||
public void setDelay(String delay) {
|
||||
this.delay = delay;
|
||||
}
|
||||
|
||||
public void setUpdateFreq(String updateInterval) {
|
||||
this.updateFreq = updateInterval;
|
||||
}
|
||||
|
||||
public void setStartTimerListenTopics(String startTimerListenTopic) {
|
||||
this.startTimerListenTopics = startTimerListenTopic;
|
||||
}
|
||||
|
||||
public void setStopTimerListenTopics(String stopTimerListenTopic) {
|
||||
this.stopTimerListenTopics = stopTimerListenTopic;
|
||||
}
|
||||
|
||||
public void setRefreshOnShow(String refreshOnShow) {
|
||||
this.refreshOnShow = refreshOnShow;
|
||||
}
|
||||
|
||||
public void setSeparateScripts(String separateScripts) {
|
||||
this.separateScripts = separateScripts;
|
||||
}
|
||||
|
||||
public void setClosable(String closable) {
|
||||
this.closable = closable;
|
||||
}
|
||||
|
||||
public void setPreload(String preload) {
|
||||
this.preload = preload;
|
||||
}
|
||||
}
|
||||
@@ -1,92 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.jsp.ui;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.Head;
|
||||
import org.apache.struts2.views.jsp.ui.AbstractUITag;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* @see Head
|
||||
*/
|
||||
public class HeadTag extends AbstractUITag {
|
||||
|
||||
private static final long serialVersionUID = 6876765769175246030L;
|
||||
|
||||
private String debug;
|
||||
private String compressed;
|
||||
private String baseRelativePath;
|
||||
private String extraLocales;
|
||||
private String locale;
|
||||
private String cache;
|
||||
private String parseContent;
|
||||
|
||||
public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
return new Head(stack, req, res);
|
||||
}
|
||||
|
||||
protected void populateParams() {
|
||||
super.populateParams();
|
||||
|
||||
Head head = (Head) component;
|
||||
head.setDebug(debug);
|
||||
head.setCompressed(compressed);
|
||||
head.setBaseRelativePath(baseRelativePath);
|
||||
head.setExtraLocales(extraLocales);
|
||||
head.setLocale(locale);
|
||||
head.setCache(cache);
|
||||
head.setParseContent(parseContent);
|
||||
}
|
||||
|
||||
public void setDebug(String debug) {
|
||||
this.debug = debug;
|
||||
}
|
||||
|
||||
public void setBaseRelativePath(String baseRelativePath) {
|
||||
this.baseRelativePath = baseRelativePath;
|
||||
}
|
||||
|
||||
public void setCompressed(String compressed) {
|
||||
this.compressed = compressed;
|
||||
}
|
||||
|
||||
public void setExtraLocales(String extraLocales) {
|
||||
this.extraLocales = extraLocales;
|
||||
}
|
||||
|
||||
public void setLocale(String locale) {
|
||||
this.locale = locale;
|
||||
}
|
||||
|
||||
public void setCache(String cache) {
|
||||
this.cache = cache;
|
||||
}
|
||||
|
||||
public void setParseContent(String parseContent) {
|
||||
this.parseContent = parseContent;
|
||||
}
|
||||
}
|
||||
@@ -1,216 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.jsp.ui;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.Submit;
|
||||
import org.apache.struts2.views.jsp.ui.AbstractUITag;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* @see Submit
|
||||
*/
|
||||
public class SubmitTag extends AbstractUITag {
|
||||
|
||||
private static final long serialVersionUID = 2179281109958301343L;
|
||||
|
||||
protected String method;
|
||||
protected String align;
|
||||
protected String type;
|
||||
protected String href;
|
||||
protected String listenTopics;
|
||||
protected String notifyTopics;
|
||||
protected String loadingText;
|
||||
protected String errorText;
|
||||
protected String executeScripts;
|
||||
protected String handler;
|
||||
protected String formId;
|
||||
protected String formFilter;
|
||||
protected String src;
|
||||
protected String showErrorTransportText;
|
||||
protected String indicator;
|
||||
protected String showLoadingText;
|
||||
protected String targets;
|
||||
protected String beforeNotifyTopics;
|
||||
protected String afterNotifyTopics;
|
||||
protected String errorNotifyTopics;
|
||||
protected String highlightColor;
|
||||
protected String highlightDuration;
|
||||
protected String validate;
|
||||
protected String ajaxAfterValidation;
|
||||
protected String separateScripts;
|
||||
protected String transport;
|
||||
protected String parseContent;
|
||||
|
||||
public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
return new Submit(stack, req, res);
|
||||
}
|
||||
|
||||
protected void populateParams() {
|
||||
super.populateParams();
|
||||
|
||||
Submit submit = ((Submit) component);
|
||||
submit.setMethod(method);
|
||||
submit.setAlign(align);
|
||||
submit.setType(type);
|
||||
submit.setHref(href);
|
||||
submit.setListenTopics(listenTopics);
|
||||
submit.setLoadingText(loadingText);
|
||||
submit.setErrorText(errorText);
|
||||
submit.setExecuteScripts(executeScripts);
|
||||
submit.setHandler(handler);
|
||||
submit.setFormFilter(formFilter);
|
||||
submit.setFormId(formId);
|
||||
submit.setSrc(src);
|
||||
submit.setTargets(targets);
|
||||
submit.setNotifyTopics(notifyTopics);
|
||||
submit.setShowErrorTransportText(showErrorTransportText);
|
||||
submit.setIndicator(indicator);
|
||||
submit.setShowLoadingText(showLoadingText);
|
||||
submit.setAfterNotifyTopics(afterNotifyTopics);
|
||||
submit.setBeforeNotifyTopics(beforeNotifyTopics);
|
||||
submit.setErrorNotifyTopics(errorNotifyTopics);
|
||||
submit.setHighlightColor(highlightColor);
|
||||
submit.setHighlightDuration(highlightDuration);
|
||||
submit.setValidate(validate);
|
||||
submit.setAjaxAfterValidation(ajaxAfterValidation);
|
||||
submit.setSeparateScripts(separateScripts);
|
||||
submit.setTransport(transport);
|
||||
submit.setParseContent(parseContent);
|
||||
}
|
||||
|
||||
public void setMethod(String method) {
|
||||
this.method = method;
|
||||
}
|
||||
|
||||
public void setAlign(String align) {
|
||||
this.align = align;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public void setHref(String href) {
|
||||
this.href = href;
|
||||
}
|
||||
|
||||
public void setErrorText(String errorText) {
|
||||
this.errorText = errorText;
|
||||
}
|
||||
|
||||
public void setLoadingText(String loadingText) {
|
||||
this.loadingText = loadingText;
|
||||
}
|
||||
|
||||
public void setListenTopics(String listenTopics) {
|
||||
this.listenTopics = listenTopics;
|
||||
}
|
||||
|
||||
public void setExecuteScripts(String executeScripts) {
|
||||
this.executeScripts = executeScripts;
|
||||
}
|
||||
|
||||
public void setHandler(String handler) {
|
||||
this.handler = handler;
|
||||
}
|
||||
|
||||
public void setFormFilter(String formFilter) {
|
||||
this.formFilter = formFilter;
|
||||
}
|
||||
|
||||
public void setFormId(String formId) {
|
||||
this.formId = formId;
|
||||
}
|
||||
|
||||
public void setSrc(String src) {
|
||||
this.src = src;
|
||||
}
|
||||
|
||||
public void setTargets(String targets) {
|
||||
this.targets = targets;
|
||||
}
|
||||
|
||||
public void setNotifyTopics(String notifyTopics) {
|
||||
this.notifyTopics = notifyTopics;
|
||||
}
|
||||
|
||||
public void setShowErrorTransportText(String showErrorTransportText) {
|
||||
this.showErrorTransportText = showErrorTransportText;
|
||||
}
|
||||
|
||||
public void setIndicator(String indicator) {
|
||||
this.indicator = indicator;
|
||||
}
|
||||
|
||||
public void setShowLoadingText(String showLoadingText) {
|
||||
this.showLoadingText = showLoadingText;
|
||||
}
|
||||
|
||||
public void setAfterNotifyTopics(String afterNotifyTopics) {
|
||||
this.afterNotifyTopics = afterNotifyTopics;
|
||||
}
|
||||
|
||||
public void setBeforeNotifyTopics(String beforeNotifyTopics) {
|
||||
this.beforeNotifyTopics = beforeNotifyTopics;
|
||||
}
|
||||
|
||||
public void setErrorNotifyTopics(String errorNotifyTopics) {
|
||||
this.errorNotifyTopics = errorNotifyTopics;
|
||||
}
|
||||
|
||||
public void setHighlightColor(String highlightColor) {
|
||||
this.highlightColor = highlightColor;
|
||||
}
|
||||
|
||||
public void setHighlightDuration(String highlightDuration) {
|
||||
this.highlightDuration = highlightDuration;
|
||||
}
|
||||
|
||||
public void setValidate(String validate) {
|
||||
this.validate = validate;
|
||||
}
|
||||
|
||||
public void setAjaxAfterValidation(String ajaxAfterValidation) {
|
||||
this.ajaxAfterValidation = ajaxAfterValidation;
|
||||
}
|
||||
|
||||
public void setSeparateScripts(String separateScripts) {
|
||||
this.separateScripts = separateScripts;
|
||||
}
|
||||
|
||||
public void setTransport(String transport) {
|
||||
this.transport = transport;
|
||||
}
|
||||
|
||||
public void setParseContent(String parseContent) {
|
||||
this.parseContent = parseContent;
|
||||
}
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.jsp.ui;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.TabbedPanel;
|
||||
import org.apache.struts2.views.jsp.ui.AbstractClosingTag;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* @see TabbedPanel
|
||||
*/
|
||||
public class TabbedPanelTag extends AbstractClosingTag {
|
||||
|
||||
private static final long serialVersionUID = -4719930205515386252L;
|
||||
|
||||
private String selectedTab;
|
||||
private String closeButton;
|
||||
private String doLayout;
|
||||
private String templateCssPath;
|
||||
private String beforeSelectTabNotifyTopics;
|
||||
private String afterSelectTabNotifyTopics;
|
||||
private String disabledTabCssClass;
|
||||
private String useSelectedTabCookie;
|
||||
|
||||
public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
return new TabbedPanel(stack, req, res);
|
||||
}
|
||||
|
||||
protected void populateParams() {
|
||||
super.populateParams();
|
||||
TabbedPanel tabbedPanel = (TabbedPanel) component;
|
||||
tabbedPanel.setSelectedTab(selectedTab);
|
||||
tabbedPanel.setCloseButton(closeButton);
|
||||
tabbedPanel.setDoLayout(doLayout);
|
||||
tabbedPanel.setLabelposition(labelposition);
|
||||
tabbedPanel.setTemplateCssPath(templateCssPath);
|
||||
tabbedPanel.setBeforeSelectTabNotifyTopics(beforeSelectTabNotifyTopics);
|
||||
tabbedPanel.setAfterSelectTabNotifyTopics(afterSelectTabNotifyTopics);
|
||||
tabbedPanel.setDisabledTabCssClass(disabledTabCssClass);
|
||||
tabbedPanel.setUseSelectedTabCookie(useSelectedTabCookie);
|
||||
}
|
||||
|
||||
public void setSelectedTab(String selectedTab) {
|
||||
this.selectedTab = selectedTab;
|
||||
}
|
||||
|
||||
public void setCloseButton(String closeButton) {
|
||||
this.closeButton = closeButton;
|
||||
}
|
||||
|
||||
public void setDoLayout(String doLayout) {
|
||||
this.doLayout = doLayout;
|
||||
}
|
||||
|
||||
public void setTemplateCssPath(String templateCssPath) {
|
||||
this.templateCssPath = templateCssPath;
|
||||
}
|
||||
|
||||
public void setBeforeSelectTabNotifyTopics(String beforeSelectTabNotifyTopics) {
|
||||
this.beforeSelectTabNotifyTopics = beforeSelectTabNotifyTopics;
|
||||
}
|
||||
|
||||
public void setAfterSelectTabNotifyTopics(String afterSelectTabNotifyTopics) {
|
||||
this.afterSelectTabNotifyTopics = afterSelectTabNotifyTopics;
|
||||
}
|
||||
|
||||
public void setDisabledTabCssClass(String disabledTabCssClass) {
|
||||
this.disabledTabCssClass = disabledTabCssClass;
|
||||
}
|
||||
|
||||
public void setUseSelectedTabCookie( String useSelectedTabCookie ) {
|
||||
this.useSelectedTabCookie = useSelectedTabCookie;
|
||||
}
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.jsp.ui;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.TextArea;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
|
||||
/**
|
||||
* @see TextArea
|
||||
*
|
||||
*/
|
||||
public class TextareaTag extends org.apache.struts2.views.jsp.ui.TextareaTag{
|
||||
public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
return new TextArea(stack, req, res);
|
||||
}
|
||||
|
||||
protected void populateParams() {
|
||||
super.populateParams();
|
||||
|
||||
TextArea textArea = ((TextArea) component);
|
||||
textArea.setCols(cols);
|
||||
textArea.setReadonly(readonly);
|
||||
textArea.setRows(rows);
|
||||
textArea.setWrap(wrap);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.jsp.ui;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.TreeNode;
|
||||
import org.apache.struts2.views.jsp.ui.AbstractClosingTag;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* @see TreeNode
|
||||
*/
|
||||
public class TreeNodeTag extends AbstractClosingTag {
|
||||
|
||||
private static final long serialVersionUID = 7340746943017900803L;
|
||||
|
||||
|
||||
public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
return new TreeNode(stack,req,res);
|
||||
}
|
||||
|
||||
public void setLabel(String label) {
|
||||
this.label = label;
|
||||
}
|
||||
|
||||
// NOTE: not necessary, label property is inherited, will be populated
|
||||
// by super-class
|
||||
/*protected void populateParams() {
|
||||
if (label != null) {
|
||||
TreeNode treeNode = (TreeNode)component;
|
||||
treeNode.setLabel(label);
|
||||
}
|
||||
super.populateParams();
|
||||
}*/
|
||||
}
|
||||
@@ -1,298 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.jsp.ui;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.Tree;
|
||||
import org.apache.struts2.views.jsp.ui.AbstractClosingTag;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* @see Tree
|
||||
*/
|
||||
public class TreeTag extends AbstractClosingTag {
|
||||
|
||||
private static final long serialVersionUID = 2735218501058548013L;
|
||||
|
||||
protected String toggle;
|
||||
protected String selectedNotifyTopics;
|
||||
protected String expandedNotifyTopics;
|
||||
protected String collapsedNotifyTopics;
|
||||
protected String rootNode;
|
||||
protected String childCollectionProperty;
|
||||
protected String nodeTitleProperty;
|
||||
protected String nodeIdProperty;
|
||||
protected String showRootGrid;
|
||||
|
||||
protected String showGrid;
|
||||
protected String blankIconSrc;
|
||||
protected String gridIconSrcL;
|
||||
protected String gridIconSrcV;
|
||||
protected String gridIconSrcP;
|
||||
protected String gridIconSrcC;
|
||||
protected String gridIconSrcX;
|
||||
protected String gridIconSrcY;
|
||||
protected String expandIconSrcPlus;
|
||||
protected String expandIconSrcMinus;
|
||||
protected String iconWidth;
|
||||
protected String iconHeight;
|
||||
protected String toggleDuration;
|
||||
protected String templateCssPath;
|
||||
protected String href;
|
||||
protected String errorNotifyTopics;
|
||||
|
||||
public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
return new Tree(stack,req,res);
|
||||
}
|
||||
|
||||
protected void populateParams() {
|
||||
super.populateParams();
|
||||
|
||||
Tree tree = (Tree) component;
|
||||
tree.setChildCollectionProperty(childCollectionProperty);
|
||||
tree.setNodeIdProperty(nodeIdProperty);
|
||||
tree.setNodeTitleProperty(nodeTitleProperty);
|
||||
tree.setRootNode(rootNode);
|
||||
tree.setToggle(toggle);
|
||||
tree.setSelectedNotifyTopics(selectedNotifyTopics);
|
||||
tree.setExpandedNotifyTopics(expandedNotifyTopics);
|
||||
tree.setCollapsedNotifyTopics(collapsedNotifyTopics);
|
||||
tree.setShowRootGrid(showRootGrid);
|
||||
|
||||
tree.setShowGrid(showGrid);
|
||||
tree.setBlankIconSrc(blankIconSrc);
|
||||
tree.setGridIconSrcL(gridIconSrcC);
|
||||
tree.setGridIconSrcV(gridIconSrcV);
|
||||
tree.setGridIconSrcP(gridIconSrcP);
|
||||
tree.setGridIconSrcC(gridIconSrcC);
|
||||
tree.setGridIconSrcX(gridIconSrcX);
|
||||
tree.setGridIconSrcY(gridIconSrcY);
|
||||
tree.setExpandIconSrcPlus(expandIconSrcPlus);
|
||||
tree.setExpandIconSrcMinus(expandIconSrcMinus);
|
||||
tree.setIconWidth(iconWidth);
|
||||
tree.setIconHeight(iconHeight);
|
||||
tree.setToggleDuration(toggleDuration);
|
||||
tree.setTemplateCssPath(templateCssPath);
|
||||
tree.setHref(href);
|
||||
tree.setErrorNotifyTopics(errorNotifyTopics);
|
||||
}
|
||||
|
||||
public String getToggle() {
|
||||
return toggle;
|
||||
}
|
||||
|
||||
public void setToggle(String toggle) {
|
||||
this.toggle = toggle;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setTreeSelectedTopic(String treeSelectedTopic) {
|
||||
this.selectedNotifyTopics = treeSelectedTopic;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setTreeExpandedTopic(String treeExpandedTopic) {
|
||||
this.expandedNotifyTopics = treeExpandedTopic;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public void setTreeCollapsedTopic(String treeCollapsedTopic) {
|
||||
this.collapsedNotifyTopics = treeCollapsedTopic;
|
||||
}
|
||||
|
||||
public String getRootNode() {
|
||||
return rootNode;
|
||||
}
|
||||
|
||||
public void setRootNode(String rootNode) {
|
||||
this.rootNode = rootNode;
|
||||
}
|
||||
|
||||
public String getChildCollectionProperty() {
|
||||
return childCollectionProperty;
|
||||
}
|
||||
|
||||
public void setChildCollectionProperty(String childCollectionProperty) {
|
||||
this.childCollectionProperty = childCollectionProperty;
|
||||
}
|
||||
|
||||
public String getNodeTitleProperty() {
|
||||
return nodeTitleProperty;
|
||||
}
|
||||
|
||||
public void setNodeTitleProperty(String nodeTitleProperty) {
|
||||
this.nodeTitleProperty = nodeTitleProperty;
|
||||
}
|
||||
|
||||
public String getNodeIdProperty() {
|
||||
return nodeIdProperty;
|
||||
}
|
||||
|
||||
public void setNodeIdProperty(String nodeIdProperty) {
|
||||
this.nodeIdProperty = nodeIdProperty;
|
||||
}
|
||||
|
||||
public String getShowRootGrid() {
|
||||
return showRootGrid;
|
||||
}
|
||||
|
||||
public void setShowRootGrid(String showRootGrid) {
|
||||
this.showRootGrid = showRootGrid;
|
||||
}
|
||||
|
||||
public String getBlankIconSrc() {
|
||||
return blankIconSrc;
|
||||
}
|
||||
|
||||
public void setBlankIconSrc(String blankIconSrc) {
|
||||
this.blankIconSrc = blankIconSrc;
|
||||
}
|
||||
|
||||
public String getExpandIconSrcMinus() {
|
||||
return expandIconSrcMinus;
|
||||
}
|
||||
|
||||
public void setExpandIconSrcMinus(String expandIconSrcMinus) {
|
||||
this.expandIconSrcMinus = expandIconSrcMinus;
|
||||
}
|
||||
|
||||
public String getExpandIconSrcPlus() {
|
||||
return expandIconSrcPlus;
|
||||
}
|
||||
|
||||
public void setExpandIconSrcPlus(String expandIconSrcPlus) {
|
||||
this.expandIconSrcPlus = expandIconSrcPlus;
|
||||
}
|
||||
|
||||
public String getGridIconSrcC() {
|
||||
return gridIconSrcC;
|
||||
}
|
||||
|
||||
public void setGridIconSrcC(String gridIconSrcC) {
|
||||
this.gridIconSrcC = gridIconSrcC;
|
||||
}
|
||||
|
||||
public String getGridIconSrcL() {
|
||||
return gridIconSrcL;
|
||||
}
|
||||
|
||||
public void setGridIconSrcL(String gridIconSrcL) {
|
||||
this.gridIconSrcL = gridIconSrcL;
|
||||
}
|
||||
|
||||
public String getGridIconSrcP() {
|
||||
return gridIconSrcP;
|
||||
}
|
||||
|
||||
public void setGridIconSrcP(String gridIconSrcP) {
|
||||
this.gridIconSrcP = gridIconSrcP;
|
||||
}
|
||||
|
||||
public String getGridIconSrcV() {
|
||||
return gridIconSrcV;
|
||||
}
|
||||
|
||||
public void setGridIconSrcV(String gridIconSrcV) {
|
||||
this.gridIconSrcV = gridIconSrcV;
|
||||
}
|
||||
|
||||
public String getGridIconSrcX() {
|
||||
return gridIconSrcX;
|
||||
}
|
||||
|
||||
public void setGridIconSrcX(String gridIconSrcX) {
|
||||
this.gridIconSrcX = gridIconSrcX;
|
||||
}
|
||||
|
||||
public String getGridIconSrcY() {
|
||||
return gridIconSrcY;
|
||||
}
|
||||
|
||||
public void setGridIconSrcY(String gridIconSrcY) {
|
||||
this.gridIconSrcY = gridIconSrcY;
|
||||
}
|
||||
|
||||
public String getIconHeight() {
|
||||
return iconHeight;
|
||||
}
|
||||
|
||||
public void setIconHeight(String iconHeight) {
|
||||
this.iconHeight = iconHeight;
|
||||
}
|
||||
|
||||
public String getIconWidth() {
|
||||
return iconWidth;
|
||||
}
|
||||
|
||||
public void setIconWidth(String iconWidth) {
|
||||
this.iconWidth = iconWidth;
|
||||
}
|
||||
|
||||
public String getTemplateCssPath() {
|
||||
return templateCssPath;
|
||||
}
|
||||
|
||||
public void setTemplateCssPath(String templateCssPath) {
|
||||
this.templateCssPath = templateCssPath;
|
||||
}
|
||||
|
||||
public String getToggleDuration() {
|
||||
return toggleDuration;
|
||||
}
|
||||
|
||||
public void setToggleDuration(String toggleDuration) {
|
||||
this.toggleDuration = toggleDuration;
|
||||
}
|
||||
|
||||
public String getShowGrid() {
|
||||
return showGrid;
|
||||
}
|
||||
|
||||
public void setShowGrid(String showGrid) {
|
||||
this.showGrid = showGrid;
|
||||
}
|
||||
|
||||
public void setCollapsedNotifyTopics(String collapsedNotifyTopics) {
|
||||
this.collapsedNotifyTopics = collapsedNotifyTopics;
|
||||
}
|
||||
|
||||
public void setExpandedNotifyTopics(String expandedNotifyTopics) {
|
||||
this.expandedNotifyTopics = expandedNotifyTopics;
|
||||
}
|
||||
|
||||
public void setSelectedNotifyTopics(String selectedNotifyTopics) {
|
||||
this.selectedNotifyTopics = selectedNotifyTopics;
|
||||
}
|
||||
|
||||
public void setHref(String href) {
|
||||
this.href = href;
|
||||
}
|
||||
|
||||
public void setErrorNotifyTopics(String errorNotifyTopics) {
|
||||
this.errorNotifyTopics = errorNotifyTopics;
|
||||
}
|
||||
}
|
||||
|
||||
-47
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.velocity.components;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Anchor;
|
||||
import org.apache.struts2.components.Component;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* @see Anchor
|
||||
*/
|
||||
public class AnchorDirective extends DojoAbstractDirective {
|
||||
public String getBeanName() {
|
||||
return "a";
|
||||
}
|
||||
|
||||
protected Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
return new Anchor(stack, req, res);
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return BLOCK;
|
||||
}
|
||||
}
|
||||
-46
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.velocity.components;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.Autocompleter;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* @see Autocompleter
|
||||
*/
|
||||
public class AutocompleterDirective extends DojoAbstractDirective {
|
||||
|
||||
protected Component getBean(ValueStack stack, HttpServletRequest req,
|
||||
HttpServletResponse res) {
|
||||
return new Autocompleter(stack, req, res);
|
||||
}
|
||||
|
||||
public String getBeanName() {
|
||||
return "autocompleter";
|
||||
}
|
||||
|
||||
}
|
||||
-43
@@ -1,43 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.velocity.components;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.Bind;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* @see Bind
|
||||
*/
|
||||
public class BindDirective extends DojoAbstractDirective {
|
||||
public String getBeanName() {
|
||||
return "bind";
|
||||
}
|
||||
|
||||
protected Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
return new Bind(stack, req, res);
|
||||
}
|
||||
}
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.velocity.components;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.DateTimePicker;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* @see DateTimePicker
|
||||
*/
|
||||
public class DateTimePickerDirective extends DojoAbstractDirective {
|
||||
|
||||
protected Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
return new DateTimePicker(stack, req, res);
|
||||
}
|
||||
|
||||
public String getBeanName() {
|
||||
return "datetimepicker";
|
||||
}
|
||||
}
|
||||
-47
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.velocity.components;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.Div;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* @see Div
|
||||
*/
|
||||
public class DivDirective extends DojoAbstractDirective {
|
||||
public String getBeanName() {
|
||||
return "div";
|
||||
}
|
||||
|
||||
protected Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
return new Div(stack, req, res);
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return BLOCK;
|
||||
}
|
||||
}
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.velocity.components;
|
||||
|
||||
import org.apache.struts2.views.velocity.components.AbstractDirective;
|
||||
|
||||
/**
|
||||
* Overwrite name prefix
|
||||
*
|
||||
*/
|
||||
public abstract class DojoAbstractDirective extends AbstractDirective {
|
||||
public String getName() {
|
||||
return "sx" + getBeanName();
|
||||
}
|
||||
}
|
||||
-43
@@ -1,43 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.velocity.components;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.Head;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* @see Head
|
||||
*/
|
||||
public class HeadDirective extends DojoAbstractDirective {
|
||||
protected Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
return new Head(stack, req, res);
|
||||
}
|
||||
|
||||
public String getBeanName() {
|
||||
return "head";
|
||||
}
|
||||
}
|
||||
-43
@@ -1,43 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.velocity.components;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.components.Submit;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* @see Submit
|
||||
*/
|
||||
public class SubmitDirective extends DojoAbstractDirective {
|
||||
public String getBeanName() {
|
||||
return "submit";
|
||||
}
|
||||
|
||||
protected Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
return new Submit(stack, req, res);
|
||||
}
|
||||
}
|
||||
-47
@@ -1,47 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.velocity.components;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.TabbedPanel;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* @see TabbedPanel
|
||||
*/
|
||||
public class TabbedPanelDirective extends DojoAbstractDirective {
|
||||
public String getBeanName() {
|
||||
return "tabbedpanel";
|
||||
}
|
||||
|
||||
protected Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
return new TabbedPanel(stack, req, res);
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return BLOCK;
|
||||
}
|
||||
}
|
||||
-48
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.velocity.components;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.TextArea;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* @see TextArea
|
||||
*/
|
||||
public class TextAreaDirective extends DojoAbstractDirective {
|
||||
public String getBeanName() {
|
||||
return "textarea";
|
||||
}
|
||||
|
||||
protected Component getBean(ValueStack stack, HttpServletRequest req,
|
||||
HttpServletResponse res) {
|
||||
return new TextArea(stack, req, res);
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return BLOCK;
|
||||
}
|
||||
}
|
||||
-48
@@ -1,48 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.velocity.components;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.Tree;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* <code>TreeDirective</code>
|
||||
* @see Tree
|
||||
*/
|
||||
public class TreeDirective extends DojoAbstractDirective {
|
||||
public String getBeanName() {
|
||||
return "tree";
|
||||
}
|
||||
|
||||
protected Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
return new Tree(stack, req, res);
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return BLOCK;
|
||||
}
|
||||
}
|
||||
-49
@@ -1,49 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
package org.apache.struts2.dojo.views.velocity.components;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.apache.struts2.components.Component;
|
||||
import org.apache.struts2.dojo.components.TreeNode;
|
||||
|
||||
import com.opensymphony.xwork2.util.ValueStack;
|
||||
|
||||
/**
|
||||
* <code>TreeNodeDirective</code>
|
||||
* @see TreeNode
|
||||
*/
|
||||
public class TreeNodeDirective extends DojoAbstractDirective {
|
||||
public String getBeanName() {
|
||||
return "treenode";
|
||||
}
|
||||
|
||||
protected Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
|
||||
return new TreeNode(stack, req, res);
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return BLOCK;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
TLD file is generated inside META-INF after compilation.
|
||||
If META-INF is empty, Maven will not copy it to the "target/classes" folder.
|
||||
Please do not remove META-INF, or this file.
|
||||
@@ -1,6 +0,0 @@
|
||||
Apache Struts
|
||||
Copyright 2000-2011 The Apache Software Foundation
|
||||
|
||||
This product includes software developed by
|
||||
The Apache Software Foundation (http://www.apache.org/).
|
||||
Dojo (http://dojotoolkit.org/).
|
||||
@@ -1,25 +0,0 @@
|
||||
/*
|
||||
* $Id$
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
|
||||
.strutsDisabledTab div span {
|
||||
font-style: italic;
|
||||
color: #7986A1
|
||||
}
|
||||
@@ -1,195 +0,0 @@
|
||||
Dojo is availble under *either* the terms of the modified BSD license *or* the
|
||||
Academic Free License version 2.1. As a recipient of Dojo, you may choose which
|
||||
license to receive this code under (except as noted in per-module LICENSE
|
||||
files). Some modules may not be the copyright of the Dojo Foundation. These
|
||||
modules contain explicit declarations of copyright in both the LICENSE files in
|
||||
the directories in which they reside and in the code itself. No external
|
||||
contributions are allowed under licenses which are fundamentally incompatible
|
||||
with the AFL or BSD licenses that Dojo is distributed under.
|
||||
|
||||
The text of the AFL and BSD licenses is reproduced below.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
The "New" BSD License:
|
||||
**********************
|
||||
|
||||
Copyright (c) 2005-2006, The Dojo Foundation
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
* Neither the name of the Dojo Foundation nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
The Academic Free License, v. 2.1:
|
||||
**********************************
|
||||
|
||||
This Academic Free License (the "License") applies to any original work of
|
||||
authorship (the "Original Work") whose owner (the "Licensor") has placed the
|
||||
following notice immediately following the copyright notice for the Original
|
||||
Work:
|
||||
|
||||
Licensed under the Academic Free License version 2.1
|
||||
|
||||
1) Grant of Copyright License. Licensor hereby grants You a world-wide,
|
||||
royalty-free, non-exclusive, perpetual, sublicenseable license to do the
|
||||
following:
|
||||
|
||||
a) to reproduce the Original Work in copies;
|
||||
|
||||
b) to prepare derivative works ("Derivative Works") based upon the Original
|
||||
Work;
|
||||
|
||||
c) to distribute copies of the Original Work and Derivative Works to the
|
||||
public;
|
||||
|
||||
d) to perform the Original Work publicly; and
|
||||
|
||||
e) to display the Original Work publicly.
|
||||
|
||||
2) Grant of Patent License. Licensor hereby grants You a world-wide,
|
||||
royalty-free, non-exclusive, perpetual, sublicenseable license, under patent
|
||||
claims owned or controlled by the Licensor that are embodied in the Original
|
||||
Work as furnished by the Licensor, to make, use, sell and offer for sale the
|
||||
Original Work and Derivative Works.
|
||||
|
||||
3) Grant of Source Code License. The term "Source Code" means the preferred
|
||||
form of the Original Work for making modifications to it and all available
|
||||
documentation describing how to modify the Original Work. Licensor hereby
|
||||
agrees to provide a machine-readable copy of the Source Code of the Original
|
||||
Work along with each copy of the Original Work that Licensor distributes.
|
||||
Licensor reserves the right to satisfy this obligation by placing a
|
||||
machine-readable copy of the Source Code in an information repository
|
||||
reasonably calculated to permit inexpensive and convenient access by You for as
|
||||
long as Licensor continues to distribute the Original Work, and by publishing
|
||||
the address of that information repository in a notice immediately following
|
||||
the copyright notice that applies to the Original Work.
|
||||
|
||||
4) Exclusions From License Grant. Neither the names of Licensor, nor the names
|
||||
of any contributors to the Original Work, nor any of their trademarks or
|
||||
service marks, may be used to endorse or promote products derived from this
|
||||
Original Work without express prior written permission of the Licensor. Nothing
|
||||
in this License shall be deemed to grant any rights to trademarks, copyrights,
|
||||
patents, trade secrets or any other intellectual property of Licensor except as
|
||||
expressly stated herein. No patent license is granted to make, use, sell or
|
||||
offer to sell embodiments of any patent claims other than the licensed claims
|
||||
defined in Section 2. No right is granted to the trademarks of Licensor even if
|
||||
such marks are included in the Original Work. Nothing in this License shall be
|
||||
interpreted to prohibit Licensor from licensing under different terms from this
|
||||
License any Original Work that Licensor otherwise would have a right to
|
||||
license.
|
||||
|
||||
5) This section intentionally omitted.
|
||||
|
||||
6) Attribution Rights. You must retain, in the Source Code of any Derivative
|
||||
Works that You create, all copyright, patent or trademark notices from the
|
||||
Source Code of the Original Work, as well as any notices of licensing and any
|
||||
descriptive text identified therein as an "Attribution Notice." You must cause
|
||||
the Source Code for any Derivative Works that You create to carry a prominent
|
||||
Attribution Notice reasonably calculated to inform recipients that You have
|
||||
modified the Original Work.
|
||||
|
||||
7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that
|
||||
the copyright in and to the Original Work and the patent rights granted herein
|
||||
by Licensor are owned by the Licensor or are sublicensed to You under the terms
|
||||
of this License with the permission of the contributor(s) of those copyrights
|
||||
and patent rights. Except as expressly stated in the immediately proceeding
|
||||
sentence, the Original Work is provided under this License on an "AS IS" BASIS
|
||||
and WITHOUT WARRANTY, either express or implied, including, without limitation,
|
||||
the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU.
|
||||
This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No
|
||||
license to Original Work is granted hereunder except under this disclaimer.
|
||||
|
||||
8) Limitation of Liability. Under no circumstances and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise, shall the
|
||||
Licensor be liable to any person for any direct, indirect, special, incidental,
|
||||
or consequential damages of any character arising as a result of this License
|
||||
or the use of the Original Work including, without limitation, damages for loss
|
||||
of goodwill, work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses. This limitation of liability shall not
|
||||
apply to liability for death or personal injury resulting from Licensor's
|
||||
negligence to the extent applicable law prohibits such limitation. Some
|
||||
jurisdictions do not allow the exclusion or limitation of incidental or
|
||||
consequential damages, so this exclusion and limitation may not apply to You.
|
||||
|
||||
9) Acceptance and Termination. If You distribute copies of the Original Work or
|
||||
a Derivative Work, You must make a reasonable effort under the circumstances to
|
||||
obtain the express assent of recipients to the terms of this License. Nothing
|
||||
else but this License (or another written agreement between Licensor and You)
|
||||
grants You permission to create Derivative Works based upon the Original Work
|
||||
or to exercise any of the rights granted in Section 1 herein, and any attempt
|
||||
to do so except under the terms of this License (or another written agreement
|
||||
between Licensor and You) is expressly prohibited by U.S. copyright law, the
|
||||
equivalent laws of other countries, and by international treaty. Therefore, by
|
||||
exercising any of the rights granted to You in Section 1 herein, You indicate
|
||||
Your acceptance of this License and all of its terms and conditions.
|
||||
|
||||
10) Termination for Patent Action. This License shall terminate automatically
|
||||
and You may no longer exercise any of the rights granted to You by this License
|
||||
as of the date You commence an action, including a cross-claim or counterclaim,
|
||||
against Licensor or any licensee alleging that the Original Work infringes a
|
||||
patent. This termination provision shall not apply for an action alleging
|
||||
patent infringement by combinations of the Original Work with other software or
|
||||
hardware.
|
||||
|
||||
11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this
|
||||
License may be brought only in the courts of a jurisdiction wherein the
|
||||
Licensor resides or in which Licensor conducts its primary business, and under
|
||||
the laws of that jurisdiction excluding its conflict-of-law provisions. The
|
||||
application of the United Nations Convention on Contracts for the International
|
||||
Sale of Goods is expressly excluded. Any use of the Original Work outside the
|
||||
scope of this License or after its termination shall be subject to the
|
||||
requirements and penalties of the U.S. Copyright Act, 17 U.S.C. § 101 et
|
||||
seq., the equivalent laws of other countries, and international treaty. This
|
||||
section shall survive the termination of this License.
|
||||
|
||||
12) Attorneys Fees. In any action to enforce the terms of this License or
|
||||
seeking damages relating thereto, the prevailing party shall be entitled to
|
||||
recover its costs and expenses, including, without limitation, reasonable
|
||||
attorneys' fees and costs incurred in connection with such action, including
|
||||
any appeal of such action. This section shall survive the termination of this
|
||||
License.
|
||||
|
||||
13) Miscellaneous. This License represents the complete agreement concerning
|
||||
the subject matter hereof. If any provision of this License is held to be
|
||||
unenforceable, such provision shall be reformed only to the extent necessary to
|
||||
make it enforceable.
|
||||
|
||||
14) Definition of "You" in This License. "You" throughout this License, whether
|
||||
in upper or lower case, means an individual or a legal entity exercising rights
|
||||
under, and complying with all of the terms of, this License. For legal
|
||||
entities, "You" includes any entity that controls, is controlled by, or is
|
||||
under common control with you. For purposes of this definition, "control" means
|
||||
(i) the power, direct or indirect, to cause the direction or management of such
|
||||
entity, whether by contract or otherwise, or (ii) ownership of fifty percent
|
||||
(50%) or more of the outstanding shares, or (iii) beneficial ownership of such
|
||||
entity.
|
||||
|
||||
15) Right to Use. You may use the Original Work in all ways not otherwise
|
||||
restricted or conditioned by this License or by law, and Licensor promises not
|
||||
to interfere with or be responsible for such uses by You.
|
||||
|
||||
This license is Copyright (C) 2003-2004 Lawrence E. Rosen. All rights reserved.
|
||||
Permission is hereby granted to copy and distribute this license without
|
||||
modification. This license may not be modified without the express written
|
||||
permission of its copyright owner.
|
||||
@@ -1,176 +0,0 @@
|
||||
The Dojo Toolkit
|
||||
----------------
|
||||
|
||||
Dojo is a portable JavaScript toolkit for web application developers and
|
||||
JavaScript professionals. Dojo solves real-world problems by providing powerful
|
||||
abstractions and solid, tested implementations.
|
||||
|
||||
Getting Started
|
||||
---------------
|
||||
|
||||
To use Dojo in your application, download one of the pre-built editions from the
|
||||
Dojo website, http://dojotoolkit.org. Once you have downloaded the file you will
|
||||
need to unzip the archive in your website root. At a minimum, you will need to
|
||||
extract:
|
||||
|
||||
src/ (folder)
|
||||
dojo.js
|
||||
iframe_history.html
|
||||
|
||||
To begin using dojo, include dojo in your pages by using:
|
||||
|
||||
<script type="text/javascript" src="/path/to/dojo.js"></script>
|
||||
|
||||
Depending on the edition that you have downloaded, this base dojo.js file may or
|
||||
may not include the modules you wish to use in your application. The files which
|
||||
have been "baked in" to the dojo.js that is part of your distribution are listed
|
||||
in the file build.txt that is part of the top-level directory that is created
|
||||
when you unpack the archive. To ensure modules you wish to use are available,
|
||||
use dojo.require() to request them. A very rich application might include:
|
||||
|
||||
<script type="text/javascript" src="/path/to/dojo.js"></script>
|
||||
<script type="text/javascript">
|
||||
dojo.require("dojo.event.*"); // sophisticated AOP event handling
|
||||
dojo.require("dojo.io.*"); // for Ajax requests
|
||||
dojo.require("dojo.storage.*"); // a persistent local data cache
|
||||
dojo.require("dojo.json"); // serialization to JSON
|
||||
dojo.require("dojo.dnd.*"); // drag-and-drop
|
||||
dojo.require("dojo.lfx.*"); // animations and eye candy
|
||||
dojo.require("dojo.widget.Editor2");// stable, portable HTML WYSIWYG
|
||||
</script>
|
||||
|
||||
Note that only those modules which are *not* already "baked in" to dojo.js by
|
||||
the edition's build process are requested by dojo.require(). This helps make
|
||||
your application faster without forcing you to use a build tool while in
|
||||
development. See "Building Dojo" and "Working From Source" for more details.
|
||||
|
||||
|
||||
Compatibility
|
||||
-------------
|
||||
|
||||
In addition to it's suite of unit-tests for core system components, Dojo has
|
||||
been tested on almost every modern browser, including:
|
||||
|
||||
- IE 5.5+
|
||||
- Mozilla 1.5+, Firefox 1.0+
|
||||
- Safari 1.3.9+
|
||||
- Konqueror 3.4+
|
||||
- Opera 8.5+
|
||||
|
||||
Note that some widgets and features may not perform exactly the same on every
|
||||
browser due to browser implementation differences.
|
||||
|
||||
For those looking to use Dojo in non-browser environments, please see "Working
|
||||
From Source".
|
||||
|
||||
|
||||
Documentation and Getting Help
|
||||
------------------------------
|
||||
|
||||
Articles outlining major Dojo systems are linked from:
|
||||
|
||||
http://dojotoolkit.org/docs/
|
||||
|
||||
Toolkit APIs are listed in outline form at:
|
||||
|
||||
http://dojotoolkit.org/docs/apis/
|
||||
|
||||
And documented in full at:
|
||||
|
||||
http://manual.dojotoolkit.org/
|
||||
|
||||
The project also maintains a JotSpot Wiki at:
|
||||
|
||||
http://dojo.jot.com/
|
||||
|
||||
A FAQ has been extracted from mailing list traffic:
|
||||
|
||||
http://dojo.jot.com/FAQ
|
||||
|
||||
And the main Dojo user mailing list is archived and made searchable at:
|
||||
|
||||
http://news.gmane.org/gmane.comp.web.dojo.user/
|
||||
|
||||
You can sign up for this list, which is a great place to ask questions, at:
|
||||
|
||||
http://dojotoolkit.org/mailman/listinfo/dojo-interest
|
||||
|
||||
The Dojo developers also tend to hang out in IRC and help people with Dojo
|
||||
problems. You're most likely to find them at:
|
||||
|
||||
irc.freenode.net #dojo
|
||||
|
||||
Note that 3PM Wed PST in #dojo-meeting is reserved for a weekly meeting between
|
||||
project developers, although anyone is welcome to participate.
|
||||
|
||||
|
||||
Working From Source
|
||||
-------------------
|
||||
|
||||
The core of Dojo is a powerful package system that allows developers to optimize
|
||||
Dojo for deployment while using *exactly the same* application code in
|
||||
development. Therefore, working from source is almost exactly like working from
|
||||
a pre-built edition. Pre-built editions are significantly faster to load than
|
||||
working from source, but are not as flexible when in development.
|
||||
|
||||
There are multiple ways to get the source. Nightly snapshots of the Dojo source
|
||||
repository are available at:
|
||||
|
||||
http://archive.dojotoolkit.org/nightly.tgz
|
||||
|
||||
Anonymous Subversion access is also available:
|
||||
|
||||
%> svn co http://svn.dojotoolkit.org/dojo/trunk/ dojo
|
||||
|
||||
Each of these sources will include some extra directories not included in the
|
||||
pre-packaged editions, including command-line tests and build tools for
|
||||
constructing your own packages.
|
||||
|
||||
Running the command-line unit test suite requires Ant 1.6. If it is installed
|
||||
and in your path, you can run the tests using:
|
||||
|
||||
%> cd buildscripts
|
||||
%> ant test
|
||||
|
||||
The command-line test harness makes use of Rhino, a JavaScript interpreter
|
||||
written in Java. Once you have a copy of Dojo's source tree, you have a copy of
|
||||
Rhino. From the root directory, you can use Rhino interactively to load Dojo:
|
||||
|
||||
%> java -jar buildscripts/lib/js.jar
|
||||
Rhino 1.5 release 3 2002 01 27
|
||||
js> load("dojo.js");
|
||||
js> print(dojo);
|
||||
[object Object]
|
||||
js> quit();
|
||||
|
||||
This environment is wonderful for testing raw JavaScript functionality in, or
|
||||
even for scripting your system. Since Rhino has full access to anything in
|
||||
Java's classpath, the sky is the limit!
|
||||
|
||||
Building Dojo
|
||||
-------------
|
||||
|
||||
Dojo requires Ant 1.6.x in order to build correctly. While using Dojo from
|
||||
source does *NOT* require that you make a build, speeding up your application by
|
||||
constructing a custom profile build does.
|
||||
|
||||
Once you have Ant and a source snapshot of Dojo, you can make your own profile
|
||||
build ("edition") which includes only those modules your application uses by
|
||||
customizing one of the files in:
|
||||
|
||||
[dojo]/buildscripts/profiles/
|
||||
|
||||
These files are named *.profile.js and each one contains a list of modules to
|
||||
include in a build. If we created a new profile called "test.profile.js", we
|
||||
could then make a profile build using it by doing:
|
||||
|
||||
%> cd buildscripts
|
||||
%> ant -Dprofile=test -Ddocless=true release intern-strings
|
||||
|
||||
If the build is successful, your newly minted and compressed profile build will
|
||||
be placed in [dojo]/release/dojo/
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Copyright (c) 2004-2006, The Dojo Foundation, All Rights Reserved
|
||||
|
||||
vim:ts=4:et:tw=80:shiftwidth=4:
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,35 +0,0 @@
|
||||
Files baked into this build:
|
||||
|
||||
dojo.js:
|
||||
dojoGuardStart.js
|
||||
../src/bootstrap1.js
|
||||
../src/loader.js
|
||||
dojoGuardEnd.js
|
||||
../src/hostenv_browser.js
|
||||
../src/string/common.js
|
||||
../src/string.js
|
||||
../src/lang/common.js
|
||||
../src/lang/extras.js
|
||||
../src/io/common.js
|
||||
../src/lang/array.js
|
||||
../src/lang/func.js
|
||||
../src/string/extras.js
|
||||
../src/dom.js
|
||||
../src/undo/browser.js
|
||||
../src/io/BrowserIO.js
|
||||
../src/io/cookie.js
|
||||
../src/io/__package__.js
|
||||
../src/event/common.js
|
||||
../src/event/topic.js
|
||||
../src/event/browser.js
|
||||
../src/event/__package__.js
|
||||
../src/gfx/color.js
|
||||
../src/lfx/Animation.js
|
||||
../src/html/common.js
|
||||
../src/uri/Uri.js
|
||||
../src/html/style.js
|
||||
../src/html/display.js
|
||||
../src/html/color.js
|
||||
../src/html/layout.js
|
||||
../src/lfx/html.js
|
||||
../src/lfx/__package__.js
|
||||
File diff suppressed because it is too large
Load Diff
-9865
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -1,84 +0,0 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<head>
|
||||
<title></title>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
|
||||
<script type="text/javascript">
|
||||
// <!--
|
||||
var noInit = false;
|
||||
var domain = "";
|
||||
// document.domain = "localhost";
|
||||
|
||||
function defineParams(sparams){
|
||||
if(sparams){
|
||||
var ss = (sparams.indexOf("&") >= 0) ? "&" : "&";
|
||||
sparams = sparams.split(ss);
|
||||
for(var x=0; x<sparams.length; x++){
|
||||
var tp = sparams[x].split("=");
|
||||
if(typeof window[tp[0]] != "undefined"){
|
||||
window[tp[0]] = ((tp[1]=="true")||(tp[1]=="false")) ? eval(tp[1]) : tp[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function init(){
|
||||
// parse the query string if there is one to try to get params that
|
||||
// we can act on. Also allow params to be in a fragment identifier.
|
||||
var query = null;
|
||||
var frag = null;
|
||||
var url = document.location.href;
|
||||
var hashIndex = url.indexOf("#");
|
||||
|
||||
//Extract fragment identifier
|
||||
if(hashIndex != -1){
|
||||
frag = url.substring(hashIndex + 1, url.length);
|
||||
url = url.substring(0, hashIndex);
|
||||
}
|
||||
|
||||
//Extract querystring
|
||||
var parts = url.split("?");
|
||||
if(parts.length == 2){
|
||||
query = parts[1];
|
||||
}
|
||||
|
||||
defineParams(query);
|
||||
defineParams(frag);
|
||||
|
||||
if(noInit){ return; }
|
||||
if(domain.length > 0){
|
||||
document.domain = domain;
|
||||
}
|
||||
var hasParentDojo = false;
|
||||
try{
|
||||
hasParentDojo = window.parent != window && window.parent["dojo"];
|
||||
}catch(e){
|
||||
alert("Initializing iframe_history.html failed. If you are using a cross-domain Dojo build,"
|
||||
+ " please save iframe_history.html to your domain and set djConfig.dojoIframeHistoryUrl"
|
||||
+ " to the path on your domain to iframe_history.html");
|
||||
throw e;
|
||||
}
|
||||
|
||||
if(hasParentDojo){
|
||||
//Set the page title so IE history shows up with a somewhat correct name.
|
||||
document.title = window.parent.document.title;
|
||||
|
||||
//Notify parent that we are loaded.
|
||||
var pdj = window.parent.dojo;
|
||||
if(pdj["undo"] && pdj["undo"]["browser"]){
|
||||
pdj.undo.browser.iframeLoaded(null, window.location);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// -->
|
||||
</script>
|
||||
</head>
|
||||
<body onload="try{ init(); }catch(e){ alert(e); }">
|
||||
<h4>The Dojo Toolkit -- iframe_history.html</h4>
|
||||
|
||||
<p>This file is used in Dojo's back/fwd button management.</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -1,11 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2004-2006, The Dojo Foundation
|
||||
All Rights Reserved.
|
||||
|
||||
Licensed under the Academic Free License version 2.1 or above OR the
|
||||
modified BSD license. For more information on Dojo licensing, see:
|
||||
|
||||
http://dojotoolkit.org/community/licensing.shtml
|
||||
*/
|
||||
|
||||
dojo.provide("nls.dojo_ROOT");dojo.provide("dojo.i18n.calendar.nls.gregorian");dojo.i18n.calendar.nls.gregorian._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorian.ROOT");dojo.i18n.calendar.nls.gregorian.ROOT={"field-weekday":"Day of the Week","dateFormat-medium":"yyyy MMM d","field-second":"Second","field-week":"Week","pm":"PM","timeFormat-full":"HH:mm:ss z","months-standAlone-narrow":["1","2","3","4","5","6","7","8","9","10","11","12"],"am":"AM","days-standAlone-narrow":["1","2","3","4","5","6","7"],"field-year":"Year","eras":["BCE","CE"],"field-minute":"Minute","timeFormat-medium":"HH:mm:ss","field-hour":"Hour","dateFormat-long":"yyyy MMMM d","field-day":"Day","field-dayperiod":"Dayperiod","field-month":"Month","dateFormat-short":"yy/MM/dd","months-format-wide":["1","2","3","4","5","6","7","8","9","10","11","12"],"field-era":"Era","timeFormat-short":"HH:mm","months-format-abbr":["1","2","3","4","5","6","7","8","9","10","11","12"],"timeFormat-long":"HH:mm:ss z","days-format-wide":["1","2","3","4","5","6","7"],"dateFormat-full":"EEEE, yyyy MMMM dd","field-zone":"Zone","days-format-abbr":["1","2","3","4","5","6","7"]};dojo.provide("dojo.i18n.calendar.nls.gregorianExtras");dojo.i18n.calendar.nls.gregorianExtras._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorianExtras.ROOT");dojo.i18n.calendar.nls.gregorianExtras.ROOT={"dateFormat-yearOnly":"yyyy"};dojo.provide("dojo.i18n.calendar.nls.gregorian");dojo.i18n.calendar.nls.gregorian._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorian.ROOT");dojo.i18n.calendar.nls.gregorian.ROOT={"field-weekday":"Day of the Week","dateFormat-medium":"yyyy MMM d","field-second":"Second","field-week":"Week","pm":"PM","timeFormat-full":"HH:mm:ss z","months-standAlone-narrow":["1","2","3","4","5","6","7","8","9","10","11","12"],"am":"AM","days-standAlone-narrow":["1","2","3","4","5","6","7"],"field-year":"Year","eras":["BCE","CE"],"field-minute":"Minute","timeFormat-medium":"HH:mm:ss","field-hour":"Hour","dateFormat-long":"yyyy MMMM d","field-day":"Day","field-dayperiod":"Dayperiod","field-month":"Month","dateFormat-short":"yy/MM/dd","months-format-wide":["1","2","3","4","5","6","7","8","9","10","11","12"],"field-era":"Era","timeFormat-short":"HH:mm","months-format-abbr":["1","2","3","4","5","6","7","8","9","10","11","12"],"timeFormat-long":"HH:mm:ss z","days-format-wide":["1","2","3","4","5","6","7"],"dateFormat-full":"EEEE, yyyy MMMM dd","field-zone":"Zone","days-format-abbr":["1","2","3","4","5","6","7"]};dojo.provide("dojo.widget.nls.TimePicker");dojo.widget.nls.TimePicker._built=true;dojo.provide("dojo.widget.nls.TimePicker.ROOT");dojo.widget.nls.TimePicker.ROOT={"any":"any"};dojo.provide("dojo.widget.nls.DropdownTimePicker");dojo.widget.nls.DropdownTimePicker._built=true;dojo.provide("dojo.widget.nls.DropdownTimePicker.ROOT");dojo.widget.nls.DropdownTimePicker.ROOT={"selectTime":"Select time"};dojo.provide("dojo.widget.nls.DropdownDatePicker");dojo.widget.nls.DropdownDatePicker._built=true;dojo.provide("dojo.widget.nls.DropdownDatePicker.ROOT");dojo.widget.nls.DropdownDatePicker.ROOT={"selectDate":"Select a date"};
|
||||
@@ -1,11 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2004-2006, The Dojo Foundation
|
||||
All Rights Reserved.
|
||||
|
||||
Licensed under the Academic Free License version 2.1 or above OR the
|
||||
modified BSD license. For more information on Dojo licensing, see:
|
||||
|
||||
http://dojotoolkit.org/community/licensing.shtml
|
||||
*/
|
||||
|
||||
dojo.provide("nls.dojo_de-de");dojo.provide("dojo.i18n.calendar.nls.gregorian");dojo.i18n.calendar.nls.gregorian._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorian.de_de");dojo.i18n.calendar.nls.gregorian.de_de={"field-weekday":"Wochentag","dateFormat-medium":"dd.MM.yyyy","field-second":"Sekunde","field-week":"Woche","pm":"nachm.","timeFormat-full":"H:mm' Uhr 'z","months-standAlone-narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"am":"vorm.","days-standAlone-narrow":["S","M","D","M","D","F","S"],"field-year":"Jahr","eras":["v. Chr.","n. Chr."],"field-hour":"Stunde","dateFormat-long":"d. MMMM yyyy","field-day":"Tag","field-dayperiod":"Tageshälfte","field-month":"Monat","dateFormat-short":"dd.MM.yy","months-format-wide":["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],"field-era":"Epoche","months-format-abbr":["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],"days-format-wide":["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],"dateFormat-full":"EEEE, d. MMMM yyyy","field-zone":"Zone","days-format-abbr":["So","Mo","Di","Mi","Do","Fr","Sa"],"field-minute":"Minute","timeFormat-medium":"HH:mm:ss","timeFormat-short":"HH:mm","timeFormat-long":"HH:mm:ss z"};dojo.provide("dojo.i18n.calendar.nls.gregorianExtras");dojo.i18n.calendar.nls.gregorianExtras._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorianExtras.de_de");dojo.i18n.calendar.nls.gregorianExtras.de_de={"dateFormat-yearOnly":"yyyy"};dojo.provide("dojo.i18n.calendar.nls.gregorian");dojo.i18n.calendar.nls.gregorian._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorian.de_de");dojo.i18n.calendar.nls.gregorian.de_de={"field-weekday":"Wochentag","dateFormat-medium":"dd.MM.yyyy","field-second":"Sekunde","field-week":"Woche","pm":"nachm.","timeFormat-full":"H:mm' Uhr 'z","months-standAlone-narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"am":"vorm.","days-standAlone-narrow":["S","M","D","M","D","F","S"],"field-year":"Jahr","eras":["v. Chr.","n. Chr."],"field-hour":"Stunde","dateFormat-long":"d. MMMM yyyy","field-day":"Tag","field-dayperiod":"Tageshälfte","field-month":"Monat","dateFormat-short":"dd.MM.yy","months-format-wide":["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],"field-era":"Epoche","months-format-abbr":["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],"days-format-wide":["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],"dateFormat-full":"EEEE, d. MMMM yyyy","field-zone":"Zone","days-format-abbr":["So","Mo","Di","Mi","Do","Fr","Sa"],"field-minute":"Minute","timeFormat-medium":"HH:mm:ss","timeFormat-short":"HH:mm","timeFormat-long":"HH:mm:ss z"};dojo.provide("dojo.widget.nls.TimePicker");dojo.widget.nls.TimePicker._built=true;dojo.provide("dojo.widget.nls.TimePicker.de_de");dojo.widget.nls.TimePicker.de_de={"any":"any"};dojo.provide("dojo.widget.nls.DropdownTimePicker");dojo.widget.nls.DropdownTimePicker._built=true;dojo.provide("dojo.widget.nls.DropdownTimePicker.de_de");dojo.widget.nls.DropdownTimePicker.de_de={"selectTime":"Select time"};dojo.provide("dojo.widget.nls.DropdownDatePicker");dojo.widget.nls.DropdownDatePicker._built=true;dojo.provide("dojo.widget.nls.DropdownDatePicker.de_de");dojo.widget.nls.DropdownDatePicker.de_de={"selectDate":"Select a date"};
|
||||
@@ -1,11 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2004-2006, The Dojo Foundation
|
||||
All Rights Reserved.
|
||||
|
||||
Licensed under the Academic Free License version 2.1 or above OR the
|
||||
modified BSD license. For more information on Dojo licensing, see:
|
||||
|
||||
http://dojotoolkit.org/community/licensing.shtml
|
||||
*/
|
||||
|
||||
dojo.provide("nls.dojo_de");dojo.provide("dojo.i18n.calendar.nls.gregorian");dojo.i18n.calendar.nls.gregorian._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorian.de");dojo.i18n.calendar.nls.gregorian.de={"field-weekday":"Wochentag","dateFormat-medium":"dd.MM.yyyy","field-second":"Sekunde","field-week":"Woche","pm":"nachm.","timeFormat-full":"H:mm' Uhr 'z","months-standAlone-narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"am":"vorm.","days-standAlone-narrow":["S","M","D","M","D","F","S"],"field-year":"Jahr","eras":["v. Chr.","n. Chr."],"field-hour":"Stunde","dateFormat-long":"d. MMMM yyyy","field-day":"Tag","field-dayperiod":"Tageshälfte","field-month":"Monat","dateFormat-short":"dd.MM.yy","months-format-wide":["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],"field-era":"Epoche","months-format-abbr":["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],"days-format-wide":["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],"dateFormat-full":"EEEE, d. MMMM yyyy","field-zone":"Zone","days-format-abbr":["So","Mo","Di","Mi","Do","Fr","Sa"],"field-minute":"Minute","timeFormat-medium":"HH:mm:ss","timeFormat-short":"HH:mm","timeFormat-long":"HH:mm:ss z"};dojo.provide("dojo.i18n.calendar.nls.gregorianExtras");dojo.i18n.calendar.nls.gregorianExtras._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorianExtras.de");dojo.i18n.calendar.nls.gregorianExtras.de={"dateFormat-yearOnly":"yyyy"};dojo.provide("dojo.i18n.calendar.nls.gregorian");dojo.i18n.calendar.nls.gregorian._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorian.de");dojo.i18n.calendar.nls.gregorian.de={"field-weekday":"Wochentag","dateFormat-medium":"dd.MM.yyyy","field-second":"Sekunde","field-week":"Woche","pm":"nachm.","timeFormat-full":"H:mm' Uhr 'z","months-standAlone-narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"am":"vorm.","days-standAlone-narrow":["S","M","D","M","D","F","S"],"field-year":"Jahr","eras":["v. Chr.","n. Chr."],"field-hour":"Stunde","dateFormat-long":"d. MMMM yyyy","field-day":"Tag","field-dayperiod":"Tageshälfte","field-month":"Monat","dateFormat-short":"dd.MM.yy","months-format-wide":["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember"],"field-era":"Epoche","months-format-abbr":["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez"],"days-format-wide":["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],"dateFormat-full":"EEEE, d. MMMM yyyy","field-zone":"Zone","days-format-abbr":["So","Mo","Di","Mi","Do","Fr","Sa"],"field-minute":"Minute","timeFormat-medium":"HH:mm:ss","timeFormat-short":"HH:mm","timeFormat-long":"HH:mm:ss z"};dojo.provide("dojo.widget.nls.TimePicker");dojo.widget.nls.TimePicker._built=true;dojo.provide("dojo.widget.nls.TimePicker.de");dojo.widget.nls.TimePicker.de={"any":"any"};dojo.provide("dojo.widget.nls.DropdownTimePicker");dojo.widget.nls.DropdownTimePicker._built=true;dojo.provide("dojo.widget.nls.DropdownTimePicker.de");dojo.widget.nls.DropdownTimePicker.de={"selectTime":"Select time"};dojo.provide("dojo.widget.nls.DropdownDatePicker");dojo.widget.nls.DropdownDatePicker._built=true;dojo.provide("dojo.widget.nls.DropdownDatePicker.de");dojo.widget.nls.DropdownDatePicker.de={"selectDate":"Select a date"};
|
||||
@@ -1,11 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2004-2006, The Dojo Foundation
|
||||
All Rights Reserved.
|
||||
|
||||
Licensed under the Academic Free License version 2.1 or above OR the
|
||||
modified BSD license. For more information on Dojo licensing, see:
|
||||
|
||||
http://dojotoolkit.org/community/licensing.shtml
|
||||
*/
|
||||
|
||||
dojo.provide("nls.dojo_en-gb");dojo.provide("dojo.i18n.calendar.nls.gregorian");dojo.i18n.calendar.nls.gregorian._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorian.en_gb");dojo.i18n.calendar.nls.gregorian.en_gb={"months-standAlone-narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"dateFormat-long":"MMMM d, yyyy","timeFormat-full":"h:mm:ss a v","eras":["BC","AD"],"timeFormat-medium":"h:mm:ss a","dateFormat-medium":"MMM d, yyyy","months-format-abbr":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"dateFormat-full":"EEEE, MMMM d, yyyy","days-format-abbr":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"timeFormat-long":"h:mm:ss a z","timeFormat-short":"h:mm a","dateFormat-short":"M/d/yy","months-format-wide":["January","February","March","April","May","June","July","August","September","October","November","December"],"days-standAlone-narrow":["S","M","T","W","T","F","S"],"days-format-wide":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"field-weekday":"Day of the Week","field-second":"Second","field-week":"Week","pm":"PM","am":"AM","field-year":"Year","field-minute":"Minute","field-hour":"Hour","field-day":"Day","field-dayperiod":"Dayperiod","field-month":"Month","field-era":"Era","field-zone":"Zone"};dojo.provide("dojo.i18n.calendar.nls.gregorianExtras");dojo.i18n.calendar.nls.gregorianExtras._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorianExtras.en_gb");dojo.i18n.calendar.nls.gregorianExtras.en_gb={"dateFormat-yearOnly":"yyyy"};dojo.provide("dojo.i18n.calendar.nls.gregorian");dojo.i18n.calendar.nls.gregorian._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorian.en_gb");dojo.i18n.calendar.nls.gregorian.en_gb={"months-standAlone-narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"dateFormat-long":"MMMM d, yyyy","timeFormat-full":"h:mm:ss a v","eras":["BC","AD"],"timeFormat-medium":"h:mm:ss a","dateFormat-medium":"MMM d, yyyy","months-format-abbr":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"dateFormat-full":"EEEE, MMMM d, yyyy","days-format-abbr":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"timeFormat-long":"h:mm:ss a z","timeFormat-short":"h:mm a","dateFormat-short":"M/d/yy","months-format-wide":["January","February","March","April","May","June","July","August","September","October","November","December"],"days-standAlone-narrow":["S","M","T","W","T","F","S"],"days-format-wide":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"field-weekday":"Day of the Week","field-second":"Second","field-week":"Week","pm":"PM","am":"AM","field-year":"Year","field-minute":"Minute","field-hour":"Hour","field-day":"Day","field-dayperiod":"Dayperiod","field-month":"Month","field-era":"Era","field-zone":"Zone"};dojo.provide("dojo.widget.nls.TimePicker");dojo.widget.nls.TimePicker._built=true;dojo.provide("dojo.widget.nls.TimePicker.en_gb");dojo.widget.nls.TimePicker.en_gb={"any":"any"};dojo.provide("dojo.widget.nls.DropdownTimePicker");dojo.widget.nls.DropdownTimePicker._built=true;dojo.provide("dojo.widget.nls.DropdownTimePicker.en_gb");dojo.widget.nls.DropdownTimePicker.en_gb={"selectTime":"Select time"};dojo.provide("dojo.widget.nls.DropdownDatePicker");dojo.widget.nls.DropdownDatePicker._built=true;dojo.provide("dojo.widget.nls.DropdownDatePicker.en_gb");dojo.widget.nls.DropdownDatePicker.en_gb={"selectDate":"Select a date"};
|
||||
@@ -1,11 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2004-2006, The Dojo Foundation
|
||||
All Rights Reserved.
|
||||
|
||||
Licensed under the Academic Free License version 2.1 or above OR the
|
||||
modified BSD license. For more information on Dojo licensing, see:
|
||||
|
||||
http://dojotoolkit.org/community/licensing.shtml
|
||||
*/
|
||||
|
||||
dojo.provide("nls.dojo_en-us");dojo.provide("dojo.i18n.calendar.nls.gregorian");dojo.i18n.calendar.nls.gregorian._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorian.en_us");dojo.i18n.calendar.nls.gregorian.en_us={"months-standAlone-narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"dateFormat-long":"MMMM d, yyyy","timeFormat-full":"h:mm:ss a v","eras":["BC","AD"],"timeFormat-medium":"h:mm:ss a","dateFormat-medium":"MMM d, yyyy","months-format-abbr":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"dateFormat-full":"EEEE, MMMM d, yyyy","days-format-abbr":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"timeFormat-long":"h:mm:ss a z","timeFormat-short":"h:mm a","dateFormat-short":"M/d/yy","months-format-wide":["January","February","March","April","May","June","July","August","September","October","November","December"],"days-standAlone-narrow":["S","M","T","W","T","F","S"],"days-format-wide":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"field-weekday":"Day of the Week","field-second":"Second","field-week":"Week","pm":"PM","am":"AM","field-year":"Year","field-minute":"Minute","field-hour":"Hour","field-day":"Day","field-dayperiod":"Dayperiod","field-month":"Month","field-era":"Era","field-zone":"Zone"};dojo.provide("dojo.i18n.calendar.nls.gregorianExtras");dojo.i18n.calendar.nls.gregorianExtras._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorianExtras.en_us");dojo.i18n.calendar.nls.gregorianExtras.en_us={"dateFormat-yearOnly":"yyyy"};dojo.provide("dojo.i18n.calendar.nls.gregorian");dojo.i18n.calendar.nls.gregorian._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorian.en_us");dojo.i18n.calendar.nls.gregorian.en_us={"months-standAlone-narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"dateFormat-long":"MMMM d, yyyy","timeFormat-full":"h:mm:ss a v","eras":["BC","AD"],"timeFormat-medium":"h:mm:ss a","dateFormat-medium":"MMM d, yyyy","months-format-abbr":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"dateFormat-full":"EEEE, MMMM d, yyyy","days-format-abbr":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"timeFormat-long":"h:mm:ss a z","timeFormat-short":"h:mm a","dateFormat-short":"M/d/yy","months-format-wide":["January","February","March","April","May","June","July","August","September","October","November","December"],"days-standAlone-narrow":["S","M","T","W","T","F","S"],"days-format-wide":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"field-weekday":"Day of the Week","field-second":"Second","field-week":"Week","pm":"PM","am":"AM","field-year":"Year","field-minute":"Minute","field-hour":"Hour","field-day":"Day","field-dayperiod":"Dayperiod","field-month":"Month","field-era":"Era","field-zone":"Zone"};dojo.provide("dojo.widget.nls.TimePicker");dojo.widget.nls.TimePicker._built=true;dojo.provide("dojo.widget.nls.TimePicker.en_us");dojo.widget.nls.TimePicker.en_us={"any":"any"};dojo.provide("dojo.widget.nls.DropdownTimePicker");dojo.widget.nls.DropdownTimePicker._built=true;dojo.provide("dojo.widget.nls.DropdownTimePicker.en_us");dojo.widget.nls.DropdownTimePicker.en_us={"selectTime":"Select time"};dojo.provide("dojo.widget.nls.DropdownDatePicker");dojo.widget.nls.DropdownDatePicker._built=true;dojo.provide("dojo.widget.nls.DropdownDatePicker.en_us");dojo.widget.nls.DropdownDatePicker.en_us={"selectDate":"Select a date"};
|
||||
@@ -1,11 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2004-2006, The Dojo Foundation
|
||||
All Rights Reserved.
|
||||
|
||||
Licensed under the Academic Free License version 2.1 or above OR the
|
||||
modified BSD license. For more information on Dojo licensing, see:
|
||||
|
||||
http://dojotoolkit.org/community/licensing.shtml
|
||||
*/
|
||||
|
||||
dojo.provide("nls.dojo_en");dojo.provide("dojo.i18n.calendar.nls.gregorian");dojo.i18n.calendar.nls.gregorian._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorian.en");dojo.i18n.calendar.nls.gregorian.en={"months-standAlone-narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"dateFormat-long":"MMMM d, yyyy","timeFormat-full":"h:mm:ss a v","eras":["BC","AD"],"timeFormat-medium":"h:mm:ss a","dateFormat-medium":"MMM d, yyyy","months-format-abbr":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"dateFormat-full":"EEEE, MMMM d, yyyy","days-format-abbr":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"timeFormat-long":"h:mm:ss a z","timeFormat-short":"h:mm a","dateFormat-short":"M/d/yy","months-format-wide":["January","February","March","April","May","June","July","August","September","October","November","December"],"days-standAlone-narrow":["S","M","T","W","T","F","S"],"days-format-wide":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"field-weekday":"Day of the Week","field-second":"Second","field-week":"Week","pm":"PM","am":"AM","field-year":"Year","field-minute":"Minute","field-hour":"Hour","field-day":"Day","field-dayperiod":"Dayperiod","field-month":"Month","field-era":"Era","field-zone":"Zone"};dojo.provide("dojo.i18n.calendar.nls.gregorianExtras");dojo.i18n.calendar.nls.gregorianExtras._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorianExtras.en");dojo.i18n.calendar.nls.gregorianExtras.en={"dateFormat-yearOnly":"yyyy"};dojo.provide("dojo.i18n.calendar.nls.gregorian");dojo.i18n.calendar.nls.gregorian._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorian.en");dojo.i18n.calendar.nls.gregorian.en={"months-standAlone-narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"dateFormat-long":"MMMM d, yyyy","timeFormat-full":"h:mm:ss a v","eras":["BC","AD"],"timeFormat-medium":"h:mm:ss a","dateFormat-medium":"MMM d, yyyy","months-format-abbr":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"dateFormat-full":"EEEE, MMMM d, yyyy","days-format-abbr":["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],"timeFormat-long":"h:mm:ss a z","timeFormat-short":"h:mm a","dateFormat-short":"M/d/yy","months-format-wide":["January","February","March","April","May","June","July","August","September","October","November","December"],"days-standAlone-narrow":["S","M","T","W","T","F","S"],"days-format-wide":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"field-weekday":"Day of the Week","field-second":"Second","field-week":"Week","pm":"PM","am":"AM","field-year":"Year","field-minute":"Minute","field-hour":"Hour","field-day":"Day","field-dayperiod":"Dayperiod","field-month":"Month","field-era":"Era","field-zone":"Zone"};dojo.provide("dojo.widget.nls.TimePicker");dojo.widget.nls.TimePicker._built=true;dojo.provide("dojo.widget.nls.TimePicker.en");dojo.widget.nls.TimePicker.en={"any":"any"};dojo.provide("dojo.widget.nls.DropdownTimePicker");dojo.widget.nls.DropdownTimePicker._built=true;dojo.provide("dojo.widget.nls.DropdownTimePicker.en");dojo.widget.nls.DropdownTimePicker.en={"selectTime":"Select time"};dojo.provide("dojo.widget.nls.DropdownDatePicker");dojo.widget.nls.DropdownDatePicker._built=true;dojo.provide("dojo.widget.nls.DropdownDatePicker.en");dojo.widget.nls.DropdownDatePicker.en={"selectDate":"Select a date"};
|
||||
@@ -1,11 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2004-2006, The Dojo Foundation
|
||||
All Rights Reserved.
|
||||
|
||||
Licensed under the Academic Free License version 2.1 or above OR the
|
||||
modified BSD license. For more information on Dojo licensing, see:
|
||||
|
||||
http://dojotoolkit.org/community/licensing.shtml
|
||||
*/
|
||||
|
||||
dojo.provide("nls.dojo_es-es");dojo.provide("dojo.i18n.calendar.nls.gregorian");dojo.i18n.calendar.nls.gregorian._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorian.es_es");dojo.i18n.calendar.nls.gregorian.es_es={"field-weekday":"día de la semana","dateFormat-medium":"dd-MMM-yy","field-second":"segundo","field-week":"semana","pm":"p.m.","timeFormat-full":"HH'H'mm''ss\" z","months-standAlone-narrow":["E","F","M","A","M","J","J","A","S","O","N","D"],"am":"a.m.","days-standAlone-narrow":["D","L","M","M","J","V","S"],"field-year":"año","eras":["a.C.","d.C."],"field-minute":"minuto","field-hour":"hora","dateFormat-long":"d' de 'MMMM' de 'yyyy","field-day":"día","field-dayperiod":"periodo del día","field-month":"mes","dateFormat-short":"d/MM/yy","months-format-wide":["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],"field-era":"era","months-format-abbr":["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],"days-format-wide":["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],"dateFormat-full":"EEEE d' de 'MMMM' de 'yyyy","field-zone":"zona","days-format-abbr":["dom","lun","mar","mié","jue","vie","sáb"],"timeFormat-medium":"HH:mm:ss","timeFormat-short":"HH:mm","timeFormat-long":"HH:mm:ss z"};dojo.provide("dojo.i18n.calendar.nls.gregorianExtras");dojo.i18n.calendar.nls.gregorianExtras._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorianExtras.es_es");dojo.i18n.calendar.nls.gregorianExtras.es_es={"dateFormat-yearOnly":"yyyy"};dojo.provide("dojo.i18n.calendar.nls.gregorian");dojo.i18n.calendar.nls.gregorian._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorian.es_es");dojo.i18n.calendar.nls.gregorian.es_es={"field-weekday":"día de la semana","dateFormat-medium":"dd-MMM-yy","field-second":"segundo","field-week":"semana","pm":"p.m.","timeFormat-full":"HH'H'mm''ss\" z","months-standAlone-narrow":["E","F","M","A","M","J","J","A","S","O","N","D"],"am":"a.m.","days-standAlone-narrow":["D","L","M","M","J","V","S"],"field-year":"año","eras":["a.C.","d.C."],"field-minute":"minuto","field-hour":"hora","dateFormat-long":"d' de 'MMMM' de 'yyyy","field-day":"día","field-dayperiod":"periodo del día","field-month":"mes","dateFormat-short":"d/MM/yy","months-format-wide":["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],"field-era":"era","months-format-abbr":["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],"days-format-wide":["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],"dateFormat-full":"EEEE d' de 'MMMM' de 'yyyy","field-zone":"zona","days-format-abbr":["dom","lun","mar","mié","jue","vie","sáb"],"timeFormat-medium":"HH:mm:ss","timeFormat-short":"HH:mm","timeFormat-long":"HH:mm:ss z"};dojo.provide("dojo.widget.nls.TimePicker");dojo.widget.nls.TimePicker._built=true;dojo.provide("dojo.widget.nls.TimePicker.es_es");dojo.widget.nls.TimePicker.es_es={"any":"any"};dojo.provide("dojo.widget.nls.DropdownTimePicker");dojo.widget.nls.DropdownTimePicker._built=true;dojo.provide("dojo.widget.nls.DropdownTimePicker.es_es");dojo.widget.nls.DropdownTimePicker.es_es={"selectTime":"Select time"};dojo.provide("dojo.widget.nls.DropdownDatePicker");dojo.widget.nls.DropdownDatePicker._built=true;dojo.provide("dojo.widget.nls.DropdownDatePicker.es_es");dojo.widget.nls.DropdownDatePicker.es_es={"selectDate":"Select a date"};
|
||||
@@ -1,11 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2004-2006, The Dojo Foundation
|
||||
All Rights Reserved.
|
||||
|
||||
Licensed under the Academic Free License version 2.1 or above OR the
|
||||
modified BSD license. For more information on Dojo licensing, see:
|
||||
|
||||
http://dojotoolkit.org/community/licensing.shtml
|
||||
*/
|
||||
|
||||
dojo.provide("nls.dojo_es");dojo.provide("dojo.i18n.calendar.nls.gregorian");dojo.i18n.calendar.nls.gregorian._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorian.es");dojo.i18n.calendar.nls.gregorian.es={"field-weekday":"día de la semana","dateFormat-medium":"dd-MMM-yy","field-second":"segundo","field-week":"semana","pm":"p.m.","timeFormat-full":"HH'H'mm''ss\" z","months-standAlone-narrow":["E","F","M","A","M","J","J","A","S","O","N","D"],"am":"a.m.","days-standAlone-narrow":["D","L","M","M","J","V","S"],"field-year":"año","eras":["a.C.","d.C."],"field-minute":"minuto","field-hour":"hora","dateFormat-long":"d' de 'MMMM' de 'yyyy","field-day":"día","field-dayperiod":"periodo del día","field-month":"mes","dateFormat-short":"d/MM/yy","months-format-wide":["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],"field-era":"era","months-format-abbr":["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],"days-format-wide":["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],"dateFormat-full":"EEEE d' de 'MMMM' de 'yyyy","field-zone":"zona","days-format-abbr":["dom","lun","mar","mié","jue","vie","sáb"],"timeFormat-medium":"HH:mm:ss","timeFormat-short":"HH:mm","timeFormat-long":"HH:mm:ss z"};dojo.provide("dojo.i18n.calendar.nls.gregorianExtras");dojo.i18n.calendar.nls.gregorianExtras._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorianExtras.es");dojo.i18n.calendar.nls.gregorianExtras.es={"dateFormat-yearOnly":"yyyy"};dojo.provide("dojo.i18n.calendar.nls.gregorian");dojo.i18n.calendar.nls.gregorian._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorian.es");dojo.i18n.calendar.nls.gregorian.es={"field-weekday":"día de la semana","dateFormat-medium":"dd-MMM-yy","field-second":"segundo","field-week":"semana","pm":"p.m.","timeFormat-full":"HH'H'mm''ss\" z","months-standAlone-narrow":["E","F","M","A","M","J","J","A","S","O","N","D"],"am":"a.m.","days-standAlone-narrow":["D","L","M","M","J","V","S"],"field-year":"año","eras":["a.C.","d.C."],"field-minute":"minuto","field-hour":"hora","dateFormat-long":"d' de 'MMMM' de 'yyyy","field-day":"día","field-dayperiod":"periodo del día","field-month":"mes","dateFormat-short":"d/MM/yy","months-format-wide":["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],"field-era":"era","months-format-abbr":["ene","feb","mar","abr","may","jun","jul","ago","sep","oct","nov","dic"],"days-format-wide":["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],"dateFormat-full":"EEEE d' de 'MMMM' de 'yyyy","field-zone":"zona","days-format-abbr":["dom","lun","mar","mié","jue","vie","sáb"],"timeFormat-medium":"HH:mm:ss","timeFormat-short":"HH:mm","timeFormat-long":"HH:mm:ss z"};dojo.provide("dojo.widget.nls.TimePicker");dojo.widget.nls.TimePicker._built=true;dojo.provide("dojo.widget.nls.TimePicker.es");dojo.widget.nls.TimePicker.es={"any":"any"};dojo.provide("dojo.widget.nls.DropdownTimePicker");dojo.widget.nls.DropdownTimePicker._built=true;dojo.provide("dojo.widget.nls.DropdownTimePicker.es");dojo.widget.nls.DropdownTimePicker.es={"selectTime":"Select time"};dojo.provide("dojo.widget.nls.DropdownDatePicker");dojo.widget.nls.DropdownDatePicker._built=true;dojo.provide("dojo.widget.nls.DropdownDatePicker.es");dojo.widget.nls.DropdownDatePicker.es={"selectDate":"Select a date"};
|
||||
@@ -1,11 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2004-2006, The Dojo Foundation
|
||||
All Rights Reserved.
|
||||
|
||||
Licensed under the Academic Free License version 2.1 or above OR the
|
||||
modified BSD license. For more information on Dojo licensing, see:
|
||||
|
||||
http://dojotoolkit.org/community/licensing.shtml
|
||||
*/
|
||||
|
||||
dojo.provide("nls.dojo_fr-fr");dojo.provide("dojo.i18n.calendar.nls.gregorian");dojo.i18n.calendar.nls.gregorian._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorian.fr_fr");dojo.i18n.calendar.nls.gregorian.fr_fr={"field-weekday":"jour de la semaine","dateFormat-medium":"d MMM yy","field-second":"seconde","field-week":"semaine","pm":"ap. m.","timeFormat-full":"HH' h 'mm z","months-standAlone-narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"am":"matin","days-standAlone-narrow":["D","L","M","M","J","V","S"],"field-year":"année","eras":["av. J.-C.","apr. J.-C."],"field-minute":"minute","field-hour":"heure","dateFormat-long":"d MMMM yyyy","field-day":"jour","field-dayperiod":"période de la journée","field-month":"mois","dateFormat-short":"dd/MM/yy","months-format-wide":["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],"field-era":"époque","months-format-abbr":["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],"days-format-wide":["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],"dateFormat-full":"EEEE d MMMM yyyy","field-zone":"zone","days-format-abbr":["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],"timeFormat-medium":"HH:mm:ss","timeFormat-short":"HH:mm","timeFormat-long":"HH:mm:ss z"};dojo.provide("dojo.i18n.calendar.nls.gregorianExtras");dojo.i18n.calendar.nls.gregorianExtras._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorianExtras.fr_fr");dojo.i18n.calendar.nls.gregorianExtras.fr_fr={"dateFormat-yearOnly":"yyyy"};dojo.provide("dojo.i18n.calendar.nls.gregorian");dojo.i18n.calendar.nls.gregorian._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorian.fr_fr");dojo.i18n.calendar.nls.gregorian.fr_fr={"field-weekday":"jour de la semaine","dateFormat-medium":"d MMM yy","field-second":"seconde","field-week":"semaine","pm":"ap. m.","timeFormat-full":"HH' h 'mm z","months-standAlone-narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"am":"matin","days-standAlone-narrow":["D","L","M","M","J","V","S"],"field-year":"année","eras":["av. J.-C.","apr. J.-C."],"field-minute":"minute","field-hour":"heure","dateFormat-long":"d MMMM yyyy","field-day":"jour","field-dayperiod":"période de la journée","field-month":"mois","dateFormat-short":"dd/MM/yy","months-format-wide":["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],"field-era":"époque","months-format-abbr":["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],"days-format-wide":["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],"dateFormat-full":"EEEE d MMMM yyyy","field-zone":"zone","days-format-abbr":["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],"timeFormat-medium":"HH:mm:ss","timeFormat-short":"HH:mm","timeFormat-long":"HH:mm:ss z"};dojo.provide("dojo.widget.nls.TimePicker");dojo.widget.nls.TimePicker._built=true;dojo.provide("dojo.widget.nls.TimePicker.fr_fr");dojo.widget.nls.TimePicker.fr_fr={"any":"any"};dojo.provide("dojo.widget.nls.DropdownTimePicker");dojo.widget.nls.DropdownTimePicker._built=true;dojo.provide("dojo.widget.nls.DropdownTimePicker.fr_fr");dojo.widget.nls.DropdownTimePicker.fr_fr={"selectTime":"Select time"};dojo.provide("dojo.widget.nls.DropdownDatePicker");dojo.widget.nls.DropdownDatePicker._built=true;dojo.provide("dojo.widget.nls.DropdownDatePicker.fr_fr");dojo.widget.nls.DropdownDatePicker.fr_fr={"selectDate":"Select a date"};
|
||||
@@ -1,11 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2004-2006, The Dojo Foundation
|
||||
All Rights Reserved.
|
||||
|
||||
Licensed under the Academic Free License version 2.1 or above OR the
|
||||
modified BSD license. For more information on Dojo licensing, see:
|
||||
|
||||
http://dojotoolkit.org/community/licensing.shtml
|
||||
*/
|
||||
|
||||
dojo.provide("nls.dojo_fr");dojo.provide("dojo.i18n.calendar.nls.gregorian");dojo.i18n.calendar.nls.gregorian._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorian.fr");dojo.i18n.calendar.nls.gregorian.fr={"field-weekday":"jour de la semaine","dateFormat-medium":"d MMM yy","field-second":"seconde","field-week":"semaine","pm":"ap. m.","timeFormat-full":"HH' h 'mm z","months-standAlone-narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"am":"matin","days-standAlone-narrow":["D","L","M","M","J","V","S"],"field-year":"année","eras":["av. J.-C.","apr. J.-C."],"field-minute":"minute","field-hour":"heure","dateFormat-long":"d MMMM yyyy","field-day":"jour","field-dayperiod":"période de la journée","field-month":"mois","dateFormat-short":"dd/MM/yy","months-format-wide":["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],"field-era":"époque","months-format-abbr":["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],"days-format-wide":["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],"dateFormat-full":"EEEE d MMMM yyyy","field-zone":"zone","days-format-abbr":["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],"timeFormat-medium":"HH:mm:ss","timeFormat-short":"HH:mm","timeFormat-long":"HH:mm:ss z"};dojo.provide("dojo.i18n.calendar.nls.gregorianExtras");dojo.i18n.calendar.nls.gregorianExtras._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorianExtras.fr");dojo.i18n.calendar.nls.gregorianExtras.fr={"dateFormat-yearOnly":"yyyy"};dojo.provide("dojo.i18n.calendar.nls.gregorian");dojo.i18n.calendar.nls.gregorian._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorian.fr");dojo.i18n.calendar.nls.gregorian.fr={"field-weekday":"jour de la semaine","dateFormat-medium":"d MMM yy","field-second":"seconde","field-week":"semaine","pm":"ap. m.","timeFormat-full":"HH' h 'mm z","months-standAlone-narrow":["J","F","M","A","M","J","J","A","S","O","N","D"],"am":"matin","days-standAlone-narrow":["D","L","M","M","J","V","S"],"field-year":"année","eras":["av. J.-C.","apr. J.-C."],"field-minute":"minute","field-hour":"heure","dateFormat-long":"d MMMM yyyy","field-day":"jour","field-dayperiod":"période de la journée","field-month":"mois","dateFormat-short":"dd/MM/yy","months-format-wide":["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],"field-era":"époque","months-format-abbr":["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc."],"days-format-wide":["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],"dateFormat-full":"EEEE d MMMM yyyy","field-zone":"zone","days-format-abbr":["dim.","lun.","mar.","mer.","jeu.","ven.","sam."],"timeFormat-medium":"HH:mm:ss","timeFormat-short":"HH:mm","timeFormat-long":"HH:mm:ss z"};dojo.provide("dojo.widget.nls.TimePicker");dojo.widget.nls.TimePicker._built=true;dojo.provide("dojo.widget.nls.TimePicker.fr");dojo.widget.nls.TimePicker.fr={"any":"any"};dojo.provide("dojo.widget.nls.DropdownTimePicker");dojo.widget.nls.DropdownTimePicker._built=true;dojo.provide("dojo.widget.nls.DropdownTimePicker.fr");dojo.widget.nls.DropdownTimePicker.fr={"selectTime":"Select time"};dojo.provide("dojo.widget.nls.DropdownDatePicker");dojo.widget.nls.DropdownDatePicker._built=true;dojo.provide("dojo.widget.nls.DropdownDatePicker.fr");dojo.widget.nls.DropdownDatePicker.fr={"selectDate":"Select a date"};
|
||||
@@ -1,11 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2004-2006, The Dojo Foundation
|
||||
All Rights Reserved.
|
||||
|
||||
Licensed under the Academic Free License version 2.1 or above OR the
|
||||
modified BSD license. For more information on Dojo licensing, see:
|
||||
|
||||
http://dojotoolkit.org/community/licensing.shtml
|
||||
*/
|
||||
|
||||
dojo.provide("nls.dojo_it-it");dojo.provide("dojo.i18n.calendar.nls.gregorian");dojo.i18n.calendar.nls.gregorian._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorian.it_it");dojo.i18n.calendar.nls.gregorian.it_it={"field-weekday":"giorno della settimana","dateFormat-medium":"dd/MMM/yy","field-second":"secondo","field-week":"settimana","pm":"p.","months-standAlone-narrow":["G","F","M","A","M","G","L","A","S","O","N","D"],"am":"m.","days-standAlone-narrow":["D","L","M","M","G","V","S"],"field-year":"anno","eras":["aC","dC"],"field-minute":"minuto","field-hour":"ora","dateFormat-long":"dd MMMM yyyy","field-day":"giorno","field-dayperiod":"periodo del giorno","field-month":"mese","dateFormat-short":"dd/MM/yy","months-format-wide":["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],"field-era":"era","months-format-abbr":["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],"days-format-wide":["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],"dateFormat-full":"EEEE d MMMM yyyy","field-zone":"zona","days-format-abbr":["dom","lun","mar","mer","gio","ven","sab"],"timeFormat-full":"HH:mm:ss z","timeFormat-medium":"HH:mm:ss","timeFormat-short":"HH:mm","timeFormat-long":"HH:mm:ss z"};dojo.provide("dojo.i18n.calendar.nls.gregorianExtras");dojo.i18n.calendar.nls.gregorianExtras._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorianExtras.it_it");dojo.i18n.calendar.nls.gregorianExtras.it_it={"dateFormat-yearOnly":"yyyy"};dojo.provide("dojo.i18n.calendar.nls.gregorian");dojo.i18n.calendar.nls.gregorian._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorian.it_it");dojo.i18n.calendar.nls.gregorian.it_it={"field-weekday":"giorno della settimana","dateFormat-medium":"dd/MMM/yy","field-second":"secondo","field-week":"settimana","pm":"p.","months-standAlone-narrow":["G","F","M","A","M","G","L","A","S","O","N","D"],"am":"m.","days-standAlone-narrow":["D","L","M","M","G","V","S"],"field-year":"anno","eras":["aC","dC"],"field-minute":"minuto","field-hour":"ora","dateFormat-long":"dd MMMM yyyy","field-day":"giorno","field-dayperiod":"periodo del giorno","field-month":"mese","dateFormat-short":"dd/MM/yy","months-format-wide":["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],"field-era":"era","months-format-abbr":["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],"days-format-wide":["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],"dateFormat-full":"EEEE d MMMM yyyy","field-zone":"zona","days-format-abbr":["dom","lun","mar","mer","gio","ven","sab"],"timeFormat-full":"HH:mm:ss z","timeFormat-medium":"HH:mm:ss","timeFormat-short":"HH:mm","timeFormat-long":"HH:mm:ss z"};dojo.provide("dojo.widget.nls.TimePicker");dojo.widget.nls.TimePicker._built=true;dojo.provide("dojo.widget.nls.TimePicker.it_it");dojo.widget.nls.TimePicker.it_it={"any":"any"};dojo.provide("dojo.widget.nls.DropdownTimePicker");dojo.widget.nls.DropdownTimePicker._built=true;dojo.provide("dojo.widget.nls.DropdownTimePicker.it_it");dojo.widget.nls.DropdownTimePicker.it_it={"selectTime":"Select time"};dojo.provide("dojo.widget.nls.DropdownDatePicker");dojo.widget.nls.DropdownDatePicker._built=true;dojo.provide("dojo.widget.nls.DropdownDatePicker.it_it");dojo.widget.nls.DropdownDatePicker.it_it={"selectDate":"Select a date"};
|
||||
@@ -1,11 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2004-2006, The Dojo Foundation
|
||||
All Rights Reserved.
|
||||
|
||||
Licensed under the Academic Free License version 2.1 or above OR the
|
||||
modified BSD license. For more information on Dojo licensing, see:
|
||||
|
||||
http://dojotoolkit.org/community/licensing.shtml
|
||||
*/
|
||||
|
||||
dojo.provide("nls.dojo_it");dojo.provide("dojo.i18n.calendar.nls.gregorian");dojo.i18n.calendar.nls.gregorian._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorian.it");dojo.i18n.calendar.nls.gregorian.it={"field-weekday":"giorno della settimana","dateFormat-medium":"dd/MMM/yy","field-second":"secondo","field-week":"settimana","pm":"p.","months-standAlone-narrow":["G","F","M","A","M","G","L","A","S","O","N","D"],"am":"m.","days-standAlone-narrow":["D","L","M","M","G","V","S"],"field-year":"anno","eras":["aC","dC"],"field-minute":"minuto","field-hour":"ora","dateFormat-long":"dd MMMM yyyy","field-day":"giorno","field-dayperiod":"periodo del giorno","field-month":"mese","dateFormat-short":"dd/MM/yy","months-format-wide":["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],"field-era":"era","months-format-abbr":["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],"days-format-wide":["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],"dateFormat-full":"EEEE d MMMM yyyy","field-zone":"zona","days-format-abbr":["dom","lun","mar","mer","gio","ven","sab"],"timeFormat-full":"HH:mm:ss z","timeFormat-medium":"HH:mm:ss","timeFormat-short":"HH:mm","timeFormat-long":"HH:mm:ss z"};dojo.provide("dojo.i18n.calendar.nls.gregorianExtras");dojo.i18n.calendar.nls.gregorianExtras._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorianExtras.it");dojo.i18n.calendar.nls.gregorianExtras.it={"dateFormat-yearOnly":"yyyy"};dojo.provide("dojo.i18n.calendar.nls.gregorian");dojo.i18n.calendar.nls.gregorian._built=true;dojo.provide("dojo.i18n.calendar.nls.gregorian.it");dojo.i18n.calendar.nls.gregorian.it={"field-weekday":"giorno della settimana","dateFormat-medium":"dd/MMM/yy","field-second":"secondo","field-week":"settimana","pm":"p.","months-standAlone-narrow":["G","F","M","A","M","G","L","A","S","O","N","D"],"am":"m.","days-standAlone-narrow":["D","L","M","M","G","V","S"],"field-year":"anno","eras":["aC","dC"],"field-minute":"minuto","field-hour":"ora","dateFormat-long":"dd MMMM yyyy","field-day":"giorno","field-dayperiod":"periodo del giorno","field-month":"mese","dateFormat-short":"dd/MM/yy","months-format-wide":["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],"field-era":"era","months-format-abbr":["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic"],"days-format-wide":["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],"dateFormat-full":"EEEE d MMMM yyyy","field-zone":"zona","days-format-abbr":["dom","lun","mar","mer","gio","ven","sab"],"timeFormat-full":"HH:mm:ss z","timeFormat-medium":"HH:mm:ss","timeFormat-short":"HH:mm","timeFormat-long":"HH:mm:ss z"};dojo.provide("dojo.widget.nls.TimePicker");dojo.widget.nls.TimePicker._built=true;dojo.provide("dojo.widget.nls.TimePicker.it");dojo.widget.nls.TimePicker.it={"any":"any"};dojo.provide("dojo.widget.nls.DropdownTimePicker");dojo.widget.nls.DropdownTimePicker._built=true;dojo.provide("dojo.widget.nls.DropdownTimePicker.it");dojo.widget.nls.DropdownTimePicker.it={"selectTime":"Select time"};dojo.provide("dojo.widget.nls.DropdownDatePicker");dojo.widget.nls.DropdownDatePicker._built=true;dojo.provide("dojo.widget.nls.DropdownDatePicker.it");dojo.widget.nls.DropdownDatePicker.it={"selectDate":"Select a date"};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user