Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
import org.apache.click.Stateful;
import org.openidentityplatform.openam.click.control.AbstractControl;
import org.openidentityplatform.openam.click.control.AbstractLink;
import org.apache.click.control.ActionLink;
import org.openidentityplatform.openam.click.control.ActionLink;
import org.openidentityplatform.openam.click.control.Container;
import org.openidentityplatform.openam.click.control.Field;
import org.openidentityplatform.openam.click.control.Form;
Expand Down Expand Up @@ -534,11 +534,11 @@ public static void autoPostRedirect(HttpServletRequest request,
}

} catch (IOException ex) {
org.apache.click.util.ClickUtils.getLogService().error(ex.getMessage(), ex);
getLogService().error(ex.getMessage(), ex);

} finally {
org.apache.click.util.ClickUtils.close(gos);
org.apache.click.util.ClickUtils.close(os);
close(gos);
close(os);
}
}

Expand Down Expand Up @@ -1151,7 +1151,7 @@ public static InputStream getClickConfig(ServletContext servletContext) {
servletContext.getResourceAsStream(DEFAULT_APP_CONFIG);

if (inputStream == null) {
inputStream = org.apache.click.util.ClickUtils.getResourceAsStream("/click.xml", org.apache.click.util.ClickUtils.class);
inputStream = getResourceAsStream("/click.xml", ClickUtils.class);
if (inputStream == null) {
String msg =
"could not find click app configuration file: "
Expand Down Expand Up @@ -1187,7 +1187,7 @@ public static ConfigService getConfigService(ServletContext servletContext) {
+ " editing your web.xml and setting the load-on-startup to 0:\n\n"
+ " <servlet>\n"
+ " <servlet-name>ClickServlet</servlet-name>\n"
+ " <servlet-class>org.apache.click.ClickServlet</servlet-class>\n"
+ " <servlet-class>org.openidentityplatform.openam.click.ClickServlet</servlet-class>\n"
+ " <load-on-startup>0</load-on-startup>\n"
+ " </servlet>\n";

Expand Down Expand Up @@ -1410,7 +1410,7 @@ public static String getApplicationResourceVersionIndicator() {
*
* <li>if control.getName() is set do the following:
* <ol>
* <li>if the control is of type {@link org.apache.click.control.ActionLink},
* <li>if the control is of type {@link org.openidentityplatform.openam.click.control.ActionLink},
* it's "<code>class</code>" attribute selector will be returned. For example:
* <code>a[class=red]</code>. <b>Please note:</b> if the link class attribute is
* not set, the class attribute will be set to its name, prefixed with
Expand Down Expand Up @@ -1570,7 +1570,7 @@ public static void deployFile(ServletContext servletContext,

if (!destinationFile.exists()) {
InputStream inputStream =
getResourceAsStream(resource, org.apache.click.util.ClickUtils.class);
getResourceAsStream(resource, ClickUtils.class);

if (inputStream != null) {
FileOutputStream fos = null;
Expand Down Expand Up @@ -1676,7 +1676,7 @@ public static void deployFileList(ServletContext servletContext,
String descriptorFile = packageName + "/" + controlName + ".files";
logService.debug("Use deployment descriptor file:" + descriptorFile);

InputStream is = getResourceAsStream(descriptorFile, org.apache.click.util.ClickUtils.class);
InputStream is = getResourceAsStream(descriptorFile, ClickUtils.class);
List fileList = IOUtils.readLines(is);
if (fileList == null || fileList.isEmpty()) {
logService.info("there are no files to deploy for control " + controlClass.getName());
Expand Down Expand Up @@ -2194,8 +2194,8 @@ public static LogService getLogService() {

/**
* Return the list of Fields for the given Form, including any Fields
* contained in FieldSets. The list of returned fields will exclude any
* <code>Button</code>, <code>FieldSet</code> or <code>Label</code> fields.
* contained in child containers. The list of returned fields will exclude
* any <code>Button</code> or <code>Label</code> fields.
*
* @param form the form to obtain the fields from
* @return the list of contained form fields
Expand Down Expand Up @@ -3072,7 +3072,7 @@ private static void bind(Container container, Context context) {
for (int i = 0; i < container.getControls().size(); i++) {
Control control = container.getControls().get(i);
if (control instanceof Container) {
// Include fields but skip fieldSets
// Include fields that are containers
if (control instanceof Field) {
Field field = (Field) control;
bindField(field, context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@

import org.openidentityplatform.openam.click.Control;
import org.openidentityplatform.openam.click.Page;
import org.apache.click.control.Button;
import org.openidentityplatform.openam.click.control.Button;
import org.openidentityplatform.openam.click.control.Container;
import org.openidentityplatform.openam.click.control.Field;
import org.apache.click.control.FieldSet;
import org.openidentityplatform.openam.click.control.Form;
import org.apache.click.control.Label;
import org.apache.click.service.LogService;
import org.apache.click.util.ClickUtils;
import org.openidentityplatform.openam.click.control.Label;
import org.openidentityplatform.openam.click.service.LogService;
import org.apache.click.util.HtmlStringBuffer;
import org.apache.click.util.PropertyUtils;
import org.apache.commons.lang.ClassUtils;
Expand Down Expand Up @@ -114,7 +112,7 @@ public static void copyContainerToObject(Container container,
}

if (fieldList.isEmpty()) {
LogService logService = org.apache.click.util.ClickUtils.getLogService();
LogService logService = ClickUtils.getLogService();
if (logService.isDebugEnabled()) {
String containerClassName =
ClassUtils.getShortClassName(container.getClass());
Expand All @@ -137,7 +135,7 @@ public static void copyContainerToObject(Container container,
return;
}

LogService logService = org.apache.click.util.ClickUtils.getLogService();
LogService logService = ClickUtils.getLogService();

Set<String> properties = getObjectPropertyNames(object);
Map<?, ?> ognlContext = Ognl.createDefaultContext(
Expand Down Expand Up @@ -235,7 +233,7 @@ public static void copyObjectToContainer(Object object,
}

if (fieldList.isEmpty()) {
LogService logService = org.apache.click.util.ClickUtils.getLogService();
LogService logService = ClickUtils.getLogService();
if (logService.isDebugEnabled()) {
String containerClassName =
ClassUtils.getShortClassName(container.getClass());
Expand All @@ -261,7 +259,7 @@ public static void copyObjectToContainer(Object object,

Set<String> properties = getObjectPropertyNames(object);

LogService logService = org.apache.click.util.ClickUtils.getLogService();
LogService logService = ClickUtils.getLogService();

for (Field field : fieldList) {

Expand Down Expand Up @@ -434,7 +432,7 @@ public static List<Field> getFields(Container container) {
/**
* Return the list of Fields for the given Container, recursively including
* any Fields contained in child containers. The list of returned fields
* will exclude any <code>Button</code> and <code>FieldSet</code> fields.
* will exclude any <code>Button</code> fields.
*
* @param container the container to obtain the fields from
* @return the list of contained fields
Expand All @@ -452,7 +450,7 @@ public static List<Field> getFieldsAndLabels(Container container) {
/**
* Return the list of hidden Fields for the given Container, recursively including
* any Fields contained in child containers. The list of returned fields
* will exclude any <code>Button</code>, <code>FieldSet</code> and <code>Label</code>
* will exclude any <code>Button</code> and <code>Label</code>
* fields.
*
* @param container the container to obtain the fields from
Expand All @@ -472,7 +470,7 @@ public static List<Field> getHiddenFields(final Container container) {
* Return the list of input Fields (TextField, Select, Radio, Checkbox etc).
* for the given Container, recursively including any Fields contained in
* child containers. The list of returned fields will exclude any
* <code>Button</code>, <code>FieldSet</code> and <code>Label</code> fields.
* <code>Button</code> and <code>Label</code> fields.
*
* @param container the container to obtain the fields from
* @return the list of contained fields
Expand Down Expand Up @@ -902,7 +900,7 @@ private static Method findGetter(Object object, String property,
String path) {

// Find the getter for property
String getterName = org.apache.click.util.ClickUtils.toGetterName(property);
String getterName = ClickUtils.toGetterName(property);

Method method = null;
Class<?> sourceClass = object.getClass();
Expand All @@ -913,7 +911,7 @@ private static Method findGetter(Object object, String property,
}

if (method == null) {
String isGetterName = org.apache.click.util.ClickUtils.toIsGetterName(property);
String isGetterName = ClickUtils.toIsGetterName(property);
try {
method = sourceClass.getMethod(isGetterName, (Class[]) null);
} catch (Exception e) {
Expand Down Expand Up @@ -973,7 +971,7 @@ private static Method findSetter(Object source,
Method method = null;

// Find the setter for property
String setterName = org.apache.click.util.ClickUtils.toSetterName(property);
String setterName = ClickUtils.toSetterName(property);

Class<?> sourceClass = source.getClass();
Class<?>[] classArgs = { targetClass };
Expand Down Expand Up @@ -1050,7 +1048,7 @@ private static void logBasicDescription(org.apache.click.util.HtmlStringBuffer b
*/
private static void copyFieldsToMap(List<Field> fieldList, Map<String, Object> map) {

LogService logService = org.apache.click.util.ClickUtils.getLogService();
LogService logService = ClickUtils.getLogService();

String objectClassname = map.getClass().getName();
objectClassname =
Expand Down Expand Up @@ -1086,7 +1084,7 @@ private static void copyFieldsToMap(List<Field> fieldList, Map<String, Object> m
*/
private static void copyMapToFields(Map<String, Object> map, List<Field> fieldList) {

LogService logService = org.apache.click.util.ClickUtils.getLogService();
LogService logService = ClickUtils.getLogService();

String objectClassname = map.getClass().getName();
objectClassname =
Expand Down Expand Up @@ -1167,7 +1165,7 @@ private static void addFields(final Container container, final List<Field> field
* Add input fields (TextField, TextArea, Select, Radio, Checkbox etc.) for
* the given Container to the specified field list, recursively including
* any Fields contained in child containers. The list of returned fields
* will exclude any <code>Button</code>, <code>FieldSet</code> and <code>Label</code>
* will exclude any <code>Button</code> and <code>Label</code>
* fields.
*
* @param container the container to obtain the fields from
Expand All @@ -1181,8 +1179,8 @@ private static void addInputFields(final Container container, final List<Field>
continue;

} else if (control instanceof Container) {
// Include fields but skip fieldSets
if (control instanceof Field && !(control instanceof FieldSet)) {
// Include fields that are containers
if (control instanceof Field) {
fields.add((Field) control);
}
Container childContainer = (Container) control;
Expand All @@ -1197,8 +1195,8 @@ private static void addInputFields(final Container container, final List<Field>
/**
* Add hidden fields for the given Container to the specified field list,
* recursively including any Fields contained in child containers. The list
* of returned fields will exclude any <code>Button</code>, <code>FieldSet</code>
* and <code>Label</code> fields.
* of returned fields will exclude any <code>Button</code> and
* <code>Label</code> fields.
*
* @param container the container to obtain the hidden fields from
* @param fields the list of contained fields
Expand All @@ -1211,8 +1209,8 @@ private static void addHiddenFields(final Container container, final List<Field>
continue;

} else if (control instanceof Container) {
// Include fields but skip fieldSets
if (control instanceof Field && !(control instanceof FieldSet)) {
// Include fields that are containers
if (control instanceof Field) {
Field field = (Field) control;
if (field.isHidden()) {
fields.add((Field) control);
Expand All @@ -1234,7 +1232,7 @@ private static void addHiddenFields(final Container container, final List<Field>
/**
* Add fields for the container to the specified field list, recursively
* including any Fields contained in child containers. The list
* of returned fields will exclude any <code>Button</code> and <code>FieldSet</code>
* of returned fields will exclude any <code>Button</code>
* fields.
*
* @param container the container to obtain the fields from
Expand All @@ -1248,8 +1246,8 @@ private static void addFieldsAndLabels(final Container container, final List<Fie
continue;

} else if (control instanceof Container) {
// Include fields but skip fieldSets
if (control instanceof Field && !(control instanceof FieldSet)) {
// Include fields that are containers
if (control instanceof Field) {
fields.add((Field) control);
}
Container childContainer = (Container) control;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public String toString() {

if (isProductionMode()) {
Locale locale = request.getLocale();
ResourceBundle bundle = org.apache.click.util.ClickUtils.getBundle("click-control", locale);
ResourceBundle bundle = ClickUtils.getBundle("click-control", locale);
return bundle.getString("production-error-message");
}

Expand Down Expand Up @@ -424,7 +424,7 @@ protected String getMessage() {
parseMsg = message.substring(startIndex + 1, endIndex);
}

parseMsg = org.apache.click.util.ClickUtils.escapeHtml(parseMsg);
parseMsg = ClickUtils.escapeHtml(parseMsg);

parseMsg = StringUtils.replace(parseMsg, "...", ", &#160;");

Expand All @@ -436,7 +436,7 @@ protected String getMessage() {
String value =
(cause.getMessage() != null) ? cause.getMessage() : "null";

return org.apache.click.util.ClickUtils.escapeHtml(value);
return ClickUtils.escapeHtml(value);
}
}

Expand Down Expand Up @@ -590,7 +590,7 @@ protected String getRenderedSource() {

} else {
if (isParseError()) {
buffer.append(org.apache.click.util.ClickUtils.escapeHtml(line));
buffer.append(ClickUtils.escapeHtml(line));
} else {
buffer.append(getRenderJavaLine(line));
}
Expand All @@ -604,7 +604,7 @@ protected String getRenderedSource() {

} catch (IOException ioe) {
buffer.append("Could not load page source: ");
buffer.append(org.apache.click.util.ClickUtils.escapeHtml(ioe.toString()));
buffer.append(ClickUtils.escapeHtml(ioe.toString()));
} finally {
try {
sourceReader.close();
Expand Down Expand Up @@ -632,7 +632,7 @@ protected String getStackTrace() {
HtmlStringBuffer buffer
= new HtmlStringBuffer(sw.toString().length() + 80);
buffer.append("<pre><tt style='font-size:10pt;'>");
buffer.append(org.apache.click.util.ClickUtils.escapeHtml(sw.toString().trim()));
buffer.append(ClickUtils.escapeHtml(sw.toString().trim()));
buffer.append("</tt></pre>");

return buffer.toString();
Expand All @@ -653,7 +653,7 @@ protected void writeMap(Map<String, Object> map, HtmlStringBuffer buffer) {
buffer.append(key);
buffer.append("=");
if (value != null) {
buffer.append(org.apache.click.util.ClickUtils.escapeHtml(value.toString()));
buffer.append(ClickUtils.escapeHtml(value.toString()));
} else {
buffer.append("null");
}
Expand Down
Loading