Skip to content

Commit

Permalink
org.geoserver.gwc.web.blob Compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
NielsCharlier committed Jan 18, 2016
1 parent f08bfa1 commit eef93f8
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 18 deletions.
Expand Up @@ -44,7 +44,10 @@
*/ */
public class BlobStorePage extends GeoServerSecuredPage { public class BlobStorePage extends GeoServerSecuredPage {


private DropDownChoice<BlobStoreType> typeOfBlobStore; private static final long serialVersionUID = -59024268194792891L;

@SuppressWarnings("rawtypes")
private DropDownChoice<BlobStoreType> typeOfBlobStore;


private WebMarkupContainer blobConfigContainer; private WebMarkupContainer blobConfigContainer;


Expand All @@ -60,7 +63,8 @@ public BlobStorePage() {
this(null); this(null);
} }


public BlobStorePage(final BlobStoreConfig originalStore) { @SuppressWarnings({ "rawtypes", "unchecked" })
public BlobStorePage(final BlobStoreConfig originalStore) {


final List<String> assignedLayers = new ArrayList<String>(); final List<String> assignedLayers = new ArrayList<String>();


Expand All @@ -74,7 +78,7 @@ public BlobStorePage(final BlobStoreConfig originalStore) {
typeOfBlobStore.add(new AjaxFormComponentUpdatingBehavior("onchange") { typeOfBlobStore.add(new AjaxFormComponentUpdatingBehavior("onchange") {
private static final long serialVersionUID = 359589121400814043L; private static final long serialVersionUID = 359589121400814043L;


@Override @Override
protected void onUpdate(AjaxRequestTarget target) { protected void onUpdate(AjaxRequestTarget target) {
blobStoreForm.setVisible(typeOfBlobStore.getModelObject() != null); blobStoreForm.setVisible(typeOfBlobStore.getModelObject() != null);
if (typeOfBlobStore.getModelObject() != null) { if (typeOfBlobStore.getModelObject() != null) {
Expand All @@ -91,7 +95,7 @@ protected void onUpdate(AjaxRequestTarget target) {
typeOfBlobStore.add(new AttributeModifier("title", new ResourceModel( typeOfBlobStore.add(new AttributeModifier("title", new ResourceModel(
"typeOfBlobStore.title"))); "typeOfBlobStore.title")));


Form selector = new Form("selector"); Form<BlobStoreType<?>> selector = new Form<BlobStoreType<?>>("selector");
selector.add(typeOfBlobStore); selector.add(typeOfBlobStore);
add(selector); add(selector);


Expand All @@ -101,7 +105,7 @@ protected void onUpdate(AjaxRequestTarget target) {


blobStoreForm = new Form<BlobStoreConfig>("blobStoreForm", blobStoreForm = new Form<BlobStoreConfig>("blobStoreForm",
new CompoundPropertyModel<BlobStoreConfig>(originalStore == null ? null new CompoundPropertyModel<BlobStoreConfig>(originalStore == null ? null
: originalStore.clone())); : (BlobStoreConfig) originalStore.clone()));
blobConfigContainer.add(blobStoreForm); blobConfigContainer.add(blobStoreForm);
blobStoreForm.setVisible(originalStore != null); blobStoreForm.setVisible(originalStore != null);


Expand Down
Expand Up @@ -26,21 +26,21 @@ private BlobStoreTypes() {}
/** /**
* Lazy loaded map of blob store types * Lazy loaded map of blob store types
*/ */
private static Map<Class<? extends BlobStoreConfig>, BlobStoreType> TYPES; private static Map<Class<? extends BlobStoreConfig>, BlobStoreType<?>> TYPES;




private static Map<Class<? extends BlobStoreConfig>, BlobStoreType> getTypes() { private static Map<Class<? extends BlobStoreConfig>, BlobStoreType<?>> getTypes() {
if (TYPES == null) { if (TYPES == null) {
//the treemap with comparator makes sure that the types are always displayed in the //the treemap with comparator makes sure that the types are always displayed in the
//same order, alphabetically sorted on name //same order, alphabetically sorted on name
TYPES = new TreeMap<Class<? extends BlobStoreConfig>, BlobStoreType>( TYPES = new TreeMap<Class<? extends BlobStoreConfig>, BlobStoreType<?>>(
new Comparator<Class>() { new Comparator<Class<?>>() {
@Override @Override
public int compare(Class o1, Class o2) { public int compare(Class<?> o1, Class<?> o2) {
return o1.toString().compareTo(o2.toString()); return o1.toString().compareTo(o2.toString());
} }
}); });
for (BlobStoreType type : GeoWebCacheExtensions.extensions(BlobStoreType.class)) { for (BlobStoreType<?> type : GeoWebCacheExtensions.extensions(BlobStoreType.class)) {
TYPES.put(type.getConfigClass(), type); TYPES.put(type.getConfigClass(), type);
} }
} }
Expand All @@ -54,7 +54,7 @@ public int compare(Class o1, Class o2) {
* @param clazz * @param clazz
* @return * @return
*/ */
public static BlobStoreType getFromClass(Class<? extends BlobStoreConfig> clazz) { public static BlobStoreType<?> getFromClass(Class<? extends BlobStoreConfig> clazz) {
return getTypes().get(clazz); return getTypes().get(clazz);
} }


Expand All @@ -63,8 +63,8 @@ public static BlobStoreType getFromClass(Class<? extends BlobStoreConfig> clazz)
* *
* @return * @return
*/ */
public static List<BlobStoreType> getAll() { public static List<BlobStoreType<?>> getAll() {
return new ArrayList<BlobStoreType>(getTypes().values()); return new ArrayList<BlobStoreType<?>>(getTypes().values());
} }


} }
Expand Up @@ -40,7 +40,9 @@
*/ */
public class BlobStoresPage extends GeoServerSecuredPage { public class BlobStoresPage extends GeoServerSecuredPage {


private AjaxLink<Object> remove; private static final long serialVersionUID = 6076989713813458347L;

private AjaxLink<Object> remove;


private GeoServerTablePanel<BlobStoreConfig> blobStoresPanel; private GeoServerTablePanel<BlobStoreConfig> blobStoresPanel;


Expand Down Expand Up @@ -157,11 +159,11 @@ public void onClose(AjaxRequestTarget target) {
private static final long serialVersionUID = -5380703588873422601L; private static final long serialVersionUID = -5380703588873422601L;


@Override @Override
protected Component getComponentForProperty(String id, IModel itemModel, protected Component getComponentForProperty(String id, IModel<BlobStoreConfig> itemModel,
Property<BlobStoreConfig> property) { Property<BlobStoreConfig> property) {
final BlobStoreConfig blobStore = (BlobStoreConfig) itemModel.getObject(); final BlobStoreConfig blobStore = (BlobStoreConfig) itemModel.getObject();
if (property == BlobStoresProvider.ID) { if (property == BlobStoresProvider.ID) {
return new SimpleAjaxLink(id, itemModel, property.getModel(itemModel)) { return new SimpleAjaxLink<BlobStoreConfig>(id, itemModel, property.getModel(itemModel)) {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;


@Override @Override
Expand Down
Expand Up @@ -40,7 +40,7 @@ protected List<org.geoserver.web.wicket.GeoServerDataProvider.Property<BlobStore
} }


@Override @Override
protected Comparator<BlobStoreConfig> getComparator(final SortParam sort) { protected Comparator<BlobStoreConfig> getComparator(final SortParam<?> sort) {
if (sort != null && sort.getProperty().equals(TYPE.getName())) { if (sort != null && sort.getProperty().equals(TYPE.getName())) {


return new Comparator<BlobStoreConfig>() { return new Comparator<BlobStoreConfig>() {
Expand Down

0 comments on commit eef93f8

Please sign in to comment.