implementing changes requested by Fabio

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/widgets/ws-thredds-sync-widget@164941 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2018-03-12 16:43:51 +00:00
parent 9733909819
commit e9ae76e295
18 changed files with 457 additions and 813 deletions

View File

@ -5,7 +5,7 @@ import java.util.List;
import org.gcube.portal.wssynclibrary.shared.ItemNotSynched; import org.gcube.portal.wssynclibrary.shared.ItemNotSynched;
import org.gcube.portal.wssynclibrary.shared.thredds.ThCatalogueBean; import org.gcube.portal.wssynclibrary.shared.thredds.ThCatalogueBean;
import org.gcube.portal.wssynclibrary.shared.thredds.ThSyncStatus; import org.gcube.portal.wssynclibrary.shared.thredds.ThSyncStatus;
import org.gcube.portlets.widgets.wsthreddssync.shared.GcubeVRE; import org.gcube.portlets.widgets.wsthreddssync.shared.GcubeScope;
import org.gcube.portlets.widgets.wsthreddssync.shared.WsThreddsSynchFolderConfiguration; import org.gcube.portlets.widgets.wsthreddssync.shared.WsThreddsSynchFolderConfiguration;
import org.gcube.portlets.widgets.wsthreddssync.shared.WsThreddsSynchFolderDescriptor; import org.gcube.portlets.widgets.wsthreddssync.shared.WsThreddsSynchFolderDescriptor;
@ -58,7 +58,7 @@ public interface ThreddsWorkspaceSyncService extends RemoteService {
* @return the list of vr es for logged user * @return the list of vr es for logged user
* @throws Exception the exception * @throws Exception the exception
*/ */
List<GcubeVRE> getListOfVREsForLoggedUser() throws Exception; List<GcubeScope> getListOfScopesForLoggedUser() throws Exception;
/** /**
* Gets the available catalogues for scope. * Gets the available catalogues for scope.

View File

@ -4,7 +4,7 @@ import java.util.List;
import org.gcube.portal.wssynclibrary.shared.thredds.ThCatalogueBean; import org.gcube.portal.wssynclibrary.shared.thredds.ThCatalogueBean;
import org.gcube.portal.wssynclibrary.shared.thredds.ThSyncStatus; import org.gcube.portal.wssynclibrary.shared.thredds.ThSyncStatus;
import org.gcube.portlets.widgets.wsthreddssync.shared.GcubeVRE; import org.gcube.portlets.widgets.wsthreddssync.shared.GcubeScope;
import org.gcube.portlets.widgets.wsthreddssync.shared.WsThreddsSynchFolderConfiguration; import org.gcube.portlets.widgets.wsthreddssync.shared.WsThreddsSynchFolderConfiguration;
import org.gcube.portlets.widgets.wsthreddssync.shared.WsThreddsSynchFolderDescriptor; import org.gcube.portlets.widgets.wsthreddssync.shared.WsThreddsSynchFolderDescriptor;
@ -83,13 +83,14 @@ public interface ThreddsWorkspaceSyncServiceAsync
void monitorSyncStatus(String folderId, AsyncCallback<ThSyncStatus> callback); void monitorSyncStatus(String folderId, AsyncCallback<ThSyncStatus> callback);
/** /**
* Gets the list of vr es for logged user. * Gets the list of scopes for logged user.
* *
* @param callback the callback * @param callback the callback
* @return the list of vr es for logged user * @return the list of scopes for logged user
*/ */
void getListOfVREsForLoggedUser(AsyncCallback<List<GcubeVRE>> callback); void getListOfScopesForLoggedUser(AsyncCallback<List<GcubeScope>> callback);
/** /**
* Gets the available catalogues for scope. * Gets the available catalogues for scope.

View File

@ -1,5 +1,7 @@
package org.gcube.portlets.widgets.wsthreddssync.client.view; package org.gcube.portlets.widgets.wsthreddssync.client.view;
import org.gcube.portlets.widgets.wsthreddssync.shared.GcubeScope;
// TODO: Auto-generated Javadoc // TODO: Auto-generated Javadoc
/** /**
* The Class FormatUtil. * The Class FormatUtil.
@ -36,5 +38,20 @@ public class FormatUtil {
public static String getFolderTitle(String folderName, int maxSize){ public static String getFolderTitle(String folderName, int maxSize){
String title = folderName!=null&&folderName.length()>0?folderName:""; String title = folderName!=null&&folderName.length()>0?folderName:"";
return FormatUtil.ellipse(title, maxSize); return FormatUtil.ellipse(title, maxSize);
} }
/**
* To scope value.
*
* @param gcubeScope the gcube scope
* @return the string
*/
public static String toScopeValue(GcubeScope gcubeScope){
if(gcubeScope==null)
return null;
return "("+gcubeScope.getScopeType()+") "+gcubeScope.getScopeTitle();
}
} }

View File

@ -177,6 +177,8 @@ public class WsThreddsWidgetViewManager {
public void onFailure(Throwable caught) { public void onFailure(Throwable caught) {
cancelMonitor(folder); cancelMonitor(folder);
//SHOW MESSAGE ON ERROR
} }
@Override @Override
@ -249,7 +251,7 @@ public class WsThreddsWidgetViewManager {
remotePath = remotePath.isEmpty()?getFolderName():remotePath+"/"+getFolderName(); remotePath = remotePath.isEmpty()?getFolderName():remotePath+"/"+getFolderName();
conf.setRemotePath(remotePath); conf.setRemotePath(remotePath);
conf.setCatalogName(catalogueSelected.getName()); conf.setCatalogName(catalogueSelected.getName());
conf.setTheVRE(getSelectedVRE()); conf.setSelectedScope(getSelectedScope());
WsThreddsWidget.eventBus.fireEvent(new PerformDoSyncEvent(folder, conf)); WsThreddsWidget.eventBus.fireEvent(new PerformDoSyncEvent(folder, conf));
} }

View File

