diff options
Diffstat (limited to 'org.eclipse.osbp.utils/src/org/eclipse')
18 files changed, 103 insertions, 45 deletions
diff --git a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/Activator.java b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/Activator.java index 003974a..82dcf9a 100644 --- a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/Activator.java +++ b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/Activator.java @@ -3,9 +3,11 @@ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) * * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation diff --git a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/annotation/CommonUtils.xtend b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/annotation/CommonUtils.xtend index b34207b..0a33cde 100644 --- a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/annotation/CommonUtils.xtend +++ b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/annotation/CommonUtils.xtend @@ -3,9 +3,11 @@ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) * * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation diff --git a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/classloader/IClassLoader.java b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/classloader/IClassLoader.java index 16697a3..70855b0 100644 --- a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/classloader/IClassLoader.java +++ b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/classloader/IClassLoader.java @@ -3,9 +3,11 @@ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) * * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation diff --git a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/classloader/IEObjectLoader.java b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/classloader/IEObjectLoader.java index 61c339e..27412af 100644 --- a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/classloader/IEObjectLoader.java +++ b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/classloader/IEObjectLoader.java @@ -3,9 +3,11 @@ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) * * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation diff --git a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/common/BundleUtilities.java b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/common/BundleUtilities.java index 9b37763..d85fb8c 100644 --- a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/common/BundleUtilities.java +++ b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/common/BundleUtilities.java @@ -3,9 +3,11 @@ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) * * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation diff --git a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/common/EntityUtils.xtend b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/common/EntityUtils.xtend index 583580e..b3ff5a9 100644 --- a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/common/EntityUtils.xtend +++ b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/common/EntityUtils.xtend @@ -3,9 +3,11 @@ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) * * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation @@ -161,12 +163,15 @@ class EntityUtils { } def static LEntity getEntityFromDto(JvmType type) { + if(type === null) { + return null + } var LEntity entity = null try { var qualifiedDtoName = type?.qualifiedName var resourceSet = type?.eResource?.resourceSet val objectDescs = ServiceListener.getEObjectDescriptions(OSBPDtoPackage.Literals.LDTO, qualifiedDtoName) - if (objectDescs?.iterator.hasNext) { + if (objectDescs !== null && objectDescs.iterator.hasNext) { val eobjectDesc = objectDescs.iterator.next if (resourceSet !== null) { var dto = resourceSet.getEObject(eobjectDesc.EObjectURI, true) as LDto diff --git a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/common/ServiceListener.java b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/common/ServiceListener.java index 56f2237..2a92ccb 100644 --- a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/common/ServiceListener.java +++ b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/common/ServiceListener.java @@ -3,9 +3,11 @@ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) * * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation diff --git a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/common/SystemInformation.java b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/common/SystemInformation.java index 3a6c7c6..264be09 100644 --- a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/common/SystemInformation.java +++ b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/common/SystemInformation.java @@ -3,9 +3,11 @@ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) * * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation diff --git a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/constants/Base26Crypt.java b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/constants/Base26Crypt.java index 700d750..1a9b639 100644 --- a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/constants/Base26Crypt.java +++ b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/constants/Base26Crypt.java @@ -3,9 +3,11 @@ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) * * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation diff --git a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/constants/ExtendedDate.java b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/constants/ExtendedDate.java index 138352c..e40f542 100644 --- a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/constants/ExtendedDate.java +++ b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/constants/ExtendedDate.java @@ -3,9 +3,11 @@ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) * * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation diff --git a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/currency/CurrencyConverter.java b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/currency/CurrencyConverter.java index df8ffe3..f97ddce 100644 --- a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/currency/CurrencyConverter.java +++ b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/currency/CurrencyConverter.java @@ -3,9 +3,11 @@ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) * * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation diff --git a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/currency/EuroBasedCurrencyConversionData.java b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/currency/EuroBasedCurrencyConversionData.java index f031b1b..ad2c73c 100644 --- a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/currency/EuroBasedCurrencyConversionData.java +++ b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/currency/EuroBasedCurrencyConversionData.java @@ -3,9 +3,11 @@ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) * * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation diff --git a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/currency/EuroBasedExchangeReferenceRates.java b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/currency/EuroBasedExchangeReferenceRates.java index 0934a4e..209159c 100644 --- a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/currency/EuroBasedExchangeReferenceRates.java +++ b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/currency/EuroBasedExchangeReferenceRates.java @@ -3,9 +3,11 @@ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) * * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation diff --git a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/currency/Utilities.java b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/currency/Utilities.java index ca33425..1b7d693 100644 --- a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/currency/Utilities.java +++ b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/currency/Utilities.java @@ -3,9 +3,11 @@ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) * * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation diff --git a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/entityhelper/DataType.xtend b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/entityhelper/DataType.xtend index f0286f9..80b5444 100644 --- a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/entityhelper/DataType.xtend +++ b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/entityhelper/DataType.xtend @@ -3,9 +3,11 @@ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) * * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation @@ -32,12 +34,14 @@ import org.eclipse.xtext.common.types.JvmType import org.eclipse.xtext.common.types.access.IJvmTypeProvider import org.eclipse.osbp.dsl.semantic.common.types.LAttribute import org.eclipse.xtext.common.types.JvmTypeReference +import org.eclipse.osbp.dsl.semantic.common.types.LDateType +import org.eclipse.osbp.runtime.common.layouting.IPropertyConstants public class DataType { @Inject @Extension - private TypeHelper typeHelper; + TypeHelper typeHelper @Inject ModelExtensions entityExtensions @@ -148,25 +152,41 @@ public class DataType { var lDataType = getLDataType(attribute) if (lDataType !== null) { if (lDataType.date) { - return EType.DATE + if (lDataType.dateType.equals(LDateType.TIMESTAMP)){ + return EType.TIMESTAMP + } else if (lDataType.dateType.equals(LDateType.DATE)){ + return EType.DATE + } else { + return EType.DATE + } } - // data type is defined as Blob if (!lDataType.properties.isNullOrEmpty) { - if (lDataType.properties.exists[it.key.toLowerCase.equals("blob")]){ + // data type is defined as Blob + if (getJvmType(attribute).string && lDataType.properties.exists[it.key.toLowerCase.equals(IPropertyConstants.PROPERTY_BLOB)]){ return EType.BLOPMAPPING } - if (lDataType.properties.exists[it.value.toLowerCase.equals("richtextarea")]){ + // data type is defined as rich text area + if (getJvmType(attribute).string && lDataType.properties.exists[it.value.toLowerCase.equals(IPropertyConstants.PROPERTY_RICH_TEXT)]){ return EType.RICHTEXTAREA } + // data type is defined as checkbox + if (getJvmType(attribute).boolean && lDataType.properties.exists[it.value.toLowerCase.equals(IPropertyConstants.PROPERTY_CHECKBOX)]){ + return EType.BOOLEAN_CHECKBOX + } } - // Otherwise entity attribute is defined as Blob if (!attribute.properties.isNullOrEmpty) { - if (attribute.properties.exists[it.key.toLowerCase.equals("blob")]){ + // Otherwise entity attribute is defined as Blob + if (getJvmType(attribute).string && attribute.properties.exists[it.key.toLowerCase.equals(IPropertyConstants.PROPERTY_BLOB)]){ return EType.BLOPMAPPING } - if (attribute.properties.exists[it.value.toLowerCase.equals("richtextarea")]){ + // Otherwise entity attribute is defined as rich text area + if (getJvmType(attribute).string && attribute.properties.exists[it.value.toLowerCase.equals(IPropertyConstants.PROPERTY_RICH_TEXT)]){ return EType.RICHTEXTAREA } + // data type is defined as rich text area + if (getJvmType(attribute).boolean && lDataType.properties.exists[it.value.toLowerCase.equals(IPropertyConstants.PROPERTY_CHECKBOX)]){ + return EType.BOOLEAN_CHECKBOX + } } if ("blobMapping".equalsIgnoreCase(lDataType.name)) { return EType.BLOPMAPPING @@ -191,6 +211,7 @@ public class DataType { case BOOLEAN: return (sourceType == EType.BOOLEAN) case BYTE: return (sourceType == EType.BYTE) case DATE: return (sourceType == EType.DATE) + case TIMESTAMP: return (sourceType == EType.TIMESTAMP) case FLOAT: return (sourceType == EType.FLOAT || sourceType == EType.LONG || sourceType == EType.INTEGER || sourceType == EType.SHORT || sourceType == EType.BOOLEAN) case DOUBLE: return (sourceType == EType.FLOAT || sourceType == EType.DOUBLE || sourceType == EType.LONG || diff --git a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/session/HttpSessionAttributes.java b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/session/HttpSessionAttributes.java index 76cc1d5..00a16b7 100644 --- a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/session/HttpSessionAttributes.java +++ b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/session/HttpSessionAttributes.java @@ -3,9 +3,11 @@ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) * * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation diff --git a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/session/UriPath.java b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/session/UriPath.java index c0c0215..b3fcfbe 100644 --- a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/session/UriPath.java +++ b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/session/UriPath.java @@ -3,9 +3,11 @@ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) * * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation diff --git a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/session/VaadinSessionAttributes.java b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/session/VaadinSessionAttributes.java index 7380a20..62f8541 100644 --- a/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/session/VaadinSessionAttributes.java +++ b/org.eclipse.osbp.utils/src/org/eclipse/osbp/utils/session/VaadinSessionAttributes.java @@ -3,9 +3,11 @@ * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) * * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 + * are made available under the terms of the Eclipse Public License 2.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 * * Contributors: * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |