From d3954ecd71b62d8c996a4ca339618f476abdfc41 Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Wed, 4 May 2022 15:15:54 +0200 Subject: [PATCH] [#23258] Implemented the requirement described in #23156 --- CHANGELOG.md | 1 + .../client/CheckConfigsUxController.java | 19 +++-- .../client/CkanContentModeratorService.java | 13 ++- .../CkanContentModeratorServiceAsync.java | 32 ++++++++ .../client/CkanContentModeratorWidget.java | 12 +-- .../CkanContentModeratorWidgetController.java | 61 +++++++++++--- .../CkanContentModeratorWidgetTrusted.java | 2 +- .../client/events/ShowItemEvent.java | 14 +++- .../client/ui/MainTabPanel.java | 39 ++++----- .../client/ui/table/ItemsTable.java | 2 +- .../CkanContentModeratorServiceImpl.java | 80 +++++++++++++++---- 11 files changed, 211 insertions(+), 64 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3410cc5..7cef2f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,3 +11,4 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - [#20650] Provided moderator skills to Catalogue Moderator(s) - [#23108] Provided Moderation facility accessible to Catalogue Editor/Admin (only) in read only mode - [#23197] Revised the query passed to gCat with the moderation states +- [#23258] Implemented the requirement described in #23156 diff --git a/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/CheckConfigsUxController.java b/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/CheckConfigsUxController.java index 11b7191..5b85d31 100644 --- a/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/CheckConfigsUxController.java +++ b/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/CheckConfigsUxController.java @@ -37,21 +37,27 @@ public class CheckConfigsUxController { private DISPLAY_FIELD[] displayFields; + private String initOnItemName; + /** * Instantiates a new check configs ux controller. * * @param mainPanel the main panel * @param initItemStatus the init item status + * @param initOnItemName * @param displayFields the display fields * @param sortByFields the sort by fields * @param moderatorcheckConfig the moderatorcheck config */ - protected CheckConfigsUxController(MainPanel mainPanel, ItemStatus initItemStatus, DISPLAY_FIELD[] displayFields, - DISPLAY_FIELD[] sortByFields, CkanContentModeratorCheckConfigs moderatorcheckConfig) { + protected CheckConfigsUxController(MainPanel mainPanel, ItemStatus initItemStatus, String initOnItemName, + DISPLAY_FIELD[] displayFields, DISPLAY_FIELD[] sortByFields, + CkanContentModeratorCheckConfigs moderatorcheckConfig) { + this.mainPanel = mainPanel; this.basePanelContainer = mainPanel.getMainPanelContainer(); this.moderatorCheckConfig = moderatorcheckConfig; this.initItemStatus = initItemStatus; + this.initOnItemName = initOnItemName; this.displayFields = displayFields; this.orderByFields = sortByFields; @@ -146,8 +152,8 @@ public class CheckConfigsUxController { } catch (Exception e) { } - cmsController = new CkanContentModeratorWidgetController(initItemStatus, displayFields, orderByFields, - false, false); + cmsController = new CkanContentModeratorWidgetController(initItemStatus, initOnItemName, displayFields, + orderByFields, false, false); basePanelContainer.add(cmsController.getMainPanel()); mainPanel.setLoggedLabelText("Logged in as Moderator"); @@ -178,11 +184,10 @@ public class CheckConfigsUxController { GWT.log("readOnlyMode is enabled? " + readOnlyMode); GWT.log("restrictDataToLoggedInUser is? " + restrictDataToLoggedInUser); - cmsController = new CkanContentModeratorWidgetController(initItemStatus, displayFields, orderByFields, - readOnlyMode, restrictDataToLoggedInUser); + cmsController = new CkanContentModeratorWidgetController(initItemStatus, initOnItemName, displayFields, + orderByFields, readOnlyMode, restrictDataToLoggedInUser); basePanelContainer.add(cmsController.getMainPanel()); - } /** diff --git a/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/CkanContentModeratorService.java b/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/CkanContentModeratorService.java index eaf4432..5b28c9b 100644 --- a/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/CkanContentModeratorService.java +++ b/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/CkanContentModeratorService.java @@ -60,7 +60,7 @@ public interface CkanContentModeratorService extends RemoteService { * @param offset the offset * @param limit the limit * @param restrictedToLoggedInUser the restricted to logged in user - * @param sortForField the sort for field + * @param sortForField the sort for field * @return the list items for status * @throws Exception the exception */ @@ -75,7 +75,7 @@ public interface CkanContentModeratorService extends RemoteService { * @param limit the limit * @param serverStartIndex the server start index * @param restrictedToLoggedInUser the restricted to logged in user - * @param sortForField the sort for field + * @param sortForField the sort for field * @return the data for status * @throws Exception the exception */ @@ -124,4 +124,13 @@ public interface CkanContentModeratorService extends RemoteService { * @throws Exception the exception */ public Boolean existsMyItemInModeration() throws Exception; + + /** + * Gets the item for name. + * + * @param itemName the item name + * @return the item for name + * @throws Exception the exception + */ + CatalogueDataset getItemForName(String itemName) throws Exception; } diff --git a/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/CkanContentModeratorServiceAsync.java b/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/CkanContentModeratorServiceAsync.java index 7bad635..f49295f 100644 --- a/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/CkanContentModeratorServiceAsync.java +++ b/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/CkanContentModeratorServiceAsync.java @@ -30,9 +30,32 @@ public interface CkanContentModeratorServiceAsync { void rejectItem(List itemNames, boolean permanentlyDelete, String reasonMsg, AsyncCallback callback); + /** + * Gets the list items for status. + * + * @param theStatus the the status + * @param offset the offset + * @param limit the limit + * @param restrictedToLoggedInUser the restricted to logged in user + * @param sortForField the sort for field + * @param callback the callback + * @return the list items for status + */ void getListItemsForStatus(ItemStatus theStatus, int offset, int limit, boolean restrictedToLoggedInUser, String sortForField, AsyncCallback> callback); + /** + * Gets the data for status. + * + * @param status the status + * @param offset the offset + * @param limit the limit + * @param serverStartIndex the server start index + * @param restrictedToLoggedInUser the restricted to logged in user + * @param sortForField the sort for field + * @param asyncCallback the async callback + * @return the data for status + */ void getDataForStatus(ItemStatus status, int offset, int limit, int serverStartIndex, boolean restrictedToLoggedInUser, String sortForField, AsyncCallback asyncCallback); @@ -94,4 +117,13 @@ public interface CkanContentModeratorServiceAsync { */ void existsMyItemInModeration(AsyncCallback callback); + /** + * Gets the item for name. + * + * @param itemName the item name + * @param callback the callback + * @return the item for name + */ + void getItemForName(String itemName, AsyncCallback callback); + } diff --git a/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/CkanContentModeratorWidget.java b/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/CkanContentModeratorWidget.java index 056b975..8225c1c 100644 --- a/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/CkanContentModeratorWidget.java +++ b/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/CkanContentModeratorWidget.java @@ -33,22 +33,18 @@ public class CkanContentModeratorWidget { public CkanContentModeratorWidget(ItemStatus initItemStatus, String initOnItemName, DISPLAY_FIELD[] displayFields, DISPLAY_FIELD[] sortByFields) { mainPanel.setWidth("100%"); - ccux = new CheckConfigsUxController(mainPanel, initItemStatus, displayFields, sortByFields, null); + ccux = new CheckConfigsUxController(mainPanel, initItemStatus, initOnItemName, displayFields, sortByFields, null); - boolean iamModerator = false; + boolean isModeratorRoleAssigned = false; try { - iamModerator = ccux.getModeratorCheckConfig().isModeratorRoleAssigned(); + isModeratorRoleAssigned = ccux.getModeratorCheckConfig().isModeratorRoleAssigned(); } catch (Exception e) { } - if (iamModerator) { + if (isModeratorRoleAssigned) { mainPanel.setLoggedLabelText("Logged in as Moderator"); } - - if(initOnItemName!=null) { - - } } /** diff --git a/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/CkanContentModeratorWidgetController.java b/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/CkanContentModeratorWidgetController.java index c9a3fd7..5c0fbef 100644 --- a/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/CkanContentModeratorWidgetController.java +++ b/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/CkanContentModeratorWidgetController.java @@ -34,7 +34,10 @@ import org.gcube.portlets.widgets.ckancontentmoderator.shared.ItemFieldDV; import org.gcube.portlets.widgets.ckancontentmoderator.shared.SearchingFilter; import com.google.gwt.core.client.GWT; +import com.google.gwt.core.client.Scheduler; +import com.google.gwt.core.client.Scheduler.ScheduledCommand; import com.google.gwt.event.shared.HandlerManager; +import com.google.gwt.user.client.rpc.AsyncCallback; import com.google.gwt.user.client.ui.ComplexPanel; import com.google.gwt.user.client.ui.FlowPanel; @@ -67,13 +70,15 @@ public class CkanContentModeratorWidgetController { * Instantiates a new ckan content moderator widget. * * @param status the status + * @param initOnItemName the init on item name * @param displayFields the display fields - * @param sortByField the sort by field + * @param sortByFields the sort by fields * @param readOnlyMode the read only mode - * @param restrictDataToLoggedInUser + * @param restrictDataToLoggedInUser the restrict data to logged in user */ - protected CkanContentModeratorWidgetController(ItemStatus status, DISPLAY_FIELD[] displayFields, - DISPLAY_FIELD[] sortByFields, boolean readOnlyMode, boolean restrictDataToLoggedInUser) { + protected CkanContentModeratorWidgetController(ItemStatus status, final String initOnItemName, + DISPLAY_FIELD[] displayFields, DISPLAY_FIELD[] sortByFields, boolean readOnlyMode, + boolean restrictDataToLoggedInUser) { DISPLAY_FIELD firstSortField = null; if (sortByFields == null || sortByFields.length == 0) { @@ -101,6 +106,40 @@ public class CkanContentModeratorWidgetController { howeView.hideUpdateStatusAction(readOnlyMode); howeView.hideSelectableRow(readOnlyMode); bindEvents(); + + if (initOnItemName != null) { + + Scheduler.get().scheduleDeferred(new ScheduledCommand() { + + @Override + public void execute() { + + CkanContentModeratorWidgetController.contentModeratorService.getItemForName(initOnItemName, + new AsyncCallback() { + + @Override + public void onSuccess(CatalogueDataset result) { + GWT.log("CatalogueDataset read is: " + result); + + if (result != null) { + eventBus.fireEvent(new ShowItemEvent(Arrays.asList(result),true)); + } + + } + + @Override + public void onFailure(Throwable caught) { + GWT.log("Error on reading " + initOnItemName + ". Either the item with name: " + + initOnItemName + " is not valid dataset or not readable"); + + } + }); + } + + }); + + } + } /** @@ -117,7 +156,7 @@ public class CkanContentModeratorWidgetController { for (SearchingFilter.ORDER order : SearchingFilter.ORDER.values()) { ItemFieldDV itemField = new ItemFieldDV(); itemField.setDisplayName(display_FIELD.getLabel() + " - " + order); - itemField.setJsonFields(Arrays.asList(display_FIELD.getJsonField() +" "+order.name().toLowerCase())); + itemField.setJsonFields(Arrays.asList(display_FIELD.getJsonField() + " " + order.name().toLowerCase())); listSortByIF.add(itemField); } } @@ -156,7 +195,7 @@ public class CkanContentModeratorWidgetController { @Override public void onShowItemClicked(ShowItemEvent showItemEvent) { - + GWT.log("onShowItemClicked fired"); if (showItemEvent.getSelectItems() != null) { List items = showItemEvent.getSelectItems(); @@ -164,7 +203,7 @@ public class CkanContentModeratorWidgetController { CatalogueDataset clickedDataset = (CatalogueDataset) t; CkanShowItemFrame csif = new CkanShowItemFrame(eventBus); csif.instanceFrame(clickedDataset.getUrl()); - mainTabPanel.addTab(clickedDataset.getTitle(), csif); + mainTabPanel.addTab(clickedDataset.getTitle(), csif, showItemEvent.isFocusOnDisplaying()); mapOfItemsTabDisplayed.put(clickedDataset.getUrl(), csif); } } @@ -228,13 +267,13 @@ public class CkanContentModeratorWidgetController { infoPanel.clear(); if (statusSelectedEvent.getItemStatus() != null) { ItemFieldDV sortBy = statusSelectedEvent.getSortBy(); - - if(sortBy==null) { + + if (sortBy == null) { sortBy = toolbar.getActiveSortBy(); - + } String sortForField = sortBy.getJsonFields().get(0); - GWT.log("sortForField is: "+sortForField); + GWT.log("sortForField is: " + sortForField); howeView.loadItemsWithStatus(statusSelectedEvent.getItemStatus(), sortForField); mainTabPanel.selectTab(0); } diff --git a/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/CkanContentModeratorWidgetTrusted.java b/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/CkanContentModeratorWidgetTrusted.java index d33bbbd..a8a6fc3 100644 --- a/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/CkanContentModeratorWidgetTrusted.java +++ b/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/CkanContentModeratorWidgetTrusted.java @@ -36,7 +36,7 @@ public class CkanContentModeratorWidgetTrusted { GWT.log("CkanContentModeratorWidget called. CkanContentModeratorCheckConfigs: " + ckanContentModeratorCheckConfig); mainPanel.setWidth("100%"); - ccux = new CheckConfigsUxController(mainPanel, initItemStatus, displayFields, sortByFields, ckanContentModeratorCheckConfig); + ccux = new CheckConfigsUxController(mainPanel, initItemStatus, null, displayFields, sortByFields, ckanContentModeratorCheckConfig); } /** diff --git a/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/events/ShowItemEvent.java b/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/events/ShowItemEvent.java index 42bbb50..a434fec 100644 --- a/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/events/ShowItemEvent.java +++ b/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/events/ShowItemEvent.java @@ -15,14 +15,17 @@ import com.google.gwt.event.shared.GwtEvent; public class ShowItemEvent extends GwtEvent { public static Type TYPE = new Type(); private List selectItems; + private boolean focusOnDisplaying = false; /** * Instantiates a new click item event. * * @param selectItems the select items + * @param focusOnDisplaying the focus on displaying */ - public ShowItemEvent(List selectItems) { + public ShowItemEvent(List selectItems, boolean focusOnDisplaying) { this.selectItems = selectItems; + this.focusOnDisplaying = focusOnDisplaying; } /** @@ -65,4 +68,13 @@ public class ShowItemEvent extends GwtEvent { public List getSelectItems() { return selectItems; } + + /** + * Checks if is focus on displaying. + * + * @return true, if is focus on displaying + */ + public boolean isFocusOnDisplaying() { + return focusOnDisplaying; + } } diff --git a/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/ui/MainTabPanel.java b/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/ui/MainTabPanel.java index 7a2f3aa..28957bb 100644 --- a/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/ui/MainTabPanel.java +++ b/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/ui/MainTabPanel.java @@ -75,7 +75,7 @@ public class MainTabPanel extends Composite { * @param w the w * @return the tab */ - public Tab addTab(String heading, Widget w) { + public Tab addTab(String heading, Widget w, boolean selectTab) { final Tab tab = new Tab(); if (w instanceof CkanShowItemFrame) { @@ -108,14 +108,15 @@ public class MainTabPanel extends Composite { mainTabPanel.add(tab); // activeTabPanels(false); - Scheduler.get().scheduleDeferred(new ScheduledCommand() { + if (selectTab) { + Scheduler.get().scheduleDeferred(new ScheduledCommand() { - @Override - public void execute() { - // mainTabPanel.selectTab(results.size() - 1); - - } - }); + @Override + public void execute() { + mainTabPanel.selectTab(results.size() - 1); + } + }); + } return tab; } @@ -163,25 +164,25 @@ public class MainTabPanel extends Composite { } } - + /** * Sets the no spinner. * * @param tab the new no spinner */ private void setNoSpinner(Tab tab) { - try{ - tab.asTabLink().getAnchor().removeStyleName("icon-spin"); - tab.asTabLink().getAnchor().removeStyleName("icon-rotate-right"); - Element anchorElem = tab.asTabLink().getAnchor().asWidget().getElement(); - anchorElem.getFirstChildElement().removeClassName("icon-spin"); - anchorElem.getFirstChildElement().removeClassName("icon-rotate-right"); - }catch(Exception e){ - //silent + try { + tab.asTabLink().getAnchor().removeStyleName("icon-spin"); + tab.asTabLink().getAnchor().removeStyleName("icon-rotate-right"); + Element anchorElem = tab.asTabLink().getAnchor().asWidget().getElement(); + anchorElem.getFirstChildElement().removeClassName("icon-spin"); + anchorElem.getFirstChildElement().removeClassName("icon-rotate-right"); + } catch (Exception e) { + // silent } tab.asTabLink().getAnchor().setIcon(IconType.BOOK); - //tab.asTabLink().getAnchor().setVisible(false); - //if(tab.asTabLink().getAnchor().setVisible(false);) + // tab.asTabLink().getAnchor().setVisible(false); + // if(tab.asTabLink().getAnchor().setVisible(false);) } diff --git a/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/ui/table/ItemsTable.java b/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/ui/table/ItemsTable.java index f911623..8e36838 100644 --- a/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/ui/table/ItemsTable.java +++ b/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/ui/table/ItemsTable.java @@ -139,7 +139,7 @@ public class ItemsTable extends AbstractItemsCellTab @Override public void update(int index, T object, String value) { GWT.log("clicked show"); - eventBus.fireEvent(new ShowItemEvent(Arrays.asList(object))); + eventBus.fireEvent(new ShowItemEvent(Arrays.asList(object), false)); } }); sortedCellTable.addColumn(showdItemColumn); diff --git a/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/server/CkanContentModeratorServiceImpl.java b/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/server/CkanContentModeratorServiceImpl.java index df8c58f..c3bd140 100644 --- a/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/server/CkanContentModeratorServiceImpl.java +++ b/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/server/CkanContentModeratorServiceImpl.java @@ -39,6 +39,12 @@ public class CkanContentModeratorServiceImpl extends RemoteServiceServlet implem private static Logger LOG = LoggerFactory.getLogger(CkanContentModeratorServiceImpl.class); + /** + * Checks if is moderation enabled. + * + * @param reloadConfig the reload config + * @return the boolean + */ @Override public Boolean isModerationEnabled(boolean reloadConfig) { LOG.info("called isContentModeratorEnabled"); @@ -154,10 +160,13 @@ public class CkanContentModeratorServiceImpl extends RemoteServiceServlet implem */ private String setContexts() { String scope = GcubeContextUtil.getCurrentScope(this.getThreadLocalRequest()); - GCubeUser user = GcubeContextUtil.getCurrentUser(this.getThreadLocalRequest()); - String token = GcubeContextUtil.getCurrentToken(scope, user.getUsername()); ScopeProvider.instance.set(scope); - SecurityTokenProvider.instance.set(token); + + GCubeUser user = GcubeContextUtil.getCurrentUser(this.getThreadLocalRequest()); + if (user != null) { + String token = GcubeContextUtil.getCurrentToken(scope, user.getUsername()); + SecurityTokenProvider.instance.set(token); + } return scope; } @@ -169,7 +178,7 @@ public class CkanContentModeratorServiceImpl extends RemoteServiceServlet implem * @param limit the limit * @param restrictedToLoggedInUser if true restricts the list of items to logged * in user - * @param sortForField the sort for field + * @param sortForField the sort for field * @return the list items for status * @throws Exception the exception */ @@ -192,15 +201,14 @@ public class CkanContentModeratorServiceImpl extends RemoteServiceServlet implem filters.put(ContentModeratorWidgetConstants.CKAN_FIELD_NAME_AUTHOR_MAIL, valueOfQueryEmails); } - List datasets = cmsInstance.getListItemsForStatus(theStatus, limit, offset, filters, sortForField); + List datasets = cmsInstance.getListItemsForStatus(theStatus, limit, offset, filters, + sortForField); if (datasets != null) { int size = datasets.size(); datasetList = new ArrayList(size); LOG.info("datasetList for input parameters returned by CMS has size: " + size); for (CkanDataset ckanDataset : datasets) { - CatalogueDataset ds = CatalogueBeansConverter.toCatalogueDataset.apply(ckanDataset); - String datasetURL = String.format("%s/dataset/%s", catalogueImpl.getCatalogueUrl(), ds.getName()); - ds.setUrl(datasetURL); + CatalogueDataset ds = toPatchedCatalogueDataset(ckanDataset, catalogueImpl.getCatalogueUrl()); LOG.trace("converted dataset is: " + ds); datasetList.add(ds); } @@ -215,6 +223,48 @@ public class CkanContentModeratorServiceImpl extends RemoteServiceServlet implem return datasetList; } + private CatalogueDataset toPatchedCatalogueDataset(CkanDataset ckanDataset, String catalogueURL) { + if (ckanDataset == null) + return null; + + CatalogueDataset ds = CatalogueBeansConverter.toCatalogueDataset.apply(ckanDataset); + String datasetURL = String.format("%s/dataset/%s", catalogueURL, ds.getName()); + ds.setUrl(datasetURL); + return ds; + } + + /** + * Gets the item for name. + * + * @param itemName the item name + * @return the item for name + * @throws Exception the exception + */ + @Override + public CatalogueDataset getItemForName(String itemName) throws Exception { + LOG.info("called getItemForName for: " + itemName); + CatalogueDataset ds = null; + try { + String scope = setContexts(); + DataCatalogueImpl catalogueImpl = CatalogueCMSFactory.getFactory().getCatalogueImplPerScope(scope); + GCubeUser user = GcubeContextUtil.getCurrentUser(this.getThreadLocalRequest()); + if (user != null) { + CkanDataset ckanDataset = catalogueImpl.getDataset(itemName, user.getUsername()); + ds = null; + if (ckanDataset != null) { + ds = toPatchedCatalogueDataset(ckanDataset, catalogueImpl.getCatalogueUrl()); + } + } + + } catch (Exception e) { + LOG.error("Error occurred on reading item for name: " + itemName, e); + throw e; + } + + LOG.info("returning: " + ds); + return ds; + } + /** * Sets the status. * @@ -367,12 +417,12 @@ public class CkanContentModeratorServiceImpl extends RemoteServiceServlet implem /** * Gets the data for status. * - * @param status the status - * @param offset the offset - * @param limit the limit - * @param serverStartIndex the server start index + * @param status the status + * @param offset the offset + * @param limit the limit + * @param serverStartIndex the server start index * @param restrictedToLoggedInUser the restricted to logged in user - * @param sortForField the sort for field + * @param sortForField the sort for field * @return the data for status * @throws Exception the exception */ @@ -400,7 +450,8 @@ public class CkanContentModeratorServiceImpl extends RemoteServiceServlet implem List listDataset = new ArrayList(); try { LOG.debug("getListItemsForStatus with searchStartIndex: " + searchStartIndex + ", limit: " + limit); - listDataset = getListItemsForStatus(status, searchStartIndex, limit, restrictedToLoggedInUser, sortForField); + listDataset = getListItemsForStatus(status, searchStartIndex, limit, restrictedToLoggedInUser, + sortForField); } catch (Exception e) { String error = "Error occurred on getting items for status: " + status; LOG.error(error, e); @@ -423,4 +474,5 @@ public class CkanContentModeratorServiceImpl extends RemoteServiceServlet implem LOG.debug("Returning: " + searchedData); return searchedData; } + }