Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalf Mollik2019-04-25 09:19:21 -0400
committerRalf Mollik2019-04-25 09:19:21 -0400
commit91a16910b215da3bb3a8d222090a1108555a9d7a (patch)
tree30e49ec76c0ac593c7b97bc41e262bc184816f13
parentc434093fab8e0de924a1e59f168446d6a086f798 (diff)
downloadorg.eclipse.osbp.xtext.table-91a16910b215da3bb3a8d222090a1108555a9d7a.tar.gz
org.eclipse.osbp.xtext.table-91a16910b215da3bb3a8d222090a1108555a9d7a.tar.xz
org.eclipse.osbp.xtext.table-91a16910b215da3bb3a8d222090a1108555a9d7a.zip
refactor image handling, adjusted legal info
-rw-r--r--org.eclipse.osbp.xtext.table.feature/feature.xml2
-rw-r--r--org.eclipse.osbp.xtext.table.ui/src/org/eclipse/osbp/xtext/table/ui/contentassist/TableDSLProposalProvider.xtend2
-rw-r--r--org.eclipse.osbp.xtext.table.ui/xtend-gen/org/eclipse/osbp/xtext/table/ui/contentassist/ImageFileNameTextApplier.java8
-rw-r--r--org.eclipse.osbp.xtext.table/src-gen/org/eclipse/osbp/xtext/table/parser/antlr/internal/InternalTableDSLLexer.java2
-rw-r--r--org.eclipse.osbp.xtext.table/src/org/eclipse/osbp/xtext/table/imports/ShouldImportProvider.java2
-rw-r--r--org.eclipse.osbp.xtext.table/src/org/eclipse/osbp/xtext/table/jvmmodel/TableDSLJvmModelInferrer.xtend176
-rw-r--r--org.eclipse.osbp.xtext.table/src/org/eclipse/osbp/xtext/table/jvmmodel/TableModelGenerator.xtend18
-rw-r--r--org.eclipse.osbp.xtext.table/src/org/eclipse/osbp/xtext/table/scoping/TableDSLScopeProvider.xtend709
-rw-r--r--org.eclipse.osbp.xtext.table/xtend-gen/org/eclipse/osbp/xtext/table/jvmmodel/TableDSLJvmModelInferrer.java464
-rw-r--r--org.eclipse.osbp.xtext.table/xtend-gen/org/eclipse/osbp/xtext/table/jvmmodel/TableModelGenerator.java16
10 files changed, 838 insertions, 561 deletions
diff --git a/org.eclipse.osbp.xtext.table.feature/feature.xml b/org.eclipse.osbp.xtext.table.feature/feature.xml
index a92456c..2832f5b 100644
--- a/org.eclipse.osbp.xtext.table.feature/feature.xml
+++ b/org.eclipse.osbp.xtext.table.feature/feature.xml
@@ -15,7 +15,7 @@
label="%featureName"
version="0.9.0.qualifier"
provider-name="%providerName"
- plugin="org.eclipse.osbp.xtext.table">
+ plugin="org.eclipse.osbp.license">
<description>
%description
diff --git a/org.eclipse.osbp.xtext.table.ui/src/org/eclipse/osbp/xtext/table/ui/contentassist/TableDSLProposalProvider.xtend b/org.eclipse.osbp.xtext.table.ui/src/org/eclipse/osbp/xtext/table/ui/contentassist/TableDSLProposalProvider.xtend
index b99714c..339ccbb 100644
--- a/org.eclipse.osbp.xtext.table.ui/src/org/eclipse/osbp/xtext/table/ui/contentassist/TableDSLProposalProvider.xtend
+++ b/org.eclipse.osbp.xtext.table.ui/src/org/eclipse/osbp/xtext/table/ui/contentassist/TableDSLProposalProvider.xtend
@@ -98,7 +98,7 @@ class ImageFileNameTextApplier extends ReplacementTextApplier {
var imageSelectorDialog = new ImageSelectorDialog(shell, 16);
imageSelectorDialog.setFilterExtensions(extensions)
var imageFileName = imageSelectorDialog.open(true);
- return "\"".concat(imageFileName).concat("\"");
+ return if (imageFileName !== null) "\"".concat(imageFileName).concat("\"") else "";
}
}
diff --git a/org.eclipse.osbp.xtext.table.ui/xtend-gen/org/eclipse/osbp/xtext/table/ui/contentassist/ImageFileNameTextApplier.java b/org.eclipse.osbp.xtext.table.ui/xtend-gen/org/eclipse/osbp/xtext/table/ui/contentassist/ImageFileNameTextApplier.java
index cf780ce..8b2a422 100644
--- a/org.eclipse.osbp.xtext.table.ui/xtend-gen/org/eclipse/osbp/xtext/table/ui/contentassist/ImageFileNameTextApplier.java
+++ b/org.eclipse.osbp.xtext.table.ui/xtend-gen/org/eclipse/osbp/xtext/table/ui/contentassist/ImageFileNameTextApplier.java
@@ -50,6 +50,12 @@ public class ImageFileNameTextApplier extends ReplacementTextApplier {
ImageSelectorDialog imageSelectorDialog = new ImageSelectorDialog(shell, 16);
imageSelectorDialog.setFilterExtensions(this.extensions);
String imageFileName = imageSelectorDialog.open(true);
- return "\"".concat(imageFileName).concat("\"");
+ String _xifexpression = null;
+ if ((imageFileName != null)) {
+ _xifexpression = "\"".concat(imageFileName).concat("\"");
+ } else {
+ _xifexpression = "";
+ }
+ return _xifexpression;
}
}
diff --git a/org.eclipse.osbp.xtext.table/src-gen/org/eclipse/osbp/xtext/table/parser/antlr/internal/InternalTableDSLLexer.java b/org.eclipse.osbp.xtext.table/src-gen/org/eclipse/osbp/xtext/table/parser/antlr/internal/InternalTableDSLLexer.java
index e33353a..82bbf83 100644
--- a/org.eclipse.osbp.xtext.table/src-gen/org/eclipse/osbp/xtext/table/parser/antlr/internal/InternalTableDSLLexer.java
+++ b/org.eclipse.osbp.xtext.table/src-gen/org/eclipse/osbp/xtext/table/parser/antlr/internal/InternalTableDSLLexer.java
@@ -6957,4 +6957,4 @@ public class InternalTableDSLLexer extends Lexer {
}
-} \ No newline at end of file
+}
diff --git a/org.eclipse.osbp.xtext.table/src/org/eclipse/osbp/xtext/table/imports/ShouldImportProvider.java b/org.eclipse.osbp.xtext.table/src/org/eclipse/osbp/xtext/table/imports/ShouldImportProvider.java
index badd2b3..e9de7d4 100644
--- a/org.eclipse.osbp.xtext.table/src/org/eclipse/osbp/xtext/table/imports/ShouldImportProvider.java
+++ b/org.eclipse.osbp.xtext.table/src/org/eclipse/osbp/xtext/table/imports/ShouldImportProvider.java
@@ -27,10 +27,12 @@ import org.eclipse.osbp.xtext.oxtype.imports.DefaultShouldImportProvider;
public class ShouldImportProvider extends DefaultShouldImportProvider {
+ @Override
protected boolean doShouldImport(EObject toImport, EReference eRef, EObject context) {
return toImport instanceof LDto || toImport instanceof DatamartDefinition || toImport instanceof ActionToolbar;
}
+ @Override
protected boolean doShouldProposeAllElements(EObject object, EReference reference) {
EClass type = reference.getEReferenceType();
return DatamartDSLPackage.Literals.DATAMART_DEFINITION.isSuperTypeOf(type)
diff --git a/org.eclipse.osbp.xtext.table/src/org/eclipse/osbp/xtext/table/jvmmodel/TableDSLJvmModelInferrer.xtend b/org.eclipse.osbp.xtext.table/src/org/eclipse/osbp/xtext/table/jvmmodel/TableDSLJvmModelInferrer.xtend
index 14ef6a1..11ea3c5 100644
--- a/org.eclipse.osbp.xtext.table/src/org/eclipse/osbp/xtext/table/jvmmodel/TableDSLJvmModelInferrer.xtend
+++ b/org.eclipse.osbp.xtext.table/src/org/eclipse/osbp/xtext/table/jvmmodel/TableDSLJvmModelInferrer.xtend
@@ -578,7 +578,7 @@ class TableDSLJvmModelInferrer extends AbstractModelInferrer {
taskClient.subscribeTaskEventNotification(this);
taskClient.subscribeProcessCompletedEventNotification(this);
«ENDIF»
- «IF !table.grid && !table.isEmbedded && (table.task || table.cube)»
+ «IF !table.grid && !table.isEmbedded»
filterGenerator.addFilterChangeListener(this);
«ENDIF»
''')]
@@ -853,11 +853,8 @@ class TableDSLJvmModelInferrer extends AbstractModelInferrer {
«FOR e:findRequestedEntities(table)»
if(event.getTopic().equals("«e.fullyQualifiedName»")){
datamartInstance.clearCache();
- List<DatamartPrimary<?>> primaryKeys = datamartInstance.getPrimaryList();
- for(DatamartPrimary key : primaryKeys) {
- if(key.contains(event.getData().get(EventDispatcherDataTag.ID))) {
- dataRefresh();
- }
+ if(datamartInstance.contains(event.getData().get(EventDispatcherDataTag.ID))) {
+ dataRefresh();
}
}
«ENDFOR»
@@ -878,6 +875,45 @@ class TableDSLJvmModelInferrer extends AbstractModelInferrer {
}*/
break;
'''
+ if (!table.isEmbedded && table.tabletype.toolbar !== null && table.tabletype.toolbar.eContainer !== null) {
+ body = '''
+ «body»
+ case ACTION:
+ if (toolbarUUID.equals(event.getTopic()) && event.getData().containsKey(EventDispatcherDataTag.BUTTON_ID)) {
+ Object id = event.getData().get(EventDispatcherDataTag.BUTTON_ID);
+ if (id instanceof TableActionEnum) {
+ TableActionEnum enumId = (TableActionEnum) id;
+ switch (enumId) {
+ case EXPORT_EXCEL:
+ for(CellSetFilterTable table:tables) {
+ ExcelExport excelExport = new ExcelExport(table, themeResourceService);
+ excelExport.excludeCollapsedColumns();
+ excelExport.setReportTitle(layoutManager.getCaption());
+ excelExport.export();
+ }
+ break;
+ case EXPORT_CSV:
+ for(CellSetFilterTable table:tables) {
+ CsvExport csvExport = new CsvExport(table, themeResourceService);
+ csvExport.excludeCollapsedColumns();
+ csvExport.setReportTitle(layoutManager.getCaption());
+ csvExport.export();
+ }
+ break;
+ case EXPORT_PDF:
+ for(CellSetFilterTable table:tables) {
+ PdfExport pdfExport = new PdfExport(table, themeResourceService);
+ pdfExport.excludeCollapsedColumns();
+ pdfExport.setReportTitle(layoutManager.getCaption());
+ pdfExport.export();
+ }
+ break;
+ }
+ }
+ }
+ break;
+ '''
+ }
body = '''
«body»
}
@@ -2802,7 +2838,10 @@ class TableDSLJvmModelInferrer extends AbstractModelInferrer {
}
«IF table.isEmbedded && table.isTask»
for(Button b:taskButtons) {
- b.setEnabled(table.getValue() != null);
+ b.setEnabled(table.getValue() != null &&
+ (dataSourceContainer.getTaskStatus(selection).equals(BPMStatus.Created) ||
+ dataSourceContainer.getTaskStatus(selection).equals(BPMStatus.Ready) ||
+ dataSourceContainer.getTaskStatus(selection).equals(BPMStatus.Suspended)));
}
«ENDIF»
'''
@@ -2828,18 +2867,19 @@ class TableDSLJvmModelInferrer extends AbstractModelInferrer {
body = '''
«body»
«IF entity.primaryKeyAttribute !== null»
- Object idObj = dataSourceContainer.getValueByProperty(selection, "«alias.toLowerCase»");
- MPerspective perspective = getContext().get(MPerspective.class);
- EventDispatcherEvent evnt = new EventDispatcherEvent(perspective, EventDispatcherCommand.SELECT, "«entity.baseType.fullyQualifiedName».«entity.idAttributeName»", "«table.fullyQualifiedName»");
- evnt.addItem(EventDispatcherDataTag.ID, idObj);
- eventDispatcher.sendEvent(evnt);
- SelectionStore.putSelectionToPerspectiveContext(getPart(), "«entity.baseType.fullyQualifiedName».«entity.idAttributeName»", idObj);
- for (DatamartPrimary<?> primary : datamartInstance.getPrimaryList()){
- if (!"«entity.baseType.fullyQualifiedName»".equals(primary.getEntityName())){
- Object primaryValue = dataSourceContainer.getValueByProperty(selection, primary.getAlias().toLowerCase());
- evnt = new EventDispatcherEvent(perspective, EventDispatcherCommand.SELECT, primary.getEntityName() + "." + primary.getAttributeName(), "«table.fullyQualifiedName»");
- evnt.addItem(EventDispatcherDataTag.ID, primaryValue);
- eventDispatcher.sendEvent(evnt);
+ if(selection != -1) {
+ Object idObj = datamartInstance.getPrimaryListKeys("«alias»").get(selection);
+ EventDispatcherEvent evnt = new EventDispatcherEvent(getContext().get(MPerspective.class), EventDispatcherCommand.SELECT, "«entity.baseType.fullyQualifiedName».«entity.idAttributeName»", "«table.fullyQualifiedName»");
+ evnt.addItem(EventDispatcherDataTag.ID, idObj);
+ eventDispatcher.sendEvent(evnt);
+ SelectionStore.putSelectionToPerspectiveContext(getPart(), "«entity.baseType.fullyQualifiedName».«entity.idAttributeName»", idObj);
+ // send all refs too
+ for (String alias : datamartInstance.getPrimaryList().keySet()){
+ if (!"«alias»".equals(alias)){
+ evnt = new EventDispatcherEvent(getContext().get(MPerspective.class), EventDispatcherCommand.SELECT, datamartInstance.getPrimaryList().get(alias).getEntityName() + "." + datamartInstance.getPrimaryList().get(alias).getAttributeName(), "«table.fullyQualifiedName»");
+ evnt.addItem(EventDispatcherDataTag.ID, datamartInstance.getPrimaryListKeys(alias).get(selection));
+ eventDispatcher.sendEvent(evnt);
+ }
}
}
«ENDIF»
@@ -2856,18 +2896,20 @@ class TableDSLJvmModelInferrer extends AbstractModelInferrer {
for (event : axis.events) {
body = '''
«body»
- «IF event.source instanceof TableOrdinal»
- EventDispatcherEvent evnt«evntCnt» = new EventDispatcherEvent(perspective, EventDispatcherCommand.SELECT, "«(event.source as TableOrdinal).valueRef»", "«table.fullyQualifiedName»");
- «ELSEIF event.source instanceof TableAttribute»
- EventDispatcherEvent evnt«evntCnt» = new EventDispatcherEvent(perspective, EventDispatcherCommand.SELECT, "«(event.source as TableAttribute).valueRef.attributeRef.name»", "«table.fullyQualifiedName»");
- «ENDIF»
- «IF event.source instanceof TableOrdinal»
- evnt«evntCnt».addItem(EventDispatcherDataTag.LIST, dataSourceContainer.getValueByProperty(selection, "«(event.source as TableOrdinal).valueRef»"));
- eventDispatcher.sendEvent(evnt«evntCnt»);
- «ELSEIF event.source instanceof TableAttribute»
- evnt«evntCnt».addItem(EventDispatcherDataTag.LIST, dataSourceContainer.getValueByProperty(selection, "«(event.source as TableAttribute).valueRef.attributeRef.name»"));
- eventDispatcher.sendEvent(evnt«evntCnt»);
- «ENDIF»
+ if(selection != -1) {
+ «IF event.source instanceof TableOrdinal»
+ EventDispatcherEvent evnt«evntCnt» = new EventDispatcherEvent(getContext().get(MPerspective.class), EventDispatcherCommand.SELECT, "«(event.source as TableOrdinal).valueRef»", "«table.fullyQualifiedName»");
+ «ELSEIF event.source instanceof TableAttribute»
+ EventDispatcherEvent evnt«evntCnt» = new EventDispatcherEvent(getContext().get(MPerspective.class), EventDispatcherCommand.SELECT, "«(event.source as TableAttribute).valueRef.attributeRef.name»", "«table.fullyQualifiedName»");
+ «ENDIF»
+ «IF event.source instanceof TableOrdinal»
+ evnt«evntCnt».addItem(EventDispatcherDataTag.LIST, dataSourceContainer.getValueByProperty(selection, "«(event.source as TableOrdinal).valueRef»"));
+ eventDispatcher.sendEvent(evnt«evntCnt»);
+ «ELSEIF event.source instanceof TableAttribute»
+ evnt«evntCnt».addItem(EventDispatcherDataTag.LIST, dataSourceContainer.getValueByProperty(selection, "«(event.source as TableAttribute).valueRef.attributeRef.name»"));
+ eventDispatcher.sendEvent(evnt«evntCnt»);
+ «ENDIF»
+ }
'''
evntCnt = evntCnt + 1
}
@@ -2922,9 +2964,12 @@ table.setImmediate(true);
// creates a hash code by the column position members
int membersHash = 0;
if (container != null) {
- List<DerivedMember> members = container.getColumnPosition(visibleColumnKey).getMembers();
- for (DerivedMember member : members) {
- membersHash += (member.getUniqueName() != null) ? member.getUniqueName().hashCode() : member.hashCode();
+ DerivedPosition pos = container.getColumnPosition(visibleColumnKey);
+ if ( pos != null ) {
+ List<DerivedMember> members = pos.getMembers();
+ for (DerivedMember member : members) {
+ membersHash += (member.getUniqueName() != null) ? member.getUniqueName().hashCode() : member.hashCode();
+ }
}
}
'''
@@ -3050,6 +3095,10 @@ table.setImmediate(true);
var prop = new IdAttribute()
prop.collapsed = true
map.put(DatamartDefinitionUtil.getEntityIdAliasName(entity.entityRef), prop)
+ if(entity.entityRef.historizedOrTimedependentWithParent) {
+ map.put(DatamartDefinitionUtil.getEntityValidAliasName(entity.entityRef), prop)
+ map.put(DatamartDefinitionUtil.getEntityCurrentAliasName(entity.entityRef), prop)
+ }
for (navigation : entity.navigations) {
navigation.datamartEntity.iterateIdMap(map)
}
@@ -3098,21 +3147,23 @@ table.setImmediate(true);
}
'''
List<Integer> selections = new ArrayList<>();
- IDto workloadDto = taskClient.getWorkloadDto(taskSummary);
- List<IDto> operativeDtos = workLoadItem.getOperativeDtos(workloadDto);
- if (operativeDtos != null) {
- Set<String> ids = new TreeSet<String>();
- for (IDto operativeDto : operativeDtos) {
- ids.add(String.valueOf(((«dtoFqn»)operativeDto).«keyGetter»));
- }
- for (Object selection : dataSourceContainer.getAllItemIds()) {
- String idValue = dataSourceContainer.getStringValueByProperty((Integer)selection,"«alias»");
- if (ids.contains(idValue)) {
- selections.add((Integer)selection);
- }
- }
- }
- selectTable.setValue(selections);
+ if(taskSummary != null) {
+ IDto workloadDto = taskClient.getWorkloadDto(taskSummary);
+ List<IDto> operativeDtos = workLoadItem.getOperativeDtos(workloadDto);
+ if (operativeDtos != null) {
+ Set<String> ids = new TreeSet<String>();
+ for (IDto operativeDto : operativeDtos) {
+ ids.add(String.valueOf(((«dtoFqn»)operativeDto).«keyGetter»));
+ }
+ for (Object selection : dataSourceContainer.getAllItemIds()) {
+ String idValue = dataSourceContainer.getStringValueByProperty((Integer)selection,"«alias»");
+ if (ids.contains(idValue)) {
+ selections.add((Integer)selection);
+ }
+ }
+ }
+ selectTable.setValue(selections);
+ }
'''
}
@@ -3126,18 +3177,26 @@ table.setImmediate(true);
var keyType = entity.primaryKeyAttribute.datatype
var dtoFqn = EntityUtils.getDtoFQNForLEntity(entity)
'''
- IDTOServiceWithMutablePersistence<«dtoFqn»> dtoService = (IDTOServiceWithMutablePersistence<«dtoFqn»>) DtoServiceAccess.getService(«dtoFqn».class);
+ IDTOService<«dtoFqn»> dtoService = (IDTOService<«dtoFqn»>) DtoServiceAccess.getService(«dtoFqn».class);
String idValue = dataSourceContainer.getStringValueByProperty((Integer)selection,"«alias»");
- if (selected) {
- workLoadItem.addOperativeDto(taskClient.getWorkloadDto(taskSummary), «IF "int".equals(keyType.name)»dtoService.get((int) Integer.parseInt(idValue))«ELSE»dtoService.get(idValue)«ENDIF»);
- }
- else {
- for(IDto dtoToRemove : workLoadItem.getOperativeDtos(taskClient.getWorkloadDto(taskSummary))) {
- if(((«dtoFqn»)dtoToRemove).getId()«IF "int".equals(keyType.name)»==(int) Integer.parseInt(idValue)«ELSE».equals(idValue)«ENDIF») {
- workLoadItem.removeOperativeDto(taskClient.getWorkloadDto(taskSummary), dtoToRemove);
- break;
+ if(taskSummary != null) {
+ if (selected) {
+ workLoadItem.addOperativeDto(taskClient.getWorkloadDto(taskSummary), «IF "int".equals(keyType.name)»dtoService.get((int) Integer.parseInt(idValue))«ELSE»dtoService.get(idValue)«ENDIF»);
+ }
+ else {
+ for(IDto dtoToRemove : workLoadItem.getOperativeDtos(taskClient.getWorkloadDto(taskSummary))) {
+ if(((«dtoFqn»)dtoToRemove).getId()«IF "int".equals(keyType.name)»==(int) Integer.parseInt(idValue)«ELSE».equals(idValue)«ENDIF») {
+ workLoadItem.removeOperativeDto(taskClient.getWorkloadDto(taskSummary), dtoToRemove);
+ break;
+ }
}
}
+ } else {
+ if(selected) {
+ SelectionStore.addSelectionToPerspectiveContext(getPart(), "«dtoFqn»", «IF "int".equals(keyType.name)»dtoService.get((int) Integer.parseInt(idValue))«ELSE»dtoService.get(idValue)«ENDIF»);
+ } else {
+ SelectionStore.removeSelectionFromPerspectiveContext(getPart(), "«dtoFqn»", «IF "int".equals(keyType.name)»dtoService.get((int) Integer.parseInt(idValue))«ELSE»dtoService.get(idValue)«ENDIF»);
+ }
}
'''
}
@@ -3199,5 +3258,4 @@ table.setImmediate(true);
]
])
}
-
}
diff --git a/org.eclipse.osbp.xtext.table/src/org/eclipse/osbp/xtext/table/jvmmodel/TableModelGenerator.xtend b/org.eclipse.osbp.xtext.table/src/org/eclipse/osbp/xtext/table/jvmmodel/TableModelGenerator.xtend
index fd0947f..a28899d 100644
--- a/org.eclipse.osbp.xtext.table/src/org/eclipse/osbp/xtext/table/jvmmodel/TableModelGenerator.xtend
+++ b/org.eclipse.osbp.xtext.table/src/org/eclipse/osbp/xtext/table/jvmmodel/TableModelGenerator.xtend
@@ -65,6 +65,7 @@ import org.eclipse.e4.ui.model.application.ui.basic.MPart
import org.eclipse.emf.ecore.EObject
import org.eclipse.emf.ecore.resource.Resource
import org.eclipse.osbp.bpm.api.BPMOperation
+import org.eclipse.osbp.bpm.api.BPMStatus
import org.eclipse.osbp.bpm.api.BPMTaskEventType
import org.eclipse.osbp.bpm.api.BPMTaskSummary
import org.eclipse.osbp.bpm.api.BPMTaskUserEvent
@@ -78,7 +79,8 @@ import org.eclipse.osbp.eventbroker.EventBrokerMsg
import org.eclipse.osbp.preferences.ProductConfiguration
import org.eclipse.osbp.runtime.common.event.EventDispatcherEvent
import org.eclipse.osbp.runtime.common.event.IDualData
-import org.eclipse.osbp.runtime.common.filter.IDTOServiceWithMutablePersistence
+import org.eclipse.osbp.runtime.common.event.SelectionStore
+import org.eclipse.osbp.runtime.common.filter.IDTOService
import org.eclipse.osbp.runtime.web.vaadin.common.data.IBeanSearchServiceFactory
import org.eclipse.osbp.ui.api.contextfunction.IViewEmbeddedProvider
import org.eclipse.osbp.ui.api.customfields.IBlobService
@@ -112,6 +114,9 @@ import org.eclipse.osbp.xtext.table.common.CellSetPagedFilterTable
import org.eclipse.osbp.xtext.table.common.CheckboxSelectionCellSetFilterTable
import org.eclipse.osbp.xtext.table.common.TableFilterDecorator
import org.eclipse.osbp.xtext.table.common.TableFilterGenerator
+import org.eclipse.osbp.xtext.table.common.export.CsvExport
+import org.eclipse.osbp.xtext.table.common.export.ExcelExport
+import org.eclipse.osbp.xtext.table.common.export.PdfExport
import org.eclipse.osbp.xtext.table.generator.TableGridSourceGenerator
import org.eclipse.xtext.generator.IFileSystemAccess
import org.eclipse.xtext.xbase.compiler.GeneratorConfig
@@ -119,7 +124,7 @@ import org.eclipse.xtext.xbase.compiler.ImportManager
import org.osgi.service.event.Event
import org.osgi.service.event.EventHandler
import org.vaadin.hene.popupbutton.PopupButton
-import org.eclipse.osbp.runtime.common.event.SelectionStore
+import org.eclipse.osbp.xtext.action.TableActionEnum
class TableModelGenerator extends I18NModelGenerator {
@Inject TableGridSourceGenerator delegate
@@ -203,7 +208,7 @@ class TableModelGenerator extends I18NModelGenerator {
IDto,
Task,
BlipItem,
- IDTOServiceWithMutablePersistence,
+ IDTOService,
DtoServiceAccess,
DatamartFilterGenerator,
ViewLayoutManager,
@@ -233,7 +238,12 @@ class TableModelGenerator extends I18NModelGenerator {
MPerspective,
MPart,
IPerspectiveProvider,
- SelectionStore
+ SelectionStore,
+ BPMStatus,
+ ExcelExport,
+ CsvExport,
+ PdfExport,
+ TableActionEnum
)
super.createAppendable(context, importManager, config)
}
diff --git a/org.eclipse.osbp.xtext.table/src/org/eclipse/osbp/xtext/table/scoping/TableDSLScopeProvider.xtend b/org.eclipse.osbp.xtext.table/src/org/eclipse/osbp/xtext/table/scoping/TableDSLScopeProvider.xtend
index 8d93a83..752e7c9 100644
--- a/org.eclipse.osbp.xtext.table/src/org/eclipse/osbp/xtext/table/scoping/TableDSLScopeProvider.xtend
+++ b/org.eclipse.osbp.xtext.table/src/org/eclipse/osbp/xtext/table/scoping/TableDSLScopeProvider.xtend
@@ -26,8 +26,16 @@ import org.eclipse.emf.ecore.EReference
import org.eclipse.osbp.dsl.common.xtext.extensions.ModelExtensions
import org.eclipse.osbp.dsl.entity.xtext.extensions.EntityTypesBuilder
import org.eclipse.osbp.infogrid.model.gridsource.CxGridNestedField
+import org.eclipse.osbp.infogrid.model.gridsource.CxGridNestedPath
import org.eclipse.osbp.infogrid.model.gridsource.CxGridProperty
import org.eclipse.osbp.infogrid.model.gridsource.CxGridSourcePackage
+import org.eclipse.osbp.infogrid.model.gridsource.style.CxGridPropPriceStyle
+import org.eclipse.osbp.infogrid.model.gridsource.style.CxGridPropQuantityStyle
+import org.eclipse.osbp.xtext.action.ActionButton
+import org.eclipse.osbp.xtext.action.ActionFunction
+import org.eclipse.osbp.xtext.action.ActionTable
+import org.eclipse.osbp.xtext.action.ActionTask
+import org.eclipse.osbp.xtext.action.ActionToolbar
import org.eclipse.osbp.xtext.cubedsl.CubeDimensionEntity
import org.eclipse.osbp.xtext.cubedsl.CubeHierarchy
import org.eclipse.osbp.xtext.cubedsl.CubeLevel
@@ -38,6 +46,7 @@ import org.eclipse.osbp.xtext.datamartdsl.DatamartCubeAxis
import org.eclipse.osbp.xtext.datamartdsl.DatamartDerivedMeasure
import org.eclipse.osbp.xtext.datamartdsl.DatamartEntity
import org.eclipse.osbp.xtext.datamartdsl.DatamartHierarchy
+import org.eclipse.osbp.xtext.datamartdsl.DatamartHierarchyLevelSingle
import org.eclipse.osbp.xtext.datamartdsl.DatamartMeasure
import org.eclipse.osbp.xtext.datamartdsl.DatamartMember
import org.eclipse.osbp.xtext.datamartdsl.DatamartOwner
@@ -46,27 +55,26 @@ import org.eclipse.osbp.xtext.datamartdsl.DatamartSetAggregationFunction
import org.eclipse.osbp.xtext.datamartdsl.DatamartTask
import org.eclipse.osbp.xtext.datamartdsl.jvmmodel.DatamartDSLJvmModelInferrer
import org.eclipse.osbp.xtext.datamartdsl.scoping.DatamartDSLScopeProvider
+import org.eclipse.osbp.xtext.datamartdsl.util.DatamartAttributeUtil
import org.eclipse.osbp.xtext.gridsource.scoping.GridSourceScopeProvider
+import org.eclipse.osbp.xtext.oxtype.resource.EcoreUtil3
import org.eclipse.osbp.xtext.table.TableAxis
import org.eclipse.osbp.xtext.table.TableDSLPackage
import org.eclipse.osbp.xtext.table.TableDatamart
import org.eclipse.osbp.xtext.table.TableDtoDatasource
+import org.eclipse.osbp.xtext.table.TableOption
import org.eclipse.xtext.common.types.JvmType
import org.eclipse.xtext.common.types.util.TypeReferences
import org.eclipse.xtext.resource.EObjectDescription
import org.eclipse.xtext.resource.IEObjectDescription
import org.eclipse.xtext.scoping.IScope
+import org.eclipse.xtext.scoping.impl.FilteringScope
import org.eclipse.xtext.scoping.impl.MapBasedScope
-import org.eclipse.osbp.xtext.datamartdsl.util.DatamartAttributeUtil
-import org.eclipse.osbp.infogrid.model.gridsource.CxGridNestedPath
-import org.eclipse.osbp.infogrid.model.gridsource.style.CxGridPropStyle
-import org.eclipse.osbp.infogrid.model.gridsource.style.CxGridPropQuantityStyle
-import org.eclipse.osbp.infogrid.model.gridsource.style.CxGridPropPriceStyle
-import org.eclipse.osbp.xtext.datamartdsl.DatamartHierarchyLevelSingle
+import org.eclipse.osbp.xtext.action.ActionCommand
+import org.eclipse.osbp.xtext.action.ActionDatainterchange
class TableDSLScopeProvider extends AbstractTableDSLScopeProvider {
@Inject extension ModelExtensions
- @Inject extension EntityTypesBuilder
@Inject extension DatamartDSLScopeProvider datamartScopeProvider
@Inject extension DatamartDSLJvmModelInferrer datamartInferrer
@Inject GridSourceScopeProvider gridScopeProvider
@@ -87,78 +95,110 @@ class TableDSLScopeProvider extends AbstractTableDSLScopeProvider {
reference == TableDSLPackage.Literals.TABLE_COLUMN__VALUE_REF ||
reference == TableDSLPackage.Literals.TABLE_HIERARCHY__VALUE_REF) {
return getScope_Table_valueRef(context, reference)
- } else if (reference == TableDSLPackage.Literals.TABLE_AGGREGATION__VALUE_REF) {
- return getScope_Table_Aggregation_valueRef(context)
- } else {
- return super.getScope(context, reference)
+ } else if (reference == TableDSLPackage.Literals.TABLE_AGGREGATION__VALUE_REF) {
+ return getScope_Table_Aggregation_valueRef(context)
+ } else if (reference == TableDSLPackage.Literals.TABLE_OPTION__TOOLBAR) {
+ return getScope_Table_Toolbar(context as TableOption, reference)
+ } else {
+ return super.getScope(context, reference)
+ }
+ }
+
+ def IScope getScope_Table_Toolbar(TableOption table, EReference reference) {
+ var superScope = super.getScope(table, reference)
+ return new FilteringScope(superScope, [
+ if (it.EObjectOrProxy instanceof ActionToolbar) {
+ var toolbar = it.EObjectOrProxy as ActionToolbar
+ toolbar = EcoreUtil3.resolve(toolbar, table.eResource.resourceSet) as ActionToolbar
+ return toolbar.filterToolbarScopeCondition
+ }
+ return false
+ ])
}
- }
- def IScope getScope_GridAttribute_path(EObject object, EReference reference) {
- switch (object) {
- CxGridProperty: {
- val CxGridProperty prop = object as CxGridProperty
- val ds = prop.eContainer as TableDtoDatasource
- if(ds !== null && ds.dtoSource !== null) {
- val JvmType type = typeReferences.findDeclaredType(ds.dtoSource.toQualifiedName, prop)
- return gridScopeProvider.toGetterScope(type)
+ private def filterToolbarScopeCondition(ActionToolbar toolbar) {
+ var allItemsOfTable = true
+ if (toolbar !== null) {
+ for (item : toolbar.actions) {
+ if (item instanceof ActionButton) {
+ if (!(item.command.actionType instanceof ActionTable ||
+ item.command.actionType instanceof ActionFunction ||
+ item.command.actionType instanceof ActionTask ||
+ item.command.actionType instanceof ActionCommand ||
+ item.command.actionType instanceof ActionDatainterchange)) {
+ allItemsOfTable = false
+ }
+ }
}
- return null
}
- CxGridNestedField,
- CxGridNestedPath,
- CxGridPropPriceStyle,
- CxGridPropQuantityStyle: {
- if (object.eContainer instanceof CxGridProperty) {
- return object.eContainer.getScope_GridAttribute_path(reference)
- } else {
- if (object instanceof CxGridNestedField){
- var CxGridNestedField containerField = object as CxGridNestedField
-// if (containerField!==null && containerField.field!==null && containerField.field.returnType!==null){
+ return allItemsOfTable
+ }
+
+ def IScope getScope_GridAttribute_path(EObject object, EReference reference) {
+ switch (object) {
+ CxGridProperty: {
+ val CxGridProperty prop = object as CxGridProperty
+ val ds = prop.eContainer as TableDtoDatasource
+ if (ds !== null && ds.dtoSource !== null) {
+ val JvmType type = typeReferences.findDeclaredType(ds.dtoSource.toQualifiedName, prop)
+ return gridScopeProvider.toGetterScope(type)
+ }
+ return null
+ }
+ CxGridNestedField,
+ CxGridNestedPath,
+ CxGridPropPriceStyle,
+ CxGridPropQuantityStyle: {
+ if (object.eContainer instanceof CxGridProperty) {
+ return object.eContainer.getScope_GridAttribute_path(reference)
+ } else {
+ if (object instanceof CxGridNestedField) {
+ var CxGridNestedField containerField = object as CxGridNestedField
+ // if (containerField!==null && containerField.field!==null && containerField.field.returnType!==null){
return gridScopeProvider.toGetterScope(containerField?.field?.returnType?.type)
-// }
- } else if (object.eContainer instanceof CxGridNestedPath){
- var CxGridNestedPath containerField = object as CxGridNestedPath
-// if (containerField!==null && containerField.field!==null && containerField.field.returnType!==null){
+ // }
+ } else if (object.eContainer instanceof CxGridNestedPath) {
+ var CxGridNestedPath containerField = object as CxGridNestedPath
+ // if (containerField!==null && containerField.field!==null && containerField.field.returnType!==null){
return gridScopeProvider.toGetterScope(containerField?.field?.returnType?.type)
-// }
- } else if (object.eContainer instanceof CxGridNestedField){
- var CxGridNestedField containerField = object.eContainer as CxGridNestedField
-// if (containerField!==null && containerField.field!==null && containerField.field.returnType!==null){
+ // }
+ } else if (object.eContainer instanceof CxGridNestedField) {
+ var CxGridNestedField containerField = object.eContainer as CxGridNestedField
+ // if (containerField!==null && containerField.field!==null && containerField.field.returnType!==null){
return gridScopeProvider.toGetterScope(containerField?.field?.returnType?.type)
-// }
+ // }
+ }
+ return null
}
- return null
}
}
+ return null
}
- return null
- }
- def IScope getScope_Table_Axis_axis(EObject object) {
- var result = <IEObjectDescription>newArrayList
- var eObj = object
- while (!(eObj instanceof TableDatamart)) {
- eObj = eObj.eContainer
- }
- if (eObj !== null) {
- var datamart = (eObj as TableDatamart).datamartRef
- if (datamart !== null && datamart.source !== null) {
- if (datamart.source instanceof DatamartCube) {
- for (axis : (datamart.source as DatamartCube).axisslicer) {
- if (axis instanceof DatamartCubeAxis) {
- var literal = (axis as DatamartCubeAxis).axis.name.literal
- result.add(EObjectDescription.create(literal, (axis as DatamartCubeAxis)))
+ def IScope getScope_Table_Axis_axis(EObject object) {
+ var result = <IEObjectDescription>newArrayList
+ var eObj = object
+ while (!(eObj instanceof TableDatamart)) {
+ eObj = eObj.eContainer
+ }
+ if (eObj !== null) {
+ var datamart = (eObj as TableDatamart).datamartRef
+ if (datamart !== null && datamart.source !== null) {
+ if (datamart.source instanceof DatamartCube) {
+ for (axis : (datamart.source as DatamartCube).axisslicer) {
+ if (axis instanceof DatamartCubeAxis) {
+ var literal = (axis as DatamartCubeAxis).axis.name.literal
+ result.add(EObjectDescription.create(literal, (axis as DatamartCubeAxis)))
+ }
}
- }
- } else if (datamart.source instanceof DatamartEntity) {
- getEntityAxes(datamart.source as DatamartEntity, result)
+ } else if (datamart.source instanceof DatamartEntity) {
+ getEntityAxes(datamart.source as DatamartEntity, result)
- // user must not supply any axes, but we need it with tables
- if (!result.containsName(AxisEnum.COLUMNS.literal)) {
- result.add(
- EObjectDescription.create(AxisEnum.COLUMNS.literal,
- (datamart.source as DatamartEntity)))
+ // user must not supply any axes, but we need it with tables
+ if (!result.containsName(AxisEnum.COLUMNS.literal)) {
+ result.add(
+ EObjectDescription.create(AxisEnum.COLUMNS.literal,
+ (datamart.source as DatamartEntity)))
}
if (!result.containsName(AxisEnum.ROWS.literal)) {
result.add(
@@ -177,312 +217,271 @@ class TableDSLScopeProvider extends AbstractTableDSLScopeProvider {
return MapBasedScope.createScope(IScope.NULLSCOPE, result)
}
- def void getEntityAxes(DatamartEntity entity, ArrayList<IEObjectDescription> result) {
- for (navigation : entity.navigations) {
- if (navigation instanceof DatamartMember) {
- (navigation as DatamartMember).datamartEntity.getEntityAxes(result)
- for (property : (navigation as DatamartMember).datamartEntity.attributes) {
- if (!result.containsName(property.axis.name.literal)) {
- result.add(
- EObjectDescription.create(property.axis.name.literal, property as DatamartCubeAxis))
- }
- }
- }
- if (navigation instanceof DatamartOwner) {
- (navigation as DatamartOwner).datamartEntity.getEntityAxes(result)
- for (property : (navigation as DatamartOwner).datamartEntity.attributes) {
- if (!result.containsName(property.axis.name.literal)) {
- result.add(
- EObjectDescription.create(property.axis.name.literal, property as DatamartCubeAxis))
- }
- }
- }
+ def void getEntityAxes(DatamartEntity entity, ArrayList<IEObjectDescription> result) {
+ for (navigation : entity.navigations) {
+ if (navigation instanceof DatamartMember) {
+ (navigation as DatamartMember).datamartEntity.getEntityAxes(result)
+ for (property : (navigation as DatamartMember).datamartEntity.attributes) {
+ if (!result.containsName(property.axis.name.literal)) {
+ result.add(
+ EObjectDescription.create(property.axis.name.literal,
+ property as DatamartCubeAxis))
}
- for (property : entity.attributes) {
- if (property.axis !== null) {
- if (!result.containsName(property.axis.name.literal)) {
- result.add(EObjectDescription.create(property.axis.name.literal, property as DatamartCubeAxis))
- }
- } else {
- if (!result.containsName(property.axis.name.literal)) {
- result.add(EObjectDescription.create(property.axis.name.literal, property as DatamartCubeAxis))
- }
- }
+ }
+ }
+ if (navigation instanceof DatamartOwner) {
+ (navigation as DatamartOwner).datamartEntity.getEntityAxes(result)
+ for (property : (navigation as DatamartOwner).datamartEntity.attributes) {
+ if (!result.containsName(property.axis.name.literal)) {
+ result.add(
+ EObjectDescription.create(property.axis.name.literal,
+ property as DatamartCubeAxis))
}
}
+ }
+ }
+ for (property : entity.attributes) {
+ if (property.axis !== null) {
+ if (!result.containsName(property.axis.name.literal)) {
+ result.add(
+ EObjectDescription.create(property.axis.name.literal, property as DatamartCubeAxis))
+ }
+ } else {
+ if (!result.containsName(property.axis.name.literal)) {
+ result.add(
+ EObjectDescription.create(property.axis.name.literal, property as DatamartCubeAxis))
+ }
+ }
+ }
+ }
- def boolean containsName(ArrayList<IEObjectDescription> list, String name) {
- for (obj : list) {
- var oname = obj.name.toString
- if (oname.equals(name)) {
- return true
- }
- }
- return false
+ def boolean containsName(ArrayList<IEObjectDescription> list, String name) {
+ for (obj : list) {
+ var oname = obj.name.toString
+ if (oname.equals(name)) {
+ return true
+ }
+ }
+ return false
+ }
+
+ def void allMembers(DatamartHierarchy hierarchy, ArrayList<IEObjectDescription> result) {
+ if ((hierarchy.level instanceof DatamartHierarchyLevelSingle) &&
+ (hierarchy.level as DatamartHierarchyLevelSingle).levelRef !== null) {
+ if (hierarchy.all) { // detailed was modeled - we must add the complete hierarchy
+ var dimEntity = ((hierarchy.level as DatamartHierarchyLevelSingle).levelRef as CubeLevel).
+ eContainer as CubeDimensionEntity
+ for (cubeLevel : dimEntity.hierarchLevels) {
+ result.add(EObjectDescription.create(cubeLevel.name, cubeLevel))
}
+ } else {
+ result.add(EObjectDescription.create((hierarchy.level as DatamartHierarchyLevelSingle).levelRef.name,
+ ((hierarchy.level as DatamartHierarchyLevelSingle).levelRef as CubeLevel)))
+ }
- def void getEntityProperties(DatamartEntity entity, ArrayList<IEObjectDescription> result,
- String requestedAxisName) {
- for (navigation : entity.navigations) {
- if (navigation instanceof DatamartMember) {
- (navigation as DatamartMember).datamartEntity.getEntityProperties(result, requestedAxisName)
- for (property : (navigation as DatamartMember).datamartEntity.attributes) {
- if (property.axis.name.literal.equals(requestedAxisName)) {
- result.add(
- EObjectDescription.create(DatamartAttributeUtil.getAliasedAttributeName(property),
- property as DatamartAttribute))
- }
- }
- }
- if (navigation instanceof DatamartOwner) {
- (navigation as DatamartOwner).datamartEntity.getEntityProperties(result, requestedAxisName)
- for (property : (navigation as DatamartOwner).datamartEntity.attributes) {
- if (property.axis.name.literal.equals(requestedAxisName)) {
- result.add(
- EObjectDescription.create(DatamartAttributeUtil.getAliasedAttributeName(property),
- property as DatamartAttribute))
- }
- }
- }
- }
- for (property : entity.attributes) {
- if (property.axis !== null) {
- if (property.axis.name.literal.equals(requestedAxisName)) {
- result.add(
- EObjectDescription.create(DatamartAttributeUtil.getAliasedAttributeName(property),
- property as DatamartAttribute))
- }
- } else {
- result.add(
- EObjectDescription.create(DatamartAttributeUtil.getAliasedAttributeName(property),
- property as DatamartAttribute))
+ } else if ((hierarchy.hierarchyRef as CubeHierarchy).allMemberName) {
+ result.add(EObjectDescription.create((hierarchy.hierarchyRef as CubeHierarchy).allMemberNameValue.toString,
+ (hierarchy.hierarchyRef as CubeHierarchy)))
+ } else if ((hierarchy.defaultMember)) {
+ result.add(EObjectDescription.create((hierarchy.hierarchyRef as CubeHierarchy).defaultMemberValue.toString,
+ (hierarchy.hierarchyRef as CubeHierarchy)))
+ }
- }
+ }
+
+ def void getEntityProperties(DatamartEntity entity, ArrayList<IEObjectDescription> result,
+ String requestedAxisName) {
+ for (navigation : entity.navigations) {
+ if (navigation instanceof DatamartMember) {
+ (navigation as DatamartMember).datamartEntity.getEntityProperties(result, requestedAxisName)
+ for (property : (navigation as DatamartMember).datamartEntity.attributes) {
+ if (property.axis.name.literal.equals(requestedAxisName)) {
+ result.add(
+ EObjectDescription.create(DatamartAttributeUtil.getAliasedAttributeName(property),
+ property as DatamartAttribute))
}
}
-
- def void getTaskColumns(DatamartTask task, ArrayList<IEObjectDescription> result,
- String requestedAxisName) {
- for (column : task.columns) {
- if (AxisEnum.COLUMNS.literal.equals(requestedAxisName)) {
- result.add(EObjectDescription.create(column.columnRef.literal, column))
- }
+ }
+ if (navigation instanceof DatamartOwner) {
+ (navigation as DatamartOwner).datamartEntity.getEntityProperties(result, requestedAxisName)
+ for (property : (navigation as DatamartOwner).datamartEntity.attributes) {
+ if (property.axis.name.literal.equals(requestedAxisName)) {
+ result.add(
+ EObjectDescription.create(DatamartAttributeUtil.getAliasedAttributeName(property),
+ property as DatamartAttribute))
}
}
+ }
+ }
+ for (property : entity.attributes) {
+ if (property.axis !== null) {
+ if (property.axis.name.literal.equals(requestedAxisName)) {
+ result.add(
+ EObjectDescription.create(DatamartAttributeUtil.getAliasedAttributeName(property),
+ property as DatamartAttribute))
+ }
+ } else {
+ result.add(
+ EObjectDescription.create(DatamartAttributeUtil.getAliasedAttributeName(property),
+ property as DatamartAttribute))
- def IScope getScope_Table_valueRef(EObject object, EReference reference) {
- var result = <IEObjectDescription>newArrayList
- var eObj = object
- var requestedAxisName = ""
- while (!(eObj instanceof TableDatamart)) {
- eObj = eObj.eContainer
- if (eObj instanceof TableAxis) {
- requestedAxisName = (eObj as TableAxis).axis.literal
- }
- }
- if (eObj !== null) {
- var datamart = (eObj as TableDatamart).datamartRef
- if (datamart !== null && datamart.source !== null) {
- if (datamart.source instanceof DatamartCube) {
- for (axis : (datamart.source as DatamartCube).axisslicer) {
- if (axis instanceof DatamartCubeAxis) {
- if ((axis as DatamartCubeAxis).axis.name.literal.equals(requestedAxisName)) {
- var hasMeasures = false
- var hasHierarchy = false
- var hasAggregation = false
- var isCrossjoined = false
- for (element : (axis as DatamartCubeAxis).elements) {
- if (element instanceof DatamartMeasure ||
- element instanceof DatamartDerivedMeasure) {
- hasMeasures = true
- }
- }
- for (element : (axis as DatamartCubeAxis).elements) {
- if (element instanceof DatamartHierarchy) {
- if (hasHierarchy) {
- isCrossjoined = true
- } else {
- hasHierarchy = true
- }
- }
- if (element instanceof DatamartSetAggregation) {
- if (hasAggregation) {
- isCrossjoined = true
- } else {
- hasAggregation = true
- }
- hasAggregation = true
- }
+ }
+ }
+ }
+
+ def void getTaskColumns(DatamartTask task, ArrayList<IEObjectDescription> result, String requestedAxisName) {
+ for (column : task.columns) {
+ if (AxisEnum.COLUMNS.literal.equals(requestedAxisName)) {
+ result.add(EObjectDescription.create(column.columnRef.literal, column))
+ }
+ }
+ }
+
+ def IScope getScope_Table_valueRef(EObject object, EReference reference) {
+ var result = <IEObjectDescription>newArrayList
+ var eObj = object
+ var requestedAxisName = ""
+ while (!(eObj instanceof TableDatamart)) {
+ eObj = eObj.eContainer
+ if (eObj instanceof TableAxis) {
+ requestedAxisName = (eObj as TableAxis).axis.literal
+ }
+ }
+ if (eObj !== null) {
+ var datamart = (eObj as TableDatamart).datamartRef
+ if (datamart !== null && datamart.source !== null) {
+ if (datamart.source instanceof DatamartCube) {
+ for (axis : (datamart.source as DatamartCube).axisslicer) {
+ if (axis instanceof DatamartCubeAxis) {
+ if ((axis as DatamartCubeAxis).axis.name.literal.equals(requestedAxisName)) {
+ var hasMeasures = false
+ var hasHierarchy = false
+ var hasAggregation = false
+ var isCrossjoined = false
+ for (element : (axis as DatamartCubeAxis).elements) {
+ if (element instanceof DatamartMeasure ||
+ element instanceof DatamartDerivedMeasure) {
+ hasMeasures = true
+ }
+ }
+ for (element : (axis as DatamartCubeAxis).elements) {
+ switch(element) {
+ DatamartHierarchy: {
+ if (hasHierarchy) {
+ isCrossjoined = true
+ } else {
+ hasHierarchy = true
}
- if (hasMeasures && (hasHierarchy || hasAggregation)) {
+ }
+ DatamartSetAggregation: {
+ if (hasAggregation) {
isCrossjoined = true
+ } else {
+ hasAggregation = true
}
- for (element : (axis as DatamartCubeAxis).elements) {
- if (element instanceof DatamartMeasure && reference ==
- TableDSLPackage.Literals.TABLE_MEASURE__VALUE_REF) {
- if ((element as DatamartMeasure).measureRef !== null) {
- result.add(
- EObjectDescription.create(
- (element as DatamartMeasure).measureRef.name,
- element))
- }
- }
- if (element instanceof DatamartDerivedMeasure && reference ==
- TableDSLPackage.Literals.TABLE_DERIVED__VALUE_REF) {
- if ((element as DatamartDerivedMeasure).
- derivedRef !== null) {
- result.add(
- EObjectDescription.create(
- (element as DatamartDerivedMeasure).
- derivedRef.name, element))
- }
- }
- if (element instanceof DatamartHierarchy && !hasMeasures &&
- reference == TableDSLPackage.Literals.
- TABLE_HIERARCHY__VALUE_REF) {
- if ((element as DatamartHierarchy).
- hierarchyRef !== null) {
- var hierarchy = element as DatamartHierarchy
- if ((hierarchy.level instanceof DatamartHierarchyLevelSingle) && (hierarchy.level as DatamartHierarchyLevelSingle).levelRef !== null) {
- if (hierarchy.all) { // detailed was modeled - we must add the complete hierarchy
- var dimEntity = ((hierarchy.level as DatamartHierarchyLevelSingle).levelRef as CubeLevel).
- eContainer as CubeDimensionEntity
- for (cubeLevel : dimEntity.
- hierarchLevels) {
- result.add(
- EObjectDescription.create(
- cubeLevel.name, cubeLevel))
- }
- } else {
- result.add(
- EObjectDescription.create(
- (hierarchy.level as DatamartHierarchyLevelSingle).levelRef.name,
- ((hierarchy.level as DatamartHierarchyLevelSingle).
- levelRef as CubeLevel)))
- }
-
- } else if ((hierarchy.
- hierarchyRef as CubeHierarchy).
- allMemberName) {
- result.add(
- EObjectDescription.create(
- (hierarchy.
- hierarchyRef as CubeHierarchy).
- allMemberNameValue.toString,
- (hierarchy.
- hierarchyRef as CubeHierarchy)))
- } else if ((hierarchy.defaultMember)) {
- result.add(
- EObjectDescription.create(
- (hierarchy.
- hierarchyRef as CubeHierarchy).
- defaultMemberValue.
- toString,
- (hierarchy.
- hierarchyRef as CubeHierarchy)))
- }
- }
- }
- }
- }
- }
- }
- } else if (datamart.source instanceof DatamartEntity) {
- getEntityProperties(datamart.source as DatamartEntity, result,
- requestedAxisName)
- } else if (datamart.source instanceof DatamartTask) {
- getTaskColumns(datamart.source as DatamartTask, result,
- requestedAxisName)
- }
- }
-
+ hasAggregation = true
+ }
+ }
+ }
+ if (hasMeasures && (hasHierarchy || hasAggregation)) {
+ isCrossjoined = true
+ }
+ for (element : (axis as DatamartCubeAxis).elements) {
+ switch(element) {
+ DatamartMeasure: {
+ if(reference == TableDSLPackage.Literals.TABLE_MEASURE__VALUE_REF && element.measureRef !== null) {
+ result.add(EObjectDescription.create(element.measureRef.name, element))
}
- return MapBasedScope.createScope(IScope.NULLSCOPE, result)
}
-
- def IScope getScope_Table_Aggregation_valueRef(EObject object) {
- var result = <IEObjectDescription>newArrayList
- var requestedAxisName = ""
- var eObj = object
- while (!(eObj instanceof TableDatamart)) {
- eObj = eObj.eContainer
- if (eObj instanceof TableAxis) {
- requestedAxisName = (eObj as TableAxis).axis.literal
- }
+ DatamartDerivedMeasure: {
+ if(reference == TableDSLPackage.Literals.TABLE_DERIVED__VALUE_REF && element.derivedRef !== null) {
+ result.add(EObjectDescription.create((element as DatamartDerivedMeasure).derivedRef.name, element))
+ }
+ }
+ DatamartHierarchy: {
+ if(!hasMeasures && reference == TableDSLPackage.Literals.TABLE_HIERARCHY__VALUE_REF && element.hierarchyRef !== null) {
+ element.allMembers(result)
}
- if (eObj !== null) {
- var datamart = (eObj as TableDatamart).datamartRef
- if (datamart !== null && datamart.source !== null) {
- if (datamart.source instanceof DatamartCube) {
- for (axis : (datamart.source as DatamartCube).axisslicer) {
- if (axis instanceof DatamartCubeAxis) {
- if ((axis as DatamartCubeAxis).axis.name.literal.equals(
- requestedAxisName)) {
- var hasMeasures = false
- var hasHierarchy = false
- var hasAggregation = false
- var isCrossjoined = false
- for (element : (axis as DatamartCubeAxis).elements) {
- if (element instanceof DatamartMeasure ||
- element instanceof DatamartDerivedMeasure) {
- hasMeasures = true
- }
- }
- for (element : (axis as DatamartCubeAxis).elements) {
- if (element instanceof DatamartHierarchy) {
- if (hasHierarchy) {
- isCrossjoined = true
- } else {
- hasHierarchy = true
- }
- }
- if (element instanceof DatamartSetAggregation) {
- if (hasAggregation) {
- isCrossjoined = true
- } else {
- hasAggregation = true
- }
- hasAggregation = true
- }
- }
- if (hasMeasures && (hasHierarchy ||
- hasAggregation)) {
- isCrossjoined = true
- }
- if (!hasMeasures && !isCrossjoined) {
- for (element : (axis as DatamartCubeAxis).
- elements) {
- if (element instanceof DatamartSetAggregation) {
- if ((element as DatamartSetAggregation).
- left !== null) {
- if ((element as DatamartSetAggregation).
- left.aggregation !== null) {
- var aggregation = ((element as DatamartSetAggregation).
- left.
- aggregation) as DatamartSetAggregationFunction
-
- // with EObjectDescription.create, we use our own name computation for scoping - it must return a created scope
- result.add(
- EObjectDescription.
- create(
- aggregation.
- aggregation.
- literal,
- aggregation))
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
+ }
+ }
+ }
+ }
+ }
+ }
+ } else if (datamart.source instanceof DatamartEntity) {
+ getEntityProperties(datamart.source as DatamartEntity, result, requestedAxisName)
+ } else if (datamart.source instanceof DatamartTask) {
+ getTaskColumns(datamart.source as DatamartTask, result, requestedAxisName)
+ }
+ }
+ }
+ return MapBasedScope.createScope(IScope.NULLSCOPE, result)
+ }
- // with EObjectDescription.create, we use our own name computation for scoping - it must return a created scope
- return MapBasedScope.createScope(IScope.NULLSCOPE, result)
- }
- }
- \ No newline at end of file
+ def IScope getScope_Table_Aggregation_valueRef(EObject object) {
+ var result = <IEObjectDescription>newArrayList
+ var requestedAxisName = ""
+ var eObj = object
+ while (!(eObj instanceof TableDatamart)) {
+ eObj = eObj.eContainer
+ if (eObj instanceof TableAxis) {
+ requestedAxisName = (eObj as TableAxis).axis.literal
+ }
+ }
+ if (eObj !== null) {
+ var datamart = (eObj as TableDatamart).datamartRef
+ if (datamart !== null && datamart.source !== null) {
+ if (datamart.source instanceof DatamartCube) {
+ for (axis : (datamart.source as DatamartCube).axisslicer) {
+ if (axis instanceof DatamartCubeAxis) {
+ if ((axis as DatamartCubeAxis).axis.name.literal.equals(requestedAxisName)) {
+ var hasMeasures = false
+ var hasHierarchy = false
+ var hasAggregation = false
+ var isCrossjoined = false
+ for (element : (axis as DatamartCubeAxis).elements) {
+ if (element instanceof DatamartMeasure ||
+ element instanceof DatamartDerivedMeasure) {
+ hasMeasures = true
+ }
+ }
+ for (element : (axis as DatamartCubeAxis).elements) {
+ if (element instanceof DatamartHierarchy) {
+ if (hasHierarchy) {
+ isCrossjoined = true
+ } else {
+ hasHierarchy = true
+ }
+ }
+ if (element instanceof DatamartSetAggregation) {
+ if (hasAggregation) {
+ isCrossjoined = true
+ } else {
+ hasAggregation = true
+ }
+ hasAggregation = true
+ }
+ }
+ if (hasMeasures && (hasHierarchy || hasAggregation)) {
+ isCrossjoined = true
+ }
+ if (!hasMeasures && !isCrossjoined) {
+ for (element : (axis as DatamartCubeAxis).elements) {
+ if (element instanceof DatamartSetAggregation) {
+ if(element.left !== null && element.left.aggregation !== null && element.left.aggregation instanceof DatamartSetAggregationFunction) {
+ var aggregation = element.left.aggregation as DatamartSetAggregationFunction
+ result.add(EObjectDescription.create(aggregation.aggregation.literal, aggregation))
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return MapBasedScope.createScope(IScope.NULLSCOPE, result)
+ }
+}
+ \ No newline at end of file
diff --git a/org.eclipse.osbp.xtext.table/xtend-gen/org/eclipse/osbp/xtext/table/jvmmodel/TableDSLJvmModelInferrer.java b/org.eclipse.osbp.xtext.table/xtend-gen/org/eclipse/osbp/xtext/table/jvmmodel/TableDSLJvmModelInferrer.java
index 93a0eea..55f196d 100644
--- a/org.eclipse.osbp.xtext.table/xtend-gen/org/eclipse/osbp/xtext/table/jvmmodel/TableDSLJvmModelInferrer.java
+++ b/org.eclipse.osbp.xtext.table/xtend-gen/org/eclipse/osbp/xtext/table/jvmmodel/TableDSLJvmModelInferrer.java
@@ -816,7 +816,7 @@ public class TableDSLJvmModelInferrer extends AbstractModelInferrer {
}
}
{
- if ((((!this.isGrid(table)) && (!this.isEmbedded(table))) && (this.isTask(table) || this.isCube(table)))) {
+ if (((!this.isGrid(table)) && (!this.isEmbedded(table)))) {
_builder.append("filterGenerator.addFilterChangeListener(this);");
_builder.newLine();
}
@@ -1449,25 +1449,13 @@ public class TableDSLJvmModelInferrer extends AbstractModelInferrer {
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("\t");
- _builder.append("List<DatamartPrimary<?>> primaryKeys = datamartInstance.getPrimaryList();");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("\t");
- _builder.append("for(DatamartPrimary key : primaryKeys) {");
+ _builder.append("if(datamartInstance.contains(event.getData().get(EventDispatcherDataTag.ID))) {");
_builder.newLine();
_builder.append("\t\t\t");
_builder.append("\t\t");
- _builder.append("if(key.contains(event.getData().get(EventDispatcherDataTag.ID))) {");
- _builder.newLine();
- _builder.append("\t\t\t");
- _builder.append("\t\t\t");
_builder.append("dataRefresh();");
_builder.newLine();
_builder.append("\t\t\t");
- _builder.append("\t\t");
- _builder.append("}");
- _builder.newLine();
- _builder.append("\t\t\t");
_builder.append("\t");
_builder.append("}");
_builder.newLine();
@@ -1532,67 +1520,175 @@ public class TableDSLJvmModelInferrer extends AbstractModelInferrer {
_builder.append("break;");
_builder.newLine();
body = _builder.toString();
- StringConcatenation _builder_1 = new StringConcatenation();
- _builder_1.append(body);
- _builder_1.newLineIfNotEmpty();
- _builder_1.append("\t");
- _builder_1.append("}");
- _builder_1.newLine();
- body = _builder_1.toString();
+ if ((((!this.isEmbedded(table)) && (table.getTabletype().getToolbar() != null)) && (table.getTabletype().getToolbar().eContainer() != null))) {
+ StringConcatenation _builder_1 = new StringConcatenation();
+ _builder_1.append(body);
+ _builder_1.newLineIfNotEmpty();
+ _builder_1.append("\t");
+ _builder_1.append("case ACTION:");
+ _builder_1.newLine();
+ _builder_1.append("\t\t");
+ _builder_1.append("if (toolbarUUID.equals(event.getTopic()) && event.getData().containsKey(EventDispatcherDataTag.BUTTON_ID)) {");
+ _builder_1.newLine();
+ _builder_1.append("\t\t\t");
+ _builder_1.append("Object id = event.getData().get(EventDispatcherDataTag.BUTTON_ID);");
+ _builder_1.newLine();
+ _builder_1.append("\t\t\t");
+ _builder_1.append("if (id instanceof TableActionEnum) {");
+ _builder_1.newLine();
+ _builder_1.append("\t\t\t\t");
+ _builder_1.append("TableActionEnum enumId = (TableActionEnum) id;");
+ _builder_1.newLine();
+ _builder_1.append("\t\t\t\t");
+ _builder_1.append("switch (enumId) {");
+ _builder_1.newLine();
+ _builder_1.append("\t\t\t\t");
+ _builder_1.append("case EXPORT_EXCEL:");
+ _builder_1.newLine();
+ _builder_1.append("\t\t\t\t\t");
+ _builder_1.append("for(CellSetFilterTable table:tables) {");
+ _builder_1.newLine();
+ _builder_1.append("\t\t\t\t\t\t");
+ _builder_1.append("ExcelExport excelExport = new ExcelExport(table, themeResourceService);");
+ _builder_1.newLine();
+ _builder_1.append("\t\t ");
+ _builder_1.append("excelExport.excludeCollapsedColumns();");
+ _builder_1.newLine();
+ _builder_1.append("\t\t ");
+ _builder_1.append("excelExport.setReportTitle(layoutManager.getCaption());");
+ _builder_1.newLine();
+ _builder_1.append("\t\t ");
+ _builder_1.append("excelExport.export();");
+ _builder_1.newLine();
+ _builder_1.append("\t\t ");
+ _builder_1.append("}");
+ _builder_1.newLine();
+ _builder_1.append("\t ");
+ _builder_1.append("break;");
+ _builder_1.newLine();
+ _builder_1.append("\t\t\t\t");
+ _builder_1.append("case EXPORT_CSV:");
+ _builder_1.newLine();
+ _builder_1.append("\t\t\t\t\t");
+ _builder_1.append("for(CellSetFilterTable table:tables) {");
+ _builder_1.newLine();
+ _builder_1.append("\t\t\t\t\t\t");
+ _builder_1.append("CsvExport csvExport = new CsvExport(table, themeResourceService);");
+ _builder_1.newLine();
+ _builder_1.append("\t\t ");
+ _builder_1.append("csvExport.excludeCollapsedColumns();");
+ _builder_1.newLine();
+ _builder_1.append("\t\t ");
+ _builder_1.append("csvExport.setReportTitle(layoutManager.getCaption());");
+ _builder_1.newLine();
+ _builder_1.append("\t\t ");
+ _builder_1.append("csvExport.export();");
+ _builder_1.newLine();
+ _builder_1.append("\t\t ");
+ _builder_1.append("}");
+ _builder_1.newLine();
+ _builder_1.append("\t ");
+ _builder_1.append("break;");
+ _builder_1.newLine();
+ _builder_1.append("\t\t\t\t");
+ _builder_1.append("case EXPORT_PDF:");
+ _builder_1.newLine();
+ _builder_1.append("\t\t\t\t\t");
+ _builder_1.append("for(CellSetFilterTable table:tables) {");
+ _builder_1.newLine();
+ _builder_1.append("\t\t\t\t\t\t");
+ _builder_1.append("PdfExport pdfExport = new PdfExport(table, themeResourceService);");
+ _builder_1.newLine();
+ _builder_1.append("\t\t ");
+ _builder_1.append("pdfExport.excludeCollapsedColumns();");
+ _builder_1.newLine();
+ _builder_1.append("\t\t ");
+ _builder_1.append("pdfExport.setReportTitle(layoutManager.getCaption());");
+ _builder_1.newLine();
+ _builder_1.append("\t\t ");
+ _builder_1.append("pdfExport.export();");
+ _builder_1.newLine();
+ _builder_1.append("\t\t ");
+ _builder_1.append("}");
+ _builder_1.newLine();
+ _builder_1.append("\t\t\t\t\t");
+ _builder_1.append("break;");
+ _builder_1.newLine();
+ _builder_1.append("\t\t\t\t");
+ _builder_1.append("}");
+ _builder_1.newLine();
+ _builder_1.append("\t\t\t");
+ _builder_1.append("}");
+ _builder_1.newLine();
+ _builder_1.append("\t\t");
+ _builder_1.append("}");
+ _builder_1.newLine();
+ _builder_1.append("\t\t");
+ _builder_1.append("break;");
+ _builder_1.newLine();
+ body = _builder_1.toString();
+ }
+ StringConcatenation _builder_2 = new StringConcatenation();
+ _builder_2.append(body);
+ _builder_2.newLineIfNotEmpty();
+ _builder_2.append("\t");
+ _builder_2.append("}");
+ _builder_2.newLine();
+ body = _builder_2.toString();
} else {
boolean _isGrid = this.isGrid(table);
if (_isGrid) {
- StringConcatenation _builder_2 = new StringConcatenation();
- _builder_2.append(body);
- _builder_2.newLineIfNotEmpty();
- _builder_2.append("switch(event.getCommand()) {");
- _builder_2.newLine();
- _builder_2.append("\t");
- _builder_2.append("case SAVE:");
- _builder_2.newLine();
- _builder_2.append("\t");
- _builder_2.append("case DELETE:");
- _builder_2.newLine();
- _builder_2.append("\t");
- _builder_2.append("case REFRESH:");
- _builder_2.newLine();
- _builder_2.append("\t\t");
- _builder_2.append("if(!event.getSender().equals(\"");
+ StringConcatenation _builder_3 = new StringConcatenation();
+ _builder_3.append(body);
+ _builder_3.newLineIfNotEmpty();
+ _builder_3.append("switch(event.getCommand()) {");
+ _builder_3.newLine();
+ _builder_3.append("\t");
+ _builder_3.append("case SAVE:");
+ _builder_3.newLine();
+ _builder_3.append("\t");
+ _builder_3.append("case DELETE:");
+ _builder_3.newLine();
+ _builder_3.append("\t");
+ _builder_3.append("case REFRESH:");
+ _builder_3.newLine();
+ _builder_3.append("\t\t");
+ _builder_3.append("if(!event.getSender().equals(\"");
QualifiedName _fullyQualifiedName_5 = this._iQualifiedNameProvider.getFullyQualifiedName(table);
- _builder_2.append(_fullyQualifiedName_5, "\t\t");
- _builder_2.append("\")) {");
- _builder_2.newLineIfNotEmpty();
+ _builder_3.append(_fullyQualifiedName_5, "\t\t");
+ _builder_3.append("\")) {");
+ _builder_3.newLineIfNotEmpty();
{
Set<LEntity> _findRequestedEntities_2 = this.findRequestedEntities(table);
for(final LEntity e_2 : _findRequestedEntities_2) {
- _builder_2.append("\t\t\t");
- _builder_2.append("if(event.getTopic().equals(\"");
+ _builder_3.append("\t\t\t");
+ _builder_3.append("if(event.getTopic().equals(\"");
QualifiedName _fullyQualifiedName_6 = this._iQualifiedNameProvider.getFullyQualifiedName(e_2);
- _builder_2.append(_fullyQualifiedName_6, "\t\t\t");
- _builder_2.append("\")){");
- _builder_2.newLineIfNotEmpty();
- _builder_2.append("\t\t\t");
- _builder_2.append("\t");
- _builder_2.append("// TODO: GridRefresh");
- _builder_2.newLine();
- _builder_2.append("\t\t\t");
- _builder_2.append("\t");
- _builder_2.append("grid.refreshData();");
- _builder_2.newLine();
- _builder_2.append("\t\t\t");
- _builder_2.append("}");
- _builder_2.newLine();
+ _builder_3.append(_fullyQualifiedName_6, "\t\t\t");
+ _builder_3.append("\")){");
+ _builder_3.newLineIfNotEmpty();
+ _builder_3.append("\t\t\t");
+ _builder_3.append("\t");
+ _builder_3.append("// TODO: GridRefresh");
+ _builder_3.newLine();
+ _builder_3.append("\t\t\t");
+ _builder_3.append("\t");
+ _builder_3.append("grid.refreshData();");
+ _builder_3.newLine();
+ _builder_3.append("\t\t\t");
+ _builder_3.append("}");
+ _builder_3.newLine();
}
}
- _builder_2.append("\t\t");
- _builder_2.append("}");
- _builder_2.newLine();
- _builder_2.append("\t\t");
- _builder_2.append("break;");
- _builder_2.newLine();
- _builder_2.append("}");
- _builder_2.newLine();
- body = _builder_2.toString();
+ _builder_3.append("\t\t");
+ _builder_3.append("}");
+ _builder_3.newLine();
+ _builder_3.append("\t\t");
+ _builder_3.append("break;");
+ _builder_3.newLine();
+ _builder_3.append("}");
+ _builder_3.newLine();
+ body = _builder_3.toString();
}
}
return body;
@@ -5915,7 +6011,19 @@ public class TableDSLJvmModelInferrer extends AbstractModelInferrer {
_builder.newLine();
_builder.append("\t\t");
_builder.append("\t");
- _builder.append("b.setEnabled(table.getValue() != null);");
+ _builder.append("b.setEnabled(table.getValue() != null && ");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("\t\t");
+ _builder.append("(dataSourceContainer.getTaskStatus(selection).equals(BPMStatus.Created) ||");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("\t\t");
+ _builder.append("dataSourceContainer.getTaskStatus(selection).equals(BPMStatus.Ready) ||");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("\t\t");
+ _builder.append("dataSourceContainer.getTaskStatus(selection).equals(BPMStatus.Suspended)));");
_builder.newLine();
_builder.append("\t\t");
_builder.append("}");
@@ -5970,69 +6078,77 @@ public class TableDSLJvmModelInferrer extends AbstractModelInferrer {
boolean _tripleNotEquals = (_primaryKeyAttribute != null);
if (_tripleNotEquals) {
_builder_1.append("\t\t");
- _builder_1.append("Object idObj = dataSourceContainer.getValueByProperty(selection, \"");
- String _lowerCase = alias.toLowerCase();
- _builder_1.append(_lowerCase, "\t\t");
- _builder_1.append("\");");
- _builder_1.newLineIfNotEmpty();
- _builder_1.append("\t\t");
- _builder_1.append("MPerspective perspective = getContext().get(MPerspective.class);");
+ _builder_1.append("if(selection != -1) {");
_builder_1.newLine();
_builder_1.append("\t\t");
- _builder_1.append("EventDispatcherEvent evnt = new EventDispatcherEvent(perspective, EventDispatcherCommand.SELECT, \"");
+ _builder_1.append("\t");
+ _builder_1.append("Object idObj = datamartInstance.getPrimaryListKeys(\"");
+ _builder_1.append(alias, "\t\t\t");
+ _builder_1.append("\").get(selection);");
+ _builder_1.newLineIfNotEmpty();
+ _builder_1.append("\t\t");
+ _builder_1.append("\t");
+ _builder_1.append("EventDispatcherEvent evnt = new EventDispatcherEvent(getContext().get(MPerspective.class), EventDispatcherCommand.SELECT, \"");
QualifiedName _fullyQualifiedName = this._iQualifiedNameProvider.getFullyQualifiedName(this.baseType(entity));
- _builder_1.append(_fullyQualifiedName, "\t\t");
+ _builder_1.append(_fullyQualifiedName, "\t\t\t");
_builder_1.append(".");
String _idAttributeName = entity.getIdAttributeName();
- _builder_1.append(_idAttributeName, "\t\t");
+ _builder_1.append(_idAttributeName, "\t\t\t");
_builder_1.append("\", \"");
QualifiedName _fullyQualifiedName_1 = this._iQualifiedNameProvider.getFullyQualifiedName(table);
- _builder_1.append(_fullyQualifiedName_1, "\t\t");
+ _builder_1.append(_fullyQualifiedName_1, "\t\t\t");
_builder_1.append("\");");
_builder_1.newLineIfNotEmpty();
_builder_1.append("\t\t");
+ _builder_1.append("\t");
_builder_1.append("evnt.addItem(EventDispatcherDataTag.ID, idObj);");
_builder_1.newLine();
_builder_1.append("\t\t");
+ _builder_1.append("\t");
_builder_1.append("eventDispatcher.sendEvent(evnt);");
_builder_1.newLine();
_builder_1.append("\t\t");
+ _builder_1.append("\t");
_builder_1.append("SelectionStore.putSelectionToPerspectiveContext(getPart(), \"");
QualifiedName _fullyQualifiedName_2 = this._iQualifiedNameProvider.getFullyQualifiedName(this.baseType(entity));
- _builder_1.append(_fullyQualifiedName_2, "\t\t");
+ _builder_1.append(_fullyQualifiedName_2, "\t\t\t");
_builder_1.append(".");
String _idAttributeName_1 = entity.getIdAttributeName();
- _builder_1.append(_idAttributeName_1, "\t\t");
+ _builder_1.append(_idAttributeName_1, "\t\t\t");
_builder_1.append("\", idObj);");
_builder_1.newLineIfNotEmpty();
_builder_1.append("\t\t");
- _builder_1.append("for (DatamartPrimary<?> primary : datamartInstance.getPrimaryList()){");
+ _builder_1.append("\t");
+ _builder_1.append("// send all refs too");
_builder_1.newLine();
_builder_1.append("\t\t");
_builder_1.append("\t");
- _builder_1.append("if (!\"");
- QualifiedName _fullyQualifiedName_3 = this._iQualifiedNameProvider.getFullyQualifiedName(this.baseType(entity));
- _builder_1.append(_fullyQualifiedName_3, "\t\t\t");
- _builder_1.append("\".equals(primary.getEntityName())){");
- _builder_1.newLineIfNotEmpty();
- _builder_1.append("\t\t");
- _builder_1.append("\t\t");
- _builder_1.append("Object primaryValue = dataSourceContainer.getValueByProperty(selection, primary.getAlias().toLowerCase());");
+ _builder_1.append("for (String alias : datamartInstance.getPrimaryList().keySet()){");
_builder_1.newLine();
_builder_1.append("\t\t");
_builder_1.append("\t\t");
- _builder_1.append("evnt = new EventDispatcherEvent(perspective, EventDispatcherCommand.SELECT, primary.getEntityName() + \".\" + primary.getAttributeName(), \"");
- QualifiedName _fullyQualifiedName_4 = this._iQualifiedNameProvider.getFullyQualifiedName(table);
- _builder_1.append(_fullyQualifiedName_4, "\t\t\t\t");
+ _builder_1.append("if (!\"");
+ _builder_1.append(alias, "\t\t\t\t");
+ _builder_1.append("\".equals(alias)){");
+ _builder_1.newLineIfNotEmpty();
+ _builder_1.append("\t\t");
+ _builder_1.append("\t\t\t");
+ _builder_1.append("evnt = new EventDispatcherEvent(getContext().get(MPerspective.class), EventDispatcherCommand.SELECT, datamartInstance.getPrimaryList().get(alias).getEntityName() + \".\" + datamartInstance.getPrimaryList().get(alias).getAttributeName(), \"");
+ QualifiedName _fullyQualifiedName_3 = this._iQualifiedNameProvider.getFullyQualifiedName(table);
+ _builder_1.append(_fullyQualifiedName_3, "\t\t\t\t\t");
_builder_1.append("\");");
_builder_1.newLineIfNotEmpty();
_builder_1.append("\t\t");
+ _builder_1.append("\t\t\t");
+ _builder_1.append("evnt.addItem(EventDispatcherDataTag.ID, datamartInstance.getPrimaryListKeys(alias).get(selection));");
+ _builder_1.newLine();
_builder_1.append("\t\t");
- _builder_1.append("evnt.addItem(EventDispatcherDataTag.ID, primaryValue);");
+ _builder_1.append("\t\t\t");
+ _builder_1.append("eventDispatcher.sendEvent(evnt);");
_builder_1.newLine();
_builder_1.append("\t\t");
_builder_1.append("\t\t");
- _builder_1.append("eventDispatcher.sendEvent(evnt);");
+ _builder_1.append("}");
_builder_1.newLine();
_builder_1.append("\t\t");
_builder_1.append("\t");
@@ -6060,34 +6176,37 @@ public class TableDSLJvmModelInferrer extends AbstractModelInferrer {
StringConcatenation _builder_1 = new StringConcatenation();
_builder_1.append(body);
_builder_1.newLineIfNotEmpty();
+ _builder_1.append("\t\t");
+ _builder_1.append("if(selection != -1) {");
+ _builder_1.newLine();
{
TableValueElement _source_1 = event.getSource();
if ((_source_1 instanceof TableOrdinal)) {
- _builder_1.append("\t\t");
+ _builder_1.append("\t\t\t");
_builder_1.append("EventDispatcherEvent evnt");
- _builder_1.append(evntCnt, "\t\t");
- _builder_1.append(" = new EventDispatcherEvent(perspective, EventDispatcherCommand.SELECT, \"");
+ _builder_1.append(evntCnt, "\t\t\t");
+ _builder_1.append(" = new EventDispatcherEvent(getContext().get(MPerspective.class), EventDispatcherCommand.SELECT, \"");
TableValueElement _source_2 = event.getSource();
String _valueRef = ((TableOrdinal) _source_2).getValueRef();
- _builder_1.append(_valueRef, "\t\t");
+ _builder_1.append(_valueRef, "\t\t\t");
_builder_1.append("\", \"");
QualifiedName _fullyQualifiedName = this._iQualifiedNameProvider.getFullyQualifiedName(table);
- _builder_1.append(_fullyQualifiedName, "\t\t");
+ _builder_1.append(_fullyQualifiedName, "\t\t\t");
_builder_1.append("\");");
_builder_1.newLineIfNotEmpty();
} else {
TableValueElement _source_3 = event.getSource();
if ((_source_3 instanceof TableAttribute)) {
- _builder_1.append("\t\t");
+ _builder_1.append("\t\t\t");
_builder_1.append("EventDispatcherEvent evnt");
- _builder_1.append(evntCnt, "\t\t");
- _builder_1.append(" = new EventDispatcherEvent(perspective, EventDispatcherCommand.SELECT, \"");
+ _builder_1.append(evntCnt, "\t\t\t");
+ _builder_1.append(" = new EventDispatcherEvent(getContext().get(MPerspective.class), EventDispatcherCommand.SELECT, \"");
TableValueElement _source_4 = event.getSource();
String _name = ((TableAttribute) _source_4).getValueRef().getAttributeRef().getName();
- _builder_1.append(_name, "\t\t");
+ _builder_1.append(_name, "\t\t\t");
_builder_1.append("\", \"");
QualifiedName _fullyQualifiedName_1 = this._iQualifiedNameProvider.getFullyQualifiedName(table);
- _builder_1.append(_fullyQualifiedName_1, "\t\t");
+ _builder_1.append(_fullyQualifiedName_1, "\t\t\t");
_builder_1.append("\");");
_builder_1.newLineIfNotEmpty();
}
@@ -6096,40 +6215,43 @@ public class TableDSLJvmModelInferrer extends AbstractModelInferrer {
{
TableValueElement _source_5 = event.getSource();
if ((_source_5 instanceof TableOrdinal)) {
- _builder_1.append("\t\t");
+ _builder_1.append("\t\t\t");
_builder_1.append("evnt");
- _builder_1.append(evntCnt, "\t\t");
+ _builder_1.append(evntCnt, "\t\t\t");
_builder_1.append(".addItem(EventDispatcherDataTag.LIST, dataSourceContainer.getValueByProperty(selection, \"");
TableValueElement _source_6 = event.getSource();
String _valueRef_1 = ((TableOrdinal) _source_6).getValueRef();
- _builder_1.append(_valueRef_1, "\t\t");
+ _builder_1.append(_valueRef_1, "\t\t\t");
_builder_1.append("\"));");
_builder_1.newLineIfNotEmpty();
- _builder_1.append("\t\t");
+ _builder_1.append("\t\t\t");
_builder_1.append("eventDispatcher.sendEvent(evnt");
- _builder_1.append(evntCnt, "\t\t");
+ _builder_1.append(evntCnt, "\t\t\t");
_builder_1.append(");");
_builder_1.newLineIfNotEmpty();
} else {
TableValueElement _source_7 = event.getSource();
if ((_source_7 instanceof TableAttribute)) {
- _builder_1.append("\t\t");
+ _builder_1.append("\t\t\t");
_builder_1.append("evnt");
- _builder_1.append(evntCnt, "\t\t");
+ _builder_1.append(evntCnt, "\t\t\t");
_builder_1.append(".addItem(EventDispatcherDataTag.LIST, dataSourceContainer.getValueByProperty(selection, \"");
TableValueElement _source_8 = event.getSource();
String _name_1 = ((TableAttribute) _source_8).getValueRef().getAttributeRef().getName();
- _builder_1.append(_name_1, "\t\t");
+ _builder_1.append(_name_1, "\t\t\t");
_builder_1.append("\"));");
_builder_1.newLineIfNotEmpty();
- _builder_1.append("\t\t");
+ _builder_1.append("\t\t\t");
_builder_1.append("eventDispatcher.sendEvent(evnt");
- _builder_1.append(evntCnt, "\t\t");
+ _builder_1.append(evntCnt, "\t\t\t");
_builder_1.append(");");
_builder_1.newLineIfNotEmpty();
}
}
}
+ _builder_1.append("\t\t");
+ _builder_1.append("} ");
+ _builder_1.newLine();
body = _builder_1.toString();
evntCnt = (evntCnt + 1);
}
@@ -6254,14 +6376,23 @@ public class TableDSLJvmModelInferrer extends AbstractModelInferrer {
_builder.append("if (container != null) {");
_builder.newLine();
_builder.append("\t");
- _builder.append("List<DerivedMember> members = container.getColumnPosition(visibleColumnKey).getMembers();");
+ _builder.append("DerivedPosition pos = container.getColumnPosition(visibleColumnKey);");
_builder.newLine();
_builder.append("\t");
- _builder.append("for (DerivedMember member : members) {");
+ _builder.append("if ( pos != null ) {");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("List<DerivedMember> members = pos.getMembers();");
_builder.newLine();
_builder.append("\t\t");
+ _builder.append("for (DerivedMember member : members) {");
+ _builder.newLine();
+ _builder.append("\t\t\t");
_builder.append("membersHash += (member.getUniqueName() != null) ? member.getUniqueName().hashCode() : member.hashCode();");
_builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("}");
+ _builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
@@ -6521,6 +6652,11 @@ public class TableDSLJvmModelInferrer extends AbstractModelInferrer {
IdAttribute prop = new IdAttribute();
prop.collapsed = true;
map.put(DatamartDefinitionUtil.getEntityIdAliasName(entity.getEntityRef()), prop);
+ boolean _isHistorizedOrTimedependentWithParent = entity.getEntityRef().isHistorizedOrTimedependentWithParent();
+ if (_isHistorizedOrTimedependentWithParent) {
+ map.put(DatamartDefinitionUtil.getEntityValidAliasName(entity.getEntityRef()), prop);
+ map.put(DatamartDefinitionUtil.getEntityCurrentAliasName(entity.getEntityRef()), prop);
+ }
EList<DatamartNavigation> _navigations = entity.getNavigations();
for (final DatamartNavigation navigation : _navigations) {
this.iterateIdMap(navigation.getDatamartEntity(), map);
@@ -6620,52 +6756,61 @@ public class TableDSLJvmModelInferrer extends AbstractModelInferrer {
StringConcatenation _builder = new StringConcatenation();
_builder.append("List<Integer> selections = new ArrayList<>();");
_builder.newLine();
+ _builder.append("if(taskSummary != null) {");
+ _builder.newLine();
+ _builder.append("\t");
_builder.append("IDto workloadDto = taskClient.getWorkloadDto(taskSummary);");
_builder.newLine();
+ _builder.append("\t");
_builder.append("List<IDto> operativeDtos = workLoadItem.getOperativeDtos(workloadDto);");
_builder.newLine();
+ _builder.append("\t");
_builder.append("if\t(operativeDtos != null) {");
_builder.newLine();
- _builder.append("\t");
+ _builder.append("\t\t");
_builder.append("Set<String> ids = new TreeSet<String>();");
_builder.newLine();
- _builder.append(" ");
+ _builder.append("\t ");
_builder.append("for\t(IDto operativeDto : operativeDtos) {");
_builder.newLine();
- _builder.append(" \t");
+ _builder.append("\t \t");
_builder.append("ids.add(String.valueOf(((");
- _builder.append(dtoFqn, " \t");
+ _builder.append(dtoFqn, "\t \t");
_builder.append(")operativeDto).");
- _builder.append(keyGetter, " \t");
+ _builder.append(keyGetter, "\t \t");
_builder.append("));");
_builder.newLineIfNotEmpty();
- _builder.append(" ");
+ _builder.append("\t ");
_builder.append("}");
_builder.newLine();
- _builder.append(" ");
+ _builder.append("\t ");
_builder.append("for\t(Object selection : dataSourceContainer.getAllItemIds()) {");
_builder.newLine();
- _builder.append(" ");
+ _builder.append("\t ");
_builder.append("String idValue = dataSourceContainer.getStringValueByProperty((Integer)selection,\"");
- _builder.append(alias, " ");
+ _builder.append(alias, "\t ");
_builder.append("\");");
_builder.newLineIfNotEmpty();
- _builder.append(" \t");
+ _builder.append("\t \t");
_builder.append("if\t(ids.contains(idValue)) {");
_builder.newLine();
- _builder.append(" \t\t");
+ _builder.append("\t \t\t");
_builder.append("selections.add((Integer)selection);");
_builder.newLine();
- _builder.append(" \t");
+ _builder.append("\t \t");
_builder.append("}");
_builder.newLine();
- _builder.append(" ");
+ _builder.append("\t ");
_builder.append("}");
_builder.newLine();
+ _builder.append("\t");
_builder.append("}");
_builder.newLine();
+ _builder.append("\t");
_builder.append("selectTable.setValue(selections);");
_builder.newLine();
+ _builder.append("}");
+ _builder.newLine();
_xblockexpression = _builder;
}
return _xblockexpression;
@@ -6692,9 +6837,9 @@ public class TableDSLJvmModelInferrer extends AbstractModelInferrer {
LDataType keyType = this._modelExtensions.getDatatype(entity.getPrimaryKeyAttribute());
String dtoFqn = EntityUtils.getDtoFQNForLEntity(entity);
StringConcatenation _builder = new StringConcatenation();
- _builder.append("IDTOServiceWithMutablePersistence<");
+ _builder.append("IDTOService<");
_builder.append(dtoFqn);
- _builder.append("> dtoService = (IDTOServiceWithMutablePersistence<");
+ _builder.append("> dtoService = (IDTOService<");
_builder.append(dtoFqn);
_builder.append(">) DtoServiceAccess.getService(");
_builder.append(dtoFqn);
@@ -6704,9 +6849,12 @@ public class TableDSLJvmModelInferrer extends AbstractModelInferrer {
_builder.append(alias);
_builder.append("\");");
_builder.newLineIfNotEmpty();
- _builder.append("if\t(selected) {");
+ _builder.append("if(taskSummary != null) {");
_builder.newLine();
_builder.append("\t");
+ _builder.append("if\t(selected) {");
+ _builder.newLine();
+ _builder.append("\t\t");
_builder.append("workLoadItem.addOperativeDto(taskClient.getWorkloadDto(taskSummary), ");
{
boolean _equals = "int".equals(keyType.getName());
@@ -6718,16 +6866,18 @@ public class TableDSLJvmModelInferrer extends AbstractModelInferrer {
}
_builder.append(");");
_builder.newLineIfNotEmpty();
+ _builder.append("\t");
_builder.append("}");
_builder.newLine();
+ _builder.append("\t");
_builder.append("else {");
_builder.newLine();
- _builder.append(" \t");
+ _builder.append("\t \t");
_builder.append("for(IDto dtoToRemove : workLoadItem.getOperativeDtos(taskClient.getWorkloadDto(taskSummary))) {");
_builder.newLine();
- _builder.append("\t\t");
+ _builder.append("\t\t\t");
_builder.append("if(((");
- _builder.append(dtoFqn, "\t\t");
+ _builder.append(dtoFqn, "\t\t\t");
_builder.append(")dtoToRemove).getId()");
{
boolean _equals_1 = "int".equals(keyType.getName());
@@ -6739,18 +6889,60 @@ public class TableDSLJvmModelInferrer extends AbstractModelInferrer {
}
_builder.append(") {");
_builder.newLineIfNotEmpty();
- _builder.append("\t\t\t");
+ _builder.append("\t\t\t\t");
_builder.append("workLoadItem.removeOperativeDto(taskClient.getWorkloadDto(taskSummary), dtoToRemove);");
_builder.newLine();
- _builder.append("\t\t\t");
+ _builder.append("\t\t\t\t");
_builder.append("break;");
_builder.newLine();
+ _builder.append("\t\t\t");
+ _builder.append("}");
+ _builder.newLine();
_builder.append("\t\t");
_builder.append("}");
_builder.newLine();
_builder.append("\t");
_builder.append("}");
_builder.newLine();
+ _builder.append("} else {");
+ _builder.newLine();
+ _builder.append("\t");
+ _builder.append("if(selected) {");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("SelectionStore.addSelectionToPerspectiveContext(getPart(), \"");
+ _builder.append(dtoFqn, "\t\t");
+ _builder.append("\", ");
+ {
+ boolean _equals_2 = "int".equals(keyType.getName());
+ if (_equals_2) {
+ _builder.append("dtoService.get((int) Integer.parseInt(idValue))");
+ } else {
+ _builder.append("dtoService.get(idValue)");
+ }
+ }
+ _builder.append(");");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("} else {");
+ _builder.newLine();
+ _builder.append("\t\t");
+ _builder.append("SelectionStore.removeSelectionFromPerspectiveContext(getPart(), \"");
+ _builder.append(dtoFqn, "\t\t");
+ _builder.append("\", ");
+ {
+ boolean _equals_3 = "int".equals(keyType.getName());
+ if (_equals_3) {
+ _builder.append("dtoService.get((int) Integer.parseInt(idValue))");
+ } else {
+ _builder.append("dtoService.get(idValue)");
+ }
+ }
+ _builder.append(");");
+ _builder.newLineIfNotEmpty();
+ _builder.append("\t");
+ _builder.append("}");
+ _builder.newLine();
_builder.append("}");
_builder.newLine();
_xblockexpression = _builder;
diff --git a/org.eclipse.osbp.xtext.table/xtend-gen/org/eclipse/osbp/xtext/table/jvmmodel/TableModelGenerator.java b/org.eclipse.osbp.xtext.table/xtend-gen/org/eclipse/osbp/xtext/table/jvmmodel/TableModelGenerator.java
index 90ba902..9d39d53 100644
--- a/org.eclipse.osbp.xtext.table/xtend-gen/org/eclipse/osbp/xtext/table/jvmmodel/TableModelGenerator.java
+++ b/org.eclipse.osbp.xtext.table/xtend-gen/org/eclipse/osbp/xtext/table/jvmmodel/TableModelGenerator.java
@@ -55,6 +55,7 @@ import org.eclipse.e4.ui.model.application.ui.basic.MPart;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.osbp.bpm.api.BPMOperation;
+import org.eclipse.osbp.bpm.api.BPMStatus;
import org.eclipse.osbp.bpm.api.BPMTaskEventType;
import org.eclipse.osbp.bpm.api.BPMTaskSummary;
import org.eclipse.osbp.bpm.api.BPMTaskUserEvent;
@@ -69,7 +70,7 @@ import org.eclipse.osbp.preferences.ProductConfiguration;
import org.eclipse.osbp.runtime.common.event.EventDispatcherEvent;
import org.eclipse.osbp.runtime.common.event.IDualData;
import org.eclipse.osbp.runtime.common.event.SelectionStore;
-import org.eclipse.osbp.runtime.common.filter.IDTOServiceWithMutablePersistence;
+import org.eclipse.osbp.runtime.common.filter.IDTOService;
import org.eclipse.osbp.runtime.web.vaadin.common.data.IBeanSearchServiceFactory;
import org.eclipse.osbp.ui.api.contextfunction.IViewEmbeddedProvider;
import org.eclipse.osbp.ui.api.customfields.IBlobService;
@@ -84,6 +85,7 @@ import org.eclipse.osbp.utils.vaadin.SelectUserWindow;
import org.eclipse.osbp.utils.vaadin.ViewLayoutManager;
import org.eclipse.osbp.vaaclipse.common.ecview.api.IECViewSessionHelper;
import org.eclipse.osbp.xtext.action.SelectWorkloadActionEnum;
+import org.eclipse.osbp.xtext.action.TableActionEnum;
import org.eclipse.osbp.xtext.basic.generator.BasicDslGeneratorUtils;
import org.eclipse.osbp.xtext.blip.BlipItem;
import org.eclipse.osbp.xtext.datamart.common.AEntityDatamart;
@@ -102,6 +104,9 @@ import org.eclipse.osbp.xtext.table.common.CellSetPagedFilterTable;
import org.eclipse.osbp.xtext.table.common.CheckboxSelectionCellSetFilterTable;
import org.eclipse.osbp.xtext.table.common.TableFilterDecorator;
import org.eclipse.osbp.xtext.table.common.TableFilterGenerator;
+import org.eclipse.osbp.xtext.table.common.export.CsvExport;
+import org.eclipse.osbp.xtext.table.common.export.ExcelExport;
+import org.eclipse.osbp.xtext.table.common.export.PdfExport;
import org.eclipse.osbp.xtext.table.generator.TableGridSourceGenerator;
import org.eclipse.xtext.generator.IFileSystemAccess;
import org.eclipse.xtext.xbase.compiler.GeneratorConfig;
@@ -199,7 +204,7 @@ public class TableModelGenerator extends I18NModelGenerator {
IDto.class,
Task.class,
BlipItem.class,
- IDTOServiceWithMutablePersistence.class,
+ IDTOService.class,
DtoServiceAccess.class,
DatamartFilterGenerator.class,
ViewLayoutManager.class,
@@ -227,7 +232,12 @@ public class TableModelGenerator extends I18NModelGenerator {
MPerspective.class,
MPart.class,
IPerspectiveProvider.class,
- SelectionStore.class);
+ SelectionStore.class,
+ BPMStatus.class,
+ ExcelExport.class,
+ CsvExport.class,
+ PdfExport.class,
+ TableActionEnum.class);
_xblockexpression = super.createAppendable(context, importManager, config);
}
return _xblockexpression;

Back to the top