refactored beans

This commit is contained in:
Francesco Mangiacrapa 2024-02-02 17:00:07 +01:00
parent 471c1f373c
commit 845a8c4ece
13 changed files with 125 additions and 125 deletions

View File

@ -1,6 +1,6 @@
package org.gcube.portlets.widgets.mpformbuilder.client.events;
import org.gcube.portlets.widgets.mpformbuilder.shared.catalogue.ResourceElementBean;
import org.gcube.portlets.widgets.mpformbuilder.shared.catalogue.ResourceElementBeanProfile;
import com.google.gwt.event.shared.GwtEvent;
@ -11,13 +11,13 @@ import com.google.gwt.event.shared.GwtEvent;
public class AddResourceEvent extends GwtEvent<AddResourceEventHandler> {
public static Type<AddResourceEventHandler> TYPE = new Type<AddResourceEventHandler>();
private ResourceElementBean resource;
private ResourceElementBeanProfile resource;
public AddResourceEvent(ResourceElementBean resource) {
public AddResourceEvent(ResourceElementBeanProfile resource) {
this.resource = resource;
}
public ResourceElementBean getResource() {
public ResourceElementBeanProfile getResource() {
return resource;
}

View File

@ -1,6 +1,6 @@
package org.gcube.portlets.widgets.mpformbuilder.client.events;
import org.gcube.portlets.widgets.mpformbuilder.shared.catalogue.ResourceElementBean;
import org.gcube.portlets.widgets.mpformbuilder.shared.catalogue.ResourceElementBeanProfile;
import com.google.gwt.event.shared.GwtEvent;
@ -11,13 +11,13 @@ import com.google.gwt.event.shared.GwtEvent;
public class DeleteResourceEvent extends GwtEvent<DeleteResourceEventHandler> {
public static Type<DeleteResourceEventHandler> TYPE = new Type<DeleteResourceEventHandler>();
private ResourceElementBean resource;
private ResourceElementBeanProfile resource;
public DeleteResourceEvent(ResourceElementBean resource) {
public DeleteResourceEvent(ResourceElementBeanProfile resource) {
this.resource = resource;
}
public ResourceElementBean getResource() {
public ResourceElementBeanProfile getResource() {
return resource;
}

View File

@ -26,7 +26,7 @@
//import org.gcube.portlets.widgets.mpformbuilder.client.ui.twincolumnselection.TwinColumnSelectionMainPanel;
//import org.gcube.portlets.widgets.mpformbuilder.client.ui.utils.InfoIconsLabels;
//import org.gcube.portlets.widgets.mpformbuilder.shared.catalogue.DatasetBean;
//import org.gcube.portlets.widgets.mpformbuilder.shared.catalogue.OrganizationBean;
//import org.gcube.portlets.widgets.mpformbuilder.shared.catalogue.OrganizationBeanProfile;
//import org.gcube.portlets.widgets.mpformbuilder.shared.license.LicenseBean;
//import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.CategoryWrapper;
//import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.MetaDataProfileBean;
@ -365,9 +365,9 @@
// }
//
// // set organizations
// List<OrganizationBean> organizations = bean.getOrganizationList();
// List<OrganizationBeanProfile> organizations = bean.getOrganizationList();
//
// for (OrganizationBean organization : organizations) {
// for (OrganizationBeanProfile organization : organizations) {
// organizationsListbox.addItem(organization.getTitle());
// nameTitleOrganizationMap.put(organization.getTitle(), organization.getName());
// }
@ -460,10 +460,10 @@
// setAlertBlock("Retrieving groups, please wait...", AlertType.INFO, true);
//
// // request groups
// ckanServices.getUserGroups(orgName, new AsyncCallback<List<OrganizationBean>>() {
// ckanServices.getUserGroups(orgName, new AsyncCallback<List<OrganizationBeanProfile>>() {
//
// @Override
// public void onSuccess(List<OrganizationBean> groups) {
// public void onSuccess(List<OrganizationBeanProfile> groups) {
// if(groups == null){
// setAlertBlock("Error while retrieving groups", AlertType.ERROR, true);
// }else{
@ -473,7 +473,7 @@
// else{
//
// // add groups
// for (OrganizationBean group : groups) {
// for (OrganizationBeanProfile group : groups) {
// groupsListbox.addItem(group.getTitle(), group.getName());
// }
// hideGroupsAlreadyInProfile(profiles);
@ -565,10 +565,10 @@
// setAlertBlock("Retrieving groups, please wait...", AlertType.INFO, true);
//
// // request groups
// ckanServices.getUserGroups(orgName, new AsyncCallback<List<OrganizationBean>>() {
// ckanServices.getUserGroups(orgName, new AsyncCallback<List<OrganizationBeanProfile>>() {
//
// @Override
// public void onSuccess(List<OrganizationBean> groups) {
// public void onSuccess(List<OrganizationBeanProfile> groups) {
//
// if(groups == null){
// setAlertBlock("Error while retrieving groups, try later", AlertType.ERROR, true);
@ -579,7 +579,7 @@
// else{
//
// // add groups
// for (OrganizationBean group : groups) {
// for (OrganizationBeanProfile group : groups) {
// groupsListbox.addItem(group.getTitle(), group.getName());
// }
// groupsListbox.setEnabled(true);
@ -934,17 +934,17 @@
// Set<String> tags = new HashSet<String>(tagsPanel.getTags());
//
// //we need to retrieve the organization's name from this title
// List<OrganizationBean> orgs = receivedBean.getOrganizationList();
// List<OrganizationBeanProfile> orgs = receivedBean.getOrganizationList();
// String chosenOrganization = null;
// for (OrganizationBean organizationBean : orgs) {
// for (OrganizationBeanProfile organizationBean : orgs) {
// if(chosenOrganizationTitle.equals(organizationBean.getTitle())){
// chosenOrganization = organizationBean.getName();
// break;
// }
// }
//
// List<OrganizationBean> groups = new ArrayList<OrganizationBean>();
// List<OrganizationBean> groupsToForceCreation = new ArrayList<OrganizationBean>();
// List<OrganizationBeanProfile> groups = new ArrayList<OrganizationBeanProfile>();
// List<OrganizationBeanProfile> groupsToForceCreation = new ArrayList<OrganizationBeanProfile>();
//
// // get groups, if any
// int items = groupsListbox.getItemCount();
@ -952,7 +952,7 @@
// String groupTitle = groupsListbox.getItemText(i);
// String groupName = groupsListbox.getValue(i);
// if(groupsListbox.isItemSelected(i)){
// groups.add(new OrganizationBean(groupTitle, groupName, false));
// groups.add(new OrganizationBeanProfile(groupTitle, groupName, false));
// }
// }
//
@ -984,9 +984,9 @@
// if(groupsTitle != null){
// for (String groupTitle : groupsTitle) {
// if(field.isGroupToForce())
// groupsToForceCreation.add(new OrganizationBean(groupTitle, groupTitle, false, field.isPropagateUp()));
// groupsToForceCreation.add(new OrganizationBeanProfile(groupTitle, groupTitle, false, field.isPropagateUp()));
// else
// groups.add(new OrganizationBean(groupTitle, groupTitle, false, field.isPropagateUp()));
// groups.add(new OrganizationBeanProfile(groupTitle, groupTitle, false, field.isPropagateUp()));
// }
// }
// }

View File

@ -25,7 +25,7 @@ import org.gcube.portlets.widgets.mpformbuilder.client.ui.utils.CustomLegend;
import org.gcube.portlets.widgets.mpformbuilder.client.ui.utils.InfoIconsLabels;
import org.gcube.portlets.widgets.mpformbuilder.client.ui.utils.LoaderIcon;
import org.gcube.portlets.widgets.mpformbuilder.shared.GenericDatasetBean;
import org.gcube.portlets.widgets.mpformbuilder.shared.catalogue.OrganizationBean;
import org.gcube.portlets.widgets.mpformbuilder.shared.catalogue.OrganizationBeanProfile;
import org.gcube.portlets.widgets.mpformbuilder.shared.license.LicenseBean;
import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.CategoryWrapper;
import org.gcube.portlets.widgets.mpformbuilder.shared.metadata.MetaDataProfileBean;
@ -633,8 +633,8 @@ public class CreateMetadataForm extends Composite implements HasGenericFormListe
} else {
// Set<String> tags = new HashSet<String>(tagsPanel.getTags());
List<OrganizationBean> groups = new ArrayList<OrganizationBean>();
List<OrganizationBean> groupsToForceCreation = new ArrayList<OrganizationBean>();
List<OrganizationBeanProfile> groups = new ArrayList<OrganizationBeanProfile>();
List<OrganizationBeanProfile> groupsToForceCreation = new ArrayList<OrganizationBeanProfile>();
LinkedHashMap<String, List<String>> customFieldsMap = new LinkedHashMap<String, List<String>>();
List<FileUploaded> listFilesUploaded = new ArrayList<FileUploaded>();
@ -673,10 +673,10 @@ public class CreateMetadataForm extends Composite implements HasGenericFormListe
if (groupsTitle != null) {
for (String groupTitle : groupsTitle) {
if (field.isGroupToForce())
groupsToForceCreation.add(new OrganizationBean(groupTitle, groupTitle, false,
groupsToForceCreation.add(new OrganizationBeanProfile(groupTitle, groupTitle, false,
field.isPropagateUp()));
else
groups.add(new OrganizationBean(groupTitle, groupTitle, false,
groups.add(new OrganizationBeanProfile(groupTitle, groupTitle, false,
field.isPropagateUp()));
}
}

View File

@ -112,8 +112,8 @@ public class AddResourceToDataset extends Composite{
// collect data and build up the bean
/*//TODO MUST BE DONE IN ANOTHER POINT
*
* final ResourceElementBean resource =
new ResourceElementBean(
* final ResourceElementBeanProfile resource =
new ResourceElementBeanProfile(
resourceNameTextBox.getText(),
true,
false,
@ -130,10 +130,10 @@ public class AddResourceToDataset extends Composite{
addResourceButton.setEnabled(false);
// try to create
ckanServices.addResourceToDataset(resource, datasetId, new AsyncCallback<ResourceElementBean>() {
ckanServices.addResourceToDataset(resource, datasetId, new AsyncCallback<ResourceElementBeanProfile>() {
@Override
public void onSuccess(ResourceElementBean result) {
public void onSuccess(ResourceElementBeanProfile result) {
if(result != null){
showAlert("Resource created correctly", AlertType.SUCCESS);

View File

@ -7,7 +7,7 @@ import org.gcube.portlets.widgets.mpformbuilder.client.events.AddResourceEvent;
import org.gcube.portlets.widgets.mpformbuilder.client.events.AddResourceEventHandler;
import org.gcube.portlets.widgets.mpformbuilder.client.events.DeleteResourceEvent;
import org.gcube.portlets.widgets.mpformbuilder.client.events.DeleteResourceEventHandler;
import org.gcube.portlets.widgets.mpformbuilder.shared.catalogue.ResourceElementBean;
import org.gcube.portlets.widgets.mpformbuilder.shared.catalogue.ResourceElementBeanProfile;
import com.github.gwtbootstrap.client.ui.Accordion;
import com.github.gwtbootstrap.client.ui.AccordionGroup;
@ -40,7 +40,7 @@ public class AddedResourcesSummary extends Composite{
private HandlerManager eventBus;
// list of added resources (beans)
List<ResourceElementBean> addedResources;
List<ResourceElementBeanProfile> addedResources;
@UiField VerticalPanel addResourcesPanel;
@ -54,7 +54,7 @@ public class AddedResourcesSummary extends Composite{
bind();
// init list
addedResources = new ArrayList<ResourceElementBean>();
addedResources = new ArrayList<ResourceElementBeanProfile>();
}
/**
@ -69,7 +69,7 @@ public class AddedResourcesSummary extends Composite{
public void onAddedResource(AddResourceEvent addResourceEvent) {
// get the resource
final ResourceElementBean justAddedResource = addResourceEvent.getResource();
final ResourceElementBeanProfile justAddedResource = addResourceEvent.getResource();
// Build an accordion to show resource info
Accordion accordion = new Accordion();
@ -116,7 +116,7 @@ public class AddedResourcesSummary extends Composite{
public void onDeletedResource(DeleteResourceEvent deleteResourceEvent) {
// to delete
ResourceElementBean toDelete = deleteResourceEvent.getResource();
ResourceElementBeanProfile toDelete = deleteResourceEvent.getResource();

View File

@ -1,7 +1,7 @@
package org.gcube.portlets.widgets.mpformbuilder.client.ui.twincolumnselection;
import org.gcube.portlets.widgets.mpformbuilder.client.ui.icons.Images;
import org.gcube.portlets.widgets.mpformbuilder.shared.catalogue.ResourceElementBean;
import org.gcube.portlets.widgets.mpformbuilder.shared.catalogue.ResourceElementBeanProfile;
import com.google.gwt.cell.client.AbstractCell;
import com.google.gwt.core.client.GWT;
@ -11,14 +11,14 @@ import com.google.gwt.user.client.ui.Image;
* Cell that renders left side panel objects
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
*/
public class ResourceCellLeft extends AbstractCell<ResourceElementBean>{
public class ResourceCellLeft extends AbstractCell<ResourceElementBeanProfile>{
private static final Images image = GWT.create(Images.class);
private static final String tipFile = "Hold down the Control (ctrl) or Command button to select multiple options";
private static final String tipFolder = "Click on the folder to navigate it";
@Override
public void render(com.google.gwt.cell.client.Cell.Context context,
ResourceElementBean value, SafeHtmlBuilder sb) {
ResourceElementBeanProfile value, SafeHtmlBuilder sb) {
if (value == null || value.isToBeAdded()) {
return;

View File

@ -1,7 +1,7 @@
package org.gcube.portlets.widgets.mpformbuilder.client.ui.twincolumnselection;
import org.gcube.portlets.widgets.mpformbuilder.client.ui.icons.Images;
import org.gcube.portlets.widgets.mpformbuilder.shared.catalogue.ResourceElementBean;
import org.gcube.portlets.widgets.mpformbuilder.shared.catalogue.ResourceElementBeanProfile;
import com.google.gwt.cell.client.AbstractCell;
import com.google.gwt.cell.client.ValueUpdater;
@ -15,7 +15,7 @@ import com.google.gwt.user.client.ui.Image;
* Cell that renders right side panel objects
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
*/
public class ResourceCellRight extends AbstractCell<ResourceElementBean>{
public class ResourceCellRight extends AbstractCell<ResourceElementBeanProfile>{
private static final Images image = GWT.create(Images.class);
private static final String tip = "Hold down the Control (CTRL) or Command button to select multiple options. Double click to access "
@ -27,7 +27,7 @@ public class ResourceCellRight extends AbstractCell<ResourceElementBean>{
@Override
public void render(com.google.gwt.cell.client.Cell.Context context,
ResourceElementBean value, SafeHtmlBuilder sb) {
ResourceElementBeanProfile value, SafeHtmlBuilder sb) {
if (value == null || !value.isToBeAdded() || value.isFolder()) {
return;
@ -51,8 +51,8 @@ public class ResourceCellRight extends AbstractCell<ResourceElementBean>{
@Override
public void onBrowserEvent(com.google.gwt.cell.client.Cell.Context context,
Element parent, ResourceElementBean value, NativeEvent event,
ValueUpdater<ResourceElementBean> valueUpdater) {
Element parent, ResourceElementBeanProfile value, NativeEvent event,
ValueUpdater<ResourceElementBeanProfile> valueUpdater) {
if(value == null || TwinColumnSelectionMainPanel.isFroozen())
return;
super.onBrowserEvent(context, parent, value, event, valueUpdater);

View File

@ -1,6 +1,6 @@
package org.gcube.portlets.widgets.mpformbuilder.client.ui.twincolumnselection;
import org.gcube.portlets.widgets.mpformbuilder.shared.catalogue.ResourceElementBean;
import org.gcube.portlets.widgets.mpformbuilder.shared.catalogue.ResourceElementBeanProfile;
import com.github.gwtbootstrap.client.ui.Button;
import com.github.gwtbootstrap.client.ui.ControlGroup;
@ -44,7 +44,7 @@ public class ResourceInfoForm extends Composite{
@UiField
ControlGroup controlName;
private ResourceElementBean resourceBean;
private ResourceElementBeanProfile resourceBean;
private static ResourceInfoFormUiBinder uiBinder = GWT
.create(ResourceInfoFormUiBinder.class);
@ -57,7 +57,7 @@ public class ResourceInfoForm extends Composite{
initWidget(uiBinder.createAndBindUi(this));
}
public ResourceInfoForm(final ResourceElementBean resource, final ValueUpdater<ResourceElementBean> valueUpdater) {
public ResourceInfoForm(final ResourceElementBeanProfile resource, final ValueUpdater<ResourceElementBeanProfile> valueUpdater) {
initWidget(uiBinder.createAndBindUi(this));
resourceBean = resource;

View File

@ -7,7 +7,7 @@ import java.util.Iterator;
import java.util.List;
import java.util.Set;
import org.gcube.portlets.widgets.mpformbuilder.shared.catalogue.ResourceElementBean;
import org.gcube.portlets.widgets.mpformbuilder.shared.catalogue.ResourceElementBeanProfile;
import com.github.gwtbootstrap.client.ui.Breadcrumbs;
import com.github.gwtbootstrap.client.ui.Button;
@ -72,9 +72,9 @@ public class TwinColumnSelectionMainPanel extends Composite{
*/
private class PathBean{
NavLink link;
ResourceElementBean resourceFolder;
ResourceElementBeanProfile resourceFolder;
PathBean(NavLink link, ResourceElementBean resourceFolder){
PathBean(NavLink link, ResourceElementBeanProfile resourceFolder){
this.link = link;
this.resourceFolder = resourceFolder;
}
@ -86,13 +86,13 @@ public class TwinColumnSelectionMainPanel extends Composite{
private static final String PANEL_HEIGHT = "400px";
private ShowMorePagerPanel showMorePanelLeft = new ShowMorePagerPanel();
private ShowMorePagerPanel showMorePanelRight = new ShowMorePagerPanel();
private CellList<ResourceElementBean> cellListLeft;
private CellList<ResourceElementBean> cellListRight;
private ListDataProvider<ResourceElementBean> dataProviderLeft = new ListDataProvider<ResourceElementBean>();
private ListDataProvider<ResourceElementBean> dataProviderRight = new ListDataProvider<ResourceElementBean>();
private MultiSelectionModel<ResourceElementBean> selectionModelRight;
private MultiSelectionModel<ResourceElementBean> selectionModelLeft;
private final ResourceElementBean initialBean;
private CellList<ResourceElementBeanProfile> cellListLeft;
private CellList<ResourceElementBeanProfile> cellListRight;
private ListDataProvider<ResourceElementBeanProfile> dataProviderLeft = new ListDataProvider<ResourceElementBeanProfile>();
private ListDataProvider<ResourceElementBeanProfile> dataProviderRight = new ListDataProvider<ResourceElementBeanProfile>();
private MultiSelectionModel<ResourceElementBeanProfile> selectionModelRight;
private MultiSelectionModel<ResourceElementBeanProfile> selectionModelLeft;
private final ResourceElementBeanProfile initialBean;
// private final static HTML aboutHeader = new HTML("<b>Resource Manager</b>");
// private final static HTML aboutBody = new HTML("<p style='text-align:justify;'>Move the files you want to attach to the product on the right panel below."
// + " Please consider that any complex hierarchy structure you may have will be flatten.</p>");
@ -106,7 +106,7 @@ public class TwinColumnSelectionMainPanel extends Composite{
UiBinder<Widget, TwinColumnSelectionMainPanel> {
}
public TwinColumnSelectionMainPanel(ResourceElementBean initialBean) {
public TwinColumnSelectionMainPanel(ResourceElementBeanProfile initialBean) {
initWidget(uiBinder.createAndBindUi(this));
frozen = false;
@ -143,13 +143,13 @@ public class TwinColumnSelectionMainPanel extends Composite{
/**
* Initialize the left side panel
*/
private void initLeftSidePanel(final ResourceElementBean initialBean) {
private void initLeftSidePanel(final ResourceElementBeanProfile initialBean) {
// initialize the left side list
ResourceCellLeft cell = new ResourceCellLeft();
// Set a key provider that provides a unique key for each object.
cellListLeft = new CellList<ResourceElementBean>(cell, ResourceElementBean.KEY_PROVIDER);
cellListLeft = new CellList<ResourceElementBeanProfile>(cell, ResourceElementBeanProfile.KEY_PROVIDER);
cellListLeft.setKeyboardPagingPolicy(KeyboardPagingPolicy.INCREASE_RANGE);
// set page size
@ -157,7 +157,7 @@ public class TwinColumnSelectionMainPanel extends Composite{
cellListLeft.setPageSize(size);
// Add a selection model so we can select cells.
selectionModelLeft = new MultiSelectionModel<ResourceElementBean>(ResourceElementBean.KEY_PROVIDER);
selectionModelLeft = new MultiSelectionModel<ResourceElementBeanProfile>(ResourceElementBeanProfile.KEY_PROVIDER);
cellListLeft.setSelectionModel(selectionModelLeft);
// perform an action on selection
@ -168,10 +168,10 @@ public class TwinColumnSelectionMainPanel extends Composite{
if(frozen)
return;
Iterator<ResourceElementBean> selectedObjectsIterator = selectionModelLeft.getSelectedSet().iterator();
Iterator<ResourceElementBeanProfile> selectedObjectsIterator = selectionModelLeft.getSelectedSet().iterator();
while (selectedObjectsIterator.hasNext()) {
ResourceElementBean selectedBean = selectedObjectsIterator.next();
ResourceElementBeanProfile selectedBean = selectedObjectsIterator.next();
if(selectedBean.isFolder()){
// a single folder selected
@ -190,7 +190,7 @@ public class TwinColumnSelectionMainPanel extends Composite{
removeStartingFromBreadcrumbs(navElem, pathBean);
GWT.log("Clicked on element " + pathBean.resourceFolder.getName());
//breadcrumbsUpdater();
ResourceElementBean folder = pathBean.resourceFolder;
ResourceElementBeanProfile folder = pathBean.resourceFolder;
Collections.sort(folder.getChildren());
dataProviderLeft.setList(folder.getChildren());
dataProviderLeft.refresh();
@ -306,12 +306,12 @@ public class TwinColumnSelectionMainPanel extends Composite{
ResourceCellRight cell = new ResourceCellRight();
// Set a key provider that provides a unique key for each object.
cellListRight = new CellList<ResourceElementBean>(cell, ResourceElementBean.KEY_PROVIDER);
cellListRight = new CellList<ResourceElementBeanProfile>(cell, ResourceElementBeanProfile.KEY_PROVIDER);
cellListRight.setKeyboardPagingPolicy(KeyboardPagingPolicy.INCREASE_RANGE);
cellListRight.setValueUpdater(new ValueUpdater<ResourceElementBean>() {
cellListRight.setValueUpdater(new ValueUpdater<ResourceElementBeanProfile>() {
@Override
public void update(ResourceElementBean value) {
public void update(ResourceElementBeanProfile value) {
// just redraw the list
cellListRight.redraw();
@ -320,7 +320,7 @@ public class TwinColumnSelectionMainPanel extends Composite{
});
// Add a selection model so we can select cells.
selectionModelRight = new MultiSelectionModel<ResourceElementBean>(ResourceElementBean.KEY_PROVIDER);
selectionModelRight = new MultiSelectionModel<ResourceElementBeanProfile>(ResourceElementBeanProfile.KEY_PROVIDER);
cellListRight.setSelectionModel(selectionModelRight);
// perform an action on selection
@ -353,7 +353,7 @@ public class TwinColumnSelectionMainPanel extends Composite{
* Enable/disable the buttons to move objects from left to right properly.
* @param setselectedItemsLeft
*/
private void enableMoveToRightButtons(Set<ResourceElementBean> setselectedItemsLeft){
private void enableMoveToRightButtons(Set<ResourceElementBeanProfile> setselectedItemsLeft){
if(setselectedItemsLeft == null || setselectedItemsLeft.isEmpty()){
allToRightButton.setEnabled(false);
@ -373,7 +373,7 @@ public class TwinColumnSelectionMainPanel extends Composite{
* Enable/disable the buttons to move objects from right to left properly.
* @param setselectedItemsRight
*/
private void enableMoveToLeftButtons(Set<ResourceElementBean> setselectedItemsRight){
private void enableMoveToLeftButtons(Set<ResourceElementBeanProfile> setselectedItemsRight){
if(setselectedItemsRight == null || setselectedItemsRight.isEmpty()){
allToLeftButton.setEnabled(false);
@ -427,14 +427,14 @@ public class TwinColumnSelectionMainPanel extends Composite{
* Move to right elements
* @param set the elements to move
*/
private void moveToRight(Set<ResourceElementBean> setSelected){
private void moveToRight(Set<ResourceElementBeanProfile> setSelected){
if(setSelected == null || setSelected.isEmpty())
return;
Iterator<ResourceElementBean> iterator = setSelected.iterator();
Iterator<ResourceElementBeanProfile> iterator = setSelected.iterator();
while (iterator.hasNext()) {
ResourceElementBean resourceElementBean = iterator
ResourceElementBeanProfile resourceElementBean = iterator
.next();
resourceElementBean.setToBeAdded(true);
@ -456,14 +456,14 @@ public class TwinColumnSelectionMainPanel extends Composite{
* Move to left elements
* @param setSelected the elements to move
*/
private void moveToLeft(Set<ResourceElementBean> setSelected){
private void moveToLeft(Set<ResourceElementBeanProfile> setSelected){
if(setSelected == null || setSelected.isEmpty())
return;
Iterator<ResourceElementBean> iterator = setSelected.iterator();
Iterator<ResourceElementBeanProfile> iterator = setSelected.iterator();
while (iterator.hasNext()) {
ResourceElementBean resourceElementBean = iterator.next();
ResourceElementBeanProfile resourceElementBean = iterator.next();
resourceElementBean.setToBeAdded(false);
}
@ -496,16 +496,16 @@ public class TwinColumnSelectionMainPanel extends Composite{
* Returns the root parent with the children as files to save
* @return the resources to save
*/
public ResourceElementBean getResourcesToPublish(){
public ResourceElementBeanProfile getResourcesToPublish(){
List<ResourceElementBean> current = dataProviderRight.getList();
List<ResourceElementBeanProfile> current = dataProviderRight.getList();
ResourceElementBean toReturn = new ResourceElementBean();
List<ResourceElementBean> children = new ArrayList<ResourceElementBean>();
ResourceElementBeanProfile toReturn = new ResourceElementBeanProfile();
List<ResourceElementBeanProfile> children = new ArrayList<ResourceElementBeanProfile>();
for (ResourceElementBean resource : current) {
for (ResourceElementBeanProfile resource : current) {
if(resource.isToBeAdded() && !resource.isFolder()){ // be sure ...
ResourceElementBean beanWithoutChildren = new ResourceElementBean(resource);
ResourceElementBeanProfile beanWithoutChildren = new ResourceElementBeanProfile(resource);
beanWithoutChildren.setName(resource.getEditableName());
children.add(beanWithoutChildren);
}

View File

@ -29,14 +29,14 @@
// private String selectedOrganization;
// private long version; // version 1, 2 ...
// private boolean visible; // Private (false) or Public(true)
// private List<OrganizationBean> organizationList; // list of organization in which the user is present and could create the dataset
// private ResourceElementBean resourceRoot; // in case of workspace, this is the directory root or the single file information
// private List<OrganizationBeanProfile> organizationList; // list of organization in which the user is present and could create the dataset
// private ResourceElementBeanProfile resourceRoot; // in case of workspace, this is the directory root or the single file information
// private List<MetaDataProfileBean> metadataList;
// private List<String> tags; // on retrieve, they are the keys of the product
// private List<String> tagsVocabulary; // when available
// private Map<String, List<String>> customFields;
// private List<OrganizationBean> groups;
// private List<OrganizationBean> groupsForceCreation;
// private List<OrganizationBeanProfile> groups;
// private List<OrganizationBeanProfile> groupsForceCreation;
//
// public DatasetBean(){
// super();
@ -68,9 +68,9 @@
// String license, boolean visible, String source, long version,
// String authorName, String authorSurname, String authorEmail, String maintainer,
// String maintainerEmail, String ownerIdentifier,
// List<OrganizationBean> organizationList, String selectedOrganization,
// ResourceElementBean resourceRoot,
// List<MetaDataProfileBean> metadataList, List<OrganizationBean> groups, List<String> tagsVocabulary) {
// List<OrganizationBeanProfile> organizationList, String selectedOrganization,
// ResourceElementBeanProfile resourceRoot,
// List<MetaDataProfileBean> metadataList, List<OrganizationBeanProfile> groups, List<String> tagsVocabulary) {
// super();
// this.id = id;
// this.title = title;
@ -231,11 +231,11 @@
// this.maintainerEmail = maintainerEmail;
// }
//
// public List<OrganizationBean> getOrganizationList() {
// public List<OrganizationBeanProfile> getOrganizationList() {
// return organizationList;
// }
//
// public void setOrganizationList(List<OrganizationBean> organizationList) {
// public void setOrganizationList(List<OrganizationBeanProfile> organizationList) {
// this.organizationList = organizationList;
// }
//
@ -247,11 +247,11 @@
// this.selectedOrganization = selectedOrganization;
// }
//
// public ResourceElementBean getResourceRoot() {
// public ResourceElementBeanProfile getResourceRoot() {
// return resourceRoot;
// }
//
// public void setResourceRoot(ResourceElementBean resourceRoot) {
// public void setResourceRoot(ResourceElementBeanProfile resourceRoot) {
// this.resourceRoot = resourceRoot;
// }
//
@ -263,11 +263,11 @@
// this.authorFullName = authorFullName;
// }
//
// public List<OrganizationBean> getGroups() {
// public List<OrganizationBeanProfile> getGroups() {
// return groups;
// }
//
// public void setGroups(List<OrganizationBean> groups) {
// public void setGroups(List<OrganizationBeanProfile> groups) {
// this.groups = groups;
// }
//
@ -279,11 +279,11 @@
// this.tagsVocabulary = tagsVocabulary;
// }
//
// public List<OrganizationBean> getGroupsForceCreation() {
// public List<OrganizationBeanProfile> getGroupsForceCreation() {
// return groupsForceCreation;
// }
//
// public void setGroupsForceCreation(List<OrganizationBean> groupsForceCreation) {
// public void setGroupsForceCreation(List<OrganizationBeanProfile> groupsForceCreation) {
// this.groupsForceCreation = groupsForceCreation;
// }
//

View File

@ -6,7 +6,7 @@ import java.io.Serializable;
* A ckan organization/group (you can check its nature by looking at getIsOrganization();) like bean with name and title
* @author Costantino Perciante (costantino.perciante@isti.cnr.it)
*/
public class OrganizationBean implements Serializable{
public class OrganizationBeanProfile implements Serializable{
private static final long serialVersionUID = -6566519399945530602L;
private String title;
@ -14,18 +14,18 @@ public class OrganizationBean implements Serializable{
private boolean isOrganization;
private boolean propagateUp; // an item linked to this group has to be added on the whole hierarchy chain
public OrganizationBean(){
public OrganizationBeanProfile(){
super();
}
public OrganizationBean(String title, String name, boolean isOrganization) {
public OrganizationBeanProfile(String title, String name, boolean isOrganization) {
super();
this.title = title;
this.name = name;
this.isOrganization = isOrganization;
}
public OrganizationBean(String title, String name, boolean isOrganization, boolean propagateUp) {
public OrganizationBeanProfile(String title, String name, boolean isOrganization, boolean propagateUp) {
super();
this.title = title;
this.name = name;
@ -67,7 +67,7 @@ public class OrganizationBean implements Serializable{
@Override
public String toString() {
return "OrganizationBean [title=" + title + ", name=" + name
return "OrganizationBeanProfile [title=" + title + ", name=" + name
+ ", isOrganization=" + isOrganization + ", propagateUp="
+ propagateUp + "]";
}

View File

@ -10,7 +10,7 @@ import com.google.gwt.view.client.ProvidesKey;
* A resource element bean. Contains part of the logic used into the TwinColumn widget
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
*/
public class ResourceElementBean implements Comparable<ResourceElementBean>, Serializable{
public class ResourceElementBeanProfile implements Comparable<ResourceElementBeanProfile>, Serializable{
private static final long serialVersionUID = -1230871392599580669L;
private String name;
@ -23,8 +23,8 @@ public class ResourceElementBean implements Comparable<ResourceElementBean>, Ser
private String url;
private String description;
private String organizationNameDatasetParent; // the organization name in which the parent dataset was created
private ResourceElementBean parent;
private List<ResourceElementBean> children;
private ResourceElementBeanProfile parent;
private List<ResourceElementBeanProfile> children;
// to generate the GWT identifiers
private static int nextId = 0;
@ -35,9 +35,9 @@ public class ResourceElementBean implements Comparable<ResourceElementBean>, Ser
/**
* The key provider that provides the unique ID of a bean.
*/
public static final ProvidesKey<ResourceElementBean> KEY_PROVIDER = new ProvidesKey<ResourceElementBean>() {
public static final ProvidesKey<ResourceElementBeanProfile> KEY_PROVIDER = new ProvidesKey<ResourceElementBeanProfile>() {
@Override
public Object getKey(ResourceElementBean item) {
public Object getKey(ResourceElementBeanProfile item) {
return item == null ? null : item.identifierGWT;
}
};
@ -46,7 +46,7 @@ public class ResourceElementBean implements Comparable<ResourceElementBean>, Ser
* Copy constructor
* @param another
*/
public ResourceElementBean(ResourceElementBean another) {
public ResourceElementBeanProfile(ResourceElementBeanProfile another) {
this.name = another.name;
this.toBeAdded = another.toBeAdded;
this.fullPath = another.fullPath;
@ -61,7 +61,7 @@ public class ResourceElementBean implements Comparable<ResourceElementBean>, Ser
/**
* Default constructor
*/
public ResourceElementBean(){
public ResourceElementBeanProfile(){
super();
this.identifierGWT = nextId;
nextId++;
@ -74,11 +74,11 @@ public class ResourceElementBean implements Comparable<ResourceElementBean>, Ser
* @param movedToRight
* @param isFolder
*/
public ResourceElementBean(
ResourceElementBean parent,
public ResourceElementBeanProfile(
ResourceElementBeanProfile parent,
String name,
boolean isFolder,
List<ResourceElementBean> children,
List<ResourceElementBeanProfile> children,
String fullPath) {
this.identifierGWT = nextId;
nextId++;
@ -102,9 +102,9 @@ public class ResourceElementBean implements Comparable<ResourceElementBean>, Ser
* @param description
* @param organizationNameDatasetParent
*/
public ResourceElementBean(String name, boolean toBeAdded,
boolean isFolder, ResourceElementBean parent,
List<ResourceElementBean> children, String fullPath,
public ResourceElementBeanProfile(String name, boolean toBeAdded,
boolean isFolder, ResourceElementBeanProfile parent,
List<ResourceElementBeanProfile> children, String fullPath,
String originalIdInWorkspace, String mimeType, String url,
String description, String organizationNameDatasetParent) {
super();
@ -123,11 +123,11 @@ public class ResourceElementBean implements Comparable<ResourceElementBean>, Ser
this.organizationNameDatasetParent = organizationNameDatasetParent;
}
public ResourceElementBean getParent() {
public ResourceElementBeanProfile getParent() {
return parent;
}
public void setParent(ResourceElementBean parent) {
public void setParent(ResourceElementBeanProfile parent) {
this.parent = parent;
}
@ -188,11 +188,11 @@ public class ResourceElementBean implements Comparable<ResourceElementBean>, Ser
this.isFolder = isFolder;
}
public List<ResourceElementBean> getChildren() {
public List<ResourceElementBeanProfile> getChildren() {
return children;
}
public void setChildren(List<ResourceElementBean> children) {
public void setChildren(List<ResourceElementBeanProfile> children) {
this.children = children;
}
@ -223,22 +223,22 @@ public class ResourceElementBean implements Comparable<ResourceElementBean>, Ser
@Override
public boolean equals(Object o) {
boolean toReturn = false;
if (o instanceof ResourceElementBean) {
toReturn = identifierGWT == ((ResourceElementBean) o).identifierGWT;
if (o instanceof ResourceElementBeanProfile) {
toReturn = identifierGWT == ((ResourceElementBeanProfile) o).identifierGWT;
}
return toReturn;
}
@Override
public int compareTo(ResourceElementBean o) {
public int compareTo(ResourceElementBeanProfile o) {
int toReturn = (o == null || o.fullPath == null) ? -1 : -o.fullPath.compareTo(fullPath);
return toReturn;
}
@Override
public String toString() {
return "ResourceElementBean [identifierGWT=" + identifierGWT
return "ResourceElementBeanProfile [identifierGWT=" + identifierGWT
+ ", name=" + name + ", editableName=" + editableName
+ ", toBeAdded=" + toBeAdded + ", isFolder=" + isFolder
+ ", fullPath=" + fullPath + ", originalIdInWorkspace="