Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactored LinearizationDefinition #91

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void startPortlet(PortletUi portletUi, WebProtegeEventBus eventBus) {

dispatch.execute(GetLinearizationDefinitionsAction.create(), result -> {
for (LinearizationDefinition definition : result.getDefinitionList()) {
this.definitionMap.put(definition.getWhoficEntityIri(), definition);
this.definitionMap.put(definition.getLinearizationUri(), definition);
}
view.setLinearizationDefinitonMap(this.definitionMap);
handleSetEntity(getSelectedEntity());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public class LinearizationPortletViewImpl extends Composite implements Lineariza
private final TableRefresh tableRefresh = (linearizationTableRow) -> {
flexTable.removeAllRows();
this.tableRowList = this.tableRowList.stream().map(row -> {
if (row.getLinearizationDefinition().getWhoficEntityIri().equalsIgnoreCase(linearizationTableRow.getLinearizationDefinition().getWhoficEntityIri())) {
if (row.getLinearizationDefinition().getLinearizationUri().equalsIgnoreCase(linearizationTableRow.getLinearizationDefinition().getLinearizationUri())) {
return linearizationTableRow;
}
return row;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private void populateEditableLinearizationParent() {
public void populateDerivedLinearizationParents(List<LinearizationTableRow> rows) {
if (isDerived()) {
LinearizationTableRow mainRow = rows.stream()
.filter(linearizationRow -> linearizationRow.linearizationDefinition.getId().equalsIgnoreCase(this.linearizationDefinition.getCoreLinId()))
.filter(linearizationRow -> linearizationRow.linearizationDefinition.getLinearizationId().equalsIgnoreCase(this.linearizationDefinition.getCoreLinId()))
.findFirst()
.orElseThrow(() -> {
logger.info("Couldn't find parent with id " + linearizationDefinition.getCoreLinId());
Expand Down Expand Up @@ -183,7 +183,7 @@ public LinearizationSpecification asLinearizationSpecification() {
this.isPartOfCheckbox.getValue().getValue(),
this.parentIri,
this.linearizationDefinition.getSortingCode(),
this.linearizationDefinition.getWhoficEntityIri(),
this.linearizationDefinition.getLinearizationUri(),
this.commentsWidget.getText()
);
return response;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ remove the orElseGet() and add back the orElseThrow() when we have proper labels
dispatch.execute(GetLinearizationDefinitionsAction.create(), definitionsResult -> {
Map<String, LinearizationDefinition> definitionMap = new HashMap<>();
for (LinearizationDefinition definition : definitionsResult.getDefinitionList()) {
definitionMap.put(definition.getWhoficEntityIri(), definition);
definitionMap.put(definition.getLinearizationUri(), definition);
}
view.setLinearizationDefinitonMap(definitionMap);
view.initializeTable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ private Optional<WhoficEntityPostCoordinationSpecification> createEditedSpec() {
WhoficEntityPostCoordinationSpecification specification = new WhoficEntityPostCoordinationSpecification(entityIri, "ICD", new ArrayList<>());
boolean somethingChanged = false;
for (PostCoordinationTableRow tableRow : this.tableRows) {
PostCoordinationSpecification postCoordinationSpecification = new PostCoordinationSpecification(tableRow.getLinearizationDefinition().getWhoficEntityIri(),
PostCoordinationSpecification postCoordinationSpecification = new PostCoordinationSpecification(tableRow.getLinearizationDefinition().getLinearizationUri(),
new ArrayList<>(),
new ArrayList<>(),
new ArrayList<>(),
Expand Down Expand Up @@ -260,7 +260,7 @@ private void bindCellsToParentCells(){
for(PostCoordinationTableRow row : this.tableRows) {
if(!row.isDerived()) {
for(PostCoordinationTableRow childRow : this.tableRows) {
if(childRow.isDerived() && childRow.getLinearizationDefinition().getCoreLinId().equalsIgnoreCase(row.getLinearizationDefinition().getId())) {
if(childRow.isDerived() && childRow.getLinearizationDefinition().getCoreLinId().equalsIgnoreCase(row.getLinearizationDefinition().getLinearizationId())) {
for(PostCoordinationTableCell parentCell: row.getCellList()) {
for(PostCoordinationTableCell childCell: childRow.getCellList()) {
if(parentCell.getAxisLabel().getPostCoordinationAxis().equalsIgnoreCase(childCell.getAxisLabel().getPostCoordinationAxis())) {
Expand Down Expand Up @@ -340,7 +340,7 @@ public void setTableData(WhoficEntityPostCoordinationSpecification whoficSpecifi
for (PostCoordinationTableCell cell : row.getCellList()) {
PostCoordinationSpecification specification = whoficSpecification.getPostCoordinationSpecifications().stream()
.filter(spec -> spec.getLinearizationView()
.equalsIgnoreCase(cell.getLinearizationDefinition().getWhoficEntityIri()))
.equalsIgnoreCase(cell.getLinearizationDefinition().getLinearizationUri()))
.findFirst()
.orElse(null);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@

@GwtCompatible(serializable = true)
public class LinearizationDefinition implements IsSerializable, Serializable {
private String id;
private String linearizationId;

private String whoficEntityIri;
private String linearizationUri;

private String linearizationMode;

Expand All @@ -30,28 +30,28 @@ private LinearizationDefinition() {
}

@JsonCreator
public LinearizationDefinition(@JsonProperty("Id") String id,
@JsonProperty("whoficEntityIri") String whoficEntityIri,
public LinearizationDefinition(@JsonProperty("linearizationId") String linearizationId,
@JsonProperty("linearizationUri") String linearizationUri,
@JsonProperty("linearizationMode") String linearizationMode,
@JsonProperty("rootId") String rootId,
@JsonProperty("DisplayLabel") String displayLabel,
@JsonProperty("displayLabel") String displayLabel,
@JsonProperty("coreLinId") String coreLinId,
@JsonProperty("sortingCode") String sortingCode) {
this.id = id;
this.whoficEntityIri = whoficEntityIri;
this.linearizationId = linearizationId;
this.linearizationUri = linearizationUri;
this.linearizationMode = linearizationMode;
this.rootId = rootId;
this.coreLinId = coreLinId;
this.sortingCode = sortingCode;
this.displayLabel = displayLabel;
}

public String getId() {
return id;
public String getLinearizationId() {
return linearizationId;
}

public String getWhoficEntityIri() {
return whoficEntityIri;
public String getLinearizationUri() {
return linearizationUri;
}

public String getLinearizationMode() {
Expand All @@ -77,8 +77,8 @@ public String getDisplayLabel() {
@Override
public String toString() {
return "LinearizationDefinition{" +
"id='" + id + '\'' +
", whoficEntityIri='" + whoficEntityIri + '\'' +
"linearizationId='" + linearizationId + '\'' +
", linearizationUri='" + linearizationUri + '\'' +
", linearizationMode='" + linearizationMode + '\'' +
", rootId='" + rootId + '\'' +
", coreLinId='" + coreLinId + '\'' +
Expand Down
Loading