@ -8,7 +8,8 @@ import java.util.Map;
import org.gcube.portal.wssynclibrary.shared.thredds.ThCatalogueBean; import org.gcube.portal.wssynclibrary.shared.thredds.ThCatalogueBean;
import org.gcube.portlets.widgets.wsthreddssync.client.WsThreddsWidget; import org.gcube.portlets.widgets.wsthreddssync.client.WsThreddsWidget;
import org.gcube.portlets.widgets.wsthreddssync.shared.GcubeVRE; import org.gcube.portlets.widgets.wsthreddssync.client.view.FormatUtil;
import org.gcube.portlets.widgets.wsthreddssync.shared.GcubeScope;
import com.github.gwtbootstrap.client.ui.Button; import com.github.gwtbootstrap.client.ui.Button;
import com.github.gwtbootstrap.client.ui.ControlGroup; import com.github.gwtbootstrap.client.ui.ControlGroup;
@ -63,7 +64,7 @@ public abstract class CreateThreddsConfigurationView extends Composite {
@UiField @UiField
ListBox field_select_vre; ListBox field_select_scope;
@UiField @UiField
Button butt_create_new_catalogue; Button butt_create_new_catalogue;
@ -107,7 +108,7 @@ public abstract class CreateThreddsConfigurationView extends Composite {
private String folderId; private String folderId;
/** The map VR es. */ /** The map VR es. */
private Map<String, GcubeVRE> mapVREs = new HashMap<String, GcubeVRE>(); private Map<String, GcubeScope> mapScopes = new HashMap<String, GcubeScope>();
private Map<String, List<ThCatalogueBean>> mapCatalogueNames = new HashMap<String, List<ThCatalogueBean>>(); private Map<String, List<ThCatalogueBean>> mapCatalogueNames = new HashMap<String, List<ThCatalogueBean>>();
@ -164,34 +165,36 @@ public abstract class CreateThreddsConfigurationView extends Composite {
cg_catalogue_name.getElement().getStyle().setMarginTop(20, Unit.PX); cg_catalogue_name.getElement().getStyle().setMarginTop(20, Unit.PX);
field_select_vre.addChangeHandler(new ChangeHandler() { field_select_scope.addChangeHandler(new ChangeHandler() {
@Override @Override
public void onChange(ChangeEvent event) { public void onChange(ChangeEvent event) {
String scope = field_select_vre.getSelectedItemText(); //String scope = field_select_scope.getSelectedItemText();
GWT.log("Selected VRE: "+scope); String value = field_select_scope.getSelectedValue();
loadCatalogueNamesForScope(scope); GWT.log("Selected SCOPE: "+value);
loadCatalogueNamesForScope(value);
} }
}); });
WsThreddsWidget.wsThreddsSyncService.getListOfVREsForLoggedUser(new AsyncCallback<List<GcubeVRE>>() { WsThreddsWidget.wsThreddsSyncService.getListOfScopesForLoggedUser(new AsyncCallback<List<GcubeScope>>() {
@Override @Override
public void onSuccess(List<GcubeVRE> result) { public void onSuccess(List<GcubeScope> result) {
for (GcubeVRE gcubeVRE : result) { for (GcubeScope gcubeScope : result) {
mapVREs.put(gcubeVRE.getVreScope(), gcubeVRE); String toValue = FormatUtil.toScopeValue(gcubeScope);
field_select_vre.addItem(gcubeVRE.getVreScope(), gcubeVRE.getVreName()); mapScopes.put(gcubeScope.getScopeName(), gcubeScope);
field_select_scope.addItem(toValue, gcubeScope.getScopeName());
} }
if(result.size()>0){ if(result.size()>0){
field_select_vre.setSelectedValue(result.get(0).getVreName()); field_select_scope.setSelectedValue(result.get(0).getScopeName());
//field_select_vre.setSelectedIndex(0); //field_select_vre.setSelectedIndex(0);
//field_select_vre.fireEvent(DomEvent.fireNativeEvent(nativeEvent, handlerSource);); //field_select_vre.fireEvent(DomEvent.fireNativeEvent(nativeEvent, handlerSource););
DomEvent.fireNativeEvent(Document.get().createChangeEvent(), field_select_vre); DomEvent.fireNativeEvent(Document.get().createChangeEvent(), field_select_scope);
} }
} }
@ -269,7 +272,6 @@ public abstract class CreateThreddsConfigurationView extends Composite {
* Adds the catalogue name for current scope. * Adds the catalogue name for current scope.
* *
* @param catalogueName the catalogue name * @param catalogueName the catalogue name
* @param folderName the folder name. Can be a relative Path
*/ */
private void addCatalogueNameForCurrentScope(String catalogueName) { private void addCatalogueNameForCurrentScope(String catalogueName) {
@ -346,7 +348,7 @@ public abstract class CreateThreddsConfigurationView extends Composite {
} }
if(field_folder_name.getValue() == null || field_folder_name.getValue().isEmpty()){ if(field_folder_name.getValue() == null || field_folder_name.getValue().isEmpty()){
cg_folder_name.setType(ControlGroupType.ERROR); cg_folder_name.setType(ControlGroupType.WARNING);
setError(true, "The Catalogue Entry is required"); setError(true, "The Catalogue Entry is required");
return false; return false;
}else if(field_folder_name.getValue().startsWith("/")){ }else if(field_folder_name.getValue().startsWith("/")){
@ -398,15 +400,16 @@ public abstract class CreateThreddsConfigurationView extends Composite {
} }
/** /**
* Gets the unit description. * Gets the selected scope.
* *
* @return the unit description * @return the selected scope
*/ */
public GcubeVRE getSelectedVRE(){ public GcubeScope getSelectedScope(){
String item = field_select_vre.getSelectedItemText(); //String item = field_select_scope.getSelectedItemText();
String text = field_select_vre.getSelectedValue(); String text = field_select_scope.getSelectedValue();
return mapVREs.get(item); return mapScopes.get(text);
} }

View File

@ -12,10 +12,10 @@
<b:Fieldset styleName="{style.noBorder}"> <b:Fieldset styleName="{style.noBorder}">
<b:ControlGroup ui:field="cg_select_vre"> <b:ControlGroup ui:field="cg_select_vre">
<b:ControlLabel for="cl_select_vre">Publish in the VRE</b:ControlLabel> <b:ControlLabel for="cl_select_vre">Publish in the Scope</b:ControlLabel>
<b:Controls> <b:Controls>
<b:ListBox name="Select a VRE..." b:id="field_select_vre" <b:ListBox name="Select a VRE..." b:id="field_select_scope"
ui:field="field_select_vre"> ui:field="field_select_scope">
</b:ListBox> </b:ListBox>
</b:Controls> </b:Controls>
</b:ControlGroup> </b:ControlGroup>

View File

@ -9,7 +9,8 @@ import org.gcube.portal.wssynclibrary.shared.thredds.ThProcessDescriptor;
import org.gcube.portal.wssynclibrary.shared.thredds.ThSyncFolderDescriptor; import org.gcube.portal.wssynclibrary.shared.thredds.ThSyncFolderDescriptor;
import org.gcube.portal.wssynclibrary.shared.thredds.ThSynchFolderConfiguration; import org.gcube.portal.wssynclibrary.shared.thredds.ThSynchFolderConfiguration;
import org.gcube.portlets.widgets.wsthreddssync.client.WsThreddsWidget; import org.gcube.portlets.widgets.wsthreddssync.client.WsThreddsWidget;
import org.gcube.portlets.widgets.wsthreddssync.shared.GcubeVRE; import org.gcube.portlets.widgets.wsthreddssync.client.view.FormatUtil;
import org.gcube.portlets.widgets.wsthreddssync.shared.GcubeScope;
import org.gcube.portlets.widgets.wsthreddssync.shared.WsFolder; import org.gcube.portlets.widgets.wsthreddssync.shared.WsFolder;
import org.gcube.portlets.widgets.wsthreddssync.shared.WsThreddsSynchFolderDescriptor; import org.gcube.portlets.widgets.wsthreddssync.shared.WsThreddsSynchFolderDescriptor;
@ -61,7 +62,7 @@ public abstract class ShowThreddsFolderInfoView extends Composite {
TextBox field_folder_status; TextBox field_folder_status;
@UiField @UiField
ListBox field_select_vre; ListBox field_select_scope;
@UiField @UiField
@ -103,16 +104,24 @@ public abstract class ShowThreddsFolderInfoView extends Composite {
private String folderId; private String folderId;
/** The map VR es. */ /** The map VR es. */
private Map<String, GcubeVRE> mapVREs = new HashMap<String, GcubeVRE>(); private Map<String, GcubeScope> mapScopes = new HashMap<String, GcubeScope>();
private boolean isCreateConfiguration; private boolean isCreateConfiguration;
/**
* The Enum SUBMIT_ACTION.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Mar 12, 2018
*/
public static enum SUBMIT_ACTION {CREATE_UPDATE_CONFIGURATION, DO_SYNC}; public static enum SUBMIT_ACTION {CREATE_UPDATE_CONFIGURATION, DO_SYNC};
/** /**
* Submit handler. * Submit handler.
*
* @param action the action
*/ */
public abstract void submitHandler(SUBMIT_ACTION action); public abstract void submitHandler(SUBMIT_ACTION action);
@ -167,15 +176,15 @@ public abstract class ShowThreddsFolderInfoView extends Composite {
}); });
if(isCreateConfiguration) { if(isCreateConfiguration) {
WsThreddsWidget.wsThreddsSyncService.getListOfVREsForLoggedUser(new AsyncCallback<List<GcubeVRE>>() { WsThreddsWidget.wsThreddsSyncService.getListOfScopesForLoggedUser(new AsyncCallback<List<GcubeScope>>() {
@Override @Override
public void onSuccess(List<GcubeVRE> result) { public void onSuccess(List<GcubeScope> result) {
for (GcubeScope gcubeScope : result) {
for (GcubeVRE gcubeVRE : result) { String toValue = FormatUtil.toScopeValue(gcubeScope);
mapVREs.put(gcubeVRE.getVreScope(), gcubeVRE); mapScopes.put(gcubeScope.getScopeName(), gcubeScope);
field_select_vre.addItem(gcubeVRE.getVreScope(), gcubeVRE.getVreName()); field_select_scope.addItem(toValue, gcubeScope.getScopeName());
} }
} }
@ -198,7 +207,7 @@ public abstract class ShowThreddsFolderInfoView extends Composite {
*/ */
public void updateViewToResult(WsFolder folder, WsThreddsSynchFolderDescriptor syncFolderDesc) { public void updateViewToResult(WsFolder folder, WsThreddsSynchFolderDescriptor syncFolderDesc) {
this.field_select_vre.clear(); this.field_select_scope.clear();
if(syncFolderDesc==null) { if(syncFolderDesc==null) {
pager.getRight().setVisible(false); pager.getRight().setVisible(false);
@ -209,10 +218,11 @@ public abstract class ShowThreddsFolderInfoView extends Composite {
this.field_folder_status.setValue(syncFolderDesc.getSyncStatus().toString()); this.field_folder_status.setValue(syncFolderDesc.getSyncStatus().toString());
} }
if(syncFolderDesc.getSelectedVRE()!=null) { if(syncFolderDesc.getSelectedScope()!=null) {
this.field_select_vre.addItem(syncFolderDesc.getSelectedVRE().getVreScope(), syncFolderDesc.getSelectedVRE().getVreName()); String toValue = FormatUtil.toScopeValue(syncFolderDesc.getSelectedScope());
this.field_select_vre.setValue(0, syncFolderDesc.getSelectedVRE().getVreName()); this.field_select_scope.addItem(toValue, syncFolderDesc.getSelectedScope().getScopeName());
this.field_select_vre.setSelectedValue(syncFolderDesc.getSelectedVRE().getVreName()); this.field_select_scope.setValue(0, syncFolderDesc.getSelectedScope().getScopeName());
this.field_select_scope.setSelectedValue(syncFolderDesc.getSelectedScope().getScopeName());
} }
ThSyncFolderDescriptor sfd = syncFolderDesc.getServerFolderDescriptor(); ThSyncFolderDescriptor sfd = syncFolderDesc.getServerFolderDescriptor();
@ -245,6 +255,11 @@ public abstract class ShowThreddsFolderInfoView extends Composite {
} }
} }
/**
* Checks if is creates the configuration.
*
* @return true, if is creates the configuration
*/
public boolean isCreateConfiguration() { public boolean isCreateConfiguration() {
return isCreateConfiguration; return isCreateConfiguration;
} }
@ -295,22 +310,33 @@ public abstract class ShowThreddsFolderInfoView extends Composite {
} }
/** /**
* Gets the unit description. * Gets the selected scope.
* *
* @return the unit description * @return the selected scope
*/ */
public GcubeVRE getSelectedVRE(){ public GcubeScope getSelectedScope(){
String item = field_select_vre.getSelectedItemText(); //String item = field_select_scope.getSelectedItemText();
String text = field_select_vre.getSelectedValue(); String scope = field_select_scope.getSelectedValue();
return mapVREs.get(item); return mapScopes.get(scope);
} }
/**
* Gets the pager.
*
* @return the pager
*/
public Pager getPager() { public Pager getPager() {
return pager; return pager;
} }
/**
* Gets the main panel.
*
* @return the main panel
*/
public HTMLPanel getMainPanel(){ public HTMLPanel getMainPanel(){
return form_unit_fields; return form_unit_fields;
} }

View File

@ -40,9 +40,9 @@
</b:ControlGroup> </b:ControlGroup>
<b:ControlGroup ui:field="cg_unit_description"> <b:ControlGroup ui:field="cg_unit_description">
<b:ControlLabel for="cl_course_description">Published in the VRE</b:ControlLabel> <b:ControlLabel for="cl_course_description">Published in the Scope</b:ControlLabel>
<b:Controls> <b:Controls>
<b:ListBox b:id="field_select_vre" ui:field="field_select_vre"> <b:ListBox b:id="field_select_scope" ui:field="field_select_scope">
</b:ListBox> </b:ListBox>
</b:Controls> </b:Controls>
</b:ControlGroup> </b:ControlGroup>

View File

@ -2,11 +2,13 @@ package org.gcube.portlets.widgets.wsthreddssync.server;
import static org.gcube.common.authorization.client.Constants.authorizationService; import static org.gcube.common.authorization.client.Constants.authorizationService;
import org.apache.commons.lang.StringUtils;
import org.gcube.common.authorization.library.AuthorizationEntry; import org.gcube.common.authorization.library.AuthorizationEntry;
import org.gcube.portal.wssynclibrary.shared.thredds.Sync_Status; import org.gcube.portal.wssynclibrary.shared.thredds.Sync_Status;
import org.gcube.portal.wssynclibrary.shared.thredds.ThSyncFolderDescriptor; import org.gcube.portal.wssynclibrary.shared.thredds.ThSyncFolderDescriptor;
import org.gcube.portal.wssynclibrary.shared.thredds.ThSynchFolderConfiguration; import org.gcube.portal.wssynclibrary.shared.thredds.ThSynchFolderConfiguration;
import org.gcube.portlets.widgets.wsthreddssync.shared.GcubeVRE; import org.gcube.portlets.widgets.wsthreddssync.shared.GcubeScope;
import org.gcube.portlets.widgets.wsthreddssync.shared.GcubeScopeType;
import org.gcube.portlets.widgets.wsthreddssync.shared.WsThreddsSynchFolderConfiguration; import org.gcube.portlets.widgets.wsthreddssync.shared.WsThreddsSynchFolderConfiguration;
import org.gcube.portlets.widgets.wsthreddssync.shared.WsThreddsSynchFolderDescriptor; import org.gcube.portlets.widgets.wsthreddssync.shared.WsThreddsSynchFolderDescriptor;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -47,9 +49,9 @@ public class BeanConverter {
try { try {
AuthorizationEntry entry = authorizationService().get(t.getConfiguration().getTargetToken()); AuthorizationEntry entry = authorizationService().get(t.getConfiguration().getTargetToken());
String scope = entry.getContext(); String scope = entry.getContext();
GcubeVRE selectedVRE = new GcubeVRE(scope, scope); GcubeScope selectedScope = new GcubeScope(toScopeTitle(scope), scope, toGcubeScope(scope));
ws.setSelectedVRE(selectedVRE); ws.setSelectedScope(selectedScope);
logger.debug("Resolved VRE: "+selectedVRE +" from token"); logger.debug("Resolved SCOPE: "+selectedScope +" from token");
}catch (Exception e) { }catch (Exception e) {
// TODO: handle exception // TODO: handle exception
} }
@ -59,7 +61,42 @@ public class BeanConverter {
return ws; return ws;
}; }
public static String toScopeTitle(String scope){
if(scope==null || scope.isEmpty())
return null;
return scope.substring(scope.lastIndexOf("/")+1, scope.length());
}
/**
* To gcube scope.
*
* @param scopeName the scope name
* @return the gcube scope type
*/
public static GcubeScopeType toGcubeScope(String scopeName){
if(scopeName==null)
return null;
int count = StringUtils.countMatches(scopeName, "/");
if(count==1)
return GcubeScopeType.ROOT;
else if(count==2)
return GcubeScopeType.VO;
else if(count==3)
return GcubeScopeType.VRE;
return null;
}
/** /**
* To th synch folder configuration. * To th synch folder configuration.

View File

@ -1,91 +0,0 @@
package org.gcube.portlets.widgets.wsthreddssync.server;
import java.util.HashMap;
import java.util.Map;
import javax.servlet.http.HttpSession;
import org.gcube.portlets.widgets.wsthreddssync.shared.TransferOnThreddsReport;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class SessionUtil {
private static Logger logger = LoggerFactory.getLogger(SessionUtil.class);
public static final String FOLDER_SYNCRONIZE_WITH_THREDDS = "Folder_Syncronize_With_Thredds";
/**
* Sets the folder publishing on thredds.
*
* @param session the session
* @param report the report
*/
public static void setTransferPublishingOnThredds(HttpSession session, TransferOnThreddsReport report){
Map<String, TransferOnThreddsReport> map = getMapTransferPublishingOnThredds(session);
if(map!=null)
map.put(report.getTransferId(), report);
}
/**
* Gets the folder publishing on thredds.
*
* @param session the session
* @return the folder publishing on thredds
*/
public static Map<String, TransferOnThreddsReport> getMapTransferPublishingOnThredds(HttpSession session){
Map<String, TransferOnThreddsReport> map = null;
try{
map = (Map<String,TransferOnThreddsReport>) session.getAttribute(FOLDER_SYNCRONIZE_WITH_THREDDS);
if(map==null){
logger.info("Creating new map to trace syncronize with thredds... ");
map = new HashMap<String, TransferOnThreddsReport>();
session.setAttribute(FOLDER_SYNCRONIZE_WITH_THREDDS, map);
}
}catch (Exception e) {
logger.error("an error occurred instancing PropertySpecialFolderReader ",e);
}
return map;
}
/**
* Ge transfer publishing on thredds for id.
*
* @param session the session
* @param transferId the transfer id
* @return the transfer on thredds report
*/
public static TransferOnThreddsReport geTransferPublishingOnThreddsForId(HttpSession session, String transferId){
Map<String, TransferOnThreddsReport> map = getMapTransferPublishingOnThredds(session);
if(map!=null){
return map.get(transferId);
}
return null;
}
/**
* Prints the as sys out.
*
* @param txt the txt
*/
public static void printAsSysOut(String txt) {
System.out.println(txt);
}
}

View File

@ -11,7 +11,8 @@ import org.gcube.portal.wssynclibrary.shared.thredds.ThSyncFolderDescriptor;
import org.gcube.portal.wssynclibrary.shared.thredds.ThSyncStatus; import org.gcube.portal.wssynclibrary.shared.thredds.ThSyncStatus;
import org.gcube.portal.wssynclibrary.shared.thredds.ThSynchFolderConfiguration; import org.gcube.portal.wssynclibrary.shared.thredds.ThSynchFolderConfiguration;
import org.gcube.portlets.widgets.wsthreddssync.client.rpc.ThreddsWorkspaceSyncService; import org.gcube.portlets.widgets.wsthreddssync.client.rpc.ThreddsWorkspaceSyncService;
import org.gcube.portlets.widgets.wsthreddssync.shared.GcubeVRE; import org.gcube.portlets.widgets.wsthreddssync.shared.GcubeScope;
import org.gcube.portlets.widgets.wsthreddssync.shared.GcubeScopeType;
import org.gcube.portlets.widgets.wsthreddssync.shared.WsThreddsSynchFolderConfiguration; import org.gcube.portlets.widgets.wsthreddssync.shared.WsThreddsSynchFolderConfiguration;
import org.gcube.portlets.widgets.wsthreddssync.shared.WsThreddsSynchFolderDescriptor; import org.gcube.portlets.widgets.wsthreddssync.shared.WsThreddsSynchFolderDescriptor;
import org.gcube.vomanagement.usermanagement.GroupManager; import org.gcube.vomanagement.usermanagement.GroupManager;
@ -101,7 +102,7 @@ public class ThreddsWorkspaceSyncServiceImpl extends RemoteServiceServlet implem
String targetScopeUserToken = null; String targetScopeUserToken = null;
ThSynchFolderConfiguration config = null; ThSynchFolderConfiguration config = null;
if(clientConfig!=null) { if(clientConfig!=null) {
targetScopeUserToken = PortalContext.getConfiguration().getCurrentUserToken(clientConfig.getTheVRE().getVreScope(), user.getUsername()); targetScopeUserToken = PortalContext.getConfiguration().getCurrentUserToken(clientConfig.getSelectedScope().getScopeName(), user.getUsername());
config = BeanConverter.toThSynchFolderConfiguration(clientConfig, targetScopeUserToken); config = BeanConverter.toThSynchFolderConfiguration(clientConfig, targetScopeUserToken);
logger.debug("Creating server config "+config); logger.debug("Creating server config "+config);
} }
@ -158,20 +159,22 @@ public class ThreddsWorkspaceSyncServiceImpl extends RemoteServiceServlet implem
* @throws Exception the exception * @throws Exception the exception
*/ */
@Override @Override
public List<GcubeVRE> getListOfVREsForLoggedUser() throws Exception{ public List<GcubeScope> getListOfScopesForLoggedUser() throws Exception{
logger.debug("getListOfVREsForLoggedUser...: "); logger.debug("getListOfVREsForLoggedUser...: ");
SessionUtil.printAsSysOut("\n\n\n\n getListOfVREsForLoggedUser"); //SessionUtil.printAsSysOut("\n\n\n\n getListOfVREsForLoggedUser");
//PortalContextInfo context = WsUtil.getPortalContext(this.getThreadLocalRequest()); //PortalContextInfo context = WsUtil.getPortalContext(this.getThreadLocalRequest());
GCubeUser user = PortalContext.getConfiguration().getCurrentUser(this.getThreadLocalRequest()); GCubeUser user = PortalContext.getConfiguration().getCurrentUser(this.getThreadLocalRequest());
long userId = user.getUserId(); long userId = user.getUserId();
// Instanciate the manager // Instanciate the manager
GroupManager groupManager = new LiferayGroupManager(); GroupManager groupManager = new LiferayGroupManager();
List<GcubeVRE> listOfVres = new ArrayList<GcubeVRE>(); List<GcubeScope> listOfVres = new ArrayList<GcubeScope>();
if (!isWithinPortal()){ if (!isWithinPortal()){
listOfVres.add(new GcubeVRE("devVRE", "/gcube/devsec/devVRE")); listOfVres.add(new GcubeScope("devVRE", "/gcube/devsec/devVRE", GcubeScopeType.VRE));
listOfVres.add(new GcubeVRE("NextNext", "/gcube/devNext/NextNext")); listOfVres.add(new GcubeScope("NextNext", "/gcube/devNext/NextNext", GcubeScopeType.VRE));
listOfVres.add(new GcubeScope("/gcube/devNext", "/gcube/devNext", GcubeScopeType.VO));
listOfVres.add(new GcubeScope("/gcube", "/gcube", GcubeScopeType.ROOT));
return listOfVres; return listOfVres;
} }
@ -179,10 +182,20 @@ public class ThreddsWorkspaceSyncServiceImpl extends RemoteServiceServlet implem
List<GCubeGroup> listOfGroups = groupManager.listGroupsByUser(userId); List<GCubeGroup> listOfGroups = groupManager.listGroupsByUser(userId);
for (GCubeGroup gCubeGroup : listOfGroups) { for (GCubeGroup gCubeGroup : listOfGroups) {
GcubeScopeType scopeType=null;
if(groupManager.isVRE(gCubeGroup.getGroupId())){ if(groupManager.isVRE(gCubeGroup.getGroupId())){
GcubeVRE gcubeVRE = new GcubeVRE(gCubeGroup.getGroupName(), groupManager.getInfrastructureScope(gCubeGroup.getGroupId())); scopeType = GcubeScopeType.VRE;
}else if(groupManager.isVO(gCubeGroup.getGroupId())){
scopeType = GcubeScopeType.VO;
}else if(groupManager.isRootVO(gCubeGroup.getGroupId())){
scopeType = GcubeScopeType.ROOT;
}
if(scopeType!=null){
GcubeScope gcubeVRE = new GcubeScope(gCubeGroup.getGroupName(), groupManager.getInfrastructureScope(gCubeGroup.getGroupId()), scopeType);
listOfVres.add(gcubeVRE); listOfVres.add(gcubeVRE);
} }
} }
} }

View File

@ -0,0 +1,127 @@
package org.gcube.portlets.widgets.wsthreddssync.shared;
import java.io.Serializable;
import com.google.gwt.user.client.rpc.IsSerializable;
// TODO: Auto-generated Javadoc
/**
* The Class GcubeVRE.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Feb 14, 2018
*/
public class GcubeScope implements Serializable, IsSerializable{
/**
*
*/
private static final long serialVersionUID = -6427520549519606384L;
private GcubeScopeType scopeType;
private String scopeTitle;
private String scopeName;
/**
* Instantiates a new gcube VRE.
*/
public GcubeScope() {
}
/**
* Instantiates a new gcube scope.
*
* @param scopeTitle the scope title
* @param scopeName the scope name
* @param scopeType the scope type
*/
public GcubeScope(String scopeTitle, String scopeName, GcubeScopeType scopeType) {
super();
this.scopeTitle = scopeTitle;
this.scopeName = scopeName;
this.scopeType = scopeType;
}
/**
* @return the scopeType
*/
public GcubeScopeType getScopeType() {
return scopeType;
}
/**
* @return the scopeTitle
*/
public String getScopeTitle() {
return scopeTitle;
}
/**
* @return the scopeName
*/
public String getScopeName() {
return scopeName;
}
/**
* @param scopeType the scopeType to set
*/
public void setScopeType(GcubeScopeType scopeType) {
this.scopeType = scopeType;
}
/**
* @param scopeTitle the scopeTitle to set
*/
public void setScopeTitle(String scopeTitle) {
this.scopeTitle = scopeTitle;
}
/**
* @param scopeName the scopeName to set
*/
public void setScopeName(String scopeName) {
this.scopeName = scopeName;
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("GcubeScope [scopeType=");
builder.append(scopeType);
builder.append(", scopeTitle=");
builder.append(scopeTitle);
builder.append(", scopeName=");
builder.append(scopeName);
builder.append("]");
return builder.toString();
}
}

View File

@ -0,0 +1,19 @@
/**
*
*/
package org.gcube.portlets.widgets.wsthreddssync.shared;
/**
* The Enum GcubeScopeType.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Mar 12, 2018
*/
public enum GcubeScopeType {
ROOT,
VO,
VRE
}

View File

@ -1,111 +0,0 @@
package org.gcube.portlets.widgets.wsthreddssync.shared;
import java.io.Serializable;
import com.google.gwt.user.client.rpc.IsSerializable;
// TODO: Auto-generated Javadoc
/**
* The Class GcubeVRE.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Feb 14, 2018
*/
public class GcubeVRE implements Serializable, IsSerializable{
/**
*
*/
private static final long serialVersionUID = -6427520549519606384L;
/** The vre name. */
private String vreName;
/** The vre scope. */
private String vreScope;
/**
* Instantiates a new gcube VRE.
*/
public GcubeVRE() {
}
/**
* Instantiates a new gcube VRE.
*
* @param vreName the vre name
* @param vreScope the vre scope
*/
public GcubeVRE(String vreName, String vreScope) {
super();
this.vreName = vreName;
this.vreScope = vreScope;
}
/**
* Gets the vre name.
*
* @return the vreName
*/
public String getVreName() {
return vreName;
}
/**
* Gets the vre scope.
*
* @return the vreScope
*/
public String getVreScope() {
return vreScope;
}
/**
* Sets the vre name.
*
* @param vreName the vreName to set
*/
public void setVreName(String vreName) {
this.vreName = vreName;
}
/**
* Sets the vre scope.
*
* @param vreScope the vreScope to set
*/
public void setVreScope(String vreScope) {
this.vreScope = vreScope;
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("GcubeVRE [vreName=");
builder.append(vreName);
builder.append(", vreScope=");
builder.append(vreScope);
builder.append("]");
return builder.toString();
}
}

View File

@ -1,201 +0,0 @@
/**
*
*/
package org.gcube.portlets.widgets.wsthreddssync.shared;
import java.io.Serializable;
import com.google.gwt.user.client.rpc.IsSerializable;
// TODO: Auto-generated Javadoc
/**
* The Class TransferOnThreddsReport.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Feb 7, 2018
*/
public class TransferOnThreddsReport implements Serializable, IsSerializable{
/**
*
*/
private static final long serialVersionUID = 326492579557983L;
/** The transfer id. */
private String transferId;
/** The folder id. */
private String folderId;
/** The on error. */
private Boolean onError = false;
/** The report message. */
private String reportMessage = null;
/** The report created on workspace. */
private Boolean reportCreatedOnWorkspace = false;
/**
* Instantiates a new transfer on thredds report.
*/
public TransferOnThreddsReport() {
}
/**
* Instantiates a new transfer on thredds report.
*
* @param transferId the transfer id
* @param folderId the folder id
* @param onError the on error
* @param reportMessage the report message
*/
public TransferOnThreddsReport(String transferId, String folderId, Boolean onError, String reportMessage) {
this.transferId = transferId;
this.folderId = folderId;
this.onError = onError;
this.reportMessage = reportMessage;
}
/**
* Sets the report created on workspace.
*
* @param reportCreatedOnWorkspace the reportCreated to set
*/
public void setReportCreatedOnWorkspace(Boolean reportCreatedOnWorkspace) {
this.reportCreatedOnWorkspace = reportCreatedOnWorkspace;
}
/**
* Checks if is transferring report available.
*
* @return the boolean
*/
public Boolean isTransferringReportAvailable() {
return reportCreatedOnWorkspace;
}
/**
* Gets the transfer id.
*
* @return the transferId
*/
public String getTransferId() {
return transferId;
}
/**
* Gets the folder id.
*
* @return the folderId
*/
public String getFolderId() {
return folderId;
}
/**
* Gets the on error.
*
* @return the onError
*/
public Boolean isOnError() {
return onError;
}
/**
* Sets the transfer id.
*
* @param transferId the transferId to set
*/
public void setTransferId(String transferId) {
this.transferId = transferId;
}
/**
* Sets the folder id.
*
* @param folderId the folderId to set
*/
public void setFolderId(String folderId) {
this.folderId = folderId;
}
/**
* Sets the on error.
*
* @param onError the onError to set
*/
public void setOnError(Boolean onError) {
this.onError = onError;
}
/**
* Gets the report message.
*
* @return the reportMessage
*/
public String getReportMessage() {
return reportMessage;
}
/**
* Sets the report message.
*
* @param reportMessage the reportMessage to set
*/
public void setReportMessage(String reportMessage) {
this.reportMessage = reportMessage;
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("TransferOnThreddsReport [transferId=");
builder.append(transferId);
builder.append(", folderId=");
builder.append(folderId);
builder.append(", onError=");
builder.append(onError);
builder.append(", reportMessage=");
builder.append(reportMessage);
builder.append(", reportCreated=");
builder.append(reportCreatedOnWorkspace);
builder.append("]");
return builder.toString();
}
}

View File

@ -1,232 +0,0 @@
/**
*
*/
package org.gcube.portlets.widgets.wsthreddssync.shared;
import java.io.Serializable;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
// TODO: Auto-generated Javadoc
/**
* The Class TransferToThreddsProperty.
*
* @author Francesco Mangiacrapa francesco.mangiacrapa@isti.cnr.it
* Feb 7, 2018
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement
public class TransferToThreddsProperty implements Serializable{
/** The folder id. */
private String folderId;
/** The catalogue name. */
private String catalogueName;
/** The vre name. */
private String vreName;
/** The vre scope. */
private String vreScope;
/** The metadata folder id. */
private String metadataFolderId;
/** The metadata folder name. */
private String metadataFolderName;
/**
* Instantiates a new transfering to thredds property.
*/
public TransferToThreddsProperty() {
}
/**
* Instantiates a new transfering to thredds property.
*
* @param folderId the folder id
* @param catalogueName the catalogue name
* @param vreName the vre name
* @param vreScope the vre scope
* @param metadataFolderId the metadata folder id
* @param metadataFolderName the metadata folder name
*/
public TransferToThreddsProperty(
String folderId, String catalogueName, String vreName,
String vreScope, String metadataFolderId, String metadataFolderName) {
super();
this.folderId = folderId;
this.catalogueName = catalogueName;
this.vreName = vreName;
this.vreScope = vreScope;
this.metadataFolderId = metadataFolderId;
this.metadataFolderName = metadataFolderName;
}
/**
* Gets the folder id.
*
* @return the folderId
*/
public String getFolderId() {
return folderId;
}
/**
* Gets the catalogue name.
*
* @return the catalogueName
*/
public String getCatalogueName() {
return catalogueName;
}
/**
* Gets the vre name.
*
* @return the vreName
*/
public String getVreName() {
return vreName;
}
/**
* Gets the vre scope.
*
* @return the vreScope
*/
public String getVreScope() {
return vreScope;
}
/**
* Gets the metadata folder id.
*
* @return the metadataFolderId
*/
public String getMetadataFolderId() {
return metadataFolderId;
}
/**
* Gets the metadata folder name.
*
* @return the metadataFolderName
*/
public String getMetadataFolderName() {
return metadataFolderName;
}
/**
* Sets the folder id.
*
* @param folderId the folderId to set
*/
public void setFolderId(String folderId) {
this.folderId = folderId;
}
/**
* Sets the catalogue name.
*
* @param catalogueName the catalogueName to set
*/
public void setCatalogueName(String catalogueName) {
this.catalogueName = catalogueName;
}
/**
* Sets the vre name.
*
* @param vreName the vreName to set
*/
public void setVreName(String vreName) {
this.vreName = vreName;
}
/**
* Sets the vre scope.
*
* @param vreScope the vreScope to set
*/
public void setVreScope(String vreScope) {
this.vreScope = vreScope;
}
/**
* Sets the metadata folder id.
*
* @param metadataFolderId the metadataFolderId to set
*/
public void setMetadataFolderId(String metadataFolderId) {
this.metadataFolderId = metadataFolderId;
}
/**
* Sets the metadata folder name.
*
* @param metadataFolderName the metadataFolderName to set
*/
public void setMetadataFolderName(String metadataFolderName) {
this.metadataFolderName = metadataFolderName;
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("TransferToThreddsProperty [folderId=");
builder.append(folderId);
builder.append(", catalogueName=");
builder.append(catalogueName);
builder.append(", vreName=");
builder.append(vreName);
builder.append(", vreScope=");
builder.append(vreScope);
builder.append(", metadataFolderId=");
builder.append(metadataFolderId);
builder.append(", metadataFolderName=");
builder.append(metadataFolderName);
builder.append("]");
return builder.toString();
}
}

View File

@ -23,7 +23,7 @@ public class WsThreddsSynchFolderConfiguration implements Serializable{
/** The remote path. */ /** The remote path. */
private String remotePath; private String remotePath;
private GcubeVRE theSelectedVRE; private GcubeScope selectedScope;
/** The filter. */ /** The filter. */
private String filter; private String filter;
@ -46,15 +46,14 @@ public class WsThreddsSynchFolderConfiguration implements Serializable{
* Instantiates a new ws thredds synch folder configuration. * Instantiates a new ws thredds synch folder configuration.
* *
* @param remotePath the remote path * @param remotePath the remote path
* @param theVRE the the VRE * @param theVRE the the vre
* @param filter the filter * @param filter the filter
* @param catalogName the catalog name * @param catalogName the catalog name
* @param serverConf the server conf
*/ */
public WsThreddsSynchFolderConfiguration(String remotePath, GcubeVRE theVRE, String filter, String catalogName) { public WsThreddsSynchFolderConfiguration(String remotePath, GcubeScope theVRE, String filter, String catalogName) {
super(); super();
this.remotePath = remotePath; this.remotePath = remotePath;
this.theSelectedVRE = theVRE; this.selectedScope = theVRE;
this.filter = filter; this.filter = filter;
this.catalogName = catalogName; this.catalogName = catalogName;
} }
@ -77,24 +76,45 @@ public class WsThreddsSynchFolderConfiguration implements Serializable{
this.remotePath = remotePath; this.remotePath = remotePath;
} }
/**
* Gets the the VRE.
*
* @return the the VRE
*/
public GcubeVRE getTheVRE() {
return theSelectedVRE;
}
/** /**
* Sets the the VRE. * @return the selectedScope
*
* @param theVRE the new the VRE
*/ */
public void setTheVRE(GcubeVRE theVRE) { public GcubeScope getSelectedScope() {
this.theSelectedVRE = theVRE;
return selectedScope;
} }
/**
* @return the status
*/
public Status getStatus() {
return status;
}
/**
* @param selectedScope the selectedScope to set
*/
public void setSelectedScope(GcubeScope selectedScope) {
this.selectedScope = selectedScope;
}
/**
* @param status the status to set
*/
public void setStatus(Status status) {
this.status = status;
}
/** /**
* Gets the filter. * Gets the filter.
* *
@ -131,21 +151,28 @@ public class WsThreddsSynchFolderConfiguration implements Serializable{
this.catalogName = catalogName; this.catalogName = catalogName;
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see java.lang.Object#toString() * @see java.lang.Object#toString()
*/ */
@Override @Override
public String toString() { public String toString() {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.append("WsThreddsSynchFolderDescriptor [remotePath="); builder.append("WsThreddsSynchFolderConfiguration [remotePath=");
builder.append(remotePath); builder.append(remotePath);
builder.append(", theSelectedVRE="); builder.append(", selectedScope=");
builder.append(theSelectedVRE); builder.append(selectedScope);
builder.append(", filter="); builder.append(", filter=");
builder.append(filter); builder.append(filter);
builder.append(", catalogName="); builder.append(", catalogName=");
builder.append(catalogName); builder.append(catalogName);
builder.append(", status=");
builder.append(status);
builder.append("]"); builder.append("]");
return builder.toString(); return builder.toString();
} }
} }

View File

@ -20,7 +20,7 @@ public class WsThreddsSynchFolderDescriptor implements Serializable {
*/ */
private static final long serialVersionUID = -5395986188613871699L; private static final long serialVersionUID = -5395986188613871699L;
private GcubeVRE selectedVRE; private GcubeScope selectedScope;
private ThSyncFolderDescriptor serverFolderDescriptor; private ThSyncFolderDescriptor serverFolderDescriptor;
@ -33,28 +33,32 @@ public class WsThreddsSynchFolderDescriptor implements Serializable {
// TODO Auto-generated constructor stub // TODO Auto-generated constructor stub
} }
/** /**
* Instantiates a new ws thredds synch folder descriptor. * Instantiates a new ws thredds synch folder descriptor.
* *
* @param selectedVRE the selected VRE * @param selectedScope the selected scope
* @param serverFolderDescriptor the server folder descriptor * @param serverFolderDescriptor the server folder descriptor
* @param syncStatus the sync status * @param syncStatus the sync status
*/ */
public WsThreddsSynchFolderDescriptor(GcubeVRE selectedVRE, ThSyncFolderDescriptor serverFolderDescriptor, public WsThreddsSynchFolderDescriptor(GcubeScope selectedScope, ThSyncFolderDescriptor serverFolderDescriptor,
Sync_Status syncStatus) { Sync_Status syncStatus) {
super(); super();
this.selectedVRE = selectedVRE; this.selectedScope = selectedScope;
this.serverFolderDescriptor = serverFolderDescriptor; this.serverFolderDescriptor = serverFolderDescriptor;
this.syncStatus = syncStatus; this.syncStatus = syncStatus;
} }
/** /**
* Gets the selected VRE. * Gets the selected scope.
* *
* @return the selected VRE * @return the selectedScope
*/ */
public GcubeVRE getSelectedVRE() { public GcubeScope getSelectedScope() {
return selectedVRE;
return selectedScope;
} }
/** /**
@ -76,14 +80,14 @@ public class WsThreddsSynchFolderDescriptor implements Serializable {
return syncStatus; return syncStatus;
} }
/** /**
* Sets the selected VRE. * Sets the selected scope.
* *
* @param selectedVRE * @param selectedVRE the new selected scope
* the new selected VRE
*/ */
public void setSelectedVRE(GcubeVRE selectedVRE) { public void setSelectedScope(GcubeScope selectedVRE) {
this.selectedVRE = selectedVRE; this.selectedScope = selectedVRE;
} }
/** /**
@ -105,11 +109,14 @@ public class WsThreddsSynchFolderDescriptor implements Serializable {
this.serverFolderDescriptor = serverFolderDescriptor; this.serverFolderDescriptor = serverFolderDescriptor;
} }
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@Override @Override
public String toString() { public String toString() {
StringBuilder builder = new StringBuilder(); StringBuilder builder = new StringBuilder();
builder.append("WsThreddsSynchFolderDescriptor [selectedVRE="); builder.append("WsThreddsSynchFolderDescriptor [selectedVRE=");
builder.append(selectedVRE); builder.append(selectedScope);
builder.append(", serverFolderDescriptor="); builder.append(", serverFolderDescriptor=");
builder.append(serverFolderDescriptor); builder.append(serverFolderDescriptor);
builder.append(", syncStatus="); builder.append(", syncStatus=");