Skip to content
Open
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 @@ -1016,6 +1016,10 @@ SafeHtml searchPreFilterLongRangeFilterParameterGreaterThan(String searchPreFilt

String detailsCreatedBy();

String detailsUpdatedOn();

String detailsUpdatedBy();

String detailsModifiedOn();

String detailsModifiedBy();
Expand Down Expand Up @@ -1312,10 +1316,15 @@ SafeHtml searchPreFilterLongRangeFilterParameterGreaterThan(String searchPreFilt

String representationInformationIntellectualEntities(@PluralCount int size, String link);

String representationInformationIntellectualEntitiesAssociations();

String representationInformationRepresentations(@PluralCount int size, String link);

String representationInformationRepresentationsAssociations();

String representationInformationFiles(@PluralCount int size, String link);

String representationInformationFilesAssociations();
/****** Descriptive Metadata ****/

String metadataType();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
package org.roda.wui.client.browse.tabs;

import java.util.ArrayList;
import java.util.List;

import org.roda.core.data.common.RodaConstants;
import org.roda.core.data.utils.RepresentationInformationUtils;
import org.roda.core.data.v2.index.IsIndexed;
import org.roda.core.data.v2.index.filter.Filter;
import org.roda.core.data.v2.index.filter.FilterParameter;
import org.roda.core.data.v2.index.filter.OrFiltersParameters;
import org.roda.core.data.v2.index.filter.SimpleFilterParameter;
import org.roda.core.data.v2.ip.IndexedAIP;
import org.roda.core.data.v2.ip.IndexedFile;
import org.roda.core.data.v2.ip.IndexedRepresentation;
import org.roda.core.data.v2.ri.RepresentationInformation;
import org.roda.wui.client.common.lists.utils.AsyncTableCellOptions;
import org.roda.wui.client.common.lists.utils.ConfigurableAsyncTableCell;
import org.roda.wui.client.common.lists.utils.ListBuilder;
import org.roda.wui.client.common.search.SearchWrapper;

import com.google.gwt.safehtml.shared.SafeHtmlUtils;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.Widget;

/**
*
* @author Eduardo Teixeira <eteixeira@keep.pt>
*/
public class BrowseRepresentationInformationTabs extends Tabs {
public void init(RepresentationInformation ri) {

List<FilterParameter> aipParams = new ArrayList<>();
List<FilterParameter> representationParams = new ArrayList<>();
List<FilterParameter> fileParams = new ArrayList<>();
initEntityFilters(ri, aipParams, representationParams, fileParams);

createAndAddTab(SafeHtmlUtils.fromSafeConstant(messages.detailsTab()), new TabContentBuilder() {
@Override
public Widget buildTabWidget() {
return new DetailsTab(ri);
}
});

createAndAddTab(SafeHtmlUtils.fromString(messages.representationInformationIntellectualEntitiesAssociations()),
() -> buildAssociationsTab(IndexedAIP.class, aipParams, "Search_AIPs"));

createAndAddTab(SafeHtmlUtils.fromString(messages.representationInformationRepresentationsAssociations()),
() -> buildAssociationsTab(IndexedRepresentation.class, representationParams, "Search_representations"));

createAndAddTab(SafeHtmlUtils.fromString(messages.representationInformationFilesAssociations()),
() -> buildAssociationsTab(IndexedFile.class, fileParams, "Search_files"));
}

private void initEntityFilters(RepresentationInformation ri, List<FilterParameter> aipParams,
List<FilterParameter> representationParams, List<FilterParameter> fileParams) {
for (String filter : ri.getFilters()) {
String[] parts = filter.split(RepresentationInformationUtils.REPRESENTATION_INFORMATION_FILTER_SEPARATOR);
if (parts.length < 3) {
continue;
}

if (RodaConstants.INDEX_AIP.equals(parts[0])) {
aipParams.add(new SimpleFilterParameter(parts[1], parts[2]));
} else if (RodaConstants.INDEX_REPRESENTATION.equals(parts[0])) {
representationParams.add(new SimpleFilterParameter(parts[1], parts[2]));
} else if (RodaConstants.INDEX_FILE.equals(parts[0])) {
fileParams.add(new SimpleFilterParameter(parts[1], parts[2]));
}
}
}

private <T extends IsIndexed> Widget buildAssociationsTab(Class<T> clazz, List<FilterParameter> params,
String listId) {

if (params == null || params.isEmpty()) {
if (IndexedAIP.class.equals(clazz)) {
return buildEmptyAssociationsCardLikeTab(messages.representationInformationIntellectualEntities(0, ""));
}
if (IndexedRepresentation.class.equals(clazz)) {
return buildEmptyAssociationsCardLikeTab(messages.representationInformationRepresentations(0, ""));
}
return buildEmptyAssociationsCardLikeTab(messages.representationInformationFiles(0, ""));
}
Filter filter = new Filter(new OrFiltersParameters(params));

ListBuilder<T> listBuilder = new ListBuilder<>(() -> new ConfigurableAsyncTableCell<>(),
new AsyncTableCellOptions<>(clazz, listId).withFilter(filter).withJustActive(false).bindOpener());

return new SearchWrapper(false).createListAndSearchPanel(listBuilder);
}

private Widget buildEmptyAssociationsCardLikeTab(String messageHtml) {
FlowPanel card = new FlowPanel();
card.addStyleName("roda6CardWithHeader");
card.addStyleName("wrapper");
card.addStyleName("skip_padding");

FlowPanel body = new FlowPanel();
body.addStyleName("cardBody");

SimplePanel info = new SimplePanel();
info.addStyleName("table-empty-inner");
HTML label = new HTML(messageHtml);
label.addStyleName("table-empty-inner-label");
info.setWidget(label);

body.add(info);
card.add(body);
return card;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@

import org.roda.core.data.v2.ip.IndexedFile;
import org.roda.core.data.v2.ip.TransferredResource;
import org.roda.core.data.v2.ri.RepresentationInformation;
import org.roda.wui.client.common.model.BrowseAIPResponse;
import org.roda.wui.client.common.model.BrowseRepresentationResponse;
import org.roda.wui.client.planning.DetailsPanelRepresentationInformation;
import org.roda.wui.client.ingest.transfer.DetailsPanelTransferredResource;
import org.roda.wui.client.planning.DetailsPanelAIP;
import org.roda.wui.client.planning.DetailsPanelFile;
Expand Down Expand Up @@ -58,6 +60,13 @@ public DetailsTab(IndexedFile file, List<String> riRules) {
content.add(detailsPanel);
}

public DetailsTab(RepresentationInformation ri){
initWidget(uiBinder.createAndBindUi(this));

DetailsPanelRepresentationInformation detailsPanel = new DetailsPanelRepresentationInformation(ri);
content.add(detailsPanel);
}

public DetailsTab(TransferredResource resource) {
initWidget(uiBinder.createAndBindUi(this));

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package org.roda.wui.client.common;

import java.util.List;

import org.roda.core.data.v2.ri.RepresentationInformation;
import org.roda.wui.client.common.actions.RepresentationInformationActions;
import org.roda.wui.client.common.actions.model.ActionableObject;
import org.roda.wui.client.common.actions.widgets.ActionableWidgetBuilder;

/**
*
* @author Eduardo Teixeira <eteixeira@keep.pt>
*/
public class BrowseRepresentationInformationActionsToolbar
extends BrowseObjectActionsToolbar<RepresentationInformation> {
public void buildIcon() {
setIcon(null);
}

public void buildTags() {
// do nothing
}

public void buildActions() {
this.actions.clear();
RepresentationInformationActions representationInformationActions;
representationInformationActions = RepresentationInformationActions.get();
this.actions.add(new ActionableWidgetBuilder<RepresentationInformation>(representationInformationActions)
.buildGroupedListWithObjects(new ActionableObject<>(object), List.of(),
List.of(RepresentationInformationActions.RepresentationInformationAction.START_PROCESS)));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@

import config.i18n.client.ClientMessages;

import javax.naming.Context;

public class RepresentationInformationActions extends AbstractActionable<RepresentationInformation> {
private static final RepresentationInformationActions INSTANCE = new RepresentationInformationActions();
private static final ClientMessages messages = GWT.create(ClientMessages.class);
Expand Down Expand Up @@ -328,7 +326,7 @@ public ActionableBundle<RepresentationInformation> createActionsBundle() {
ActionableBundle<RepresentationInformation> formatActionableBundle = new ActionableBundle<>();

// MANAGEMENT
ActionableGroup<RepresentationInformation> managementGroup = new ActionableGroup<>(messages.sidebarActionsTitle());
ActionableGroup<RepresentationInformation> managementGroup = new ActionableGroup<>(messages.manage(), "btn-edit");
managementGroup.addButton(messages.newButton(), RepresentationInformationAction.NEW, ActionImpact.UPDATED,
"btn-plus-circle");
managementGroup.addButton(messages.createNewRepresentationInformation(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2556,6 +2556,7 @@ td.datePickerMonth, td.datePickerYear {
.main .wui-breadcrumbPanel .breadcrumb-root {
color: COLOR_PRIMARY;
font-weight: bold;
max-width: none !important;
}

.main .wui-breadcrumbPanel .breadcrumb-last {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,14 @@
import org.roda.core.data.v2.ip.IndexedFile;
import org.roda.core.data.v2.ip.IndexedRepresentation;
import org.roda.core.data.v2.ip.TransferredResource;
import org.roda.core.data.v2.ri.RepresentationInformation;
import org.roda.wui.client.browse.BrowseTop;
import org.roda.wui.client.browse.PreservationEvents;
import org.roda.wui.client.disposal.DisposalDestroyedRecords;
import org.roda.wui.client.ingest.appraisal.IngestAppraisal;
import org.roda.wui.client.ingest.transfer.IngestTransfer;
import org.roda.wui.client.planning.RepresentationInformationNetwork;
import org.roda.wui.client.planning.ShowRepresentationInformation;
import org.roda.wui.common.client.tools.DescriptionLevelUtils;
import org.roda.wui.common.client.tools.HistoryUtils;
import org.roda.wui.common.client.tools.ListUtils;
Expand Down Expand Up @@ -352,6 +355,23 @@ public static List<BreadcrumbItem> getTransferredResourceBreadcrumbs(Transferred
return ret;
}

public static List<BreadcrumbItem> getRepresentationInformationBreadCrumbs(RepresentationInformation ri){
List<BreadcrumbItem> ret = new ArrayList<>();
ret.add(new BreadcrumbItem(
SafeHtmlUtils.fromSafeConstant(messages.representationInformationTitle()),
messages.representationInformationTitle(),
RepresentationInformationNetwork.RESOLVER.getHistoryPath()));

if (ri != null) {
List<String> path = new ArrayList<>(ShowRepresentationInformation.RESOLVER.getHistoryPath());
path.add(ri.getUUID());
String label = ri.getName() != null ? ri.getName() : ri.getId();
ret.add(new BreadcrumbItem(SafeHtmlUtils.fromString(label), label, path));
}

return ret;
}

public static List<BreadcrumbItem> getDipBreadcrumbs(IndexedDIP dip, DIPFile dipFile,
List<DIPFile> dipFileAncestors) {
List<BreadcrumbItem> ret = new ArrayList<>();
Expand Down
Loading
Loading