catch up with development Signed-off-by: Ralf Mollik <ramollik@compex-commerce.com>
diff --git a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/DatamartData.java b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/DatamartData.java index 7eb83b8..5978a32 100644 --- a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/DatamartData.java +++ b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/DatamartData.java
@@ -15,15 +15,20 @@ */ package org.eclipse.osbp.ui.api.datamart; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; + import org.eclipse.osbp.runtime.common.event.IDualData; /** * The Class DatamartData. */ +@XmlRootElement public class DatamartData implements IDualData { private String selectionValue; private String formattedValue; private String hierarchy = null; + @XmlElement private boolean isString = false; @Override @@ -39,26 +44,34 @@ return selectionValue; } + @XmlElement + @Override + public void setSelectionValue(String selectionValue) { + this.selectionValue = selectionValue; + } + @Override public String getSelectionValue() { return selectionValue; } + @XmlElement @Override - public void setSelectionValue(String selectionValue) { - this.selectionValue = selectionValue; + public void setFormattedValue(String formattedValue) { + this.formattedValue = formattedValue; } - + @Override public String getFormattedValue() { return formattedValue; } + @XmlElement @Override - public void setFormattedValue(String formattedValue) { - this.formattedValue = formattedValue; + public void setHierarchy(String hierarchy) { + this.hierarchy = hierarchy; } - + @Override public String getHierarchy() { return hierarchy; @@ -73,17 +86,53 @@ } @Override - public void setHierarchy(String hierarchy) { - this.hierarchy = hierarchy; + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + ((formattedValue == null) ? 0 : formattedValue.hashCode()); + result = prime * result + ((hierarchy == null) ? 0 : hierarchy.hashCode()); + result = prime * result + (isString ? 1231 : 1237); + result = prime * result + ((selectionValue == null) ? 0 : selectionValue.hashCode()); + return result; } @Override - public boolean equals(IDualData item) { - if (item != null && (item.getHierarchy() == null || item.getHierarchy().equals(getHierarchy())) - && item.getSelectionValue().equals(getSelectionValue()) - && item.getFormattedValue().equals(getFormattedValue())) { + public boolean equals(Object obj) { + if (this == obj) { return true; } - return false; + if (obj == null) { + return false; + } + if (!(obj instanceof DatamartData)) { + return false; + } + DatamartData other = (DatamartData) obj; + if (formattedValue == null) { + if (other.formattedValue != null) { + return false; + } + } else if (!formattedValue.equals(other.formattedValue)) { + return false; + } + if (hierarchy == null) { + if (other.hierarchy != null) { + return false; + } + } else if (!hierarchy.equals(other.hierarchy)) { + return false; + } + if (isString != other.isString) { + return false; + } + if (selectionValue == null) { + if (other.selectionValue != null) { + return false; + } + } else if (!selectionValue.equals(other.selectionValue)) { + return false; + } + return true; } + }
diff --git a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/DatamartFilter.java b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/DatamartFilter.java index 90ad1da..baf098b 100644 --- a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/DatamartFilter.java +++ b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/DatamartFilter.java
@@ -21,12 +21,17 @@ import java.util.Map.Entry; import java.util.stream.Collectors; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlTransient; + import org.eclipse.osbp.runtime.common.event.EventDispatcherEvent.EventDispatcherDataTag; import org.eclipse.osbp.runtime.common.event.IDualData; /** * The Class DatamartFilter. */ +@XmlRootElement(name="filter") public class DatamartFilter { /** The Constant FILTER_PLACEHOLDER. */ @@ -241,12 +246,15 @@ /** optional filter. */ private boolean optional; - private IDatamartBetweenInput inputComponent; + private IDatamartBetweenInput inputComponent; - public DateTimeFormat format; + private DateTimeFormat format; - public DateResolution resolution; + private DateResolution resolution; + public DatamartFilter() { + this(MultipleType.NONE, FilterType.SQL, null, null, true); + } /** * Instantiates a new datamart filter for non date data typed attributes. * @@ -311,8 +319,6 @@ this.type = type; this.name = name; this.shortName = shortName; - DateTimeFormat format = null; - DateResolution resolution = null; if (dateFormatMap != null) { for (Entry<String, String> entry : dateFormatMap.entrySet()){ if (DateTimeFormat.get(entry.getKey()) != null ){ @@ -323,8 +329,6 @@ } } } - this.format = format; - this.resolution = resolution; this.sql = sql; this.setOptional(optional); data = new ArrayList<>(); @@ -332,6 +336,16 @@ } /** + * Sets the name. + * + * @param name the new name + */ + @XmlElement + public void setName(String name) { + this.name = name; + } + + /** * Gets the name. * * @return the name @@ -363,19 +377,11 @@ } /** - * Sets the name. - * - * @param name the new name - */ - public void setName(String name) { - this.name = name; - } - - /** * Gets the short name. * * @return the short name */ + @XmlElement public String getShortName() { return shortName; } @@ -409,6 +415,17 @@ } /** + * Sets the type. + * + * @param type the new type + */ + + @XmlElement + public void setType(FilterType type) { + this.type = type; + } + + /** * Gets the type. * * @return the type @@ -418,14 +435,15 @@ } /** - * Sets the type. + * Sets the multiple type. * - * @param type the new type + * @param multipleType the new multiple type */ - public void setType(FilterType type) { - this.type = type; + @XmlElement + public void setMultipleType(MultipleType multipleType) { + this.multipleType = multipleType; } - + /** * Gets the multiple type. * @@ -435,15 +453,16 @@ return multipleType; } - /** - * Sets the multiple type. - * - * @param multipleType the new multiple type - */ - public void setMultipleType(MultipleType multipleType) { - this.multipleType = multipleType; - } - + /** + * Sets the sql. + * + * @param sql the new sql + */ + @XmlElement + public void setSql(String sql) { + this.sql = sql; + } + /** * Gets the sql. * @@ -454,14 +473,15 @@ } /** - * Sets the sql. + * Sets the condition. * - * @param sql the new sql + * @param condition the new condition */ - public void setSql(String sql) { - this.sql = sql; + @XmlElement + public void setCondition(String condition) { + this.condition = condition; } - + /** * Gets the condition. * @@ -471,15 +491,6 @@ return condition; } - /** - * Sets the condition. - * - * @param condition the new condition - */ - public void setCondition(String condition) { - this.condition = condition; - } - public String getHistCondition(String currentColumnName) { return currentColumnName+"=1"; } @@ -489,6 +500,7 @@ * * @return the selector */ + @XmlTransient public IDatamartSelectable getSelector() { return selector; } @@ -507,6 +519,7 @@ * * @return the input component */ + @XmlTransient public IDatamartBetweenInput getBetweenInputComponent() { return inputComponent; } @@ -521,6 +534,18 @@ } /** + * Sets the data. + * + * @param data the new data + */ + @XmlTransient + public void setData(List<IDualData> data) { + if(data != null) { + this.data.addAll(data); + } + } + + /** * Gets the data. * * @return the data @@ -529,24 +554,15 @@ return data; } + @XmlElement + public void setOptional(boolean optional) { + this.optional = optional; + } + public boolean isOptional() { return optional; } - public void setOptional(boolean optional) { - this.optional = optional; - } - - /** - * Sets the data. - * - * @param data the new data - */ - public void setData(List<IDualData> data) { - if(data != null) { - this.data.addAll(data); - } - } /** * Adds the item. @@ -633,6 +649,18 @@ } /** + * Sets the selected data. + * + * @param selection the new selected data + */ + @XmlElement(type=DatamartData.class, name="selection") + public void setSelectedData(List<IDualData> selection) { + if(selection != null) { + this.selection.addAll(selection); + } + } + + /** * Gets the selected data. * * @return the selected data @@ -642,17 +670,6 @@ } /** - * Sets the selected data. - * - * @param selection the new selected data - */ - public void setSelectedData(List<IDualData> selection) { - if(selection != null) { - this.selection.addAll(selection); - } - } - - /** * Adds the selected item. * * @param item the item @@ -697,11 +714,11 @@ */ @SuppressWarnings("unchecked") public boolean canSelectData(Map<EventDispatcherDataTag, Object> selectedData) { - for(EventDispatcherDataTag tag : selectedData.keySet()) { - if(tag == EventDispatcherDataTag.ID) { + for(Entry<EventDispatcherDataTag, Object> entrySet : selectedData.entrySet()) { + if(entrySet.getKey() == EventDispatcherDataTag.ID) { return false; - } else if(tag == EventDispatcherDataTag.LIST) { - return selectData((List<String>)selectedData.get(tag)); + } else if(entrySet.getKey() == EventDispatcherDataTag.LIST) { + return selectData((List<String>)entrySet.getValue()); } } return false; @@ -759,5 +776,17 @@ } return false; } + public DateTimeFormat getFormat() { + return format; + } + public void setFormat(DateTimeFormat format) { + this.format = format; + } + public DateResolution getResolution() { + return resolution; + } + public void setResolution(DateResolution resolution) { + this.resolution = resolution; + } }
diff --git a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/IDataMart.java b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/IDataMart.java index 74cfd7a..fd688e6 100644 --- a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/IDataMart.java +++ b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/IDataMart.java
@@ -26,7 +26,7 @@ public enum AttributeVisibility { HIDDEN, READONLY } - + String getName(); static final String DATAMART_CLASS_POSTFIX = "Datamart"; static final String DATAMART_SERVICE_POSTFIX = "DatamartService"; static final String DATAMART_CONTAINER_POSTFIX = "DatamartContainer";
diff --git a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/IDatamartBetweenInput.java b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/IDatamartBetweenInput.java index c9aed8b..38798db 100644 --- a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/IDatamartBetweenInput.java +++ b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/IDatamartBetweenInput.java
@@ -14,6 +14,8 @@ */ package org.eclipse.osbp.ui.api.datamart; +import java.util.Locale; + import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.ui.AbstractField; @@ -31,6 +33,8 @@ <T> AbstractField<T> getUntilInput(); + void setLocale(Locale locale); + /** * Sets the caption. *
diff --git a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/IDatamartSelectable.java b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/IDatamartSelectable.java index f10582c..e7e79c1 100644 --- a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/IDatamartSelectable.java +++ b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/datamart/IDatamartSelectable.java
@@ -45,6 +45,13 @@ * @return the selected items */ List<IDualData> getSelectedItems(); + + /** + * Sets the selected items. + * + * @param selectedItems the new selected items + */ + void setSelectedItems(List<IDualData> selectedItems); /** * Gets a selected single value.
diff --git a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/metadata/IDSLMetadataService.java b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/metadata/IDSLMetadataService.java index 5537b76..60d07cd 100644 --- a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/metadata/IDSLMetadataService.java +++ b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/metadata/IDSLMetadataService.java
@@ -43,6 +43,8 @@ PERSPECTIVES } + public static final String DASHBOARD = "osbee.Dashboard"; + public static final class ThrowableMessages { private ThrowableMessages() { }
diff --git a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/statemachine/IStateMachine.java b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/statemachine/IStateMachine.java index aa9e643..92ac353 100644 --- a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/statemachine/IStateMachine.java +++ b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/statemachine/IStateMachine.java
@@ -21,7 +21,6 @@ import java.util.Set; import org.eclipse.e4.core.contexts.IEclipseContext; -import org.eclipse.e4.ui.model.application.ui.basic.MPart; import org.eclipse.osbp.dsl.common.datatypes.IDto; import org.eclipse.osbp.runtime.common.filter.IQuery; import org.eclipse.osbp.ui.api.customfields.IBlobService; @@ -62,6 +61,8 @@ Object get(String id); + Object get(String id, String parameter); + void set(String id, Object content); void set(String id, String device, Object content); @@ -193,8 +194,6 @@ void blockQueueTaking(boolean block); - boolean isJavaPosRemote(); - int getRemotePort(); void setRemotePort(int port);
diff --git a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/statemachine/IStateMachineParticipant.java b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/statemachine/IStateMachineParticipant.java index f8f2af5..bd67b32 100644 --- a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/statemachine/IStateMachineParticipant.java +++ b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/statemachine/IStateMachineParticipant.java
@@ -22,12 +22,14 @@ IStateMachine getStatemachine(); - void init(); + void init(String pRemoteHost, int pRemotePort); void setLocale(Locale locale); Method getter(Object listener, String id); + Method getter(Object listener, String id, String device); + Method setter(Object listener, String id, Class<?> parameter); Method setter(Object listener, String id, Class<?> content, int contentIndex); @@ -44,5 +46,8 @@ Object get(Object obj, String id); + Object get(Object obj, String id, String parameter); + void clear(Object obj, String id); + }
diff --git a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/themes/EnumCssClass.java b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/themes/EnumCssClass.java index 21b0554..e2ad4ad 100644 --- a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/themes/EnumCssClass.java +++ b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/themes/EnumCssClass.java
@@ -32,6 +32,7 @@ SINGLE_SELECTION, SINGLE_SELECTION_AREA, RANGE_SELECTION, + DEFAULT_TIMES, DATA_COMPONENT, DATA_AREA, MULTI_AREA,
diff --git a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/user/IUser.java b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/user/IUser.java index 57317bb..1c5d783 100644 --- a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/user/IUser.java +++ b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/user/IUser.java
@@ -18,6 +18,7 @@ import org.eclipse.e4.ui.model.application.MApplication; import org.eclipse.osbp.ui.api.user.filter.FilterMap; +import org.w3c.dom.Document; /** * Every user object needs to implement this interface. @@ -25,6 +26,8 @@ public interface IUser { // to avoid dependency to publicapi public static final String userClass = "userClass"; + public static final String docRoot = "datamartFilter"; + /** * Sets the application. * @@ -91,11 +94,11 @@ String getExtraPassword(); /** - * Gets the supervisor. + * Gets the superuser. * - * @return the supervisor + * @return the superuser */ - boolean isSupervisor(); + boolean isSuperuser(); /** * Gets the perspective id. @@ -227,5 +230,14 @@ } FilterMap getUserFilter(); - + + String loadDashboard(); + void saveDashboard(String dashboard); + + String loadFavorites(); + void saveFavorites(String favorites); + + Document getFilterDocument(); + void loadFilterDocument(); + void saveFilterDocument(); }
diff --git a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/useraccess/IUserAccessService.java b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/useraccess/IUserAccessService.java index 4fd4bde..a69d8f5 100644 --- a/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/useraccess/IUserAccessService.java +++ b/org.eclipse.osbp.ui.api/src/org/eclipse/osbp/ui/api/useraccess/IUserAccessService.java
@@ -475,4 +475,11 @@ * @return the blip process permissions */ IBlipProcessPermissions getBlipProcessPermissions(); + + String getDashboard(); + void setDashboard(String dashboard); + String getFavorites(); + void setFavorites(String favorites); + String getFilterSelections(); + void setFilterSelections(String filters); }