Added Delete Validations
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@115466 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
b454b07d2d
commit
c794410030
|
@ -420,6 +420,16 @@ public interface TDGWTService extends RemoteService {
|
||||||
public ArrayList<ColumnData> getValidationColumns(String columnLocalId,
|
public ArrayList<ColumnData> getValidationColumns(String columnLocalId,
|
||||||
TRId trId) throws TDGWTServiceException;
|
TRId trId) throws TDGWTServiceException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remove Validations from tabular resource
|
||||||
|
*
|
||||||
|
* @param trId
|
||||||
|
* @return
|
||||||
|
* @throws TDGWTServiceException
|
||||||
|
*/
|
||||||
|
public String startValidationsDelete(TRId trId)
|
||||||
|
throws TDGWTServiceException;
|
||||||
|
|
||||||
// RollBack
|
// RollBack
|
||||||
/**
|
/**
|
||||||
* Call rollback on tabular resource
|
* Call rollback on tabular resource
|
||||||
|
@ -460,7 +470,6 @@ public interface TDGWTService extends RemoteService {
|
||||||
public void setShareTemplate(ShareTemplate shareTemplate)
|
public void setShareTemplate(ShareTemplate shareTemplate)
|
||||||
throws TDGWTServiceException;
|
throws TDGWTServiceException;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Share Rule
|
* Share Rule
|
||||||
*
|
*
|
||||||
|
@ -468,8 +477,7 @@ public interface TDGWTService extends RemoteService {
|
||||||
* @return
|
* @return
|
||||||
* @throws TDGWTServiceException
|
* @throws TDGWTServiceException
|
||||||
*/
|
*/
|
||||||
public void setShareRule(ShareRule shareRule)
|
public void setShareRule(ShareRule shareRule) throws TDGWTServiceException;
|
||||||
throws TDGWTServiceException;
|
|
||||||
|
|
||||||
// Open
|
// Open
|
||||||
|
|
||||||
|
@ -568,11 +576,11 @@ public interface TDGWTService extends RemoteService {
|
||||||
*/
|
*/
|
||||||
public ArrayList<ColumnData> getColumnWithViewColumnIncluded(TRId trId)
|
public ArrayList<ColumnData> getColumnWithViewColumnIncluded(TRId trId)
|
||||||
throws TDGWTServiceException;
|
throws TDGWTServiceException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the list of columns in the table provided by trId
|
* Retrieves the list of columns in the table provided by trId only view
|
||||||
* only view columns in relationship are included.
|
* columns in relationship are included. TimeDimensionColumn and
|
||||||
* TimeDimensionColumn and DimensionColumn are not included.
|
* DimensionColumn are not included.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
* @param trId
|
* @param trId
|
||||||
|
@ -581,7 +589,7 @@ public interface TDGWTService extends RemoteService {
|
||||||
*/
|
*/
|
||||||
public ArrayList<ColumnData> getColumnWithOnlyViewColumnInRel(TRId trId)
|
public ArrayList<ColumnData> getColumnWithOnlyViewColumnInRel(TRId trId)
|
||||||
throws TDGWTServiceException;
|
throws TDGWTServiceException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the list of columns in the table provided by trId for
|
* Retrieves the list of columns in the table provided by trId for
|
||||||
* statistical
|
* statistical
|
||||||
|
|
|
@ -215,6 +215,8 @@ public interface TDGWTServiceAsync {
|
||||||
|
|
||||||
void getValidationColumns(String columnLocalId, TRId trId,
|
void getValidationColumns(String columnLocalId, TRId trId,
|
||||||
AsyncCallback<ArrayList<ColumnData>> callback);
|
AsyncCallback<ArrayList<ColumnData>> callback);
|
||||||
|
|
||||||
|
void startValidationsDelete(TRId trId, AsyncCallback<String> callback);
|
||||||
|
|
||||||
// RollBack
|
// RollBack
|
||||||
void startRollBack(RollBackSession rollBackSession,
|
void startRollBack(RollBackSession rollBackSession,
|
||||||
|
|
|
@ -5846,7 +5846,59 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public String startValidationsDelete(TRId trId)
|
||||||
|
throws TDGWTServiceException {
|
||||||
|
try {
|
||||||
|
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||||
|
ASLSession aslSession = SessionUtil.getAslSession(session);
|
||||||
|
|
||||||
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
|
aslSession.getUsername(), aslSession.getScope()));
|
||||||
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
|
||||||
|
checkTRId(trId);
|
||||||
|
|
||||||
|
TabularResourceId tabularResourceId = new TabularResourceId(
|
||||||
|
Long.valueOf(trId.getId()));
|
||||||
|
TabularResource tabularResource = service
|
||||||
|
.getTabularResource(tabularResourceId);
|
||||||
|
|
||||||
|
checkTabularResourceIsFlow(tabularResource);
|
||||||
|
checkTabularResourceLocked(tabularResource);
|
||||||
|
checkTabularResourceIsFinal(tabularResource);
|
||||||
|
|
||||||
|
Task trTask = service.removeValidations(tabularResourceId);
|
||||||
|
logger.debug("Start Task on service: TaskId " + trTask.getId());
|
||||||
|
|
||||||
|
TaskWrapper taskWrapper = new TaskWrapper(trTask,
|
||||||
|
UIOperationsId.ValidationsDelete, trId);
|
||||||
|
SessionUtil.setStartedTask(session, taskWrapper);
|
||||||
|
|
||||||
|
return trTask.getId().getValue();
|
||||||
|
} catch (TDGWTServiceException e) {
|
||||||
|
throw e;
|
||||||
|
} catch (SecurityException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS);
|
||||||
|
} catch (Throwable e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new TDGWTServiceException(
|
||||||
|
"Error deleting validations: "
|
||||||
|
+ e.getLocalizedMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private ArrayList<Contacts> retrieveShareInfo(TabularResource tr)
|
private ArrayList<Contacts> retrieveShareInfo(TabularResource tr)
|
||||||
throws TDGWTServiceException {
|
throws TDGWTServiceException {
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue