Added Locked
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@99564 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
53ea631110
commit
59808d9050
|
@ -13,11 +13,11 @@ import java.text.SimpleDateFormat;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.GregorianCalendar;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.GregorianCalendar;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -26,7 +26,6 @@ import java.util.Set;
|
||||||
|
|
||||||
import javax.servlet.http.HttpSession;
|
import javax.servlet.http.HttpSession;
|
||||||
|
|
||||||
import org.gcube.data.analysis.tabulardata.expression.Expression;
|
|
||||||
import org.gcube.application.framework.core.session.ASLSession;
|
import org.gcube.application.framework.core.session.ASLSession;
|
||||||
import org.gcube.common.homelibrary.home.Home;
|
import org.gcube.common.homelibrary.home.Home;
|
||||||
import org.gcube.common.homelibrary.home.HomeLibrary;
|
import org.gcube.common.homelibrary.home.HomeLibrary;
|
||||||
|
@ -46,6 +45,7 @@ import org.gcube.data.analysis.tabulardata.commons.webservice.types.TemplateDesc
|
||||||
import org.gcube.data.analysis.tabulardata.commons.webservice.types.operations.OperationDefinition;
|
import org.gcube.data.analysis.tabulardata.commons.webservice.types.operations.OperationDefinition;
|
||||||
import org.gcube.data.analysis.tabulardata.commons.webservice.types.operations.OperationExecution;
|
import org.gcube.data.analysis.tabulardata.commons.webservice.types.operations.OperationExecution;
|
||||||
import org.gcube.data.analysis.tabulardata.commons.webservice.types.tasks.ValidationDescriptor;
|
import org.gcube.data.analysis.tabulardata.commons.webservice.types.tasks.ValidationDescriptor;
|
||||||
|
import org.gcube.data.analysis.tabulardata.expression.Expression;
|
||||||
import org.gcube.data.analysis.tabulardata.metadata.NoSuchMetadataException;
|
import org.gcube.data.analysis.tabulardata.metadata.NoSuchMetadataException;
|
||||||
import org.gcube.data.analysis.tabulardata.model.column.Column;
|
import org.gcube.data.analysis.tabulardata.model.column.Column;
|
||||||
import org.gcube.data.analysis.tabulardata.model.column.ColumnLocalId;
|
import org.gcube.data.analysis.tabulardata.model.column.ColumnLocalId;
|
||||||
|
@ -381,6 +381,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
currentTR.setDate(sdf.format(tr.getCreationDate().getTime()));
|
currentTR.setDate(sdf.format(tr.getCreationDate().getTime()));
|
||||||
currentTR.setValid(tr.isValid());
|
currentTR.setValid(tr.isValid());
|
||||||
currentTR.setFinalized(tr.isFinalized());
|
currentTR.setFinalized(tr.isFinalized());
|
||||||
|
currentTR.setLocked(tr.isLocked());
|
||||||
Contacts owner = new Contacts("", tr.getOwner(), false);
|
Contacts owner = new Contacts("", tr.getOwner(), false);
|
||||||
currentTR.setOwner(owner);
|
currentTR.setOwner(owner);
|
||||||
SessionUtil.setTabResource(session, currentTR);
|
SessionUtil.setTabResource(session, currentTR);
|
||||||
|
@ -441,6 +442,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
currentTR.setDate(sdf.format(tr.getCreationDate().getTime()));
|
currentTR.setDate(sdf.format(tr.getCreationDate().getTime()));
|
||||||
currentTR.setValid(tr.isValid());
|
currentTR.setValid(tr.isValid());
|
||||||
currentTR.setFinalized(tr.isFinalized());
|
currentTR.setFinalized(tr.isFinalized());
|
||||||
|
currentTR.setLocked(tr.isLocked());
|
||||||
Contacts owner = new Contacts("", tr.getOwner(), false);
|
Contacts owner = new Contacts("", tr.getOwner(), false);
|
||||||
currentTR.setOwner(owner);
|
currentTR.setOwner(owner);
|
||||||
logger.debug("GetTabResourceInformation() updated information:"
|
logger.debug("GetTabResourceInformation() updated information:"
|
||||||
|
@ -1490,6 +1492,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
|
@ -1506,6 +1509,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
+ tabResource.getRight() + "]");
|
+ tabResource.getRight() + "]");
|
||||||
tabResource.setDate(sdf.format(tr.getCreationDate().getTime()));
|
tabResource.setDate(sdf.format(tr.getCreationDate().getTime()));
|
||||||
tabResource.setValid(tr.isValid());
|
tabResource.setValid(tr.isValid());
|
||||||
|
tabResource.setFinalized(tr.isFinalized());
|
||||||
|
tabResource.setLocked(tr.isLocked());
|
||||||
tr.setMetadata(new NameMetadata(tabResource.getName()));
|
tr.setMetadata(new NameMetadata(tabResource.getName()));
|
||||||
tr.setMetadata(new DescriptionMetadata(tabResource.getDescription()));
|
tr.setMetadata(new DescriptionMetadata(tabResource.getDescription()));
|
||||||
// tr.setMetadata(new CreationDateMetadata(date));
|
// tr.setMetadata(new CreationDateMetadata(date));
|
||||||
|
@ -1515,7 +1520,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
}
|
}
|
||||||
tr.setMetadata(new RightsMetadata(tabResource.getRight()));
|
tr.setMetadata(new RightsMetadata(tabResource.getRight()));
|
||||||
|
|
||||||
if(tabResource.getValidFrom()!=null&& !tabResource.getValidFrom().isEmpty()){
|
if (tabResource.getValidFrom() != null
|
||||||
|
&& !tabResource.getValidFrom().isEmpty()) {
|
||||||
try {
|
try {
|
||||||
Date dateF = sdfDate.parse(tabResource.getValidFrom());
|
Date dateF = sdfDate.parse(tabResource.getValidFrom());
|
||||||
GregorianCalendar validFromC = new GregorianCalendar();
|
GregorianCalendar validFromC = new GregorianCalendar();
|
||||||
|
@ -1528,7 +1534,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tabResource.getValidUntilTo()!=null&& !tabResource.getValidUntilTo().isEmpty()){
|
if (tabResource.getValidUntilTo() != null
|
||||||
|
&& !tabResource.getValidUntilTo().isEmpty()) {
|
||||||
try {
|
try {
|
||||||
Date dateU = sdfDate.parse(tabResource.getValidUntilTo());
|
Date dateU = sdfDate.parse(tabResource.getValidUntilTo());
|
||||||
GregorianCalendar validUntilToC = new GregorianCalendar();
|
GregorianCalendar validUntilToC = new GregorianCalendar();
|
||||||
|
@ -1541,20 +1548,20 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tabResource.getLicence()!=null && !tabResource.getLicence().isEmpty()){
|
if (tabResource.getLicence() != null
|
||||||
|
&& !tabResource.getLicence().isEmpty()) {
|
||||||
LicenceMetadata licenceMetadata = new LicenceMetadata();
|
LicenceMetadata licenceMetadata = new LicenceMetadata();
|
||||||
Licence licence = LicenceMap.map(tabResource.getLicence());
|
Licence licence = LicenceMap.map(tabResource.getLicence());
|
||||||
if (licence != null) {
|
if (licence != null) {
|
||||||
licenceMetadata.setValue(licence);
|
licenceMetadata.setValue(licence);
|
||||||
tr.setMetadata(licenceMetadata);
|
tr.setMetadata(licenceMetadata);
|
||||||
} else {
|
} else {
|
||||||
logger.error("Licence type not found: "+tabResource.getLicence());
|
logger.error("Licence type not found: "
|
||||||
|
+ tabResource.getLicence());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1589,6 +1596,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
t.setTrId(trId);
|
t.setTrId(trId);
|
||||||
t.setValid(tr.isValid());
|
t.setValid(tr.isValid());
|
||||||
t.setFinalized(tr.isFinalized());
|
t.setFinalized(tr.isFinalized());
|
||||||
|
t.setLocked(tr.isLocked());
|
||||||
Contacts owner = new Contacts("", tr.getOwner(), false);
|
Contacts owner = new Contacts("", tr.getOwner(), false);
|
||||||
t.setOwner(owner);
|
t.setOwner(owner);
|
||||||
|
|
||||||
|
@ -1653,7 +1661,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// logger.debug("TabResource: "+t);
|
// logger.debug("TabResource: "+t);
|
||||||
return t;
|
return t;
|
||||||
|
|
||||||
|
@ -2255,6 +2262,10 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
TabularResourceId id = new TabularResourceId(Long.valueOf(trId
|
TabularResourceId id = new TabularResourceId(Long.valueOf(trId
|
||||||
.getId()));
|
.getId()));
|
||||||
TabularResource tr = service.getTabularResource(id);
|
TabularResource tr = service.getTabularResource(id);
|
||||||
|
if (tr.isLocked()) {
|
||||||
|
throw new TDGWTServiceException("Tabular Resource Is Locked");
|
||||||
|
}
|
||||||
|
|
||||||
String owner = tr.getOwner();
|
String owner = tr.getOwner();
|
||||||
if (owner != null && owner.compareTo(aslSession.getUsername()) == 0) {
|
if (owner != null && owner.compareTo(aslSession.getUsername()) == 0) {
|
||||||
service.removeTabularResource(id);
|
service.removeTabularResource(id);
|
||||||
|
@ -2309,8 +2320,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
serviceTR.getTableType(), String.valueOf(table.getId()
|
serviceTR.getTableType(), String.valueOf(table.getId()
|
||||||
.getValue()), table.getTableType().getName());
|
.getValue()), table.getTableType().getName());
|
||||||
tabResource.setTrId(trId);
|
tabResource.setTrId(trId);
|
||||||
tabResource.setValid(serviceTR.isValid());
|
|
||||||
tabResource.setFinalized(serviceTR.isFinalized());
|
|
||||||
return tabResource;
|
return tabResource;
|
||||||
|
|
||||||
} catch (TDGWTSessionExpiredException e) {
|
} catch (TDGWTSessionExpiredException e) {
|
||||||
|
@ -3061,6 +3071,45 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check locked status of a tabular resource
|
||||||
|
*
|
||||||
|
* @param trId
|
||||||
|
* @return
|
||||||
|
* @throws TDGWTServiceException
|
||||||
|
*/
|
||||||
|
public Boolean isTabularResourceLocked(TRId trId)
|
||||||
|
throws TDGWTServiceException {
|
||||||
|
try {
|
||||||
|
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||||
|
ASLSession aslSession = SessionUtil.getAslSession(session);
|
||||||
|
|
||||||
|
logger.debug("IsTabularResourceLocked: " + trId);
|
||||||
|
|
||||||
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
|
aslSession.getUsername(), aslSession.getScope()));
|
||||||
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
|
||||||
|
TabularResource tr = service
|
||||||
|
.getTabularResource(new TabularResourceId(Long.valueOf(trId
|
||||||
|
.getId())));
|
||||||
|
logger.debug("IsTabularResourceLocked: " + tr.isLocked());
|
||||||
|
return tr.isLocked();
|
||||||
|
} catch (TDGWTSessionExpiredException e) {
|
||||||
|
throw e;
|
||||||
|
} catch (SecurityException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new TDGWTServiceException(
|
||||||
|
"Security exception, you haven't rights!");
|
||||||
|
} catch (Throwable e) {
|
||||||
|
logger.error("Error checking if it is a locked tabular resource: "
|
||||||
|
+ e.getLocalizedMessage(), e);
|
||||||
|
throw new TDGWTServiceException(
|
||||||
|
"Error checking if it is a locked tabular resource: "
|
||||||
|
+ e.getLocalizedMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
@ -3120,22 +3169,24 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
TRValidSinceMetadata validSinceMetadata = new TRValidSinceMetadata();
|
TRValidSinceMetadata validSinceMetadata = new TRValidSinceMetadata();
|
||||||
Calendar cal = ((ValidSinceMetadata) trMetadata)
|
Calendar cal = ((ValidSinceMetadata) trMetadata)
|
||||||
.getValue();
|
.getValue();
|
||||||
validSinceMetadata
|
validSinceMetadata.setValue(sdfDate
|
||||||
.setValue(sdfDate.format(cal.getTime()));
|
.format(cal.getTime()));
|
||||||
listTRMetadata.add(validSinceMetadata);
|
listTRMetadata.add(validSinceMetadata);
|
||||||
} else {
|
} else {
|
||||||
if (trMetadata instanceof ValidUntilMetadata) {
|
if (trMetadata instanceof ValidUntilMetadata) {
|
||||||
TRValidUntilMetadata validUntilMetadata = new TRValidUntilMetadata();
|
TRValidUntilMetadata validUntilMetadata = new TRValidUntilMetadata();
|
||||||
Calendar cal = ((ValidUntilMetadata) trMetadata)
|
Calendar cal = ((ValidUntilMetadata) trMetadata)
|
||||||
.getValue();
|
.getValue();
|
||||||
validUntilMetadata
|
validUntilMetadata.setValue(sdfDate
|
||||||
.setValue(sdfDate.format(cal.getTime()));
|
.format(cal.getTime()));
|
||||||
listTRMetadata.add(validUntilMetadata);
|
listTRMetadata.add(validUntilMetadata);
|
||||||
} else {
|
} else {
|
||||||
if (trMetadata instanceof LicenceMetadata) {
|
if (trMetadata instanceof LicenceMetadata) {
|
||||||
TRLicenceMetadata licenceMetadata = new TRLicenceMetadata();
|
TRLicenceMetadata licenceMetadata = new TRLicenceMetadata();
|
||||||
licenceMetadata
|
licenceMetadata
|
||||||
.setValue(((LicenceMetadata) trMetadata).getValue().toString());
|
.setValue(((LicenceMetadata) trMetadata)
|
||||||
|
.getValue()
|
||||||
|
.toString());
|
||||||
listTRMetadata.add(licenceMetadata);
|
listTRMetadata.add(licenceMetadata);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -3431,6 +3482,46 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
return parameterInstances;
|
return parameterInstances;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param service
|
||||||
|
* @param trId
|
||||||
|
* @throws TDGWTServiceException
|
||||||
|
*/
|
||||||
|
protected void checkTabularResourceLocked(TabularDataService service,
|
||||||
|
TRId trId) throws TDGWTServiceException {
|
||||||
|
try {
|
||||||
|
if (trId == null) {
|
||||||
|
logger.error("TRId is null");
|
||||||
|
new TDGWTServiceException(
|
||||||
|
"No valid tabular resource id present");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (trId.getId() == null || trId.getId().isEmpty()) {
|
||||||
|
logger.error("TRId not valid: " + trId);
|
||||||
|
new TDGWTServiceException(
|
||||||
|
"No valid tabular resource id present");
|
||||||
|
}
|
||||||
|
|
||||||
|
TabularResourceId tabularResourceId = new TabularResourceId(
|
||||||
|
Long.valueOf(trId.getId()));
|
||||||
|
TabularResource tabularResource = service
|
||||||
|
.getTabularResource(tabularResourceId);
|
||||||
|
|
||||||
|
if (tabularResource.isLocked()) {
|
||||||
|
throw new TDGWTServiceException("Tabular Resource Is Locked");
|
||||||
|
}
|
||||||
|
|
||||||
|
} catch (TDGWTSessionExpiredException e) {
|
||||||
|
throw e;
|
||||||
|
} catch (SecurityException e) {
|
||||||
|
throw e;
|
||||||
|
} catch (Throwable e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new TDGWTServiceException(e.getLocalizedMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param exportSession
|
* @param exportSession
|
||||||
|
@ -3473,6 +3564,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
aslSession.getUsername(), aslSession.getScope()));
|
aslSession.getUsername(), aslSession.getScope()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
|
||||||
|
checkTabularResourceLocked(service, trId);
|
||||||
|
|
||||||
// Export SDMX Codelist
|
// Export SDMX Codelist
|
||||||
OperationDefinition exportSDMXOperation = OperationDefinitionMap
|
OperationDefinition exportSDMXOperation = OperationDefinitionMap
|
||||||
.map(OperationsId.SDMXCodelistExport.toString(), service);
|
.map(OperationsId.SDMXCodelistExport.toString(), service);
|
||||||
|
@ -3546,6 +3639,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
aslSession.getUsername(), aslSession.getScope()));
|
aslSession.getUsername(), aslSession.getScope()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
checkTabularResourceLocked(service, trId);
|
||||||
|
|
||||||
// Export CSV file
|
// Export CSV file
|
||||||
OperationDefinition exportCSVFileOperation = OperationDefinitionMap
|
OperationDefinition exportCSVFileOperation = OperationDefinitionMap
|
||||||
|
@ -3598,6 +3692,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
aslSession.getUsername(), aslSession.getScope()));
|
aslSession.getUsername(), aslSession.getScope()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
checkTabularResourceLocked(service, changeColumnTypeSession
|
||||||
|
.getColumnData().getTrId());
|
||||||
|
|
||||||
OpExecution4ChangeColumnType opEx = new OpExecution4ChangeColumnType(
|
OpExecution4ChangeColumnType opEx = new OpExecution4ChangeColumnType(
|
||||||
service, changeColumnTypeSession);
|
service, changeColumnTypeSession);
|
||||||
|
@ -3652,6 +3748,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
aslSession.getUsername(), aslSession.getScope()));
|
aslSession.getUsername(), aslSession.getScope()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
checkTabularResourceLocked(service, addColumnSession.getTrId());
|
||||||
|
|
||||||
OpExecution4AddColumn opEx = new OpExecution4AddColumn(service,
|
OpExecution4AddColumn opEx = new OpExecution4AddColumn(service,
|
||||||
addColumnSession);
|
addColumnSession);
|
||||||
|
@ -3705,6 +3802,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
aslSession.getUsername(), aslSession.getScope()));
|
aslSession.getUsername(), aslSession.getScope()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
checkTabularResourceLocked(service, deleteColumnSession.getTrId());
|
||||||
|
|
||||||
OpExecution4DeleteColumn opEx = new OpExecution4DeleteColumn(
|
OpExecution4DeleteColumn opEx = new OpExecution4DeleteColumn(
|
||||||
service, deleteColumnSession);
|
service, deleteColumnSession);
|
||||||
|
@ -3772,9 +3870,11 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
aslSession.getUsername(), aslSession.getScope()));
|
aslSession.getUsername(), aslSession.getScope()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
checkTabularResourceLocked(service, filterColumnSession.getColumn()
|
||||||
|
.getTrId());
|
||||||
|
|
||||||
OpExecution4FilterColumn opEx = new OpExecution4FilterColumn(service,
|
OpExecution4FilterColumn opEx = new OpExecution4FilterColumn(
|
||||||
filterColumnSession, expression);
|
service, filterColumnSession, expression);
|
||||||
OpExecutionDirector director = new OpExecutionDirector();
|
OpExecutionDirector director = new OpExecutionDirector();
|
||||||
director.setOperationExecutionBuilder(opEx);
|
director.setOperationExecutionBuilder(opEx);
|
||||||
director.constructOperationExecution();
|
director.constructOperationExecution();
|
||||||
|
@ -3785,8 +3885,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
throw new TDGWTServiceException(
|
throw new TDGWTServiceException(
|
||||||
"Error in invocation: Operation not supported");
|
"Error in invocation: Operation not supported");
|
||||||
}
|
}
|
||||||
Long id = Long.valueOf(
|
Long id = Long.valueOf(filterColumnSession.getColumn().getTrId()
|
||||||
filterColumnSession.getColumn().getTrId().getId());
|
.getId());
|
||||||
|
|
||||||
TabularResourceId serviceTR = new TabularResourceId(id);
|
TabularResourceId serviceTR = new TabularResourceId(id);
|
||||||
logger.debug("OperationInvocation: \n" + invocations.toString());
|
logger.debug("OperationInvocation: \n" + invocations.toString());
|
||||||
|
@ -3813,8 +3913,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
|
@ -3830,6 +3928,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
aslSession.getUsername(), aslSession.getScope()));
|
aslSession.getUsername(), aslSession.getScope()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
checkTabularResourceLocked(service, labelColumnSession.getTrId());
|
||||||
|
|
||||||
OpExecution4LabelColumn opEx = new OpExecution4LabelColumn(service,
|
OpExecution4LabelColumn opEx = new OpExecution4LabelColumn(service,
|
||||||
labelColumnSession);
|
labelColumnSession);
|
||||||
|
@ -3843,14 +3942,13 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
throw new TDGWTServiceException("Operation not supported");
|
throw new TDGWTServiceException("Operation not supported");
|
||||||
}
|
}
|
||||||
TabularResourceId serviceTR = new TabularResourceId(
|
TabularResourceId serviceTR = new TabularResourceId(
|
||||||
Long.valueOf(labelColumnSession.getTrId()
|
Long.valueOf(labelColumnSession.getTrId().getId()));
|
||||||
.getId()));
|
|
||||||
logger.debug("OperationInvocation: \n" + invocations);
|
logger.debug("OperationInvocation: \n" + invocations);
|
||||||
Task trTask = service.executeBatch(invocations, serviceTR);
|
Task trTask = service.executeBatch(invocations, serviceTR);
|
||||||
logger.debug("Start Task on service: TaskId " + trTask.getId());
|
logger.debug("Start Task on service: TaskId " + trTask.getId());
|
||||||
TaskWrapper taskWrapper = new TaskWrapper(trTask,
|
TaskWrapper taskWrapper = new TaskWrapper(trTask,
|
||||||
UIOperationsId.ChangeColumnLabel, labelColumnSession
|
UIOperationsId.ChangeColumnLabel,
|
||||||
.getTrId());
|
labelColumnSession.getTrId());
|
||||||
SessionUtil.setTaskStarted(session, taskWrapper);
|
SessionUtil.setTaskStarted(session, taskWrapper);
|
||||||
|
|
||||||
return trTask.getId().getValue();
|
return trTask.getId().getValue();
|
||||||
|
@ -3885,6 +3983,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
aslSession.getUsername(), aslSession.getScope()));
|
aslSession.getUsername(), aslSession.getScope()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
checkTabularResourceLocked(service,
|
||||||
|
changeTableTypeSession.getTrId());
|
||||||
|
|
||||||
OpExecution4ChangeTableType opEx = new OpExecution4ChangeTableType(
|
OpExecution4ChangeTableType opEx = new OpExecution4ChangeTableType(
|
||||||
service, changeTableTypeSession);
|
service, changeTableTypeSession);
|
||||||
|
@ -4056,6 +4156,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
aslSession.getUsername(), aslSession.getScope()));
|
aslSession.getUsername(), aslSession.getScope()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
checkTabularResourceLocked(service, deleteRowsSession.getTrId());
|
||||||
|
|
||||||
OpExecution4DeleteRows opEx = new OpExecution4DeleteRows(service,
|
OpExecution4DeleteRows opEx = new OpExecution4DeleteRows(service,
|
||||||
deleteRowsSession);
|
deleteRowsSession);
|
||||||
|
@ -4098,6 +4199,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
*
|
*
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String startCloneTabularResource(
|
public String startCloneTabularResource(
|
||||||
CloneTabularResourceSession cloneTabularResourceSession)
|
CloneTabularResourceSession cloneTabularResourceSession)
|
||||||
|
@ -4113,6 +4215,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
+ cloneTabularResourceSession);
|
+ cloneTabularResourceSession);
|
||||||
|
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
checkTabularResourceLocked(service,
|
||||||
|
cloneTabularResourceSession.getTrId());
|
||||||
|
|
||||||
OpExecution4Clone opEx = new OpExecution4Clone(service,
|
OpExecution4Clone opEx = new OpExecution4Clone(service,
|
||||||
cloneTabularResourceSession);
|
cloneTabularResourceSession);
|
||||||
|
@ -4193,6 +4297,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
aslSession.getUsername(), aslSession.getScope()));
|
aslSession.getUsername(), aslSession.getScope()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
checkTabularResourceLocked(service, duplicatesSession.getTrId());
|
||||||
|
|
||||||
OpExecution4Duplicates opEx = new OpExecution4Duplicates(service,
|
OpExecution4Duplicates opEx = new OpExecution4Duplicates(service,
|
||||||
duplicatesSession);
|
duplicatesSession);
|
||||||
|
@ -4299,8 +4404,10 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
aslSession.getUsername(), aslSession.getScope()));
|
aslSession.getUsername(), aslSession.getScope()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
checkTabularResourceLocked(service, shareInfo.getTabResource()
|
||||||
|
.getTrId());
|
||||||
|
|
||||||
TabularResourceId serviceTR = new TabularResourceId(
|
TabularResourceId tabularResourceId = new TabularResourceId(
|
||||||
Long.valueOf(shareInfo.getTabResource().getTrId().getId()));
|
Long.valueOf(shareInfo.getTabResource().getTrId().getId()));
|
||||||
|
|
||||||
List<AuthorizationToken> users = new ArrayList<AuthorizationToken>();
|
List<AuthorizationToken> users = new ArrayList<AuthorizationToken>();
|
||||||
|
@ -4317,7 +4424,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
.toArray(new AuthorizationToken[0]);
|
.toArray(new AuthorizationToken[0]);
|
||||||
|
|
||||||
logger.debug("Share with Users: " + users);
|
logger.debug("Share with Users: " + users);
|
||||||
service.share(serviceTR, usersArray);
|
service.share(tabularResourceId, usersArray);
|
||||||
|
|
||||||
} catch (TDGWTSessionExpiredException e) {
|
} catch (TDGWTSessionExpiredException e) {
|
||||||
throw e;
|
throw e;
|
||||||
|
@ -4378,6 +4485,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
aslSession.getUsername(), aslSession.getScope()));
|
aslSession.getUsername(), aslSession.getScope()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
checkTabularResourceLocked(service, tabResource.getTrId());
|
||||||
|
|
||||||
TabularResourceId tabularResourceId = new TabularResourceId(
|
TabularResourceId tabularResourceId = new TabularResourceId(
|
||||||
new Long(tabResource.getTrId().getId()));
|
new Long(tabResource.getTrId().getId()));
|
||||||
|
@ -4408,7 +4516,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
tr.setMetadata(rights);
|
tr.setMetadata(rights);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tabResource.getValidFrom()!=null&& !tabResource.getValidFrom().isEmpty()){
|
if (tabResource.getValidFrom() != null
|
||||||
|
&& !tabResource.getValidFrom().isEmpty()) {
|
||||||
try {
|
try {
|
||||||
Date dateF = sdfDate.parse(tabResource.getValidFrom());
|
Date dateF = sdfDate.parse(tabResource.getValidFrom());
|
||||||
GregorianCalendar validFromC = new GregorianCalendar();
|
GregorianCalendar validFromC = new GregorianCalendar();
|
||||||
|
@ -4421,7 +4530,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tabResource.getValidUntilTo()!=null&& !tabResource.getValidUntilTo().isEmpty()){
|
if (tabResource.getValidUntilTo() != null
|
||||||
|
&& !tabResource.getValidUntilTo().isEmpty()) {
|
||||||
try {
|
try {
|
||||||
Date dateU = sdfDate.parse(tabResource.getValidUntilTo());
|
Date dateU = sdfDate.parse(tabResource.getValidUntilTo());
|
||||||
GregorianCalendar validUntilToC = new GregorianCalendar();
|
GregorianCalendar validUntilToC = new GregorianCalendar();
|
||||||
|
@ -4434,23 +4544,29 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(tabResource.getLicence()!=null && !tabResource.getLicence().isEmpty()){
|
if (tabResource.getLicence() != null
|
||||||
|
&& !tabResource.getLicence().isEmpty()) {
|
||||||
LicenceMetadata licenceMetadata = new LicenceMetadata();
|
LicenceMetadata licenceMetadata = new LicenceMetadata();
|
||||||
Licence licence = LicenceMap.map(tabResource.getLicence());
|
Licence licence = LicenceMap.map(tabResource.getLicence());
|
||||||
if (licence != null) {
|
if (licence != null) {
|
||||||
licenceMetadata.setValue(licence);
|
licenceMetadata.setValue(licence);
|
||||||
tr.setMetadata(licenceMetadata);
|
tr.setMetadata(licenceMetadata);
|
||||||
} else {
|
} else {
|
||||||
logger.error("Licence type not found: "+tabResource.getLicence());
|
logger.error("Licence type not found: "
|
||||||
|
+ tabResource.getLicence());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (tabResource.isFinalized()) {
|
if (tabResource.isFinalized()) {
|
||||||
|
if (tr.isValid()) {
|
||||||
if (!tr.isFinalized()) {
|
if (!tr.isFinalized()) {
|
||||||
tr.finalize();
|
tr.finalize();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
throw new TDGWTServiceException(
|
||||||
|
"Only valid tabular resource can be finalized!");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
logger.debug("setTabResourceInformation - new information:" + tr);
|
logger.debug("setTabResourceInformation - new information:" + tr);
|
||||||
|
|
||||||
|
@ -4590,6 +4706,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
aslSession.getUsername(), aslSession.getScope()));
|
aslSession.getUsername(), aslSession.getScope()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
checkTabularResourceLocked(service, templateApplySession.getTrId());
|
||||||
|
|
||||||
TemplateId templateId = new TemplateId(templateApplySession
|
TemplateId templateId = new TemplateId(templateApplySession
|
||||||
.getTemplateData().getId());
|
.getTemplateData().getId());
|
||||||
|
@ -4678,6 +4795,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
aslSession.getUsername(), aslSession.getScope()));
|
aslSession.getUsername(), aslSession.getScope()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
checkTabularResourceLocked(service, replaceColumnSession.getTrId());
|
||||||
|
|
||||||
OpExecution4ReplaceColumn opEx = new OpExecution4ReplaceColumn(
|
OpExecution4ReplaceColumn opEx = new OpExecution4ReplaceColumn(
|
||||||
service, replaceColumnSession);
|
service, replaceColumnSession);
|
||||||
|
@ -4736,6 +4854,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
aslSession.getUsername(), aslSession.getScope()));
|
aslSession.getUsername(), aslSession.getScope()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
checkTabularResourceLocked(service,
|
||||||
|
replaceBatchColumnSession.getTrId());
|
||||||
|
|
||||||
OpExecution4ReplaceBatch opEx = new OpExecution4ReplaceBatch(
|
OpExecution4ReplaceBatch opEx = new OpExecution4ReplaceBatch(
|
||||||
service, replaceBatchColumnSession);
|
service, replaceBatchColumnSession);
|
||||||
|
@ -5068,6 +5188,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
aslSession.getUsername(), aslSession.getScope()));
|
aslSession.getUsername(), aslSession.getScope()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
checkTabularResourceLocked(service, trId);
|
||||||
|
|
||||||
TabularResourceId tabularResourceId = new TabularResourceId(
|
TabularResourceId tabularResourceId = new TabularResourceId(
|
||||||
Long.valueOf(trId.getId()));
|
Long.valueOf(trId.getId()));
|
||||||
|
@ -5137,6 +5258,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
aslSession.getUsername(), aslSession.getScope()));
|
aslSession.getUsername(), aslSession.getScope()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
checkTabularResourceLocked(service, rollBackSession.getTrId());
|
||||||
|
|
||||||
TabularResourceId tabularResourceId = new TabularResourceId(
|
TabularResourceId tabularResourceId = new TabularResourceId(
|
||||||
Long.valueOf(rollBackSession.getTrId().getId()));
|
Long.valueOf(rollBackSession.getTrId().getId()));
|
||||||
|
@ -5186,7 +5308,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
|
|
||||||
ArrayList<TaskS> taskSList = new ArrayList<TaskS>();
|
ArrayList<TaskS> taskSList = new ArrayList<TaskS>();
|
||||||
List<Task> tasks = service.getTasks(tabularResourceId);
|
List<Task> tasks = service.getTasks(tabularResourceId);
|
||||||
for (Task task : tasks) {
|
if(tasks.size()>0) {
|
||||||
|
Task task=tasks.get(0);
|
||||||
ArrayList<JobS> jobSList = new ArrayList<JobS>();
|
ArrayList<JobS> jobSList = new ArrayList<JobS>();
|
||||||
int j = 1;
|
int j = 1;
|
||||||
for (Job job : task.getTaskJobs()) {
|
for (Job job : task.getTaskJobs()) {
|
||||||
|
@ -5275,6 +5398,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
aslSession.getUsername(), aslSession.getScope()));
|
aslSession.getUsername(), aslSession.getScope()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
checkTabularResourceLocked(service, editRowSession.getTrId());
|
||||||
|
|
||||||
OpExecution4EditRow opEx = new OpExecution4EditRow(service,
|
OpExecution4EditRow opEx = new OpExecution4EditRow(service,
|
||||||
editRowSession);
|
editRowSession);
|
||||||
|
@ -5372,15 +5496,16 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
SessionUtil.setTaskResubmitSession(session, taskResubmitSession);
|
SessionUtil.setTaskResubmitSession(session, taskResubmitSession);
|
||||||
ASLSession aslSession = SessionUtil.getAslSession(session);
|
ASLSession aslSession = SessionUtil.getAslSession(session);
|
||||||
logger.debug("StartTaskResubmit: " + taskResubmitSession);
|
logger.debug("StartTaskResubmit: " + taskResubmitSession);
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
|
||||||
aslSession.getUsername(), aslSession.getScope()));
|
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
|
||||||
|
|
||||||
if (taskResubmitSession == null) {
|
if (taskResubmitSession == null) {
|
||||||
logger.error("TaskResubmitSession is null");
|
logger.error("TaskResubmitSession is null");
|
||||||
throw new TDGWTServiceException(
|
throw new TDGWTServiceException(
|
||||||
"Error in resubmit task: TaskResubmitSession is null");
|
"Error in resubmit task: TaskResubmitSession is null");
|
||||||
}
|
}
|
||||||
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
|
aslSession.getUsername(), aslSession.getScope()));
|
||||||
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
checkTabularResourceLocked(service, taskResubmitSession.getTrId());
|
||||||
|
|
||||||
if (taskResubmitSession.getTaskId() == null
|
if (taskResubmitSession.getTaskId() == null
|
||||||
|| taskResubmitSession.getTaskId().isEmpty()) {
|
|| taskResubmitSession.getTaskId().isEmpty()) {
|
||||||
logger.error("Task Id is: " + taskResubmitSession.getTaskId());
|
logger.error("Task Id is: " + taskResubmitSession.getTaskId());
|
||||||
|
@ -5421,15 +5546,16 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
SessionUtil.setTaskResumeSession(session, taskResumeSession);
|
SessionUtil.setTaskResumeSession(session, taskResumeSession);
|
||||||
ASLSession aslSession = SessionUtil.getAslSession(session);
|
ASLSession aslSession = SessionUtil.getAslSession(session);
|
||||||
logger.debug("StartTaskResume: " + taskResumeSession);
|
logger.debug("StartTaskResume: " + taskResumeSession);
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
|
||||||
aslSession.getUsername(), aslSession.getScope()));
|
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
|
||||||
|
|
||||||
if (taskResumeSession == null) {
|
if (taskResumeSession == null) {
|
||||||
logger.error("TaskResumeSession is null");
|
logger.error("TaskResumeSession is null");
|
||||||
throw new TDGWTServiceException(
|
throw new TDGWTServiceException(
|
||||||
"Error in resume: TaskResumeSession is null");
|
"Error in resume: TaskResumeSession is null");
|
||||||
}
|
}
|
||||||
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
|
aslSession.getUsername(), aslSession.getScope()));
|
||||||
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
checkTabularResourceLocked(service, taskResumeSession.getTrId());
|
||||||
|
|
||||||
if (taskResumeSession.getTaskId() == null
|
if (taskResumeSession.getTaskId() == null
|
||||||
|| taskResumeSession.getTaskId().isEmpty()) {
|
|| taskResumeSession.getTaskId().isEmpty()) {
|
||||||
logger.error("Task Id is: " + taskResumeSession.getTaskId());
|
logger.error("Task Id is: " + taskResumeSession.getTaskId());
|
||||||
|
@ -5560,16 +5686,17 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
SessionUtil.setExtractCodelistSession(session,
|
SessionUtil.setExtractCodelistSession(session,
|
||||||
extractCodelistSession);
|
extractCodelistSession);
|
||||||
ASLSession aslSession = SessionUtil.getAslSession(session);
|
ASLSession aslSession = SessionUtil.getAslSession(session);
|
||||||
|
logger.debug("StartExtractCodelist: " + extractCodelistSession);
|
||||||
if (extractCodelistSession == null) {
|
if (extractCodelistSession == null) {
|
||||||
logger.error("ExtractCodelistSession is null");
|
logger.error("ExtractCodelistSession is null");
|
||||||
throw new TDGWTServiceException(
|
throw new TDGWTServiceException(
|
||||||
"Error in extract codelist: ExtractCodelistSession is null");
|
"Error in extract codelist: ExtractCodelistSession is null");
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.debug("StartExtractCodelist: " + extractCodelistSession);
|
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
aslSession.getUsername(), aslSession.getScope()));
|
aslSession.getUsername(), aslSession.getScope()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
checkTabularResourceLocked(service,
|
||||||
|
extractCodelistSession.getTrId());
|
||||||
|
|
||||||
OpExecution4ExtractCodelist opEx = new OpExecution4ExtractCodelist(
|
OpExecution4ExtractCodelist opEx = new OpExecution4ExtractCodelist(
|
||||||
service, extractCodelistSession);
|
service, extractCodelistSession);
|
||||||
|
@ -5610,7 +5737,6 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
|
||||||
public String startSplitColumn(SplitColumnSession splitColumnSession,
|
public String startSplitColumn(SplitColumnSession splitColumnSession,
|
||||||
HttpSession session) throws TDGWTServiceException {
|
HttpSession session) throws TDGWTServiceException {
|
||||||
try {
|
try {
|
||||||
|
@ -5627,6 +5753,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
aslSession.getUsername(), aslSession.getScope()));
|
aslSession.getUsername(), aslSession.getScope()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
checkTabularResourceLocked(service, splitColumnSession
|
||||||
|
.getColumnData().getTrId());
|
||||||
|
|
||||||
OpExecution4SplitColumn opEx = new OpExecution4SplitColumn(service,
|
OpExecution4SplitColumn opEx = new OpExecution4SplitColumn(service,
|
||||||
splitColumnSession);
|
splitColumnSession);
|
||||||
|
@ -5685,6 +5813,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
aslSession.getUsername(), aslSession.getScope()));
|
aslSession.getUsername(), aslSession.getScope()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
checkTabularResourceLocked(service, mergeColumnSession
|
||||||
|
.getColumnDataSource1().getTrId());
|
||||||
|
|
||||||
OpExecution4MergeColumn opEx = new OpExecution4MergeColumn(service,
|
OpExecution4MergeColumn opEx = new OpExecution4MergeColumn(service,
|
||||||
mergeColumnSession);
|
mergeColumnSession);
|
||||||
|
@ -5859,7 +5989,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.debug("StartCodelistMappingImport: "
|
logger.debug("StartCodelistMappingImport: "
|
||||||
+ codelistMappingSession.toString());
|
+ codelistMappingSession);
|
||||||
|
|
||||||
SessionUtil.setCodelistMappingSession(session,
|
SessionUtil.setCodelistMappingSession(session,
|
||||||
codelistMappingSession);
|
codelistMappingSession);
|
||||||
|
@ -5925,6 +6055,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(aslSession
|
AuthorizationProvider.instance.set(new AuthorizationToken(aslSession
|
||||||
.getUsername(), aslSession.getScope()));
|
.getUsername(), aslSession.getScope()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
checkTabularResourceLocked(service, codelistMappingSession.getTrId());
|
||||||
|
|
||||||
OpExecution4CodelistMapping opEx = new OpExecution4CodelistMapping(
|
OpExecution4CodelistMapping opEx = new OpExecution4CodelistMapping(
|
||||||
service, codelistMappingSession, importUrl);
|
service, codelistMappingSession, importUrl);
|
||||||
|
@ -5964,6 +6095,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
aslSession.getUsername(), aslSession.getScope()));
|
aslSession.getUsername(), aslSession.getScope()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
checkTabularResourceLocked(service, groupBySession.getTrId());
|
||||||
|
|
||||||
OpExecution4GroupBy opEx = new OpExecution4GroupBy(service,
|
OpExecution4GroupBy opEx = new OpExecution4GroupBy(service,
|
||||||
groupBySession);
|
groupBySession);
|
||||||
|
@ -6017,6 +6149,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
aslSession.getUsername(), aslSession.getScope()));
|
aslSession.getUsername(), aslSession.getScope()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
checkTabularResourceLocked(service, normalizationSession.getTrId());
|
||||||
|
|
||||||
OpExecution4Normalization opEx = new OpExecution4Normalization(
|
OpExecution4Normalization opEx = new OpExecution4Normalization(
|
||||||
service, normalizationSession);
|
service, normalizationSession);
|
||||||
|
@ -6075,6 +6208,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
aslSession.getUsername(), aslSession.getScope()));
|
aslSession.getUsername(), aslSession.getScope()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
checkTabularResourceLocked(service, denormalizationSession.getTrId());
|
||||||
|
|
||||||
OpExecution4Denormalization opEx = new OpExecution4Denormalization(
|
OpExecution4Denormalization opEx = new OpExecution4Denormalization(
|
||||||
service, denormalizationSession);
|
service, denormalizationSession);
|
||||||
|
@ -6129,6 +6263,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
aslSession.getUsername(), aslSession.getScope()));
|
aslSession.getUsername(), aslSession.getScope()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
checkTabularResourceLocked(service, unionSession.getTrId());
|
||||||
|
|
||||||
OpExecution4Union opEx = new OpExecution4Union(service,
|
OpExecution4Union opEx = new OpExecution4Union(service,
|
||||||
unionSession);
|
unionSession);
|
||||||
|
|
|
@ -40,11 +40,6 @@ public class OpExecution4Clone extends OpExecutionBuilder {
|
||||||
public void buildOpEx() throws TDGWTServiceException {
|
public void buildOpEx() throws TDGWTServiceException {
|
||||||
logger.debug(cloneTabularResourceSession.toString());
|
logger.debug(cloneTabularResourceSession.toString());
|
||||||
|
|
||||||
if(cloneTabularResourceSession.getTrId()==null){
|
|
||||||
logger.error("TRId is null");
|
|
||||||
new TDGWTServiceException("No valid tabular resource id present");
|
|
||||||
}
|
|
||||||
|
|
||||||
TRId trId=cloneTabularResourceSession.getTrId();
|
TRId trId=cloneTabularResourceSession.getTrId();
|
||||||
TableId tableId;
|
TableId tableId;
|
||||||
if(trId.isViewTable()){
|
if(trId.isViewTable()){
|
||||||
|
|
|
@ -41,12 +41,6 @@ public class OpExecution4FilterColumn extends OpExecutionBuilder {
|
||||||
public void buildOpEx() throws TDGWTServiceException {
|
public void buildOpEx() throws TDGWTServiceException {
|
||||||
logger.debug(filterColumnSession.toString());
|
logger.debug(filterColumnSession.toString());
|
||||||
|
|
||||||
if(filterColumnSession.getColumn().getTrId()==null){
|
|
||||||
logger.error("TRId is null");
|
|
||||||
new TDGWTServiceException("No valid tabular resource id present");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
OperationDefinition operationDefinition;
|
OperationDefinition operationDefinition;
|
||||||
operationDefinition = OperationDefinitionMap.map(
|
operationDefinition = OperationDefinitionMap.map(
|
||||||
OperationsId.FilterByExpression.toString(), service);
|
OperationsId.FilterByExpression.toString(), service);
|
||||||
|
|
|
@ -42,11 +42,10 @@ public class OpExecution4ReplaceBatch extends OpExecutionBuilder {
|
||||||
@Override
|
@Override
|
||||||
public void buildOpEx() throws TDGWTServiceException {
|
public void buildOpEx() throws TDGWTServiceException {
|
||||||
ArrayList<OperationExecution> invocations = new ArrayList<OperationExecution>();
|
ArrayList<OperationExecution> invocations = new ArrayList<OperationExecution>();
|
||||||
|
logger.debug(replaceBatchColumnSession.toString());
|
||||||
for (ReplaceEntry re : replaceBatchColumnSession.getReplaceEntryList()) {
|
for (ReplaceEntry re : replaceBatchColumnSession.getReplaceEntryList()) {
|
||||||
|
|
||||||
OperationExecution invocation = null;
|
OperationExecution invocation = null;
|
||||||
|
|
||||||
logger.debug(replaceBatchColumnSession.toString());
|
|
||||||
OperationDefinition operationDefinition;
|
OperationDefinition operationDefinition;
|
||||||
Map<String, Object> map = new HashMap<String, Object>();
|
Map<String, Object> map = new HashMap<String, Object>();
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,7 @@ public class TabResource implements Serializable {
|
||||||
protected Contacts owner;
|
protected Contacts owner;
|
||||||
protected boolean valid;
|
protected boolean valid;
|
||||||
protected boolean finalized;
|
protected boolean finalized;
|
||||||
|
protected boolean locked;
|
||||||
|
|
||||||
public TabResource() {
|
public TabResource() {
|
||||||
}
|
}
|
||||||
|
@ -166,6 +167,14 @@ public class TabResource implements Serializable {
|
||||||
this.licence = licence;
|
this.licence = licence;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isLocked() {
|
||||||
|
return locked;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setLocked(boolean locked) {
|
||||||
|
this.locked = locked;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "TabResource [trId=" + trId + ", id=" + id + ", name=" + name
|
return "TabResource [trId=" + trId + ", id=" + id + ", name=" + name
|
||||||
|
@ -173,10 +182,8 @@ public class TabResource implements Serializable {
|
||||||
+ ", date=" + date + ", right=" + right + ", validFrom="
|
+ ", date=" + date + ", right=" + right + ", validFrom="
|
||||||
+ validFrom + ", validUntilTo=" + validUntilTo + ", licence="
|
+ validFrom + ", validUntilTo=" + validUntilTo + ", licence="
|
||||||
+ licence + ", owner=" + owner + ", valid=" + valid
|
+ licence + ", owner=" + owner + ", valid=" + valid
|
||||||
+ ", finalized=" + finalized + "]";
|
+ ", finalized=" + finalized + ", locked=" + locked + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue