diff --git a/lightadmin-core/pom.xml b/lightadmin-core/pom.xml
index 9aa8a28c..bfb0e84d 100644
--- a/lightadmin-core/pom.xml
+++ b/lightadmin-core/pom.xml
@@ -8,7 +8,7 @@
lightadmin
jar
- 1.2.0.BUILD-SNAPSHOT
+ 1.3.1.BUILD-SNAPSHOT
LightAdmin
Pluggable data management solution for Java web applications developed in a "Rapid" manner
@@ -95,7 +95,7 @@
1.7
1.7
- 1.1.2.RELEASE
+ 2.0.5.RELEASE
4.0
4.2
diff --git a/lightadmin-core/src/main/java/org/lightadmin/api/config/utils/Editors.java b/lightadmin-core/src/main/java/org/lightadmin/api/config/utils/Editors.java
index a0238d90..52dc88fe 100644
--- a/lightadmin-core/src/main/java/org/lightadmin/api/config/utils/Editors.java
+++ b/lightadmin-core/src/main/java/org/lightadmin/api/config/utils/Editors.java
@@ -35,6 +35,10 @@ public static JspFragmentFieldControl wysiwyg() {
return new JspFragmentFieldControl("/views/editors/wysiwyg-field-edit-control.jsp");
}
+ public static JspFragmentFieldControl readOnly() {
+ return new JspFragmentFieldControl("/views/editors/readonly-field-control.jsp");
+ }
+
public static JspFragmentFieldControl enumeration(List elements) {
return new EnumFieldEditControl(elements);
}
diff --git a/lightadmin-core/src/main/java/org/lightadmin/core/config/bootstrap/JpaMetamodelMappingContextFactoryBean.java b/lightadmin-core/src/main/java/org/lightadmin/core/config/bootstrap/JpaMetamodelMappingContextFactoryBean.java
index 82365dd7..00f2dbca 100644
--- a/lightadmin-core/src/main/java/org/lightadmin/core/config/bootstrap/JpaMetamodelMappingContextFactoryBean.java
+++ b/lightadmin-core/src/main/java/org/lightadmin/core/config/bootstrap/JpaMetamodelMappingContextFactoryBean.java
@@ -22,6 +22,8 @@
import javax.persistence.EntityManager;
import javax.persistence.metamodel.ManagedType;
import javax.persistence.metamodel.Metamodel;
+import java.util.Arrays;
+import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
@@ -50,7 +52,8 @@ protected JpaMetamodelMappingContext createInstance() throws Exception {
}
}
- JpaMetamodelMappingContext context = new JpaMetamodelMappingContext(metamodel);
+ Set metaModelSet = new HashSet<>(Collections.singletonList(metamodel));
+ JpaMetamodelMappingContext context = new JpaMetamodelMappingContext(metaModelSet);
context.setInitialEntitySet(entitySources);
context.initialize();
diff --git a/lightadmin-core/src/main/java/org/lightadmin/core/config/context/LightAdminRepositoryRestMvcConfiguration.java b/lightadmin-core/src/main/java/org/lightadmin/core/config/context/LightAdminRepositoryRestMvcConfiguration.java
index e643bb56..26afd46f 100644
--- a/lightadmin-core/src/main/java/org/lightadmin/core/config/context/LightAdminRepositoryRestMvcConfiguration.java
+++ b/lightadmin-core/src/main/java/org/lightadmin/core/config/context/LightAdminRepositoryRestMvcConfiguration.java
@@ -33,9 +33,9 @@
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.repository.support.Repositories;
+import org.springframework.data.repository.support.RepositoryInvokerFactory;
import org.springframework.data.rest.core.config.RepositoryRestConfiguration;
import org.springframework.data.rest.core.event.ValidatingRepositoryEventListener;
-import org.springframework.data.rest.core.invoke.RepositoryInvokerFactory;
import org.springframework.data.rest.core.support.DomainObjectMerger;
import org.springframework.data.rest.webmvc.RepositoryRestController;
import org.springframework.data.rest.webmvc.config.PersistentEntityResourceAssemblerArgumentResolver;
@@ -44,6 +44,7 @@
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter;
+import java.net.URI;
import java.util.List;
import static com.google.common.collect.Lists.newLinkedList;
@@ -113,7 +114,7 @@ public FileManipulationRepositoryEventListener domainRepositoryEventListener(Glo
@Override
protected void configureRepositoryRestConfiguration(RepositoryRestConfiguration config) {
config.setDefaultPageSize(10);
- config.setBaseUri(lightAdminConfiguration().getApplicationRestBaseUrl());
+ config.setBasePath(lightAdminConfiguration().getApplicationRestBaseUrl().toString());
config.exposeIdsFor(globalAdministrationConfiguration().getAllDomainTypesAsArray());
config.setReturnBodyOnCreate(true);
config.setReturnBodyOnUpdate(true);
diff --git a/lightadmin-core/src/main/java/org/lightadmin/core/config/context/LightAdminSecurityConfiguration.java b/lightadmin-core/src/main/java/org/lightadmin/core/config/context/LightAdminSecurityConfiguration.java
index 732790a0..af0bb636 100644
--- a/lightadmin-core/src/main/java/org/lightadmin/core/config/context/LightAdminSecurityConfiguration.java
+++ b/lightadmin-core/src/main/java/org/lightadmin/core/config/context/LightAdminSecurityConfiguration.java
@@ -63,10 +63,7 @@
import javax.servlet.Filter;
import java.io.IOException;
-import java.util.Collection;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Properties;
+import java.util.*;
import static com.google.common.collect.Lists.newArrayList;
import static com.google.common.collect.Maps.newLinkedHashMap;
@@ -109,7 +106,7 @@ public FilterChainProxy springSecurityFilterChain(Filter filterSecurityIntercept
public Filter filterSecurityInterceptor(AuthenticationManager authenticationManager) throws Exception {
FilterSecurityInterceptor filter = new FilterSecurityInterceptor();
filter.setAuthenticationManager(authenticationManager);
- filter.setAccessDecisionManager(new AffirmativeBased(asList((AccessDecisionVoter) new RoleVoter())));
+ filter.setAccessDecisionManager(new AffirmativeBased(Arrays.>asList((AccessDecisionVoter