Skip to content

Commit

Permalink
Update plugin not installed section
Browse files Browse the repository at this point in the history
  • Loading branch information
hmiguim committed May 3, 2024
1 parent 2cfa624 commit 941058b
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
package org.roda.core.data.v2.jobs;

import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;

Expand All @@ -27,7 +29,7 @@ public class MarketInfo implements Serializable {
private String id = null;
@JsonProperty("name")
private String name = null;
//plugin, service, component
// plugin, service, component
@JsonProperty("type")
private String type = null;
@JsonProperty("version")
Expand All @@ -45,6 +47,8 @@ public class MarketInfo implements Serializable {
private Vendor vendor = new Vendor();
@JsonProperty("compatibility")
private List<String> compatibility = null;
@JsonProperty("linkToQuote")
private Map<String, String> linkToQuote = new HashMap<>();

public MarketInfo() {
}
Expand All @@ -64,16 +68,20 @@ public String getName() {
public void setName(String name) {
this.name = name;
}
public String getType(){

public String getType() {
return type;
}
public void setType(String type){

public void setType(String type) {
this.type = type;
}

@JsonIgnore
public PluginType getPluginType() {
return pluginProperties.getType();
}

@JsonIgnore
public void setPluginType(PluginType type) {
this.pluginProperties.setType(type);
Expand All @@ -94,18 +102,22 @@ public String getDescription() {
public void setDescription(String description) {
this.description = description;
}

@JsonIgnore
public List<String> getCategories() {
return pluginProperties.getCategories();
}

@JsonIgnore
public void setCategories(List<String> categories) {
this.pluginProperties.setCategories(categories);
}

@JsonIgnore
public Set<String> getObjectClasses() {
return pluginProperties.getObjectClasses();
}

@JsonIgnore
public void setObjectClasses(Set<String> objectClasses) {
this.pluginProperties.setObjectClasses(objectClasses);
Expand Down Expand Up @@ -146,10 +158,12 @@ public Vendor getVendor() {
public void setVendor(Vendor vendor) {
this.vendor = vendor;
}

@JsonIgnore
public String getVendorName() {
return vendor.getName();
}

@JsonIgnore
public void setVendorName(String vendor) {
this.vendor.setName(vendor);
Expand All @@ -171,24 +185,34 @@ public void setCompatibility(List<String> compatibility) {
this.compatibility = compatibility;
}

public Map<String, String> getLinkToQuote() {
return linkToQuote;
}

public void setLinkToQuote(Map<String, String> linkToQuote) {
this.linkToQuote = linkToQuote;
}

@Override
public boolean equals(Object o) {
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
MarketInfo that = (MarketInfo) o;
return Objects.equals(id, that.id) && Objects.equals(name, that.name) && pluginProperties.getType() == that.pluginProperties.getType()
&& Objects.equals(version, that.version) && Objects.equals(description, that.description)
&& Objects.equals(pluginProperties.getCategories(), that.pluginProperties.getCategories()) && Objects.equals(pluginProperties.getObjectClasses(), that.pluginProperties.getObjectClasses())
return Objects.equals(id, that.id) && Objects.equals(name, that.name)
&& pluginProperties.getType() == that.pluginProperties.getType() && Objects.equals(version, that.version)
&& Objects.equals(description, that.description)
&& Objects.equals(pluginProperties.getCategories(), that.pluginProperties.getCategories())
&& Objects.equals(pluginProperties.getObjectClasses(), that.pluginProperties.getObjectClasses())
&& Objects.equals(license, that.license) && Objects.equals(installation, that.installation)
&& Objects.equals(homepage, that.homepage) && Objects.equals(vendor, that.vendor)
&& Objects.equals(compatibility, that.compatibility);
}

@Override
public int hashCode() {
return Objects.hash(id, name, pluginProperties.getType(), version, description, pluginProperties.getCategories(), pluginProperties.getCategories(), license, installation,
homepage, vendor, compatibility);
return Objects.hash(id, name, pluginProperties.getType(), version, description, pluginProperties.getCategories(),
pluginProperties.getCategories(), license, installation, homepage, vendor, compatibility);
}
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.http.client.URL;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
Expand Down Expand Up @@ -616,8 +617,8 @@ private void buildPluginStatusPanel() {
MarketInfo marketInfo = selectedPlugin.getMarketInfo();
Button installBtn = new Button(messages.marketStoreInstallLabel());
installBtn.addStyleName("btn btn-download plugin-install-btn");
if (marketInfo != null && marketInfo.getInstallation() != null) {
installBtn.addClickHandler(clickEvent -> Window.open(marketInfo.getInstallation(), "_blank", ""));
if (marketInfo != null && marketInfo.getLinkToQuote().get("en") != null) {
installBtn.addClickHandler(clickEvent -> Window.open(marketInfo.getLinkToQuote().get("en") + URL.encodeQueryString(marketInfo.getName()), "_blank", ""));
} else {
installBtn.addClickHandler(clickEvent -> Window.open(RodaConstants.DEFAULT_MARKET_SUPPORT_URL, "_blank", ""));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.http.client.URL;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
Expand Down Expand Up @@ -599,8 +600,8 @@ private void buildPluginStatusPanel() {
MarketInfo marketInfo = selectedPlugin.getMarketInfo();
Button installBtn = new Button(messages.marketStoreInstallLabel());
installBtn.addStyleName("btn btn-download plugin-install-btn");
if (marketInfo != null && marketInfo.getInstallation() != null) {
installBtn.addClickHandler(clickEvent -> Window.open(marketInfo.getInstallation(), "_blank", ""));
if (marketInfo != null && marketInfo.getLinkToQuote().get("en") != null) {
installBtn.addClickHandler(clickEvent -> Window.open(marketInfo.getLinkToQuote().get("en") + URL.encodeQueryString(marketInfo.getName()), "_blank", ""));
} else {
installBtn.addClickHandler(clickEvent -> Window.open(RodaConstants.DEFAULT_MARKET_SUPPORT_URL, "_blank", ""));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,7 @@ pluginLicenseStatus:{0}
pluginLicenseStatus[INTERNAL]:Built-in
pluginLicenseStatus[VERIFIED]:Verified
pluginLicenseStatus[NOT_VERIFIED]:Not verified
pluginNotInstalledMessage:Please select the "Install" button for more information on how to install this action.
pluginNotInstalledMessage:Please select the "Get" button for more information on how to get this action.
pluginInternalMessage:This action is part of RODA.
pluginTrustedMessage:Developed by <strong>{0}</strong> and licensed to <strong>{1}</strong>
pluginUntrustedMessage:Publisher is unknown or it cannot be verified. <strong>For security reasons this action cannot be run.</strong>
Expand Down Expand Up @@ -1683,7 +1683,7 @@ accessKeyRegenerateConfirmationMessage:Are you sure you want to regenerate this
marketPluginsActionsTabLabel:Actions
marketVersionLabel:Version {0} available in the store
marketTabLabel:Marketplace
marketStoreInstallLabel:Install
marketStoreInstallLabel:Get
# Descriptive metatada lock to edit
editDescMetadataLockedTitle: Unable to edit descriptive metadata
editDescMetadataLockedText: Intellectual entity is currently being edited by another user
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1173,7 +1173,7 @@ pluginLicenseStatus:{0}
pluginLicenseStatus[INTERNAL]:Incorporado
pluginLicenseStatus[VERIFIED]:Verificado
pluginLicenseStatus[NOT_VERIFIED]:Não verificado
pluginNotInstalledMessage:Por favor selecione o botão "Instalar" para mais informações de como instalar esta ação.
pluginNotInstalledMessage:Por favor selecione o botão "Obter" para mais informações de como obter esta ação.
pluginInternalMessage:Esta ação faz parte do RODA.
pluginTrustedMessage:Desenvolvido por <strong>{0}</strong> e licencidado para <strong>{1}</strong>
pluginUntrustedMessage:O editor de software é desconhecido ou não é possível ser verificado. <strong>Por razões de seguraça esta ação não pode ser executada.</strong>
Expand Down Expand Up @@ -1619,7 +1619,7 @@ accessKeyRegenerateConfirmationMessage:Tem a certeza de que deseja regerar o tok
marketPluginsActionsTabLabel:Ações
marketVersionLabel:Versão {0} disponível no Marketplace
marketTabLabel:Marketplace
marketStoreInstallLabel:Instalar
marketStoreInstallLabel:Obter
# Descriptive metatada lock to edit
editDescMetadataLockedTitle: Não é possível editar a metainformação descritiva
editDescMetadataLockedText: Entidade intelectual está atualmente a ser editada por outro utilizador
Expand Down
6 changes: 6 additions & 0 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ if [[ -z "$RELEASE_VERSION" ]]; then
exit 1
fi

docker pull docker.labs.keep.pt/bu/digitalpreservation/dev/market-info-generator:1
docker run -it -e GITLAB_PRIVATE_TOKEN=${GITLAB_PRIVATE_TOKEN} -v /tmp/market-info:/tmp/target docker.labs.keep.pt/bu/digitalpreservation/dev/market-info-generator:1 -o /tmp/target
cp /tmp/market-info/marketInfo.jsonl roda-core/roda-core/src/main/resources/config/market/marketInfo.jsonl

exit 0

cat << EOF
################################
# Release version
Expand Down

0 comments on commit 941058b

Please sign in to comment.