Skip to content

Commit

Permalink
Migrate DIP and DIP files REST
Browse files Browse the repository at this point in the history
  • Loading branch information
hmiguim committed Jun 12, 2024
1 parent c7d01e1 commit 45ef086
Show file tree
Hide file tree
Showing 93 changed files with 2,382 additions and 2,292 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,9 @@ public enum DateGranularity {
// files
public static final String API_REST_V2_FILES = "api/v2/files/";

// dips
public static final String API_REST_V2_DIPS = "api/v2/dips/";

// representation-information
public static final String API_REST_V2_REPRESENTATION_INFORMATION = "api/v2/representation-information/";

Expand All @@ -372,6 +375,12 @@ public enum DateGranularity {
// members
public static final String API_REST_V2_MEMBERS = "api/v2/members/";

// disposal confirmation
public static final String API_REST_V2_DISPOSAL_CONFIRMATION = "api/v2/disposal/confirmations/";
public static final String API_REST_V2_DISPOSAL_CONFIRMATION_REPORT = "report";
public static final String API_REST_V2_DISPOSAL_CONFIRMATION_REPORT_HTML = "html";
public static final String API_REST_V2_DISPOSAL_CONFIRMATION_QUERY_PARAM_TO_PRINT = "to-print";

// themes
public static final String API_REST_V2_THEME = "api/v2/themes";
public static final String API_V2_QUERY_PARAM_RESOURCE_ID = "resource-id";
Expand Down Expand Up @@ -648,6 +657,7 @@ public String toString() {
public static final String CONTROLLER_DIP_PARAM = RODA_OBJECT_DIP;
public static final String CONTROLLER_DIPS_PARAM = RODA_OBJECT_DIPS;
public static final String CONTROLLER_DIP_ID_PARAM = "dipId";
public static final String CONTROLLER_DIP_UUID_PARAM = "dipUUID";
public static final String CONTROLLER_DIP_FILE_ID_PARAM = "dipFileId";
public static final String CONTROLLER_DIP_FILE_UUID_PARAM = "dipFileUUID";
public static final String CONTROLLER_AGENT_ID_PARAM = "agentId";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,27 @@
import org.roda.core.data.v2.index.select.SelectedItems;
import org.roda.core.data.v2.ip.IndexedAIP;

import java.io.Serial;
import java.io.Serializable;

/**
* @author Miguel Guimarães <[email protected]>
*/
public class DisposalConfirmationCreateRequest implements Serializable {

@Serial
private static final long serialVersionUID = -3852472973580068030L;

private String title;
private SelectedItems<IndexedAIP> selectedItems;
private DisposalConfirmationForm form;

public DisposalConfirmationCreateRequest() {
// empty constructor
}

public DisposalConfirmationCreateRequest(String title, SelectedItems<IndexedAIP> selectedItems,
DisposalConfirmationForm form) {
DisposalConfirmationForm form) {
this.title = title;
this.selectedItems = selectedItems;
this.form = form;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
package org.roda.core.data.v2.generics;

/**
* @author Miguel Guimarães <[email protected]>
*/

import org.roda.core.data.v2.index.IsIndexed;
import org.roda.core.data.v2.index.select.SelectedItems;

import java.io.Serial;
import java.io.Serializable;


public class DeleteRequest<T extends IsIndexed> implements Serializable {

@Serial
private static final long serialVersionUID = -6600408657058206155L;

private SelectedItems<T> itemsToDelete;
private String details;

public DeleteRequest() {
// empty constructor
}

public SelectedItems<T> getItemsToDelete() {
return itemsToDelete;
}

public void setItemsToDelete(SelectedItems<T> itemsToDelete) {
this.itemsToDelete = itemsToDelete;
}

public String getDetails() {
return details;
}

public void setDetails(String details) {
this.details = details;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
package org.roda.core.data.v2.generics;

import java.io.Serial;
import java.io.Serializable;

import org.roda.core.data.v2.index.IsIndexed;
import org.roda.core.data.v2.index.select.SelectedItems;
import org.roda.core.data.v2.ip.Permissions;

/**
* @author Miguel Guimarães <[email protected]>
*/
public class UpdatePermissionsRequest<T extends IsIndexed> implements Serializable {
@Serial
private static final long serialVersionUID = -3807428982711600007L;

private SelectedItems<T> itemsToUpdate;
private String details;
private Permissions permissions;
private boolean recursive;

public UpdatePermissionsRequest() {
// empty constructor
}

public SelectedItems<T> getItemsToUpdate() {
return itemsToUpdate;
}

public void setItemsToUpdate(SelectedItems<T> itemsToUpdate) {
this.itemsToUpdate = itemsToUpdate;
}

public String getDetails() {
return details;
}

public void setDetails(String details) {
this.details = details;
}

public Permissions getPermissions() {
return permissions;
}

public void setPermissions(Permissions permissions) {
this.permissions = permissions;
}

public boolean isRecursive() {
return recursive;
}

public void setRecursive(boolean recursive) {
this.recursive = recursive;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
*/
package org.roda.core.data.v2.index.filter;

import java.io.Serial;
import java.util.List;

public abstract class FiltersParameters extends FilterParameter {
@Serial
private static final long serialVersionUID = -7444113772637341849L;

private List<FilterParameter> values = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
*/
package org.roda.core.data.v2.index.filter;

import java.io.Serial;
import java.util.List;

public class OrFiltersParameters extends FiltersParameters {
@Serial
private static final long serialVersionUID = -7444113772637341849L;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
*/
package org.roda.core.data.v2.index.filter;

import java.io.Serial;
import java.io.Serializable;

/**
* @author Rui Castro
* @author Luis Faria <[email protected]>
*/
public abstract class RangeFilterParameter<T extends Serializable> extends FilterParameter {
@Serial
private static final long serialVersionUID = -2923383960685420739L;

private T fromValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@
*/
package org.roda.core.data.v2.index.filter;

import java.io.Serial;

/**
* @author Rui Castro
*
*/
public class SimpleFilterParameter extends FilterParameter {
@Serial
private static final long serialVersionUID = -2122986808484304112L;

private String value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
package org.roda.core.data.v2.ip;

import java.io.Serial;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
Expand All @@ -27,6 +28,7 @@
@JsonInclude(JsonInclude.Include.NON_NULL)
public class AIP implements IsModelObject, HasId, HasState, HasPermissions, HasDisposal, HasInstanceID {

@Serial
private static final long serialVersionUID = 430629679119752757L;
private static final int VERSION = 1;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@
*/
package org.roda.core.data.v2.ip;

import java.io.Serial;
import java.io.Serializable;

public class AIPLink implements Serializable {

@Serial
private static final long serialVersionUID = 6222816570283361558L;
private String aipId;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
package org.roda.core.data.v2.ip;

import java.io.Serial;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
Expand All @@ -24,6 +25,7 @@
@JsonInclude(JsonInclude.Include.NON_NULL)
public class DIP implements IsModelObject, HasId, HasPermissions, HasInstanceID {

@Serial
private static final long serialVersionUID = -7335470043357396783L;
private static final int VERSION = 1;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
package org.roda.core.data.v2.ip;

import java.io.Serial;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
Expand All @@ -23,6 +24,7 @@
@jakarta.xml.bind.annotation.XmlRootElement(name = RodaConstants.RODA_OBJECT_DIPFILE)
public class DIPFile implements IsModelObject, IsIndexed, HasId, SetsUUID, HasPermissionFilters {

@Serial
private static final long serialVersionUID = 1L;
private static final int VERSION = 1;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ public class IndexedAIP
private AIPState state;

private String type = null;
private String instanceId = null;

private String instanceId = null;
private String instanceName = null;
private boolean isLocalInstance = false;

private String level = null;
private String title = null;
private Date dateInitial = null;
Expand Down Expand Up @@ -563,7 +565,7 @@ public AIPDisposalScheduleAssociationType getScheduleAssociationType() {
return scheduleAssociationType;
}

public IndexedAIP setDisposalScheduleAssociationType(AIPDisposalScheduleAssociationType scheduleAssociationType) {
public IndexedAIP setScheduleAssociationType(AIPDisposalScheduleAssociationType scheduleAssociationType) {
this.scheduleAssociationType = scheduleAssociationType;
return this;
}
Expand Down Expand Up @@ -772,4 +774,12 @@ public String getInstanceName() {
public void setInstanceName(String instanceName) {
this.instanceName = instanceName;
}

public boolean isLocalInstance() {
return isLocalInstance;
}

public void setLocalInstance(boolean localInstance) {
isLocalInstance = localInstance;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
*/
package org.roda.core.data.v2.ip;

import java.io.Serial;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
Expand All @@ -20,8 +21,10 @@
@jakarta.xml.bind.annotation.XmlRootElement(name = RodaConstants.RODA_OBJECT_DIP)
@JsonInclude(JsonInclude.Include.NON_NULL)
public class IndexedDIP extends DIP implements IsIndexed, HasInstanceName {

@Serial
private static final long serialVersionUID = 4188689893034771594L;
private String openExternalURL = "";
private String openExternalURL = null;
private String instanceName = null;

private Map<String, Object> fields;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
*/
package org.roda.core.data.v2.ip;

import java.io.Serial;
import java.io.Serializable;

public class RepresentationLink extends AIPLink implements Serializable {

@Serial
private static final long serialVersionUID = -1203642066028643508L;
private String representationId;

Expand Down
Loading

0 comments on commit 45ef086

Please sign in to comment.