- Change to start using bootstrap grid

This commit is contained in:
Paulo Gustavo Veiga
2012-09-10 23:51:53 -03:00
parent 6efc068a6c
commit 3fb746f79b
23 changed files with 316 additions and 375 deletions

View File

@@ -333,7 +333,7 @@ public class UserAgent implements Serializable {
public boolean isBrowserSupported() {
// Is it a supported browser ?.
final UserAgent.Product product = this.getProduct();
boolean result = product == UserAgent.Product.FIREFOX && this.isVersionGreatedOrEqualThan(12, 0);
boolean result = product == UserAgent.Product.FIREFOX && this.isVersionGreatedOrEqualThan(10, 0);
result = result || product == UserAgent.Product.EXPLORER && this.isVersionGreatedOrEqualThan(7, 0) && this.getOs() == UserAgent.OS.WINDOWS;
result = result || product == UserAgent.Product.OPERA && this.isVersionGreatedOrEqualThan(11, 0);
result = result || product == UserAgent.Product.CHROME && this.isVersionGreatedOrEqualThan(18, 0);

View File

@@ -20,6 +20,7 @@ package com.wisemapping.mail;
import com.wisemapping.filter.UserAgent;
import com.wisemapping.model.Collaboration;
import com.wisemapping.model.CollaborationRole;
import com.wisemapping.model.Mindmap;
import com.wisemapping.model.User;
import org.apache.commons.io.IOUtils;

View File

@@ -29,7 +29,7 @@ public class NotifyingExceptionResolver extends SimpleMappingExceptionResolver {
}
private void sendNotification(@NotNull Exception ex, @NotNull HttpServletRequest request) {
final User user = Utils.getUser();
final User user = Utils.getUser(false);
notificationService.reportJavaException(ex, user, request);
}

View File

@@ -18,9 +18,7 @@
package com.wisemapping.rest;
import com.wisemapping.exceptions.AccessDeniedSecurityException;
import com.wisemapping.exceptions.ClientException;
import com.wisemapping.filter.UserAgent;
import com.wisemapping.mail.NotificationService;
import com.wisemapping.model.User;
import com.wisemapping.rest.model.RestErrors;
@@ -69,10 +67,11 @@ public class BaseController {
return ex.getMessage();
}
@ExceptionHandler(ValidationException.class)
@ExceptionHandler(JsonHttpMessageNotReadableException.class)
@ResponseStatus(HttpStatus.BAD_REQUEST)
public RestErrors handleValidationErrors(@NotNull ValidationException ex) {
return new RestErrors(ex.getErrors(), messageSource);
public String handleValidationErrors(@NotNull JsonHttpMessageNotReadableException ex) {
return "Request could not be saved. Message is not valid";
}
@ExceptionHandler(java.lang.reflect.UndeclaredThrowableException.class)

View File

@@ -12,7 +12,7 @@ import java.io.InputStream;
public class DebugMappingJacksonHttpMessageConverter extends MappingJacksonHttpMessageConverter {
@Override
protected Object readInternal(Class<?> clazz, HttpInputMessage inputMessage) throws IOException, HttpMessageNotReadableException {
protected Object readInternal(Class<?> clazz, HttpInputMessage inputMessage) throws IOException, JsonHttpMessageNotReadableException {
final byte[] bytes = IOUtils.toByteArray(inputMessage.getBody());
final ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
final WrapHttpInputMessage wrap = new WrapHttpInputMessage(bais, inputMessage.getHeaders());
@@ -21,20 +21,14 @@ public class DebugMappingJacksonHttpMessageConverter extends MappingJacksonHttpM
return super.readInternal(clazz, wrap);
} catch (org.springframework.http.converter.HttpMessageNotReadableException e) {
throw new HttpMessageNotReadableException("Request Body:\n" + new String(bytes, "UTF-8"), e);
throw new JsonHttpMessageNotReadableException("Request Body:\n" + new String(bytes, "UTF-8"), e);
}
catch (IOException e) {
throw new HttpMessageNotReadableException("Request Body:\n" + new String(bytes, "UTF-8"), e);
throw new JsonHttpMessageNotReadableException("Request Body:\n" + new String(bytes, "UTF-8"), e);
}
}
}
class HttpMessageNotReadableException extends org.springframework.http.converter.HttpMessageNotReadableException {
public HttpMessageNotReadableException(String msg, Exception cause) {
super(msg, cause);
}
}
class WrapHttpInputMessage implements HttpInputMessage {
private InputStream body;

View File

@@ -0,0 +1,8 @@
package com.wisemapping.rest;
class JsonHttpMessageNotReadableException extends org.springframework.http.converter.HttpMessageNotReadableException {
public JsonHttpMessageNotReadableException(String msg, Exception cause) {
super(msg, cause);
}
}

View File

@@ -1,27 +0,0 @@
package com.wisemapping.rest;
import org.jetbrains.annotations.NotNull;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.http.converter.json.MappingJacksonHttpMessageConverter;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import java.util.List;
@EnableWebMvc
@Configuration
public class RestMvcConfiguration extends WebMvcConfigurerAdapter {
@Override
public void configureMessageConverters(@NotNull final List<HttpMessageConverter<?>> converters) {
converters.add(converter());
super.configureMessageConverters(converters);
}
@Bean
MappingJacksonHttpMessageConverter converter() {
return new DebugMappingJacksonHttpMessageConverter();
}
}