fixing issue on clicking event
This commit is contained in:
parent
55dc9379c5
commit
2cb435c546
|
@ -38,7 +38,8 @@ public class ActionListPanel extends Composite {
|
||||||
private List<ActionDefinitionDV> listActionDefinition;
|
private List<ActionDefinitionDV> listActionDefinition;
|
||||||
private HandlerManager appManagerBus;
|
private HandlerManager appManagerBus;
|
||||||
|
|
||||||
public ActionListPanel(HandlerManager appManagerBus,String projectName, String profileID, List<ActionDefinitionDV> listActionDef) {
|
public ActionListPanel(HandlerManager appManagerBus, String projectName, String profileID,
|
||||||
|
List<ActionDefinitionDV> listActionDef) {
|
||||||
initWidget(uiBinder.createAndBindUi(this));
|
initWidget(uiBinder.createAndBindUi(this));
|
||||||
GWT.log("Adding list of actions: " + listActionDef);
|
GWT.log("Adding list of actions: " + listActionDef);
|
||||||
this.appManagerBus = appManagerBus;
|
this.appManagerBus = appManagerBus;
|
||||||
|
@ -70,7 +71,8 @@ public class ActionListPanel extends Composite {
|
||||||
for (ActionDefinitionDV actionDefinitionDV : listActionDef) {
|
for (ActionDefinitionDV actionDefinitionDV : listActionDef) {
|
||||||
|
|
||||||
// skipping the special workflow action
|
// skipping the special workflow action
|
||||||
if(actionDefinitionDV.getId().equals(ConstantsGeoPortalDataEntryApp.WORKFLOW_ACTION_POST_CREATION_ACTION_ID)) {
|
if (actionDefinitionDV.getId()
|
||||||
|
.equals(ConstantsGeoPortalDataEntryApp.WORKFLOW_ACTION_POST_CREATION_ACTION_ID)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +85,8 @@ public class ActionListPanel extends Composite {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(ClickEvent event) {
|
public void onClick(ClickEvent event) {
|
||||||
|
|
||||||
appManagerBus.fireEvent(new WorkflowActionOnSelectedItemEvent<ResultDocumentDV>(actionDefinitionDV));
|
appManagerBus
|
||||||
|
.fireEvent(new WorkflowActionOnSelectedItemEvent<ResultDocumentDV>(actionDefinitionDV));
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -120,6 +123,9 @@ public class ActionListPanel extends Composite {
|
||||||
String itemPhase = ((ResultDocumentDV) item).getLifecycleInfo().getPhase();
|
String itemPhase = ((ResultDocumentDV) item).getLifecycleInfo().getPhase();
|
||||||
|
|
||||||
List<ActionDefButton> listButtons = mapPhaseListButtons.get(itemPhase);
|
List<ActionDefButton> listButtons = mapPhaseListButtons.get(itemPhase);
|
||||||
|
|
||||||
|
if (listButtons != null) {
|
||||||
|
|
||||||
for (ActionDefButton actionDefButton : listButtons) {
|
for (ActionDefButton actionDefButton : listButtons) {
|
||||||
|
|
||||||
Set<String> roles = actionDefButton.getActionDefinitionDV().getRoles();
|
Set<String> roles = actionDefButton.getActionDefinitionDV().getRoles();
|
||||||
|
@ -130,7 +136,8 @@ public class ActionListPanel extends Composite {
|
||||||
actionListBasePanel.setVisible(true);
|
actionListBasePanel.setVisible(true);
|
||||||
} else {
|
} else {
|
||||||
// Checking if the userRole is matching the role defined in the ActionDefinition
|
// Checking if the userRole is matching the role defined in the ActionDefinition
|
||||||
boolean isRoleIntoActionDef= roles.stream().anyMatch(userRole.getName()::equalsIgnoreCase);
|
boolean isRoleIntoActionDef = roles.stream()
|
||||||
|
.anyMatch(userRole.getName()::equalsIgnoreCase);
|
||||||
if (isRoleIntoActionDef) {
|
if (isRoleIntoActionDef) {
|
||||||
actionDefButton.getButton().setVisible(true);
|
actionDefButton.getButton().setVisible(true);
|
||||||
actionListBasePanel.setVisible(true);
|
actionListBasePanel.setVisible(true);
|
||||||
|
@ -140,11 +147,16 @@ public class ActionListPanel extends Composite {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setAllActionsVisible(boolean bool) {
|
private void setAllActionsVisible(boolean bool) {
|
||||||
|
|
||||||
|
if (mapPhaseListButtons != null && mapPhaseListButtons.values().size() > 0) {
|
||||||
|
|
||||||
Iterator<List<ActionDefButton>> collIterator = mapPhaseListButtons.values().iterator();
|
Iterator<List<ActionDefButton>> collIterator = mapPhaseListButtons.values().iterator();
|
||||||
|
if (collIterator != null) {
|
||||||
while (collIterator.hasNext()) {
|
while (collIterator.hasNext()) {
|
||||||
List<ActionDefButton> listButton = collIterator.next();
|
List<ActionDefButton> listButton = collIterator.next();
|
||||||
for (ActionDefButton actionDefButton : listButton) {
|
for (ActionDefButton actionDefButton : listButton) {
|
||||||
|
@ -154,3 +166,5 @@ public class ActionListPanel extends Composite {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -143,6 +143,9 @@ public class ItemsTable<T extends DocumentDV> extends AbstractItemsCellTable<T>
|
||||||
String key = itemField.getJsonFields().get(0)
|
String key = itemField.getJsonFields().get(0)
|
||||||
.replace(ConstantsGeoPortalDataEntryApp.DEFAULT_DOCUMENT_PROJECTION_NAME + ".", "");
|
.replace(ConstantsGeoPortalDataEntryApp.DEFAULT_DOCUMENT_PROJECTION_NAME + ".", "");
|
||||||
Object value = documentDV.getDocumentAsMap().get(key);
|
Object value = documentDV.getDocumentAsMap().get(key);
|
||||||
|
if(value==null)
|
||||||
|
return "";
|
||||||
|
|
||||||
return value.toString();
|
return value.toString();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
GWT.log("Error e: " + e);
|
GWT.log("Error e: " + e);
|
||||||
|
@ -165,6 +168,9 @@ public class ItemsTable<T extends DocumentDV> extends AbstractItemsCellTable<T>
|
||||||
Object value = documentDV.getDocumentAsMap().get(key);
|
Object value = documentDV.getDocumentAsMap().get(key);
|
||||||
// GWT.log("key: "+key+" is instance of: "+value.getClass());
|
// GWT.log("key: "+key+" is instance of: "+value.getClass());
|
||||||
|
|
||||||
|
if(value==null)
|
||||||
|
return;
|
||||||
|
|
||||||
if (value instanceof ArrayList) {
|
if (value instanceof ArrayList) {
|
||||||
ArrayList<Object> arrayValues = (ArrayList<Object>) value;
|
ArrayList<Object> arrayValues = (ArrayList<Object>) value;
|
||||||
String toReturn = "<ul>";
|
String toReturn = "<ul>";
|
||||||
|
|
Loading…
Reference in New Issue