    public Resolution save() {
        layer.getDetails().clear();
        for(Map.Entry<String,String> e: details.entrySet()) {
            layer.getDetails().put(e.getKey(), new ClobElement(e.getValue()));
        }
        layer.getReaders().clear();
        for (String groupName : groupsRead) {
            layer.getReaders().add(groupName);
        }
        layer.getWriters().clear();
        for (String groupName : groupsWrite) {
            layer.getWriters().add(groupName);
        }
        layer.setFeatureType(simpleFeatureType);
        Stripersist.getEntityManager().persist(layer);
        layer.getService().authorizationsModified();
        Stripersist.getEntityManager().getTransaction().commit();
        getContext().getMessages().add(new SimpleMessage("De kaartlaag is opgeslagen"));
        return new ForwardResolution(JSP);
    }

    public Resolution save() {
        layer.getDetails().keySet().removeAll(Arrays.asList(
                Layer.EXTRA_KEY_METADATA_STYLESHEET_URL,
                Layer.EXTRA_KEY_DOWNLOAD_URL,
                Layer.EXTRA_KEY_FILTERABLE
        ));
        for(Map.Entry<String,String> e: details.entrySet()) {
            if(e.getValue() != null) { 
                layer.getDetails().put(e.getKey(), new ClobElement(e.getValue()));
            }
        }
        layer.getReaders().clear();
        for (String groupName : groupsRead) {
            layer.getReaders().add(groupName);
        }
        layer.getWriters().clear();
        for (String groupName : groupsWrite) {
            layer.getWriters().add(groupName);
        }
        layer.setFeatureType(simpleFeatureType);
        Stripersist.getEntityManager().persist(layer);
        layer.getService().authorizationsModified();
        Stripersist.getEntityManager().getTransaction().commit();
        getContext().getMessages().add(new SimpleMessage("De kaartlaag is opgeslagen"));
        return new ForwardResolution(JSP);
    }
