bug fixing issue on displaying automatically the layers
This commit is contained in:
parent
143e79388d
commit
7211ddaeaf
|
@ -497,6 +497,10 @@ public class LayerManager {
|
|||
lo.setProjectID(projectID);
|
||||
lo.setProfileID(profileID);
|
||||
lo.setProjectDV(projectDV);
|
||||
|
||||
GWT.log("LayerObject ID is: "+lo.getProjectID());
|
||||
if(lo.getProjectDV()!=null)
|
||||
GWT.log("LayerObject into ProjectDV is: "+lo.getProjectDV().getId());
|
||||
|
||||
String layerNameKey = layerItem.getName();
|
||||
|
||||
|
|
|
@ -26,8 +26,9 @@ public class OverlayLayerManager {
|
|||
this.applicationBus = applicationBus;
|
||||
}
|
||||
|
||||
void addLayerItem(LayerObject lo) {
|
||||
public void addLayerItem(LayerObject lo) {
|
||||
GWT.log("Adding LayerObject having project: "+lo.getProjectDV());
|
||||
GWT.log("Adding LayerObject having project id: "+lo.getProjectDV().getId());
|
||||
|
||||
ArrayList<DragDropLayer> listDDLayers = mapCollectionsPerProfileID.get(lo.getProfileID());
|
||||
|
||||
|
|
|
@ -462,7 +462,7 @@ public abstract class OpenLayerMap {
|
|||
*
|
||||
* @param layerItem the layer item
|
||||
*/
|
||||
public synchronized void addWMSDetailLayer(LayerItem layerItem) {
|
||||
public void addWMSDetailLayer(LayerItem layerItem) {
|
||||
|
||||
if (wmsDetailsLayerMap == null)
|
||||
wmsDetailsLayerMap = new LinkedHashMap<String, Image>();
|
||||
|
|
|
@ -61,35 +61,34 @@ public class DragDropLayer extends FlowPanel {
|
|||
this.layerItem = layerObject.getLayerItem();
|
||||
GWT.log("DragDropLayer for projectDV: " + layerObject.getProjectDV());
|
||||
|
||||
String referProject = "Project ID: " + layerObject.getProjectDV().getId();
|
||||
String referProjectID = "Project ID: " + layerObject.getProjectDV().getId();
|
||||
labelProject = new com.google.gwt.user.client.ui.Label("");
|
||||
labelProject.setTitle(referProject);
|
||||
labelProject.setTitle(referProjectID);
|
||||
GeoportalDataViewerServiceAsync.Util.getInstance().getEntrySetsDocumentForProjectID(
|
||||
layerObject.getProjectDV().getProfileID(), layerObject.getProjectDV().getId(), 1,
|
||||
new AsyncCallback<LinkedHashMap<String, Object>>() {
|
||||
|
||||
@Override
|
||||
public void onSuccess(LinkedHashMap<String, Object> result) {
|
||||
String referProject = "";
|
||||
String realProjectName = "";
|
||||
if (result != null) {
|
||||
for (String key : result.keySet()) {
|
||||
result.get(key);
|
||||
//referProject = key + ": " + result.get(key);
|
||||
referProject = result.get(key)+"";
|
||||
realProjectName = result.get(key)+"";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (referProject != null && !referProject.isEmpty()) {
|
||||
labelProject.setText(StringUtil.ellipsize(referProject, 40));
|
||||
labelProject.setTitle(referProject);
|
||||
if (realProjectName != null && !realProjectName.isEmpty()) {
|
||||
labelProject.setText(StringUtil.ellipsize(realProjectName, 40));
|
||||
labelProject.setTitle(realProjectName);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
labelProject.setText(StringUtil.ellipsize(referProject, 40));
|
||||
labelProject.setTitle(referProject);
|
||||
labelProject.setTitle("Error on reading the project name");
|
||||
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1005,8 +1005,11 @@ public class GeoportalDataViewerServiceImpl extends RemoteServiceServlet impleme
|
|||
switch (layerObject.getType()) {
|
||||
case INDEX_LAYER: {
|
||||
|
||||
// Expected 1 feature
|
||||
// Expected more than 1 feature for the BBOX of the Map
|
||||
FeatureRow fRow = features.get(0);
|
||||
//using only the first feature returned from BBOX of the Map
|
||||
//when querying the centroid layers
|
||||
geoDAO.setFeatures(Arrays.asList(fRow));
|
||||
if (fRow.getMapProperties() != null) {
|
||||
List<String> productIDs = fRow.getMapProperties()
|
||||
.get(GeoportalDataViewerConstants.PROJECT_ID_KEY_FEATURE);
|
||||
|
|
|
@ -574,7 +574,7 @@ public class Geoportal_JSON_Mapper {
|
|||
com.jayway.jsonpath.Configuration configuration = com.jayway.jsonpath.Configuration.builder()
|
||||
.jsonProvider(new JsonOrgJsonProvider()).build();
|
||||
|
||||
LOG.info("Reading sectionPath at {} into section document {}", _payloadsJSONPath, sectionJSONDocument);
|
||||
LOG.debug("Reading sectionPath at {} into section document {}", _payloadsJSONPath, sectionJSONDocument);
|
||||
JsonPath theSectionPolycJsonPath = JsonPath.compile(_payloadsJSONPath);
|
||||
Object _payloads = theSectionPolycJsonPath.read(sectionJSONDocument, configuration).toString();
|
||||
|
||||
|
@ -607,14 +607,14 @@ public class Geoportal_JSON_Mapper {
|
|||
*/
|
||||
public static List<PayloadDV> readImagesForFileset(String parentJSONPath, String sectionJSONDocument,
|
||||
boolean limitToFirstOneFound) {
|
||||
LOG.debug("readImagesForFileset called");
|
||||
LOG.info("readImagesForFileset called");
|
||||
|
||||
List<PayloadDV> listImages = new ArrayList<PayloadDV>();
|
||||
com.jayway.jsonpath.Configuration config = com.jayway.jsonpath.Configuration.builder()
|
||||
.jsonProvider(new JsonOrgJsonProvider()).build();
|
||||
// Reading Fileset _payloads
|
||||
String filesetJSONPath = String.format("%s.%s", parentJSONPath, _PAYLOADS);
|
||||
LOG.info("Reading sectionPath {} into section document {}", filesetJSONPath, sectionJSONDocument);
|
||||
LOG.debug("Reading sectionPath {} into section document {}", filesetJSONPath, sectionJSONDocument);
|
||||
JsonPath theSectionPolycJsonPath = JsonPath.compile(filesetJSONPath);
|
||||
Object _filesets = theSectionPolycJsonPath.read(sectionJSONDocument, config);
|
||||
|
||||
|
@ -644,7 +644,7 @@ public class Geoportal_JSON_Mapper {
|
|||
*/
|
||||
public static List<GCubeSDIViewerLayerDV> readGcubeSDILayersForFileset(String materializationParentJSONPath,
|
||||
String sectionJSONDocument) {
|
||||
LOG.debug("readGcubeSDILayersForFileset called");
|
||||
LOG.info("readGcubeSDILayersForFileset called");
|
||||
|
||||
List<GCubeSDIViewerLayerDV> listSDILayers = new ArrayList<GCubeSDIViewerLayerDV>();
|
||||
String _materializationsJSONPath = String.format("%s.%s", materializationParentJSONPath, _MATERIALIZATIONS);
|
||||
|
@ -653,7 +653,7 @@ public class Geoportal_JSON_Mapper {
|
|||
com.jayway.jsonpath.Configuration configurationJSONSmart = com.jayway.jsonpath.Configuration.builder()
|
||||
.jsonProvider(new JsonOrgJsonProvider()).build();
|
||||
|
||||
LOG.info("Reading sectionPath {} into section document {}", _materializationsJSONPath, sectionJSONDocument);
|
||||
LOG.debug("Reading sectionPath {} into section document {}", _materializationsJSONPath, sectionJSONDocument);
|
||||
JsonPath theSectionPolycJsonPath = JsonPath.compile(_materializationsJSONPath);
|
||||
Object _materializations = theSectionPolycJsonPath.read(sectionJSONDocument, configurationJSONSmart);
|
||||
|
||||
|
@ -827,7 +827,7 @@ public class Geoportal_JSON_Mapper {
|
|||
* @return true, if successful
|
||||
*/
|
||||
private static boolean checkAccessPolicy(String sectionDocumentJSON, String myLogin) {
|
||||
LOG.debug("checkAccessPolicy called");
|
||||
LOG.info("checkAccessPolicy called");
|
||||
// CHECKING THE POLICY
|
||||
String accessPolicyPath = JSON_$_POINTER + "._access._policy";
|
||||
boolean isAccessible = true;
|
||||
|
@ -835,10 +835,10 @@ public class Geoportal_JSON_Mapper {
|
|||
com.jayway.jsonpath.Configuration configuration = com.jayway.jsonpath.Configuration.builder()
|
||||
.jsonProvider(new JsonOrgJsonProvider()).build();
|
||||
|
||||
LOG.info("Reading access policy at {} into section document {}", accessPolicyPath, sectionDocumentJSON);
|
||||
LOG.debug("Reading access policy at {} into section document {}", accessPolicyPath, sectionDocumentJSON);
|
||||
JsonPath theSectionPolycJsonPath = JsonPath.compile(accessPolicyPath);
|
||||
String _policy = theSectionPolycJsonPath.read(sectionDocumentJSON, configuration).toString();
|
||||
LOG.info("The section {} has policy {}", accessPolicyPath, _policy);
|
||||
LOG.debug("The section {} has policy {}", accessPolicyPath, _policy);
|
||||
isAccessible = GeportalCheckAccessPolicy.isAccessible(_policy, myLogin);
|
||||
} catch (Exception e) {
|
||||
LOG.error(accessPolicyPath + " not found. Check OK");
|
||||
|
|
Loading…
Reference in New Issue