Skip to content
Snippets Groups Projects
Commit 9b51e510 authored by felmer's avatar felmer
Browse files

SSDM-4647: ExternalDms: Attribute permId added

SVN: 37982
parent 2eaeda27
No related branches found
No related tags found
No related merge requests found
......@@ -24,6 +24,7 @@ import org.springframework.stereotype.Component;
import ch.ethz.sis.openbis.generic.asapi.v3.dto.externaldms.ExternalDms;
import ch.ethz.sis.openbis.generic.asapi.v3.dto.externaldms.ExternalDmsAddressType;
import ch.ethz.sis.openbis.generic.asapi.v3.dto.externaldms.fetchoptions.ExternalDmsFetchOptions;
import ch.ethz.sis.openbis.generic.asapi.v3.dto.externaldms.id.ExternalDmsPermId;
import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.AbstractCachingTranslator;
import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.TranslationContext;
import ch.ethz.sis.openbis.generic.server.asapi.v3.translator.TranslationResults;
......@@ -65,6 +66,7 @@ public class ExternalDmsTranslator extends AbstractCachingTranslator<Long, Exter
TranslationResults relations = (TranslationResults) objectRelations;
ExternalDmsBaseRecord baseRecord = relations.get(IExternalDmsBaseTranslator.class, externalDmsId);
result.setPermId(new ExternalDmsPermId(baseRecord.code));
result.setCode(baseRecord.code);
result.setLabel(baseRecord.label);
result.setUrlTemplate(baseRecord.address);
......
......@@ -9,6 +9,7 @@ define([ "stjs", "util/Exceptions" ], function(stjs, exceptions) {
prototype['@type'] = 'as.dto.externaldms.ExternalDms';
constructor.serialVersionUID = 1;
prototype.fetchOptions = null;
prototype.permId = null;
prototype.code = null;
prototype.label = null;
prototype.urlTemplate = null;
......@@ -22,6 +23,12 @@ define([ "stjs", "util/Exceptions" ], function(stjs, exceptions) {
prototype.setFetchOptions = function(fetchOptions) {
this.fetchOptions = fetchOptions;
};
prototype.getPermId = function() {
return this.permId;
};
prototype.setPermId = function(permId) {
this.permId = permId;
};
prototype.getCode = function() {
return this.code;
};
......@@ -62,6 +69,7 @@ define([ "stjs", "util/Exceptions" ], function(stjs, exceptions) {
return "ExternalDms " + this.code;
};
}, {
permId : "ExternalDmsPermId",
fetchOptions : "ExternalDmsFetchOptions",
addressType : "ExternalDmsAddressType"
});
......
......@@ -208,6 +208,7 @@ public abstract class AbstractExternalDmsTest extends AbstractTest
return Objects.equals(edms.getAddress(), another.getAddress()) &&
Objects.equals(edms.getAddressType(), another.getAddressType()) &&
Objects.equals(edms.getCode(), another.getCode()) &&
Objects.equals(edms.getPermId(), another.getPermId()) &&
Objects.equals(edms.getLabel(), another.getLabel()) &&
Objects.equals(edms.getUrlTemplate(), another.getUrlTemplate());
}
......
......@@ -22,6 +22,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import ch.ethz.sis.openbis.generic.asapi.v3.dto.common.interfaces.ICodeHolder;
import ch.ethz.sis.openbis.generic.asapi.v3.dto.externaldms.fetchoptions.ExternalDmsFetchOptions;
import ch.ethz.sis.openbis.generic.asapi.v3.dto.externaldms.id.ExternalDmsPermId;
import ch.systemsx.cisd.base.annotation.JsonObject;
import ch.systemsx.cisd.common.annotation.TechPreview;
......@@ -36,6 +37,9 @@ public class ExternalDms implements Serializable, ICodeHolder
@JsonProperty
private ExternalDmsFetchOptions fetchOptions;
@JsonProperty
private ExternalDmsPermId permId;
@JsonProperty
private String code;
......@@ -66,7 +70,17 @@ public class ExternalDms implements Serializable, ICodeHolder
{
this.fetchOptions = fetchOptions;
}
@JsonIgnore
public ExternalDmsPermId getPermId()
{
return permId;
}
public void setPermId(ExternalDmsPermId permId)
{
this.permId = permId;
}
// Method automatically generated with DtoGenerator
@JsonIgnore
@Override
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment