Skip to content

Commit

Permalink
Rename Userprofile to ConversionProfile; apply changes to remaning
Browse files Browse the repository at this point in the history
  • Loading branch information
hmiguim committed Feb 14, 2024
1 parent 4dbce29 commit b433e18
Show file tree
Hide file tree
Showing 15 changed files with 96 additions and 94 deletions.
14 changes: 7 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<url>https://roda.keep.pt/</url>
<groupId>org.roda-project</groupId>
<artifactId>roda</artifactId>
<version>5.4.0-SNAPSHOT</version>
<version>5.5.0-SNAPSHOT</version>
<packaging>pom</packaging>
<description>RODA is a full-featured open-source digital preservation repository providing all the
functionality
Expand Down Expand Up @@ -618,34 +618,34 @@
<groupId>org.roda-project</groupId>
<artifactId>roda-common-data</artifactId>
<classifier>sources</classifier>
<version>5.4.0-SNAPSHOT</version>
<version>5.5.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.roda-project</groupId>
<artifactId>roda-common-data</artifactId>
<version>5.4.0-SNAPSHOT</version>
<version>5.5.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.roda-project</groupId>
<artifactId>roda-common-utils</artifactId>
<version>5.4.0-SNAPSHOT</version>
<version>5.5.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.roda-project</groupId>
<artifactId>roda-core</artifactId>
<version>5.4.0-SNAPSHOT</version>
<version>5.5.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.roda-project</groupId>
<artifactId>roda-core-tests</artifactId>
<version>5.4.0-SNAPSHOT</version>
<version>5.5.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.roda-project</groupId>
<artifactId>roda-core-tests</artifactId>
<type>test-jar</type>
<scope>test</scope>
<version>5.4.0-SNAPSHOT</version>
<version>5.5.0-SNAPSHOT</version>
</dependency>
<!-- RODA own modules dependencies - end -->
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion roda-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.roda-project</groupId>
<artifactId>roda</artifactId>
<version>5.4.0-SNAPSHOT</version>
<version>5.5.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion roda-common/roda-common-data/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>org.roda-project</groupId>
<artifactId>roda-common</artifactId>
<version>5.4.0-SNAPSHOT</version>
<version>5.5.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

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

import java.io.Serial;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
* @author António Lindo <[email protected]>
*/
public class UserProfile implements Serializable {
public class ConversionProfile implements Serializable {
@Serial
private static final long serialVersionUID = -117396300862413045L;
private String title;
private String profile;
private String description;
private boolean dissemination;
private boolean representation;
private boolean canBeUsedForDissemination;
private boolean canBeUsedForRepresentation;
private Map<String, String> options;

public UserProfile() {
public ConversionProfile() {
options = new HashMap<>();
}

public void setTitle(String title) {
this.title = title;
}

public void setProfile(String profile) {
this.profile = profile;
}

public void setDescription(String description) {
this.description = description;
}

public void setOptions(Map<String, String> options) {
this.options = options;
}

public void setHasRepresentation(boolean representation) {
this.representation = representation;
public void setCanBeUsedForRepresentation(boolean representation) {
this.canBeUsedForRepresentation = representation;
}

public void setHasDissemination(boolean dissemination) {
this.dissemination = dissemination;
public void setCanBeUsedForDissemination(boolean dissemination) {
this.canBeUsedForDissemination = dissemination;
}

public boolean isDissemination() {
return dissemination;
public boolean canBeUsedForDissemination() {
return canBeUsedForDissemination;
}

public boolean isRepresentation() {
return representation;
public boolean canBeUsedForRepresentation() {
return canBeUsedForRepresentation;
}

public String getTitle() {
return title;
}

public void setTitle(String title) {
this.title = title;
}

public String getProfile() {
return profile;
}

public void setProfile(String profile) {
this.profile = profile;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

public Map<String, String> getOptions() {
return options;
}

public void setOptions(Map<String, String> options) {
this.options = options;
}
}
2 changes: 1 addition & 1 deletion roda-common/roda-common-utils/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>org.roda-project</groupId>
<artifactId>roda-common</artifactId>
<version>5.4.0-SNAPSHOT</version>
<version>5.5.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<build>
Expand Down
2 changes: 1 addition & 1 deletion roda-core/roda-core-tests/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<parent>
<groupId>org.roda-project</groupId>
<artifactId>roda</artifactId>
<version>5.4.0-SNAPSHOT</version>
<version>5.5.0-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<profiles>
Expand Down
2 changes: 1 addition & 1 deletion roda-core/roda-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.roda-project</groupId>
<artifactId>roda</artifactId>
<version>5.4.0-SNAPSHOT</version>
<version>5.5.0-SNAPSHOT</version>
<relativePath>../..</relativePath>
</parent>
<properties>
Expand Down
2 changes: 1 addition & 1 deletion roda-ui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>org.roda-project</groupId>
<artifactId>roda</artifactId>
<version>5.4.0-SNAPSHOT</version>
<version>5.5.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<packaging>pom</packaging>
Expand Down
2 changes: 1 addition & 1 deletion roda-ui/roda-wui/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>org.roda-project</groupId>
<artifactId>roda-ui</artifactId>
<version>5.4.0-SNAPSHOT</version>
<version>5.5.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,5 @@
<!-- <stylesheet src="Main.css" /> Replaced by MyResources -->
<stylesheet src="../api/v1/theme?resource_id=theme.css" />
<stylesheet src="../api/v1/theme?resource_id=printing.css" />
<!-- <collapse-all-properties />-->
<collapse-all-properties />
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@
<!-- <stylesheet src="Main.css" /> Replaced by MyResources -->
<stylesheet src="../api/v1/theme?resource_id=theme.css" />
<stylesheet src="../api/v1/theme?resource_id=printing.css" />
<!-- <collapse-all-properties />-->
<collapse-all-properties />
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
import org.roda.core.data.exceptions.RequestNotValidException;
import org.roda.core.data.v2.accessKey.AccessKey;
import org.roda.core.data.v2.accessKey.AccessKeys;
import org.roda.core.data.v2.common.ConversionProfile;
import org.roda.core.data.v2.common.Pair;
import org.roda.core.data.v2.common.UserProfile;
import org.roda.core.data.v2.index.IndexResult;
import org.roda.core.data.v2.index.IsIndexed;
import org.roda.core.data.v2.index.facet.Facets;
Expand Down Expand Up @@ -199,7 +199,7 @@ void rejectJob(SelectedItems<Job> jobs, String details) throws RequestNotValidEx

Set<Pair<String, String>> retrieveDropdownPluginItems(String parameterId, String localeString);

Set<UserProfile> retrieveUserProfilePluginItems(String pluginId, String repOrDip, String localeString);
Set<ConversionProfile> retrieveConversionProfilePluginItems(String pluginId, String repOrDip, String localeString);

CreateIngestJobBundle retrieveCreateIngestProcessBundle();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import org.roda.core.data.v2.accessKey.AccessKey;
import org.roda.core.data.v2.accessKey.AccessKeys;
import org.roda.core.data.v2.common.Pair;
import org.roda.core.data.v2.common.UserProfile;
import org.roda.core.data.v2.common.ConversionProfile;
import org.roda.core.data.v2.index.IndexResult;
import org.roda.core.data.v2.index.IsIndexed;
import org.roda.core.data.v2.index.facet.Facets;
Expand Down Expand Up @@ -138,8 +138,8 @@ void createTransferredResourcesFolder(String parent, String folderName, boolean
void retrieveDropdownPluginItems(String parameterId, String localeString,
AsyncCallback<Set<Pair<String, String>>> asyncCallback);

void retrieveUserProfilePluginItems(String pluginId, String repOrDip, String localeString,
AsyncCallback<Set<UserProfile>> asyncCallback);
void retrieveConversionProfilePluginItems(String pluginId, String repOrDip, String localeString,
AsyncCallback<Set<ConversionProfile>> asyncCallback);

void retrieveCreateIngestProcessBundle(AsyncCallback<CreateIngestJobBundle> callback);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@
import config.i18n.client.ClientMessages;
import org.roda.core.data.common.RodaConstants;
import org.roda.core.data.utils.RepresentationInformationUtils;
import org.roda.core.data.v2.common.ConversionProfile;
import org.roda.core.data.v2.common.Pair;
import org.roda.core.data.v2.common.UserProfile;
import org.roda.core.data.v2.ip.AIP;
import org.roda.core.data.v2.ip.File;
import org.roda.core.data.v2.ip.IndexedAIP;
Expand Down Expand Up @@ -486,7 +486,7 @@ public void onSuccess(Set<Pair<String, String>> result) {
}

private FlowPanel createConversionProfileLayout(String repOrDip, String pluginId) {
Set<UserProfile> treeSet = new HashSet<>();
Set<ConversionProfile> treeSet = new HashSet<>();
Label parameterName = new Label("Conversion Profile");
final Label description = new Label();
final ListBox dropdown = new ListBox();
Expand All @@ -497,27 +497,27 @@ private FlowPanel createConversionProfileLayout(String repOrDip, String pluginId
FlowPanel panel = new FlowPanel();
FlowPanel descriptionPanel = new FlowPanel();

BrowserService.Util.getInstance().retrieveUserProfilePluginItems(pluginId, repOrDip,
LocaleInfo.getCurrentLocale().getLocaleName(), new AsyncCallback<Set<UserProfile>>() {
BrowserService.Util.getInstance().retrieveConversionProfilePluginItems(pluginId, repOrDip,
LocaleInfo.getCurrentLocale().getLocaleName(), new AsyncCallback<Set<ConversionProfile>>() {

@Override
public void onFailure(Throwable caught) {
// do nothing
}

@Override
public void onSuccess(Set<UserProfile> result) {
public void onSuccess(Set<ConversionProfile> result) {
treeSet.addAll(result);
for (UserProfile item : treeSet) {
for (ConversionProfile item : treeSet) {
dropdown.addItem(item.getTitle(), item.getProfile());
description.setText(item.getDescription());
description.addStyleName(FORM_HELP);
}

profile = dropdown.getSelectedValue();
for (UserProfile userProfile : treeSet) {
if (userProfile.getProfile().equals(profile)) {
description.setText(userProfile.getDescription());
for (ConversionProfile conversionProfile : treeSet) {
if (conversionProfile.getProfile().equals(profile)) {
description.setText(conversionProfile.getDescription());
break;
}
}
Expand All @@ -526,9 +526,9 @@ public void onSuccess(Set<UserProfile> result) {

dropdown.addChangeHandler(event -> {
profile = dropdown.getSelectedValue();
for (UserProfile userProfile : treeSet) {
if (userProfile.getProfile().equals(profile)) {
description.setText(userProfile.getDescription());
for (ConversionProfile conversionProfile : treeSet) {
if (conversionProfile.getProfile().equals(profile)) {
description.setText(conversionProfile.getDescription());
break;
}
}
Expand All @@ -540,7 +540,7 @@ public void onSuccess(Set<UserProfile> result) {

dropdown.setTitle(OBJECT_BOX);
result.add(parameterName);
addHelp(result, "User profile options");
addHelp(result, "Conversion profile options");
result.add(panel);
result.add(descriptionPanel);
return result;
Expand Down
Loading

0 comments on commit b433e18

Please sign in to comment.