Skip to content

Commit

Permalink
SAK-45745 Deprecated: new AttributeModifier(String attribute, boolean
Browse files Browse the repository at this point in the history
The serializable class does not declare a static final serialVersionUID field of type long
  • Loading branch information
axxter99 authored and Miguel Pellicer committed Jul 5, 2021
1 parent dfd322d commit b7e6c11
Show file tree
Hide file tree
Showing 49 changed files with 102 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ protected void init() {
setRootRequestMapper(cryptoMapper);
}

@SuppressWarnings("unchecked")
public Class getHomePage() {
return AdminPage.class;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ public IRequestHandler onException(RequestCycle cycle, Exception ex)
setRootRequestMapper(cryptoMapper);
}

@SuppressWarnings("unchecked")
public Class getHomePage() {
return OverviewPage.class;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/
public abstract class AbstractSakaiSpinnerAjaxCallListener extends AjaxCallListener
{
private static final long serialVersionUID = 1L;
protected static final String SPINNER_CLASS = "spinButton";
protected static final String DISABLED = "$('#%s').prop('disabled', true);";
protected static final String ENABLED = "$('#%s').prop('disabled', false);";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public AdminMenu(String id) {
/**
* Render Sakai Menu
*/
@SuppressWarnings("unchecked")
private void renderBody() {
// site id
String siteId = Locator.getFacade().getToolManager().getCurrentPlacement().getContext();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* @author Nuno Fernandes
*/
public abstract class AjaxLazyLoadFragment extends Panel {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;

// State:
// 0:add loading component
Expand All @@ -53,6 +53,8 @@ public AjaxLazyLoadFragment(final String id) {
setOutputMarkupId(true);

final AbstractDefaultAjaxBehavior behavior = new AbstractDefaultAjaxBehavior() {
private static final long serialVersionUID = 1L;

@Override
protected void respond(AjaxRequestTarget target) {
Fragment fragment = getLazyLoadFragment("content");
Expand Down Expand Up @@ -107,7 +109,7 @@ protected void onBeforeRender() {
public Component getLoadingComponent(String markupId) {
Label indicator = new Label(markupId, "<img src=\"" + RequestCycle.get().urlFor(AbstractDefaultAjaxBehavior.INDICATOR, null) + "\"/>");
indicator.setEscapeModelStrings(false);
indicator.add(new AttributeModifier("title", new Model("...")));
indicator.add(new AttributeModifier("title", new Model<String>("...")));
return indicator;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,13 @@
*/
package org.sakaiproject.sitestats.tool.wicket.components;

import lombok.extern.slf4j.Slf4j;
import org.apache.wicket.AttributeModifier;
import org.apache.wicket.Component;
import org.apache.wicket.Page;
import org.apache.wicket.request.Request;
import org.apache.wicket.request.cycle.RequestCycle;
import org.apache.wicket.request.resource.IResource;
import org.apache.wicket.request.resource.AbstractResource;
import org.apache.wicket.ajax.AbstractDefaultAjaxBehavior;
import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
import org.apache.wicket.ajax.AjaxChannel;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.attributes.AjaxRequestAttributes;
import org.apache.wicket.markup.head.IHeaderResponse;
import org.apache.wicket.markup.head.OnDomReadyHeaderItem;
import org.apache.wicket.markup.html.basic.Label;
Expand All @@ -38,29 +33,33 @@
import org.apache.wicket.markup.html.form.SubmitLink;
import org.apache.wicket.markup.html.image.Image;
import org.apache.wicket.markup.html.image.NonCachingImage;
import org.apache.wicket.request.resource.DynamicImageResource;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.Model;
import org.apache.wicket.model.ResourceModel;
import org.apache.wicket.request.Request;
import org.apache.wicket.request.cycle.RequestCycle;
import org.apache.wicket.request.http.WebResponse.CacheScope;
import org.apache.wicket.request.resource.AbstractResource;
import org.apache.wicket.request.resource.DynamicImageResource;
import org.apache.wicket.request.resource.IResource;
import org.apache.wicket.util.time.Duration;
import org.sakaiproject.sitestats.tool.wicket.pages.MaximizedImagePage;

@Slf4j

public abstract class AjaxLazyLoadImage extends Panel {
private static final long serialVersionUID = 1L;
private SubmitLink link = null;
private Page returnPage = null;
private Class<?> returnClass = null;
private AbstractDefaultAjaxBehavior chartRenderAjaxBehavior = null;
private static final long serialVersionUID = 1L;
private SubmitLink link = null;
private Page returnPage = null;
private Class<?> returnClass = null;
private AbstractDefaultAjaxBehavior chartRenderAjaxBehavior = null;

private Form form = null;
private boolean autoDetermineChartSizeByAjax = false;
private int selectedWidth = 400;
private int selectedHeight = 200;
private int maxWidth = 800;
private int maxHeight = 600;
private Form form = null;
private boolean autoDetermineChartSizeByAjax = false;
private int selectedWidth = 400;
private int selectedHeight = 200;
private int maxWidth = 800;
private int maxHeight = 600;

// State:
// 0:add loading component
Expand Down Expand Up @@ -196,7 +195,7 @@ public Image renderImage(AjaxRequestTarget target, boolean fullRender) {
public Component getLoadingComponent(String markupId) {
Label indicator = new Label(markupId, "<img src=\"" + RequestCycle.get().urlFor(AbstractDefaultAjaxBehavior.INDICATOR, null) + "\"/>");
indicator.setEscapeModelStrings(false);
indicator.add(new AttributeModifier("title", new Model("...")));
indicator.add(new AttributeModifier("title", new Model<String>("...")));
return indicator;
}

Expand All @@ -212,6 +211,8 @@ private SubmitLink createMaximizedLink(final String id) {
public void onSubmit() {
if(returnPage != null || returnClass != null) {
setResponsePage(new MaximizedImagePage(returnPage, returnClass) {
private static final long serialVersionUID = 1L;

@Override
public byte[] getMaximizedImageData() {
int _width = (int) ((int) maxWidth * 0.98);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public CSSFeedbackPanel(String id) {
super(id);
WebMarkupContainer feedbackul = (WebMarkupContainer) get("feedbackul");
if(feedbackul != null){
feedbackul.add(new AttributeModifier("class", true, new Model() {
private static final long serialVersionUID = 1L;
feedbackul.add(new AttributeModifier("class", new Model() {
private static final long serialVersionUID = 1L;
public Serializable getObject() {
if(anyErrorMessage()){
return "alertMessage";
Expand All @@ -44,7 +44,7 @@ public Serializable getObject() {
}
}
}));
feedbackul.add(new AttributeModifier("style", true, new Model("list-style-type:none")));
feedbackul.add(new AttributeModifier("style", new Model("list-style-type:none")));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ public class ExternalImage extends WebComponent {

public ExternalImage(String id, String imageUrl) {
super(id);
add(new AttributeModifier("src", true, new Model(imageUrl)));
add(new AttributeModifier("src", new Model(imageUrl)));
setVisible(!(imageUrl==null || imageUrl.equals("")));
}

protected void onComponentTag(ComponentTag tag) {
super.onComponentTag(tag);
checkComponentTag(tag, "img");
tag.addBehavior(new AttributeModifier("id", true, new Model(getMarkupId())));
tag.addBehavior(new AttributeModifier("id", new Model(getMarkupId())));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* @author Nuno Fernandes
*/
public class ImageWithLink extends Panel {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 1L;

public ImageWithLink(String id) {
this(id, null, null, null, null);
Expand All @@ -44,7 +44,7 @@ public ImageWithLink(String id, String imgUrl, String lnkUrl, String lnkLabel, S
if(exists) {
add( new ExternalImage("image", imgUrl).setVisible(imgUrl != null) );
lnk = new ExternalLink("link", lnkUrl, lnkLabel);
lnk.add(new AttributeModifier("target", true, new Model(lnkTarget)));
lnk.add(new AttributeModifier("target", new Model(lnkTarget)));
}else{
StringBuilder b = new StringBuilder();
b.append(lnkLabel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
*/
public class SakaiAjaxButton extends AjaxButton
{
private static final long serialVersionUID = 1L;
protected boolean willRenderOnClick = false;

public SakaiAjaxButton(String id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
*/
public class SakaiResponsivePropertyColumn<T,S> extends PropertyColumn<T,S>
{
private static final long serialVersionUID = 1L;

/**
* A PropertyColumn with CardTable support
* @param displayModel display model
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*/
public class SakaiSpinnerAjaxCallListener extends AbstractSakaiSpinnerAjaxCallListener
{
private static final long serialVersionUID = 1L;
private static final String SPIN = "$('#%s').addClass('" + SPINNER_CLASS + "');";
private static final String STOP = "$('#%s').removeClass('" + SPINNER_CLASS + "');";
private static final String DISABLE_AND_SPIN = DISABLED + SPIN;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@

public class SelectOptionsGroup extends Border {

private static final long serialVersionUID = 1L;

public SelectOptionsGroup(String id, IModel model) {
super(id);
WebMarkupContainer optgroup = new WebMarkupContainer("optgroup");
optgroup.add(new AttributeModifier("label", true, model));
optgroup.add(new AttributeModifier("label", model));
add(optgroup);
optgroup.add(getBodyContainer());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
*/
public class SakaiSpinnerDropDownChoice<T> extends GenericPanel<T>
{
private static final long serialVersionUID = 1L;
public final DropDownChoice<T> select;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/
public class SakaiSpinningSelectAjaxCallListener extends AbstractSakaiSpinnerAjaxCallListener
{
private static final long serialVersionUID = 1L;
private static final String SPIN = "$('#%s').parent().addClass('" + SPINNER_CLASS + "');";
private static final String STOP = "$('#%s').parent().removeClass('" + SPINNER_CLASS + "');";
private static final String DISABLE_AND_SPIN = DISABLED + SPIN;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
*/
public abstract class SakaiSpinningSelectOnChangeBehavior extends AjaxFormComponentUpdatingBehavior
{

private static final long serialVersionUID = 1L;

public SakaiSpinningSelectOnChangeBehavior()
{
super("onchange");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/
public class SakaiStringResourceChoiceRenderer implements IChoiceRenderer<String>
{
private static final long serialVersionUID = 1L;
private final String msgKey;
private final Component component;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
*/
public class AbstractInfinitePagingDataGridView<T> extends InfinitePagingDataViewBase<T>
{
private static final long serialVersionUID = 1L;
private static final String CELL_REPEATER_ID = "cells";
private static final String CELL_ITEM_ID = "cell";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
*/
public abstract class AbstractInfinitePagingView<T> extends RefreshingView<T>
{
private static final long serialVersionUID = 1L;
@Getter private long itemsPerPage = Long.MAX_VALUE;
@Getter @Setter protected long offset = 0;
protected boolean hasNextPage = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
*/
public class InfinitePagingDataGridView<T> extends AbstractInfinitePagingDataGridView<T>
{
private static final long serialVersionUID = 1L;

public InfinitePagingDataGridView(final String id, final List<? extends ICellPopulator<T>> populators, final InfiniteDataProvider<T> dataProvider)
{
super(id, populators, dataProvider);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
*/
public class InfinitePagingDataTable<T, S> extends Panel
{

private static final long serialVersionUID = 1L;

static abstract class CssAttributeBehavior extends Behavior
{
private static final long serialVersionUID = 1L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
*/
public class InfinitePagingDataTableHeadersToolbar<S> extends InfinitePagingDataTableToolbar
{
private static final long serialVersionUID = 1L;
private static final String TOOLBAR_JS = StatsManager.SITESTATS_WEBAPP + "/script/infinitepagingdatatableheaderstoolbar.js";

public <T> InfinitePagingDataTableHeadersToolbar(final InfinitePagingDataTable<T, S> table, final ISortStateLocator<S> stateLocator)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
*/
public class InfinitePagingDataTableToolbar extends Panel
{
private static final long serialVersionUID = 1L;
protected final InfinitePagingDataTable<?, ?> table;

public InfinitePagingDataTableToolbar(final IModel<?> model, final InfinitePagingDataTable<?, ?> table)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
*/
public abstract class InfinitePagingDataViewBase<T> extends AbstractInfinitePagingView<T>
{
private static final long serialVersionUID = 1L;
private final InfiniteDataProvider<T> dataProvider;

public InfinitePagingDataViewBase(String id, InfiniteDataProvider<T> dataProvider)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
*/
public class InfinitePagingNavigationIncrementButton extends SakaiAjaxButton
{
private static final long serialVersionUID = 1L;
protected final InfinitePagingDataTable table;
private final boolean increment;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
*/
public class InfinitePagingNavigator extends Panel
{
private static final long serialVersionUID = 1L;
private final InfinitePagingDataTable table;
private final String pageSizeSelection;
private final Form<?> form;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
*/
public class SakaiInfinitePagingDataTable<T, S> extends InfinitePagingDataTable<T, S>
{
private static final long serialVersionUID = 1L;

public SakaiInfinitePagingDataTable(final String id, final List<? extends IColumn<T, S>> columns, final SortableInfiniteDataProvider<T, S> dataProvider,
final int rowsPerPage)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
*/
public class SakaiInfinitePagingDataTableNavigationToolbar extends InfinitePagingDataTableToolbar
{
private static final long serialVersionUID = 1L;

public SakaiInfinitePagingDataTableNavigationToolbar(final InfinitePagingDataTable<?, ?> table)
{
super(null, table);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
*/
public class SakaiInfinitePagingNoRecordsToolbar extends InfinitePagingDataTableToolbar
{
private static final long serialVersionUID = 1L;

public SakaiInfinitePagingNoRecordsToolbar(final InfinitePagingDataTable<?, ?> table)
{
super(null, table);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
*/
public class EventRefDetailsButtonPanel extends GenericPanel<DetailedEvent>
{
private static final long serialVersionUID = 1L;

public final boolean resolvable;

private final String siteID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
*/
public class EventRefDetailsPanel extends GenericPanel<ResolvedEventData>
{
private static final long serialVersionUID = 1L;

/**
* Constructor
* @param id wicket id
Expand Down
Loading

0 comments on commit b7e6c11

Please sign in to comment.