diff --git a/DIST/XLSReport_mx7_6.0.6.mpk b/DIST/XLSReport_mx7_6.0.6.mpk new file mode 100644 index 0000000..2f93243 Binary files /dev/null and b/DIST/XLSReport_mx7_6.0.6.mpk differ diff --git a/XLSReport.mpr b/XLSReport.mpr index 312685d..48ad277 100644 Binary files a/XLSReport.mpr and b/XLSReport.mpr differ diff --git a/javasource/excelimporter/actions/GetHeaderInformationFromExcelFile.java b/javasource/excelimporter/actions/GetHeaderInformationFromExcelFile.java deleted file mode 100644 index c9717f3..0000000 --- a/javasource/excelimporter/actions/GetHeaderInformationFromExcelFile.java +++ /dev/null @@ -1,59 +0,0 @@ -// This file was generated by Mendix Modeler. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package excelimporter.actions; - -import com.mendix.systemwideinterfaces.core.IMendixObject; -import excelimporter.reader.ExcelImporter; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Synchronise all excel columns and add/update/remove the existing columns from the template in the parameter. - * The return value is irrelevant and will be always true - */ -public class GetHeaderInformationFromExcelFile extends CustomJavaAction -{ - private IMendixObject __TemplateObject; - private excelimporter.proxies.Template TemplateObject; - private IMendixObject __ExcelFileDocument; - private excelimporter.proxies.TemplateDocument ExcelFileDocument; - - public GetHeaderInformationFromExcelFile(IContext context, IMendixObject TemplateObject, IMendixObject ExcelFileDocument) - { - super(context); - this.__TemplateObject = TemplateObject; - this.__ExcelFileDocument = ExcelFileDocument; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - this.TemplateObject = __TemplateObject == null ? null : excelimporter.proxies.Template.initialize(getContext(), __TemplateObject); - - this.ExcelFileDocument = __ExcelFileDocument == null ? null : excelimporter.proxies.TemplateDocument.initialize(getContext(), __ExcelFileDocument); - - // BEGIN USER CODE - ExcelImporter.getColumns(this.getContext(), this.TemplateObject.getMendixObject(), this.ExcelFileDocument.getMendixObject() ); - return true; - // END USER CODE - } - - /** - * Returns a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "GetHeaderInformationFromExcelFile"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} diff --git a/javasource/excelimporter/actions/RefreshClass.java b/javasource/excelimporter/actions/RefreshClass.java deleted file mode 100644 index 59c72ef..0000000 --- a/javasource/excelimporter/actions/RefreshClass.java +++ /dev/null @@ -1,46 +0,0 @@ -// This file was generated by Mendix Modeler. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package excelimporter.actions; - -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; -import com.mendix.webui.FeedbackHelper; - -public class RefreshClass extends CustomJavaAction -{ - private java.lang.String objectType; - - public RefreshClass(IContext context, java.lang.String objectType) - { - super(context); - this.objectType = objectType; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - // BEGIN USER CODE - FeedbackHelper.addRefreshClass(getContext(), this.objectType); - return true; - // END USER CODE - } - - /** - * Returns a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "RefreshClass"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} diff --git a/javasource/excelimporter/actions/StartImportByTemplate.java b/javasource/excelimporter/actions/StartImportByTemplate.java deleted file mode 100644 index 582b68b..0000000 --- a/javasource/excelimporter/actions/StartImportByTemplate.java +++ /dev/null @@ -1,69 +0,0 @@ -// This file was generated by Mendix Modeler. -// -// WARNING: Only the following code will be retained when actions are regenerated: -// - the import list -// - the code between BEGIN USER CODE and END USER CODE -// - the code between BEGIN EXTRA CODE and END EXTRA CODE -// Other code you write will be lost the next time you deploy the project. -// Special characters, e.g., é, ö, à, etc. are supported in comments. - -package excelimporter.actions; - -import com.mendix.core.CoreException; -import com.mendix.systemwideinterfaces.core.IMendixObject; -import excelimporter.reader.ExcelImporter; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.webui.CustomJavaAction; - -/** - * Start the excel import, The parameter TemplateObject should be a valid parameter, this template is analysed and by this template configuration the filedocument (which should be an excel .xls file) - * - * The last parameter is the ImportObjectParameter, when an 'reference to imported object' is configured this parameter should containt the object to which all objects should refer to.This parameter is optional and can be left empty. - * - * The return value is irrelevant and will be always true - */ -public class StartImportByTemplate extends CustomJavaAction -{ - private IMendixObject __TemplateObject; - private excelimporter.proxies.Template TemplateObject; - private IMendixObject __ImportExcelDoc; - private system.proxies.FileDocument ImportExcelDoc; - private IMendixObject ImportObjectParameter; - - public StartImportByTemplate(IContext context, IMendixObject TemplateObject, IMendixObject ImportExcelDoc, IMendixObject ImportObjectParameter) - { - super(context); - this.__TemplateObject = TemplateObject; - this.__ImportExcelDoc = ImportExcelDoc; - this.ImportObjectParameter = ImportObjectParameter; - } - - @java.lang.Override - public java.lang.Long executeAction() throws Exception - { - this.TemplateObject = __TemplateObject == null ? null : excelimporter.proxies.Template.initialize(getContext(), __TemplateObject); - - this.ImportExcelDoc = __ImportExcelDoc == null ? null : system.proxies.FileDocument.initialize(getContext(), __ImportExcelDoc); - - // BEGIN USER CODE - if( this.TemplateObject == null ) - throw new CoreException( "No template" ); - if( this.ImportExcelDoc == null ) - throw new CoreException( "No excel document" ); - - return ExcelImporter.startImport(this.getContext(), this.TemplateObject.getMendixObject(), this.ImportExcelDoc.getMendixObject(), this.ImportObjectParameter ); - // END USER CODE - } - - /** - * Returns a string representation of this action - */ - @java.lang.Override - public java.lang.String toString() - { - return "StartImportByTemplate"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} diff --git a/javasource/excelimporter/proxies/AdditionalProperties.java b/javasource/excelimporter/proxies/AdditionalProperties.java deleted file mode 100644 index 30a49e6..0000000 --- a/javasource/excelimporter/proxies/AdditionalProperties.java +++ /dev/null @@ -1,501 +0,0 @@ -// This file was generated by Mendix Modeler. -// -// WARNING: Code you write here will be lost the next time you deploy the project. - -package excelimporter.proxies; - -/** - * Besides the basic settings in the Template this entity contains all advanced settings. - * - * This entity can not exist without a template - */ -public class AdditionalProperties -{ - private final com.mendix.systemwideinterfaces.core.IMendixObject additionalPropertiesMendixObject; - - private final com.mendix.systemwideinterfaces.core.IContext context; - - /** - * Internal name of this entity - */ - public static final java.lang.String entityName = "ExcelImporter.AdditionalProperties"; - - /** - * Enum describing members of this entity - */ - public enum MemberNames - { - PrintStatisticsMessages("PrintStatisticsMessages"), - PrintNotFoundMessages_MainObject("PrintNotFoundMessages_MainObject"), - IgnoreEmptyKeys("IgnoreEmptyKeys"), - CommitUnchangedObjects_MainObject("CommitUnchangedObjects_MainObject"), - RemoveUnsyncedObjects("RemoveUnsyncedObjects"), - ResetEmptyAssociations("ResetEmptyAssociations"), - Template_AdditionalProperties("ExcelImporter.Template_AdditionalProperties"), - AdditionalProperties_MxObjectMember_RemoveIndicator("ExcelImporter.AdditionalProperties_MxObjectMember_RemoveIndicator"); - - private java.lang.String metaName; - - MemberNames(java.lang.String s) - { - metaName = s; - } - - @java.lang.Override - public java.lang.String toString() - { - return metaName; - } - } - - public AdditionalProperties(com.mendix.systemwideinterfaces.core.IContext context) - { - this(context, com.mendix.core.Core.instantiate(context, "ExcelImporter.AdditionalProperties")); - } - - protected AdditionalProperties(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixObject additionalPropertiesMendixObject) - { - if (additionalPropertiesMendixObject == null) - throw new java.lang.IllegalArgumentException("The given object cannot be null."); - if (!com.mendix.core.Core.isSubClassOf("ExcelImporter.AdditionalProperties", additionalPropertiesMendixObject.getType())) - throw new java.lang.IllegalArgumentException("The given object is not a ExcelImporter.AdditionalProperties"); - - this.additionalPropertiesMendixObject = additionalPropertiesMendixObject; - this.context = context; - } - - /** - * @deprecated Use 'AdditionalProperties.load(IContext, IMendixIdentifier)' instead. - */ - @java.lang.Deprecated - public static excelimporter.proxies.AdditionalProperties initialize(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixIdentifier mendixIdentifier) throws com.mendix.core.CoreException - { - return excelimporter.proxies.AdditionalProperties.load(context, mendixIdentifier); - } - - /** - * Initialize a proxy using context (recommended). This context will be used for security checking when the get- and set-methods without context parameters are called. - * The get- and set-methods with context parameter should be used when for instance sudo access is necessary (IContext.createSudoClone() can be used to obtain sudo access). - */ - public static excelimporter.proxies.AdditionalProperties initialize(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixObject mendixObject) - { - return new excelimporter.proxies.AdditionalProperties(context, mendixObject); - } - - public static excelimporter.proxies.AdditionalProperties load(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixIdentifier mendixIdentifier) throws com.mendix.core.CoreException - { - com.mendix.systemwideinterfaces.core.IMendixObject mendixObject = com.mendix.core.Core.retrieveId(context, mendixIdentifier); - return excelimporter.proxies.AdditionalProperties.initialize(context, mendixObject); - } - - public static java.util.List load(com.mendix.systemwideinterfaces.core.IContext context, java.lang.String xpathConstraint) throws com.mendix.core.CoreException - { - java.util.List result = new java.util.ArrayList(); - for (com.mendix.systemwideinterfaces.core.IMendixObject obj : com.mendix.core.Core.retrieveXPathQuery(context, "//ExcelImporter.AdditionalProperties" + xpathConstraint)) - result.add(excelimporter.proxies.AdditionalProperties.initialize(context, obj)); - return result; - } - - /** - * Commit the changes made on this proxy object. - */ - public final void commit() throws com.mendix.core.CoreException - { - com.mendix.core.Core.commit(context, getMendixObject()); - } - - /** - * Commit the changes made on this proxy object using the specified context. - */ - public final void commit(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException - { - com.mendix.core.Core.commit(context, getMendixObject()); - } - - /** - * Delete the object. - */ - public final void delete() - { - com.mendix.core.Core.delete(context, getMendixObject()); - } - - /** - * Delete the object using the specified context. - */ - public final void delete(com.mendix.systemwideinterfaces.core.IContext context) - { - com.mendix.core.Core.delete(context, getMendixObject()); - } - /** - * Set value of PrintStatisticsMessages - * @param printstatisticsmessages - */ - public final excelimporter.proxies.StatisticsLevel getPrintStatisticsMessages() - { - return getPrintStatisticsMessages(getContext()); - } - - /** - * @param context - * @return value of PrintStatisticsMessages - */ - public final excelimporter.proxies.StatisticsLevel getPrintStatisticsMessages(com.mendix.systemwideinterfaces.core.IContext context) - { - Object obj = getMendixObject().getValue(context, MemberNames.PrintStatisticsMessages.toString()); - if (obj == null) - return null; - - return excelimporter.proxies.StatisticsLevel.valueOf((java.lang.String) obj); - } - - /** - * Set value of PrintStatisticsMessages - * @param printstatisticsmessages - */ - public final void setPrintStatisticsMessages(excelimporter.proxies.StatisticsLevel printstatisticsmessages) - { - setPrintStatisticsMessages(getContext(), printstatisticsmessages); - } - - /** - * Set value of PrintStatisticsMessages - * @param context - * @param printstatisticsmessages - */ - public final void setPrintStatisticsMessages(com.mendix.systemwideinterfaces.core.IContext context, excelimporter.proxies.StatisticsLevel printstatisticsmessages) - { - if (printstatisticsmessages != null) - getMendixObject().setValue(context, MemberNames.PrintStatisticsMessages.toString(), printstatisticsmessages.toString()); - else - getMendixObject().setValue(context, MemberNames.PrintStatisticsMessages.toString(), null); - } - - /** - * @return value of PrintNotFoundMessages_MainObject - */ - public final java.lang.Boolean getPrintNotFoundMessages_MainObject() - { - return getPrintNotFoundMessages_MainObject(getContext()); - } - - /** - * @param context - * @return value of PrintNotFoundMessages_MainObject - */ - public final java.lang.Boolean getPrintNotFoundMessages_MainObject(com.mendix.systemwideinterfaces.core.IContext context) - { - return (java.lang.Boolean) getMendixObject().getValue(context, MemberNames.PrintNotFoundMessages_MainObject.toString()); - } - - /** - * Set value of PrintNotFoundMessages_MainObject - * @param printnotfoundmessages_mainobject - */ - public final void setPrintNotFoundMessages_MainObject(java.lang.Boolean printnotfoundmessages_mainobject) - { - setPrintNotFoundMessages_MainObject(getContext(), printnotfoundmessages_mainobject); - } - - /** - * Set value of PrintNotFoundMessages_MainObject - * @param context - * @param printnotfoundmessages_mainobject - */ - public final void setPrintNotFoundMessages_MainObject(com.mendix.systemwideinterfaces.core.IContext context, java.lang.Boolean printnotfoundmessages_mainobject) - { - getMendixObject().setValue(context, MemberNames.PrintNotFoundMessages_MainObject.toString(), printnotfoundmessages_mainobject); - } - - /** - * @return value of IgnoreEmptyKeys - */ - public final java.lang.Boolean getIgnoreEmptyKeys() - { - return getIgnoreEmptyKeys(getContext()); - } - - /** - * @param context - * @return value of IgnoreEmptyKeys - */ - public final java.lang.Boolean getIgnoreEmptyKeys(com.mendix.systemwideinterfaces.core.IContext context) - { - return (java.lang.Boolean) getMendixObject().getValue(context, MemberNames.IgnoreEmptyKeys.toString()); - } - - /** - * Set value of IgnoreEmptyKeys - * @param ignoreemptykeys - */ - public final void setIgnoreEmptyKeys(java.lang.Boolean ignoreemptykeys) - { - setIgnoreEmptyKeys(getContext(), ignoreemptykeys); - } - - /** - * Set value of IgnoreEmptyKeys - * @param context - * @param ignoreemptykeys - */ - public final void setIgnoreEmptyKeys(com.mendix.systemwideinterfaces.core.IContext context, java.lang.Boolean ignoreemptykeys) - { - getMendixObject().setValue(context, MemberNames.IgnoreEmptyKeys.toString(), ignoreemptykeys); - } - - /** - * @return value of CommitUnchangedObjects_MainObject - */ - public final java.lang.Boolean getCommitUnchangedObjects_MainObject() - { - return getCommitUnchangedObjects_MainObject(getContext()); - } - - /** - * @param context - * @return value of CommitUnchangedObjects_MainObject - */ - public final java.lang.Boolean getCommitUnchangedObjects_MainObject(com.mendix.systemwideinterfaces.core.IContext context) - { - return (java.lang.Boolean) getMendixObject().getValue(context, MemberNames.CommitUnchangedObjects_MainObject.toString()); - } - - /** - * Set value of CommitUnchangedObjects_MainObject - * @param commitunchangedobjects_mainobject - */ - public final void setCommitUnchangedObjects_MainObject(java.lang.Boolean commitunchangedobjects_mainobject) - { - setCommitUnchangedObjects_MainObject(getContext(), commitunchangedobjects_mainobject); - } - - /** - * Set value of CommitUnchangedObjects_MainObject - * @param context - * @param commitunchangedobjects_mainobject - */ - public final void setCommitUnchangedObjects_MainObject(com.mendix.systemwideinterfaces.core.IContext context, java.lang.Boolean commitunchangedobjects_mainobject) - { - getMendixObject().setValue(context, MemberNames.CommitUnchangedObjects_MainObject.toString(), commitunchangedobjects_mainobject); - } - - /** - * Set value of RemoveUnsyncedObjects - * @param removeunsyncedobjects - */ - public final excelimporter.proxies.RemoveIndicator getRemoveUnsyncedObjects() - { - return getRemoveUnsyncedObjects(getContext()); - } - - /** - * @param context - * @return value of RemoveUnsyncedObjects - */ - public final excelimporter.proxies.RemoveIndicator getRemoveUnsyncedObjects(com.mendix.systemwideinterfaces.core.IContext context) - { - Object obj = getMendixObject().getValue(context, MemberNames.RemoveUnsyncedObjects.toString()); - if (obj == null) - return null; - - return excelimporter.proxies.RemoveIndicator.valueOf((java.lang.String) obj); - } - - /** - * Set value of RemoveUnsyncedObjects - * @param removeunsyncedobjects - */ - public final void setRemoveUnsyncedObjects(excelimporter.proxies.RemoveIndicator removeunsyncedobjects) - { - setRemoveUnsyncedObjects(getContext(), removeunsyncedobjects); - } - - /** - * Set value of RemoveUnsyncedObjects - * @param context - * @param removeunsyncedobjects - */ - public final void setRemoveUnsyncedObjects(com.mendix.systemwideinterfaces.core.IContext context, excelimporter.proxies.RemoveIndicator removeunsyncedobjects) - { - if (removeunsyncedobjects != null) - getMendixObject().setValue(context, MemberNames.RemoveUnsyncedObjects.toString(), removeunsyncedobjects.toString()); - else - getMendixObject().setValue(context, MemberNames.RemoveUnsyncedObjects.toString(), null); - } - - /** - * @return value of ResetEmptyAssociations - */ - public final java.lang.Boolean getResetEmptyAssociations() - { - return getResetEmptyAssociations(getContext()); - } - - /** - * @param context - * @return value of ResetEmptyAssociations - */ - public final java.lang.Boolean getResetEmptyAssociations(com.mendix.systemwideinterfaces.core.IContext context) - { - return (java.lang.Boolean) getMendixObject().getValue(context, MemberNames.ResetEmptyAssociations.toString()); - } - - /** - * Set value of ResetEmptyAssociations - * @param resetemptyassociations - */ - public final void setResetEmptyAssociations(java.lang.Boolean resetemptyassociations) - { - setResetEmptyAssociations(getContext(), resetemptyassociations); - } - - /** - * Set value of ResetEmptyAssociations - * @param context - * @param resetemptyassociations - */ - public final void setResetEmptyAssociations(com.mendix.systemwideinterfaces.core.IContext context, java.lang.Boolean resetemptyassociations) - { - getMendixObject().setValue(context, MemberNames.ResetEmptyAssociations.toString(), resetemptyassociations); - } - - /** - * @return value of Template_AdditionalProperties - */ - public final excelimporter.proxies.Template getTemplate_AdditionalProperties() throws com.mendix.core.CoreException - { - return getTemplate_AdditionalProperties(getContext()); - } - - /** - * @param context - * @return value of Template_AdditionalProperties - */ - public final excelimporter.proxies.Template getTemplate_AdditionalProperties(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException - { - excelimporter.proxies.Template result = null; - com.mendix.systemwideinterfaces.core.IMendixIdentifier identifier = getMendixObject().getValue(context, MemberNames.Template_AdditionalProperties.toString()); - if (identifier != null) - result = excelimporter.proxies.Template.load(context, identifier); - return result; - } - - /** - * Set value of Template_AdditionalProperties - * @param template_additionalproperties - */ - public final void setTemplate_AdditionalProperties(excelimporter.proxies.Template template_additionalproperties) - { - setTemplate_AdditionalProperties(getContext(), template_additionalproperties); - } - - /** - * Set value of Template_AdditionalProperties - * @param context - * @param template_additionalproperties - */ - public final void setTemplate_AdditionalProperties(com.mendix.systemwideinterfaces.core.IContext context, excelimporter.proxies.Template template_additionalproperties) - { - if (template_additionalproperties == null) - getMendixObject().setValue(context, MemberNames.Template_AdditionalProperties.toString(), null); - else - getMendixObject().setValue(context, MemberNames.Template_AdditionalProperties.toString(), template_additionalproperties.getMendixObject().getId()); - } - - /** - * @return value of AdditionalProperties_MxObjectMember_RemoveIndicator - */ - public final mxmodelreflection.proxies.MxObjectMember getAdditionalProperties_MxObjectMember_RemoveIndicator() throws com.mendix.core.CoreException - { - return getAdditionalProperties_MxObjectMember_RemoveIndicator(getContext()); - } - - /** - * @param context - * @return value of AdditionalProperties_MxObjectMember_RemoveIndicator - */ - public final mxmodelreflection.proxies.MxObjectMember getAdditionalProperties_MxObjectMember_RemoveIndicator(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException - { - mxmodelreflection.proxies.MxObjectMember result = null; - com.mendix.systemwideinterfaces.core.IMendixIdentifier identifier = getMendixObject().getValue(context, MemberNames.AdditionalProperties_MxObjectMember_RemoveIndicator.toString()); - if (identifier != null) - result = mxmodelreflection.proxies.MxObjectMember.load(context, identifier); - return result; - } - - /** - * Set value of AdditionalProperties_MxObjectMember_RemoveIndicator - * @param additionalproperties_mxobjectmember_removeindicator - */ - public final void setAdditionalProperties_MxObjectMember_RemoveIndicator(mxmodelreflection.proxies.MxObjectMember additionalproperties_mxobjectmember_removeindicator) - { - setAdditionalProperties_MxObjectMember_RemoveIndicator(getContext(), additionalproperties_mxobjectmember_removeindicator); - } - - /** - * Set value of AdditionalProperties_MxObjectMember_RemoveIndicator - * @param context - * @param additionalproperties_mxobjectmember_removeindicator - */ - public final void setAdditionalProperties_MxObjectMember_RemoveIndicator(com.mendix.systemwideinterfaces.core.IContext context, mxmodelreflection.proxies.MxObjectMember additionalproperties_mxobjectmember_removeindicator) - { - if (additionalproperties_mxobjectmember_removeindicator == null) - getMendixObject().setValue(context, MemberNames.AdditionalProperties_MxObjectMember_RemoveIndicator.toString(), null); - else - getMendixObject().setValue(context, MemberNames.AdditionalProperties_MxObjectMember_RemoveIndicator.toString(), additionalproperties_mxobjectmember_removeindicator.getMendixObject().getId()); - } - - /** - * @return the IMendixObject instance of this proxy for use in the Core interface. - */ - public final com.mendix.systemwideinterfaces.core.IMendixObject getMendixObject() - { - return additionalPropertiesMendixObject; - } - - /** - * @return the IContext instance of this proxy, or null if no IContext instance was specified at initialization. - */ - public final com.mendix.systemwideinterfaces.core.IContext getContext() - { - return context; - } - - @java.lang.Override - public boolean equals(Object obj) - { - if (obj == this) - return true; - - if (obj != null && getClass().equals(obj.getClass())) - { - final excelimporter.proxies.AdditionalProperties that = (excelimporter.proxies.AdditionalProperties) obj; - return getMendixObject().equals(that.getMendixObject()); - } - return false; - } - - @java.lang.Override - public int hashCode() - { - return getMendixObject().hashCode(); - } - - /** - * @return String name of this class - */ - public static java.lang.String getType() - { - return "ExcelImporter.AdditionalProperties"; - } - - /** - * @return String GUID from this object, format: ID_0000000000 - * @deprecated Use getMendixObject().getId().toLong() to get a unique identifier for this object. - */ - @java.lang.Deprecated - public java.lang.String getGUID() - { - return "ID_" + getMendixObject().getId().toLong(); - } -} diff --git a/javasource/excelimporter/proxies/Column.java b/javasource/excelimporter/proxies/Column.java deleted file mode 100644 index 87a5e09..0000000 --- a/javasource/excelimporter/proxies/Column.java +++ /dev/null @@ -1,1180 +0,0 @@ -// This file was generated by Mendix Modeler. -// -// WARNING: Code you write here will be lost the next time you deploy the project. - -package excelimporter.proxies; - -/** - * The Column contains the specific mapping for each usefull column. All the mapping and all settings for each column will be configured here. - */ -public class Column -{ - private final com.mendix.systemwideinterfaces.core.IMendixObject columnMendixObject; - - private final com.mendix.systemwideinterfaces.core.IContext context; - - /** - * Internal name of this entity - */ - public static final java.lang.String entityName = "ExcelImporter.Column"; - - /** - * Enum describing members of this entity - */ - public enum MemberNames - { - ColNumber("ColNumber"), - Text("Text"), - MappingType("MappingType"), - IsKey("IsKey"), - IsReferenceKey("IsReferenceKey"), - Status("Status"), - Details("Details"), - CaseSensitive("CaseSensitive"), - FindAttribute("FindAttribute"), - FindReference("FindReference"), - FindObjectType("FindObjectType"), - FindMicroflow("FindMicroflow"), - DataSource("DataSource"), - AttributeTypeEnum("AttributeTypeEnum"), - InputMask("InputMask"), - Column_Template("ExcelImporter.Column_Template"), - Column_MasterColumn("ExcelImporter.Column_MasterColumn"), - Column_MxObjectType_Reference("ExcelImporter.Column_MxObjectType_Reference"), - Column_MxObjectType("ExcelImporter.Column_MxObjectType"), - Column_MxObjectMember("ExcelImporter.Column_MxObjectMember"), - Column_MxObjectMember_Reference("ExcelImporter.Column_MxObjectMember_Reference"), - Column_MxObjectReference("ExcelImporter.Column_MxObjectReference"), - Column_Microflows("ExcelImporter.Column_Microflows"), - Column_ValueType("ExcelImporter.Column_ValueType"); - - private java.lang.String metaName; - - MemberNames(java.lang.String s) - { - metaName = s; - } - - @java.lang.Override - public java.lang.String toString() - { - return metaName; - } - } - - public Column(com.mendix.systemwideinterfaces.core.IContext context) - { - this(context, com.mendix.core.Core.instantiate(context, "ExcelImporter.Column")); - } - - protected Column(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixObject columnMendixObject) - { - if (columnMendixObject == null) - throw new java.lang.IllegalArgumentException("The given object cannot be null."); - if (!com.mendix.core.Core.isSubClassOf("ExcelImporter.Column", columnMendixObject.getType())) - throw new java.lang.IllegalArgumentException("The given object is not a ExcelImporter.Column"); - - this.columnMendixObject = columnMendixObject; - this.context = context; - } - - /** - * @deprecated Use 'Column.load(IContext, IMendixIdentifier)' instead. - */ - @java.lang.Deprecated - public static excelimporter.proxies.Column initialize(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixIdentifier mendixIdentifier) throws com.mendix.core.CoreException - { - return excelimporter.proxies.Column.load(context, mendixIdentifier); - } - - /** - * Initialize a proxy using context (recommended). This context will be used for security checking when the get- and set-methods without context parameters are called. - * The get- and set-methods with context parameter should be used when for instance sudo access is necessary (IContext.createSudoClone() can be used to obtain sudo access). - */ - public static excelimporter.proxies.Column initialize(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixObject mendixObject) - { - return new excelimporter.proxies.Column(context, mendixObject); - } - - public static excelimporter.proxies.Column load(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixIdentifier mendixIdentifier) throws com.mendix.core.CoreException - { - com.mendix.systemwideinterfaces.core.IMendixObject mendixObject = com.mendix.core.Core.retrieveId(context, mendixIdentifier); - return excelimporter.proxies.Column.initialize(context, mendixObject); - } - - public static java.util.List load(com.mendix.systemwideinterfaces.core.IContext context, java.lang.String xpathConstraint) throws com.mendix.core.CoreException - { - java.util.List result = new java.util.ArrayList(); - for (com.mendix.systemwideinterfaces.core.IMendixObject obj : com.mendix.core.Core.retrieveXPathQuery(context, "//ExcelImporter.Column" + xpathConstraint)) - result.add(excelimporter.proxies.Column.initialize(context, obj)); - return result; - } - - /** - * Commit the changes made on this proxy object. - */ - public final void commit() throws com.mendix.core.CoreException - { - com.mendix.core.Core.commit(context, getMendixObject()); - } - - /** - * Commit the changes made on this proxy object using the specified context. - */ - public final void commit(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException - { - com.mendix.core.Core.commit(context, getMendixObject()); - } - - /** - * Delete the object. - */ - public final void delete() - { - com.mendix.core.Core.delete(context, getMendixObject()); - } - - /** - * Delete the object using the specified context. - */ - public final void delete(com.mendix.systemwideinterfaces.core.IContext context) - { - com.mendix.core.Core.delete(context, getMendixObject()); - } - /** - * @return value of ColNumber - */ - public final java.lang.Integer getColNumber() - { - return getColNumber(getContext()); - } - - /** - * @param context - * @return value of ColNumber - */ - public final java.lang.Integer getColNumber(com.mendix.systemwideinterfaces.core.IContext context) - { - return (java.lang.Integer) getMendixObject().getValue(context, MemberNames.ColNumber.toString()); - } - - /** - * Set value of ColNumber - * @param colnumber - */ - public final void setColNumber(java.lang.Integer colnumber) - { - setColNumber(getContext(), colnumber); - } - - /** - * Set value of ColNumber - * @param context - * @param colnumber - */ - public final void setColNumber(com.mendix.systemwideinterfaces.core.IContext context, java.lang.Integer colnumber) - { - getMendixObject().setValue(context, MemberNames.ColNumber.toString(), colnumber); - } - - /** - * @return value of Text - */ - public final java.lang.String getText() - { - return getText(getContext()); - } - - /** - * @param context - * @return value of Text - */ - public final java.lang.String getText(com.mendix.systemwideinterfaces.core.IContext context) - { - return (java.lang.String) getMendixObject().getValue(context, MemberNames.Text.toString()); - } - - /** - * Set value of Text - * @param text - */ - public final void setText(java.lang.String text) - { - setText(getContext(), text); - } - - /** - * Set value of Text - * @param context - * @param text - */ - public final void setText(com.mendix.systemwideinterfaces.core.IContext context, java.lang.String text) - { - getMendixObject().setValue(context, MemberNames.Text.toString(), text); - } - - /** - * Set value of MappingType - * @param mappingtype - */ - public final excelimporter.proxies.MappingType getMappingType() - { - return getMappingType(getContext()); - } - - /** - * @param context - * @return value of MappingType - */ - public final excelimporter.proxies.MappingType getMappingType(com.mendix.systemwideinterfaces.core.IContext context) - { - Object obj = getMendixObject().getValue(context, MemberNames.MappingType.toString()); - if (obj == null) - return null; - - return excelimporter.proxies.MappingType.valueOf((java.lang.String) obj); - } - - /** - * Set value of MappingType - * @param mappingtype - */ - public final void setMappingType(excelimporter.proxies.MappingType mappingtype) - { - setMappingType(getContext(), mappingtype); - } - - /** - * Set value of MappingType - * @param context - * @param mappingtype - */ - public final void setMappingType(com.mendix.systemwideinterfaces.core.IContext context, excelimporter.proxies.MappingType mappingtype) - { - if (mappingtype != null) - getMendixObject().setValue(context, MemberNames.MappingType.toString(), mappingtype.toString()); - else - getMendixObject().setValue(context, MemberNames.MappingType.toString(), null); - } - - /** - * Set value of IsKey - * @param iskey - */ - public final excelimporter.proxies.YesNo getIsKey() - { - return getIsKey(getContext()); - } - - /** - * @param context - * @return value of IsKey - */ - public final excelimporter.proxies.YesNo getIsKey(com.mendix.systemwideinterfaces.core.IContext context) - { - Object obj = getMendixObject().getValue(context, MemberNames.IsKey.toString()); - if (obj == null) - return null; - - return excelimporter.proxies.YesNo.valueOf((java.lang.String) obj); - } - - /** - * Set value of IsKey - * @param iskey - */ - public final void setIsKey(excelimporter.proxies.YesNo iskey) - { - setIsKey(getContext(), iskey); - } - - /** - * Set value of IsKey - * @param context - * @param iskey - */ - public final void setIsKey(com.mendix.systemwideinterfaces.core.IContext context, excelimporter.proxies.YesNo iskey) - { - if (iskey != null) - getMendixObject().setValue(context, MemberNames.IsKey.toString(), iskey.toString()); - else - getMendixObject().setValue(context, MemberNames.IsKey.toString(), null); - } - - /** - * Set value of IsReferenceKey - * @param isreferencekey - */ - public final excelimporter.proxies.ReferenceKeyType getIsReferenceKey() - { - return getIsReferenceKey(getContext()); - } - - /** - * @param context - * @return value of IsReferenceKey - */ - public final excelimporter.proxies.ReferenceKeyType getIsReferenceKey(com.mendix.systemwideinterfaces.core.IContext context) - { - Object obj = getMendixObject().getValue(context, MemberNames.IsReferenceKey.toString()); - if (obj == null) - return null; - - return excelimporter.proxies.ReferenceKeyType.valueOf((java.lang.String) obj); - } - - /** - * Set value of IsReferenceKey - * @param isreferencekey - */ - public final void setIsReferenceKey(excelimporter.proxies.ReferenceKeyType isreferencekey) - { - setIsReferenceKey(getContext(), isreferencekey); - } - - /** - * Set value of IsReferenceKey - * @param context - * @param isreferencekey - */ - public final void setIsReferenceKey(com.mendix.systemwideinterfaces.core.IContext context, excelimporter.proxies.ReferenceKeyType isreferencekey) - { - if (isreferencekey != null) - getMendixObject().setValue(context, MemberNames.IsReferenceKey.toString(), isreferencekey.toString()); - else - getMendixObject().setValue(context, MemberNames.IsReferenceKey.toString(), null); - } - - /** - * Set value of Status - * @param status - */ - public final excelimporter.proxies.Status getStatus() - { - return getStatus(getContext()); - } - - /** - * @param context - * @return value of Status - */ - public final excelimporter.proxies.Status getStatus(com.mendix.systemwideinterfaces.core.IContext context) - { - Object obj = getMendixObject().getValue(context, MemberNames.Status.toString()); - if (obj == null) - return null; - - return excelimporter.proxies.Status.valueOf((java.lang.String) obj); - } - - /** - * Set value of Status - * @param status - */ - public final void setStatus(excelimporter.proxies.Status status) - { - setStatus(getContext(), status); - } - - /** - * Set value of Status - * @param context - * @param status - */ - public final void setStatus(com.mendix.systemwideinterfaces.core.IContext context, excelimporter.proxies.Status status) - { - if (status != null) - getMendixObject().setValue(context, MemberNames.Status.toString(), status.toString()); - else - getMendixObject().setValue(context, MemberNames.Status.toString(), null); - } - - /** - * @return value of Details - */ - public final java.lang.String getDetails() - { - return getDetails(getContext()); - } - - /** - * @param context - * @return value of Details - */ - public final java.lang.String getDetails(com.mendix.systemwideinterfaces.core.IContext context) - { - return (java.lang.String) getMendixObject().getValue(context, MemberNames.Details.toString()); - } - - /** - * Set value of Details - * @param details - */ - public final void setDetails(java.lang.String details) - { - setDetails(getContext(), details); - } - - /** - * Set value of Details - * @param context - * @param details - */ - public final void setDetails(com.mendix.systemwideinterfaces.core.IContext context, java.lang.String details) - { - getMendixObject().setValue(context, MemberNames.Details.toString(), details); - } - - /** - * Set value of CaseSensitive - * @param casesensitive - */ - public final excelimporter.proxies.YesNo getCaseSensitive() - { - return getCaseSensitive(getContext()); - } - - /** - * @param context - * @return value of CaseSensitive - */ - public final excelimporter.proxies.YesNo getCaseSensitive(com.mendix.systemwideinterfaces.core.IContext context) - { - Object obj = getMendixObject().getValue(context, MemberNames.CaseSensitive.toString()); - if (obj == null) - return null; - - return excelimporter.proxies.YesNo.valueOf((java.lang.String) obj); - } - - /** - * Set value of CaseSensitive - * @param casesensitive - */ - public final void setCaseSensitive(excelimporter.proxies.YesNo casesensitive) - { - setCaseSensitive(getContext(), casesensitive); - } - - /** - * Set value of CaseSensitive - * @param context - * @param casesensitive - */ - public final void setCaseSensitive(com.mendix.systemwideinterfaces.core.IContext context, excelimporter.proxies.YesNo casesensitive) - { - if (casesensitive != null) - getMendixObject().setValue(context, MemberNames.CaseSensitive.toString(), casesensitive.toString()); - else - getMendixObject().setValue(context, MemberNames.CaseSensitive.toString(), null); - } - - /** - * @return value of FindAttribute - */ - public final java.lang.String getFindAttribute() - { - return getFindAttribute(getContext()); - } - - /** - * @param context - * @return value of FindAttribute - */ - public final java.lang.String getFindAttribute(com.mendix.systemwideinterfaces.core.IContext context) - { - return (java.lang.String) getMendixObject().getValue(context, MemberNames.FindAttribute.toString()); - } - - /** - * Set value of FindAttribute - * @param findattribute - */ - public final void setFindAttribute(java.lang.String findattribute) - { - setFindAttribute(getContext(), findattribute); - } - - /** - * Set value of FindAttribute - * @param context - * @param findattribute - */ - public final void setFindAttribute(com.mendix.systemwideinterfaces.core.IContext context, java.lang.String findattribute) - { - getMendixObject().setValue(context, MemberNames.FindAttribute.toString(), findattribute); - } - - /** - * @return value of FindReference - */ - public final java.lang.String getFindReference() - { - return getFindReference(getContext()); - } - - /** - * @param context - * @return value of FindReference - */ - public final java.lang.String getFindReference(com.mendix.systemwideinterfaces.core.IContext context) - { - return (java.lang.String) getMendixObject().getValue(context, MemberNames.FindReference.toString()); - } - - /** - * Set value of FindReference - * @param findreference - */ - public final void setFindReference(java.lang.String findreference) - { - setFindReference(getContext(), findreference); - } - - /** - * Set value of FindReference - * @param context - * @param findreference - */ - public final void setFindReference(com.mendix.systemwideinterfaces.core.IContext context, java.lang.String findreference) - { - getMendixObject().setValue(context, MemberNames.FindReference.toString(), findreference); - } - - /** - * @return value of FindObjectType - */ - public final java.lang.String getFindObjectType() - { - return getFindObjectType(getContext()); - } - - /** - * @param context - * @return value of FindObjectType - */ - public final java.lang.String getFindObjectType(com.mendix.systemwideinterfaces.core.IContext context) - { - return (java.lang.String) getMendixObject().getValue(context, MemberNames.FindObjectType.toString()); - } - - /** - * Set value of FindObjectType - * @param findobjecttype - */ - public final void setFindObjectType(java.lang.String findobjecttype) - { - setFindObjectType(getContext(), findobjecttype); - } - - /** - * Set value of FindObjectType - * @param context - * @param findobjecttype - */ - public final void setFindObjectType(com.mendix.systemwideinterfaces.core.IContext context, java.lang.String findobjecttype) - { - getMendixObject().setValue(context, MemberNames.FindObjectType.toString(), findobjecttype); - } - - /** - * @return value of FindMicroflow - */ - public final java.lang.String getFindMicroflow() - { - return getFindMicroflow(getContext()); - } - - /** - * @param context - * @return value of FindMicroflow - */ - public final java.lang.String getFindMicroflow(com.mendix.systemwideinterfaces.core.IContext context) - { - return (java.lang.String) getMendixObject().getValue(context, MemberNames.FindMicroflow.toString()); - } - - /** - * Set value of FindMicroflow - * @param findmicroflow - */ - public final void setFindMicroflow(java.lang.String findmicroflow) - { - setFindMicroflow(getContext(), findmicroflow); - } - - /** - * Set value of FindMicroflow - * @param context - * @param findmicroflow - */ - public final void setFindMicroflow(com.mendix.systemwideinterfaces.core.IContext context, java.lang.String findmicroflow) - { - getMendixObject().setValue(context, MemberNames.FindMicroflow.toString(), findmicroflow); - } - - /** - * Set value of DataSource - * @param datasource - */ - public final excelimporter.proxies.DataSource getDataSource() - { - return getDataSource(getContext()); - } - - /** - * @param context - * @return value of DataSource - */ - public final excelimporter.proxies.DataSource getDataSource(com.mendix.systemwideinterfaces.core.IContext context) - { - Object obj = getMendixObject().getValue(context, MemberNames.DataSource.toString()); - if (obj == null) - return null; - - return excelimporter.proxies.DataSource.valueOf((java.lang.String) obj); - } - - /** - * Set value of DataSource - * @param datasource - */ - public final void setDataSource(excelimporter.proxies.DataSource datasource) - { - setDataSource(getContext(), datasource); - } - - /** - * Set value of DataSource - * @param context - * @param datasource - */ - public final void setDataSource(com.mendix.systemwideinterfaces.core.IContext context, excelimporter.proxies.DataSource datasource) - { - if (datasource != null) - getMendixObject().setValue(context, MemberNames.DataSource.toString(), datasource.toString()); - else - getMendixObject().setValue(context, MemberNames.DataSource.toString(), null); - } - - /** - * Set value of AttributeTypeEnum - * @param attributetypeenum - */ - public final mxmodelreflection.proxies.PrimitiveTypes getAttributeTypeEnum() - { - return getAttributeTypeEnum(getContext()); - } - - /** - * @param context - * @return value of AttributeTypeEnum - */ - public final mxmodelreflection.proxies.PrimitiveTypes getAttributeTypeEnum(com.mendix.systemwideinterfaces.core.IContext context) - { - Object obj = getMendixObject().getValue(context, MemberNames.AttributeTypeEnum.toString()); - if (obj == null) - return null; - - return mxmodelreflection.proxies.PrimitiveTypes.valueOf((java.lang.String) obj); - } - - /** - * Set value of AttributeTypeEnum - * @param attributetypeenum - */ - public final void setAttributeTypeEnum(mxmodelreflection.proxies.PrimitiveTypes attributetypeenum) - { - setAttributeTypeEnum(getContext(), attributetypeenum); - } - - /** - * Set value of AttributeTypeEnum - * @param context - * @param attributetypeenum - */ - public final void setAttributeTypeEnum(com.mendix.systemwideinterfaces.core.IContext context, mxmodelreflection.proxies.PrimitiveTypes attributetypeenum) - { - if (attributetypeenum != null) - getMendixObject().setValue(context, MemberNames.AttributeTypeEnum.toString(), attributetypeenum.toString()); - else - getMendixObject().setValue(context, MemberNames.AttributeTypeEnum.toString(), null); - } - - /** - * @return value of InputMask - */ - public final java.lang.String getInputMask() - { - return getInputMask(getContext()); - } - - /** - * @param context - * @return value of InputMask - */ - public final java.lang.String getInputMask(com.mendix.systemwideinterfaces.core.IContext context) - { - return (java.lang.String) getMendixObject().getValue(context, MemberNames.InputMask.toString()); - } - - /** - * Set value of InputMask - * @param inputmask - */ - public final void setInputMask(java.lang.String inputmask) - { - setInputMask(getContext(), inputmask); - } - - /** - * Set value of InputMask - * @param context - * @param inputmask - */ - public final void setInputMask(com.mendix.systemwideinterfaces.core.IContext context, java.lang.String inputmask) - { - getMendixObject().setValue(context, MemberNames.InputMask.toString(), inputmask); - } - - /** - * @return value of Column_Template - */ - public final excelimporter.proxies.Template getColumn_Template() throws com.mendix.core.CoreException - { - return getColumn_Template(getContext()); - } - - /** - * @param context - * @return value of Column_Template - */ - public final excelimporter.proxies.Template getColumn_Template(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException - { - excelimporter.proxies.Template result = null; - com.mendix.systemwideinterfaces.core.IMendixIdentifier identifier = getMendixObject().getValue(context, MemberNames.Column_Template.toString()); - if (identifier != null) - result = excelimporter.proxies.Template.load(context, identifier); - return result; - } - - /** - * Set value of Column_Template - * @param column_template - */ - public final void setColumn_Template(excelimporter.proxies.Template column_template) - { - setColumn_Template(getContext(), column_template); - } - - /** - * Set value of Column_Template - * @param context - * @param column_template - */ - public final void setColumn_Template(com.mendix.systemwideinterfaces.core.IContext context, excelimporter.proxies.Template column_template) - { - if (column_template == null) - getMendixObject().setValue(context, MemberNames.Column_Template.toString(), null); - else - getMendixObject().setValue(context, MemberNames.Column_Template.toString(), column_template.getMendixObject().getId()); - } - - /** - * @return value of Column_MasterColumn - */ - public final excelimporter.proxies.Column getColumn_MasterColumn() throws com.mendix.core.CoreException - { - return getColumn_MasterColumn(getContext()); - } - - /** - * @param context - * @return value of Column_MasterColumn - */ - public final excelimporter.proxies.Column getColumn_MasterColumn(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException - { - excelimporter.proxies.Column result = null; - com.mendix.systemwideinterfaces.core.IMendixIdentifier identifier = getMendixObject().getValue(context, MemberNames.Column_MasterColumn.toString()); - if (identifier != null) - result = excelimporter.proxies.Column.load(context, identifier); - return result; - } - - /** - * Set value of Column_MasterColumn - * @param column_mastercolumn - */ - public final void setColumn_MasterColumn(excelimporter.proxies.Column column_mastercolumn) - { - setColumn_MasterColumn(getContext(), column_mastercolumn); - } - - /** - * Set value of Column_MasterColumn - * @param context - * @param column_mastercolumn - */ - public final void setColumn_MasterColumn(com.mendix.systemwideinterfaces.core.IContext context, excelimporter.proxies.Column column_mastercolumn) - { - if (column_mastercolumn == null) - getMendixObject().setValue(context, MemberNames.Column_MasterColumn.toString(), null); - else - getMendixObject().setValue(context, MemberNames.Column_MasterColumn.toString(), column_mastercolumn.getMendixObject().getId()); - } - - /** - * @return value of Column_MxObjectType_Reference - */ - public final mxmodelreflection.proxies.MxObjectType getColumn_MxObjectType_Reference() throws com.mendix.core.CoreException - { - return getColumn_MxObjectType_Reference(getContext()); - } - - /** - * @param context - * @return value of Column_MxObjectType_Reference - */ - public final mxmodelreflection.proxies.MxObjectType getColumn_MxObjectType_Reference(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException - { - mxmodelreflection.proxies.MxObjectType result = null; - com.mendix.systemwideinterfaces.core.IMendixIdentifier identifier = getMendixObject().getValue(context, MemberNames.Column_MxObjectType_Reference.toString()); - if (identifier != null) - result = mxmodelreflection.proxies.MxObjectType.load(context, identifier); - return result; - } - - /** - * Set value of Column_MxObjectType_Reference - * @param column_mxobjecttype_reference - */ - public final void setColumn_MxObjectType_Reference(mxmodelreflection.proxies.MxObjectType column_mxobjecttype_reference) - { - setColumn_MxObjectType_Reference(getContext(), column_mxobjecttype_reference); - } - - /** - * Set value of Column_MxObjectType_Reference - * @param context - * @param column_mxobjecttype_reference - */ - public final void setColumn_MxObjectType_Reference(com.mendix.systemwideinterfaces.core.IContext context, mxmodelreflection.proxies.MxObjectType column_mxobjecttype_reference) - { - if (column_mxobjecttype_reference == null) - getMendixObject().setValue(context, MemberNames.Column_MxObjectType_Reference.toString(), null); - else - getMendixObject().setValue(context, MemberNames.Column_MxObjectType_Reference.toString(), column_mxobjecttype_reference.getMendixObject().getId()); - } - - /** - * @return value of Column_MxObjectType - */ - public final mxmodelreflection.proxies.MxObjectType getColumn_MxObjectType() throws com.mendix.core.CoreException - { - return getColumn_MxObjectType(getContext()); - } - - /** - * @param context - * @return value of Column_MxObjectType - */ - public final mxmodelreflection.proxies.MxObjectType getColumn_MxObjectType(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException - { - mxmodelreflection.proxies.MxObjectType result = null; - com.mendix.systemwideinterfaces.core.IMendixIdentifier identifier = getMendixObject().getValue(context, MemberNames.Column_MxObjectType.toString()); - if (identifier != null) - result = mxmodelreflection.proxies.MxObjectType.load(context, identifier); - return result; - } - - /** - * Set value of Column_MxObjectType - * @param column_mxobjecttype - */ - public final void setColumn_MxObjectType(mxmodelreflection.proxies.MxObjectType column_mxobjecttype) - { - setColumn_MxObjectType(getContext(), column_mxobjecttype); - } - - /** - * Set value of Column_MxObjectType - * @param context - * @param column_mxobjecttype - */ - public final void setColumn_MxObjectType(com.mendix.systemwideinterfaces.core.IContext context, mxmodelreflection.proxies.MxObjectType column_mxobjecttype) - { - if (column_mxobjecttype == null) - getMendixObject().setValue(context, MemberNames.Column_MxObjectType.toString(), null); - else - getMendixObject().setValue(context, MemberNames.Column_MxObjectType.toString(), column_mxobjecttype.getMendixObject().getId()); - } - - /** - * @return value of Column_MxObjectMember - */ - public final mxmodelreflection.proxies.MxObjectMember getColumn_MxObjectMember() throws com.mendix.core.CoreException - { - return getColumn_MxObjectMember(getContext()); - } - - /** - * @param context - * @return value of Column_MxObjectMember - */ - public final mxmodelreflection.proxies.MxObjectMember getColumn_MxObjectMember(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException - { - mxmodelreflection.proxies.MxObjectMember result = null; - com.mendix.systemwideinterfaces.core.IMendixIdentifier identifier = getMendixObject().getValue(context, MemberNames.Column_MxObjectMember.toString()); - if (identifier != null) - result = mxmodelreflection.proxies.MxObjectMember.load(context, identifier); - return result; - } - - /** - * Set value of Column_MxObjectMember - * @param column_mxobjectmember - */ - public final void setColumn_MxObjectMember(mxmodelreflection.proxies.MxObjectMember column_mxobjectmember) - { - setColumn_MxObjectMember(getContext(), column_mxobjectmember); - } - - /** - * Set value of Column_MxObjectMember - * @param context - * @param column_mxobjectmember - */ - public final void setColumn_MxObjectMember(com.mendix.systemwideinterfaces.core.IContext context, mxmodelreflection.proxies.MxObjectMember column_mxobjectmember) - { - if (column_mxobjectmember == null) - getMendixObject().setValue(context, MemberNames.Column_MxObjectMember.toString(), null); - else - getMendixObject().setValue(context, MemberNames.Column_MxObjectMember.toString(), column_mxobjectmember.getMendixObject().getId()); - } - - /** - * @return value of Column_MxObjectMember_Reference - */ - public final mxmodelreflection.proxies.MxObjectMember getColumn_MxObjectMember_Reference() throws com.mendix.core.CoreException - { - return getColumn_MxObjectMember_Reference(getContext()); - } - - /** - * @param context - * @return value of Column_MxObjectMember_Reference - */ - public final mxmodelreflection.proxies.MxObjectMember getColumn_MxObjectMember_Reference(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException - { - mxmodelreflection.proxies.MxObjectMember result = null; - com.mendix.systemwideinterfaces.core.IMendixIdentifier identifier = getMendixObject().getValue(context, MemberNames.Column_MxObjectMember_Reference.toString()); - if (identifier != null) - result = mxmodelreflection.proxies.MxObjectMember.load(context, identifier); - return result; - } - - /** - * Set value of Column_MxObjectMember_Reference - * @param column_mxobjectmember_reference - */ - public final void setColumn_MxObjectMember_Reference(mxmodelreflection.proxies.MxObjectMember column_mxobjectmember_reference) - { - setColumn_MxObjectMember_Reference(getContext(), column_mxobjectmember_reference); - } - - /** - * Set value of Column_MxObjectMember_Reference - * @param context - * @param column_mxobjectmember_reference - */ - public final void setColumn_MxObjectMember_Reference(com.mendix.systemwideinterfaces.core.IContext context, mxmodelreflection.proxies.MxObjectMember column_mxobjectmember_reference) - { - if (column_mxobjectmember_reference == null) - getMendixObject().setValue(context, MemberNames.Column_MxObjectMember_Reference.toString(), null); - else - getMendixObject().setValue(context, MemberNames.Column_MxObjectMember_Reference.toString(), column_mxobjectmember_reference.getMendixObject().getId()); - } - - /** - * @return value of Column_MxObjectReference - */ - public final mxmodelreflection.proxies.MxObjectReference getColumn_MxObjectReference() throws com.mendix.core.CoreException - { - return getColumn_MxObjectReference(getContext()); - } - - /** - * @param context - * @return value of Column_MxObjectReference - */ - public final mxmodelreflection.proxies.MxObjectReference getColumn_MxObjectReference(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException - { - mxmodelreflection.proxies.MxObjectReference result = null; - com.mendix.systemwideinterfaces.core.IMendixIdentifier identifier = getMendixObject().getValue(context, MemberNames.Column_MxObjectReference.toString()); - if (identifier != null) - result = mxmodelreflection.proxies.MxObjectReference.load(context, identifier); - return result; - } - - /** - * Set value of Column_MxObjectReference - * @param column_mxobjectreference - */ - public final void setColumn_MxObjectReference(mxmodelreflection.proxies.MxObjectReference column_mxobjectreference) - { - setColumn_MxObjectReference(getContext(), column_mxobjectreference); - } - - /** - * Set value of Column_MxObjectReference - * @param context - * @param column_mxobjectreference - */ - public final void setColumn_MxObjectReference(com.mendix.systemwideinterfaces.core.IContext context, mxmodelreflection.proxies.MxObjectReference column_mxobjectreference) - { - if (column_mxobjectreference == null) - getMendixObject().setValue(context, MemberNames.Column_MxObjectReference.toString(), null); - else - getMendixObject().setValue(context, MemberNames.Column_MxObjectReference.toString(), column_mxobjectreference.getMendixObject().getId()); - } - - /** - * @return value of Column_Microflows - */ - public final mxmodelreflection.proxies.Microflows getColumn_Microflows() throws com.mendix.core.CoreException - { - return getColumn_Microflows(getContext()); - } - - /** - * @param context - * @return value of Column_Microflows - */ - public final mxmodelreflection.proxies.Microflows getColumn_Microflows(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException - { - mxmodelreflection.proxies.Microflows result = null; - com.mendix.systemwideinterfaces.core.IMendixIdentifier identifier = getMendixObject().getValue(context, MemberNames.Column_Microflows.toString()); - if (identifier != null) - result = mxmodelreflection.proxies.Microflows.load(context, identifier); - return result; - } - - /** - * Set value of Column_Microflows - * @param column_microflows - */ - public final void setColumn_Microflows(mxmodelreflection.proxies.Microflows column_microflows) - { - setColumn_Microflows(getContext(), column_microflows); - } - - /** - * Set value of Column_Microflows - * @param context - * @param column_microflows - */ - public final void setColumn_Microflows(com.mendix.systemwideinterfaces.core.IContext context, mxmodelreflection.proxies.Microflows column_microflows) - { - if (column_microflows == null) - getMendixObject().setValue(context, MemberNames.Column_Microflows.toString(), null); - else - getMendixObject().setValue(context, MemberNames.Column_Microflows.toString(), column_microflows.getMendixObject().getId()); - } - - /** - * @return value of Column_ValueType - */ - public final mxmodelreflection.proxies.ValueType getColumn_ValueType() throws com.mendix.core.CoreException - { - return getColumn_ValueType(getContext()); - } - - /** - * @param context - * @return value of Column_ValueType - */ - public final mxmodelreflection.proxies.ValueType getColumn_ValueType(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException - { - mxmodelreflection.proxies.ValueType result = null; - com.mendix.systemwideinterfaces.core.IMendixIdentifier identifier = getMendixObject().getValue(context, MemberNames.Column_ValueType.toString()); - if (identifier != null) - result = mxmodelreflection.proxies.ValueType.load(context, identifier); - return result; - } - - /** - * Set value of Column_ValueType - * @param column_valuetype - */ - public final void setColumn_ValueType(mxmodelreflection.proxies.ValueType column_valuetype) - { - setColumn_ValueType(getContext(), column_valuetype); - } - - /** - * Set value of Column_ValueType - * @param context - * @param column_valuetype - */ - public final void setColumn_ValueType(com.mendix.systemwideinterfaces.core.IContext context, mxmodelreflection.proxies.ValueType column_valuetype) - { - if (column_valuetype == null) - getMendixObject().setValue(context, MemberNames.Column_ValueType.toString(), null); - else - getMendixObject().setValue(context, MemberNames.Column_ValueType.toString(), column_valuetype.getMendixObject().getId()); - } - - /** - * @return the IMendixObject instance of this proxy for use in the Core interface. - */ - public final com.mendix.systemwideinterfaces.core.IMendixObject getMendixObject() - { - return columnMendixObject; - } - - /** - * @return the IContext instance of this proxy, or null if no IContext instance was specified at initialization. - */ - public final com.mendix.systemwideinterfaces.core.IContext getContext() - { - return context; - } - - @java.lang.Override - public boolean equals(Object obj) - { - if (obj == this) - return true; - - if (obj != null && getClass().equals(obj.getClass())) - { - final excelimporter.proxies.Column that = (excelimporter.proxies.Column) obj; - return getMendixObject().equals(that.getMendixObject()); - } - return false; - } - - @java.lang.Override - public int hashCode() - { - return getMendixObject().hashCode(); - } - - /** - * @return String name of this class - */ - public static java.lang.String getType() - { - return "ExcelImporter.Column"; - } - - /** - * @return String GUID from this object, format: ID_0000000000 - * @deprecated Use getMendixObject().getId().toLong() to get a unique identifier for this object. - */ - @java.lang.Deprecated - public java.lang.String getGUID() - { - return "ID_" + getMendixObject().getId().toLong(); - } -} diff --git a/javasource/excelimporter/proxies/DataSource.java b/javasource/excelimporter/proxies/DataSource.java deleted file mode 100644 index 4776893..0000000 --- a/javasource/excelimporter/proxies/DataSource.java +++ /dev/null @@ -1,34 +0,0 @@ -// This file was generated by Mendix Modeler. -// -// WARNING: Code you write here will be lost the next time you deploy the project. - -package excelimporter.proxies; - -public enum DataSource -{ - CellValue(new java.lang.String[][] { new java.lang.String[] { "en_US", "Cell Value" }, new java.lang.String[] { "en_GB", "Cell Value" }, new java.lang.String[] { "en_ZA", "Cell Value" }, new java.lang.String[] { "nl_NL", "Cel waarde" } }), - DocumentPropertyRowNr(new java.lang.String[][] { new java.lang.String[] { "en_US", "Document property - row number" }, new java.lang.String[] { "en_GB", "Document property - row number" }, new java.lang.String[] { "en_ZA", "Document property - row number" }, new java.lang.String[] { "nl_NL", "Document eigenschap - rij nummer" } }), - DocumentPropertySheetNr(new java.lang.String[][] { new java.lang.String[] { "en_US", "Document property - sheet number" }, new java.lang.String[] { "en_GB", "Document property - sheet number" }, new java.lang.String[] { "en_ZA", "Document property - sheet number" }, new java.lang.String[] { "nl_NL", "Document eigenschap - sheet nummer" } }), - StaticValue(new java.lang.String[][] { new java.lang.String[] { "en_US", "Static Value - Copy caption into the member" }, new java.lang.String[] { "nl_NL", "Statische Waarrde - Kopier de titel in de Member" }, new java.lang.String[] { "en_GB", "Static Value - Copy caption into the member" }, new java.lang.String[] { "en_ZA", "Static Value - Copy caption into the member" } }); - - private java.util.Map captions; - - private DataSource(java.lang.String[][] captionStrings) - { - this.captions = new java.util.HashMap(); - for (java.lang.String[] captionString : captionStrings) - captions.put(captionString[0], captionString[1]); - } - - public java.lang.String getCaption(java.lang.String languageCode) - { - if (captions.containsKey(languageCode)) - return captions.get(languageCode); - return captions.get("en_US"); - } - - public java.lang.String getCaption() - { - return captions.get("en_US"); - } -} diff --git a/javasource/excelimporter/proxies/ImportActions.java b/javasource/excelimporter/proxies/ImportActions.java deleted file mode 100644 index 35d635f..0000000 --- a/javasource/excelimporter/proxies/ImportActions.java +++ /dev/null @@ -1,34 +0,0 @@ -// This file was generated by Mendix Modeler. -// -// WARNING: Code you write here will be lost the next time you deploy the project. - -package excelimporter.proxies; - -public enum ImportActions -{ - SynchronizeObjects(new java.lang.String[][] { new java.lang.String[] { "en_US", "Synchronize objects" }, new java.lang.String[] { "nl_NL", "Synchroniseer objecten" }, new java.lang.String[] { "en_GB", "Synchronize objects" }, new java.lang.String[] { "en_ZA", "Synchronize objects" } }), - SynchronizeOnlyExisting(new java.lang.String[][] { new java.lang.String[] { "en_US", "Synchronize only existing objects, ignore others" }, new java.lang.String[] { "nl_NL", "Synchroniseer alleen bestaande objecten, negeer de rest" }, new java.lang.String[] { "en_GB", "Synchronize only existing objects, ignore others" }, new java.lang.String[] { "en_ZA", "Synchronize only existing objects, ignore others" } }), - CreateObjects(new java.lang.String[][] { new java.lang.String[] { "en_US", "Create an object for each row" }, new java.lang.String[] { "nl_NL", "Creeër een object voor iedere rij" }, new java.lang.String[] { "en_GB", "Create an object for each row" }, new java.lang.String[] { "en_ZA", "Create an object for each row" } }), - OnlyCreateNewObjects(new java.lang.String[][] { new java.lang.String[] { "en_US", "Only create not existing object" }, new java.lang.String[] { "nl_NL", "Creeër alleen niet bestaande objecten" }, new java.lang.String[] { "en_GB", "Only create not existing object" }, new java.lang.String[] { "en_ZA", "Only create not existing object" } }); - - private java.util.Map captions; - - private ImportActions(java.lang.String[][] captionStrings) - { - this.captions = new java.util.HashMap(); - for (java.lang.String[] captionString : captionStrings) - captions.put(captionString[0], captionString[1]); - } - - public java.lang.String getCaption(java.lang.String languageCode) - { - if (captions.containsKey(languageCode)) - return captions.get(languageCode); - return captions.get("en_US"); - } - - public java.lang.String getCaption() - { - return captions.get("en_US"); - } -} diff --git a/javasource/excelimporter/proxies/Log.java b/javasource/excelimporter/proxies/Log.java deleted file mode 100644 index 49ffec6..0000000 --- a/javasource/excelimporter/proxies/Log.java +++ /dev/null @@ -1,251 +0,0 @@ -// This file was generated by Mendix Modeler. -// -// WARNING: Code you write here will be lost the next time you deploy the project. - -package excelimporter.proxies; - -public class Log -{ - private final com.mendix.systemwideinterfaces.core.IMendixObject logMendixObject; - - private final com.mendix.systemwideinterfaces.core.IContext context; - - /** - * Internal name of this entity - */ - public static final java.lang.String entityName = "ExcelImporter.Log"; - - /** - * Enum describing members of this entity - */ - public enum MemberNames - { - Logline("Logline"), - Log_XMLDocumentTemplate("ExcelImporter.Log_XMLDocumentTemplate"); - - private java.lang.String metaName; - - MemberNames(java.lang.String s) - { - metaName = s; - } - - @java.lang.Override - public java.lang.String toString() - { - return metaName; - } - } - - public Log(com.mendix.systemwideinterfaces.core.IContext context) - { - this(context, com.mendix.core.Core.instantiate(context, "ExcelImporter.Log")); - } - - protected Log(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixObject logMendixObject) - { - if (logMendixObject == null) - throw new java.lang.IllegalArgumentException("The given object cannot be null."); - if (!com.mendix.core.Core.isSubClassOf("ExcelImporter.Log", logMendixObject.getType())) - throw new java.lang.IllegalArgumentException("The given object is not a ExcelImporter.Log"); - - this.logMendixObject = logMendixObject; - this.context = context; - } - - /** - * @deprecated Use 'Log.load(IContext, IMendixIdentifier)' instead. - */ - @java.lang.Deprecated - public static excelimporter.proxies.Log initialize(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixIdentifier mendixIdentifier) throws com.mendix.core.CoreException - { - return excelimporter.proxies.Log.load(context, mendixIdentifier); - } - - /** - * Initialize a proxy using context (recommended). This context will be used for security checking when the get- and set-methods without context parameters are called. - * The get- and set-methods with context parameter should be used when for instance sudo access is necessary (IContext.createSudoClone() can be used to obtain sudo access). - */ - public static excelimporter.proxies.Log initialize(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixObject mendixObject) - { - return new excelimporter.proxies.Log(context, mendixObject); - } - - public static excelimporter.proxies.Log load(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixIdentifier mendixIdentifier) throws com.mendix.core.CoreException - { - com.mendix.systemwideinterfaces.core.IMendixObject mendixObject = com.mendix.core.Core.retrieveId(context, mendixIdentifier); - return excelimporter.proxies.Log.initialize(context, mendixObject); - } - - public static java.util.List load(com.mendix.systemwideinterfaces.core.IContext context, java.lang.String xpathConstraint) throws com.mendix.core.CoreException - { - java.util.List result = new java.util.ArrayList(); - for (com.mendix.systemwideinterfaces.core.IMendixObject obj : com.mendix.core.Core.retrieveXPathQuery(context, "//ExcelImporter.Log" + xpathConstraint)) - result.add(excelimporter.proxies.Log.initialize(context, obj)); - return result; - } - - /** - * Commit the changes made on this proxy object. - */ - public final void commit() throws com.mendix.core.CoreException - { - com.mendix.core.Core.commit(context, getMendixObject()); - } - - /** - * Commit the changes made on this proxy object using the specified context. - */ - public final void commit(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException - { - com.mendix.core.Core.commit(context, getMendixObject()); - } - - /** - * Delete the object. - */ - public final void delete() - { - com.mendix.core.Core.delete(context, getMendixObject()); - } - - /** - * Delete the object using the specified context. - */ - public final void delete(com.mendix.systemwideinterfaces.core.IContext context) - { - com.mendix.core.Core.delete(context, getMendixObject()); - } - /** - * @return value of Logline - */ - public final java.lang.String getLogline() - { - return getLogline(getContext()); - } - - /** - * @param context - * @return value of Logline - */ - public final java.lang.String getLogline(com.mendix.systemwideinterfaces.core.IContext context) - { - return (java.lang.String) getMendixObject().getValue(context, MemberNames.Logline.toString()); - } - - /** - * Set value of Logline - * @param logline - */ - public final void setLogline(java.lang.String logline) - { - setLogline(getContext(), logline); - } - - /** - * Set value of Logline - * @param context - * @param logline - */ - public final void setLogline(com.mendix.systemwideinterfaces.core.IContext context, java.lang.String logline) - { - getMendixObject().setValue(context, MemberNames.Logline.toString(), logline); - } - - /** - * @return value of Log_XMLDocumentTemplate - */ - public final excelimporter.proxies.XMLDocumentTemplate getLog_XMLDocumentTemplate() throws com.mendix.core.CoreException - { - return getLog_XMLDocumentTemplate(getContext()); - } - - /** - * @param context - * @return value of Log_XMLDocumentTemplate - */ - public final excelimporter.proxies.XMLDocumentTemplate getLog_XMLDocumentTemplate(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException - { - excelimporter.proxies.XMLDocumentTemplate result = null; - com.mendix.systemwideinterfaces.core.IMendixIdentifier identifier = getMendixObject().getValue(context, MemberNames.Log_XMLDocumentTemplate.toString()); - if (identifier != null) - result = excelimporter.proxies.XMLDocumentTemplate.load(context, identifier); - return result; - } - - /** - * Set value of Log_XMLDocumentTemplate - * @param log_xmldocumenttemplate - */ - public final void setLog_XMLDocumentTemplate(excelimporter.proxies.XMLDocumentTemplate log_xmldocumenttemplate) - { - setLog_XMLDocumentTemplate(getContext(), log_xmldocumenttemplate); - } - - /** - * Set value of Log_XMLDocumentTemplate - * @param context - * @param log_xmldocumenttemplate - */ - public final void setLog_XMLDocumentTemplate(com.mendix.systemwideinterfaces.core.IContext context, excelimporter.proxies.XMLDocumentTemplate log_xmldocumenttemplate) - { - if (log_xmldocumenttemplate == null) - getMendixObject().setValue(context, MemberNames.Log_XMLDocumentTemplate.toString(), null); - else - getMendixObject().setValue(context, MemberNames.Log_XMLDocumentTemplate.toString(), log_xmldocumenttemplate.getMendixObject().getId()); - } - - /** - * @return the IMendixObject instance of this proxy for use in the Core interface. - */ - public final com.mendix.systemwideinterfaces.core.IMendixObject getMendixObject() - { - return logMendixObject; - } - - /** - * @return the IContext instance of this proxy, or null if no IContext instance was specified at initialization. - */ - public final com.mendix.systemwideinterfaces.core.IContext getContext() - { - return context; - } - - @java.lang.Override - public boolean equals(Object obj) - { - if (obj == this) - return true; - - if (obj != null && getClass().equals(obj.getClass())) - { - final excelimporter.proxies.Log that = (excelimporter.proxies.Log) obj; - return getMendixObject().equals(that.getMendixObject()); - } - return false; - } - - @java.lang.Override - public int hashCode() - { - return getMendixObject().hashCode(); - } - - /** - * @return String name of this class - */ - public static java.lang.String getType() - { - return "ExcelImporter.Log"; - } - - /** - * @return String GUID from this object, format: ID_0000000000 - * @deprecated Use getMendixObject().getId().toLong() to get a unique identifier for this object. - */ - @java.lang.Deprecated - public java.lang.String getGUID() - { - return "ID_" + getMendixObject().getId().toLong(); - } -} diff --git a/javasource/excelimporter/proxies/MappingType.java b/javasource/excelimporter/proxies/MappingType.java deleted file mode 100644 index 657c236..0000000 --- a/javasource/excelimporter/proxies/MappingType.java +++ /dev/null @@ -1,33 +0,0 @@ -// This file was generated by Mendix Modeler. -// -// WARNING: Code you write here will be lost the next time you deploy the project. - -package excelimporter.proxies; - -public enum MappingType -{ - Attribute(new java.lang.String[][] { new java.lang.String[] { "en_US", "Attribute" }, new java.lang.String[] { "nl_NL", "Attribuut" }, new java.lang.String[] { "en_GB", "Attribute" }, new java.lang.String[] { "en_ZA", "Attribute" } }), - Reference(new java.lang.String[][] { new java.lang.String[] { "en_US", "Reference" }, new java.lang.String[] { "nl_NL", "Referentie" }, new java.lang.String[] { "en_GB", "Reference" }, new java.lang.String[] { "en_ZA", "Reference" } }), - DoNotUse(new java.lang.String[][] { new java.lang.String[] { "en_US", "Do not use" }, new java.lang.String[] { "nl_NL", "Niet gebruiken" }, new java.lang.String[] { "en_GB", "Do not use" }, new java.lang.String[] { "en_ZA", "Do not use" } }); - - private java.util.Map captions; - - private MappingType(java.lang.String[][] captionStrings) - { - this.captions = new java.util.HashMap(); - for (java.lang.String[] captionString : captionStrings) - captions.put(captionString[0], captionString[1]); - } - - public java.lang.String getCaption(java.lang.String languageCode) - { - if (captions.containsKey(languageCode)) - return captions.get(languageCode); - return captions.get("en_US"); - } - - public java.lang.String getCaption() - { - return captions.get("en_US"); - } -} diff --git a/javasource/excelimporter/proxies/ReferenceDataHandling.java b/javasource/excelimporter/proxies/ReferenceDataHandling.java deleted file mode 100644 index 669778c..0000000 --- a/javasource/excelimporter/proxies/ReferenceDataHandling.java +++ /dev/null @@ -1,32 +0,0 @@ -// This file was generated by Mendix Modeler. -// -// WARNING: Code you write here will be lost the next time you deploy the project. - -package excelimporter.proxies; - -public enum ReferenceDataHandling -{ - Overwrite(new java.lang.String[][] { new java.lang.String[] { "en_US", "Overwrite" }, new java.lang.String[] { "nl_NL", "Overschrijven" }, new java.lang.String[] { "en_GB", "Overwrite" }, new java.lang.String[] { "en_ZA", "Overwrite" } }), - Append(new java.lang.String[][] { new java.lang.String[] { "en_US", "Append" }, new java.lang.String[] { "nl_NL", "Aanvullen" }, new java.lang.String[] { "en_GB", "Append" }, new java.lang.String[] { "en_ZA", "Append" } }); - - private java.util.Map captions; - - private ReferenceDataHandling(java.lang.String[][] captionStrings) - { - this.captions = new java.util.HashMap(); - for (java.lang.String[] captionString : captionStrings) - captions.put(captionString[0], captionString[1]); - } - - public java.lang.String getCaption(java.lang.String languageCode) - { - if (captions.containsKey(languageCode)) - return captions.get(languageCode); - return captions.get("en_US"); - } - - public java.lang.String getCaption() - { - return captions.get("en_US"); - } -} diff --git a/javasource/excelimporter/proxies/ReferenceHandling.java b/javasource/excelimporter/proxies/ReferenceHandling.java deleted file mode 100644 index cdab578..0000000 --- a/javasource/excelimporter/proxies/ReferenceHandling.java +++ /dev/null @@ -1,468 +0,0 @@ -// This file was generated by Mendix Modeler. -// -// WARNING: Code you write here will be lost the next time you deploy the project. - -package excelimporter.proxies; - -/** - * References - * For each reference that is used in the mapping, you can configure what should happen if a referenced object is not found. Just like in the modeler the value of a reference(set) can be added to the current values of be overwritten. - * Print message when reference is not found - * Keep track of all the object keys in this association that could not be found. Warning: This consumes a lot of memory since all values need to be remembered. - * Commit unchanged objects - * Even if there aren't any changes to the object still commit the objects in order to execute the events. - * - */ -public class ReferenceHandling -{ - private final com.mendix.systemwideinterfaces.core.IMendixObject referenceHandlingMendixObject; - - private final com.mendix.systemwideinterfaces.core.IContext context; - - /** - * Internal name of this entity - */ - public static final java.lang.String entityName = "ExcelImporter.ReferenceHandling"; - - /** - * Enum describing members of this entity - */ - public enum MemberNames - { - Handling("Handling"), - DataHandling("DataHandling"), - PrintNotFoundMessages("PrintNotFoundMessages"), - CommitUnchangedObjects("CommitUnchangedObjects"), - IgnoreEmptyKeys("IgnoreEmptyKeys"), - ReferenceHandling_Template("ExcelImporter.ReferenceHandling_Template"), - ReferenceHandling_MxObjectReference("ExcelImporter.ReferenceHandling_MxObjectReference"); - - private java.lang.String metaName; - - MemberNames(java.lang.String s) - { - metaName = s; - } - - @java.lang.Override - public java.lang.String toString() - { - return metaName; - } - } - - public ReferenceHandling(com.mendix.systemwideinterfaces.core.IContext context) - { - this(context, com.mendix.core.Core.instantiate(context, "ExcelImporter.ReferenceHandling")); - } - - protected ReferenceHandling(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixObject referenceHandlingMendixObject) - { - if (referenceHandlingMendixObject == null) - throw new java.lang.IllegalArgumentException("The given object cannot be null."); - if (!com.mendix.core.Core.isSubClassOf("ExcelImporter.ReferenceHandling", referenceHandlingMendixObject.getType())) - throw new java.lang.IllegalArgumentException("The given object is not a ExcelImporter.ReferenceHandling"); - - this.referenceHandlingMendixObject = referenceHandlingMendixObject; - this.context = context; - } - - /** - * @deprecated Use 'ReferenceHandling.load(IContext, IMendixIdentifier)' instead. - */ - @java.lang.Deprecated - public static excelimporter.proxies.ReferenceHandling initialize(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixIdentifier mendixIdentifier) throws com.mendix.core.CoreException - { - return excelimporter.proxies.ReferenceHandling.load(context, mendixIdentifier); - } - - /** - * Initialize a proxy using context (recommended). This context will be used for security checking when the get- and set-methods without context parameters are called. - * The get- and set-methods with context parameter should be used when for instance sudo access is necessary (IContext.createSudoClone() can be used to obtain sudo access). - */ - public static excelimporter.proxies.ReferenceHandling initialize(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixObject mendixObject) - { - return new excelimporter.proxies.ReferenceHandling(context, mendixObject); - } - - public static excelimporter.proxies.ReferenceHandling load(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixIdentifier mendixIdentifier) throws com.mendix.core.CoreException - { - com.mendix.systemwideinterfaces.core.IMendixObject mendixObject = com.mendix.core.Core.retrieveId(context, mendixIdentifier); - return excelimporter.proxies.ReferenceHandling.initialize(context, mendixObject); - } - - public static java.util.List load(com.mendix.systemwideinterfaces.core.IContext context, java.lang.String xpathConstraint) throws com.mendix.core.CoreException - { - java.util.List result = new java.util.ArrayList(); - for (com.mendix.systemwideinterfaces.core.IMendixObject obj : com.mendix.core.Core.retrieveXPathQuery(context, "//ExcelImporter.ReferenceHandling" + xpathConstraint)) - result.add(excelimporter.proxies.ReferenceHandling.initialize(context, obj)); - return result; - } - - /** - * Commit the changes made on this proxy object. - */ - public final void commit() throws com.mendix.core.CoreException - { - com.mendix.core.Core.commit(context, getMendixObject()); - } - - /** - * Commit the changes made on this proxy object using the specified context. - */ - public final void commit(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException - { - com.mendix.core.Core.commit(context, getMendixObject()); - } - - /** - * Delete the object. - */ - public final void delete() - { - com.mendix.core.Core.delete(context, getMendixObject()); - } - - /** - * Delete the object using the specified context. - */ - public final void delete(com.mendix.systemwideinterfaces.core.IContext context) - { - com.mendix.core.Core.delete(context, getMendixObject()); - } - /** - * Set value of Handling - * @param handling - */ - public final excelimporter.proxies.ReferenceHandlingEnum getHandling() - { - return getHandling(getContext()); - } - - /** - * @param context - * @return value of Handling - */ - public final excelimporter.proxies.ReferenceHandlingEnum getHandling(com.mendix.systemwideinterfaces.core.IContext context) - { - Object obj = getMendixObject().getValue(context, MemberNames.Handling.toString()); - if (obj == null) - return null; - - return excelimporter.proxies.ReferenceHandlingEnum.valueOf((java.lang.String) obj); - } - - /** - * Set value of Handling - * @param handling - */ - public final void setHandling(excelimporter.proxies.ReferenceHandlingEnum handling) - { - setHandling(getContext(), handling); - } - - /** - * Set value of Handling - * @param context - * @param handling - */ - public final void setHandling(com.mendix.systemwideinterfaces.core.IContext context, excelimporter.proxies.ReferenceHandlingEnum handling) - { - if (handling != null) - getMendixObject().setValue(context, MemberNames.Handling.toString(), handling.toString()); - else - getMendixObject().setValue(context, MemberNames.Handling.toString(), null); - } - - /** - * Set value of DataHandling - * @param datahandling - */ - public final excelimporter.proxies.ReferenceDataHandling getDataHandling() - { - return getDataHandling(getContext()); - } - - /** - * @param context - * @return value of DataHandling - */ - public final excelimporter.proxies.ReferenceDataHandling getDataHandling(com.mendix.systemwideinterfaces.core.IContext context) - { - Object obj = getMendixObject().getValue(context, MemberNames.DataHandling.toString()); - if (obj == null) - return null; - - return excelimporter.proxies.ReferenceDataHandling.valueOf((java.lang.String) obj); - } - - /** - * Set value of DataHandling - * @param datahandling - */ - public final void setDataHandling(excelimporter.proxies.ReferenceDataHandling datahandling) - { - setDataHandling(getContext(), datahandling); - } - - /** - * Set value of DataHandling - * @param context - * @param datahandling - */ - public final void setDataHandling(com.mendix.systemwideinterfaces.core.IContext context, excelimporter.proxies.ReferenceDataHandling datahandling) - { - if (datahandling != null) - getMendixObject().setValue(context, MemberNames.DataHandling.toString(), datahandling.toString()); - else - getMendixObject().setValue(context, MemberNames.DataHandling.toString(), null); - } - - /** - * @return value of PrintNotFoundMessages - */ - public final java.lang.Boolean getPrintNotFoundMessages() - { - return getPrintNotFoundMessages(getContext()); - } - - /** - * @param context - * @return value of PrintNotFoundMessages - */ - public final java.lang.Boolean getPrintNotFoundMessages(com.mendix.systemwideinterfaces.core.IContext context) - { - return (java.lang.Boolean) getMendixObject().getValue(context, MemberNames.PrintNotFoundMessages.toString()); - } - - /** - * Set value of PrintNotFoundMessages - * @param printnotfoundmessages - */ - public final void setPrintNotFoundMessages(java.lang.Boolean printnotfoundmessages) - { - setPrintNotFoundMessages(getContext(), printnotfoundmessages); - } - - /** - * Set value of PrintNotFoundMessages - * @param context - * @param printnotfoundmessages - */ - public final void setPrintNotFoundMessages(com.mendix.systemwideinterfaces.core.IContext context, java.lang.Boolean printnotfoundmessages) - { - getMendixObject().setValue(context, MemberNames.PrintNotFoundMessages.toString(), printnotfoundmessages); - } - - /** - * @return value of CommitUnchangedObjects - */ - public final java.lang.Boolean getCommitUnchangedObjects() - { - return getCommitUnchangedObjects(getContext()); - } - - /** - * @param context - * @return value of CommitUnchangedObjects - */ - public final java.lang.Boolean getCommitUnchangedObjects(com.mendix.systemwideinterfaces.core.IContext context) - { - return (java.lang.Boolean) getMendixObject().getValue(context, MemberNames.CommitUnchangedObjects.toString()); - } - - /** - * Set value of CommitUnchangedObjects - * @param commitunchangedobjects - */ - public final void setCommitUnchangedObjects(java.lang.Boolean commitunchangedobjects) - { - setCommitUnchangedObjects(getContext(), commitunchangedobjects); - } - - /** - * Set value of CommitUnchangedObjects - * @param context - * @param commitunchangedobjects - */ - public final void setCommitUnchangedObjects(com.mendix.systemwideinterfaces.core.IContext context, java.lang.Boolean commitunchangedobjects) - { - getMendixObject().setValue(context, MemberNames.CommitUnchangedObjects.toString(), commitunchangedobjects); - } - - /** - * @return value of IgnoreEmptyKeys - */ - public final java.lang.Boolean getIgnoreEmptyKeys() - { - return getIgnoreEmptyKeys(getContext()); - } - - /** - * @param context - * @return value of IgnoreEmptyKeys - */ - public final java.lang.Boolean getIgnoreEmptyKeys(com.mendix.systemwideinterfaces.core.IContext context) - { - return (java.lang.Boolean) getMendixObject().getValue(context, MemberNames.IgnoreEmptyKeys.toString()); - } - - /** - * Set value of IgnoreEmptyKeys - * @param ignoreemptykeys - */ - public final void setIgnoreEmptyKeys(java.lang.Boolean ignoreemptykeys) - { - setIgnoreEmptyKeys(getContext(), ignoreemptykeys); - } - - /** - * Set value of IgnoreEmptyKeys - * @param context - * @param ignoreemptykeys - */ - public final void setIgnoreEmptyKeys(com.mendix.systemwideinterfaces.core.IContext context, java.lang.Boolean ignoreemptykeys) - { - getMendixObject().setValue(context, MemberNames.IgnoreEmptyKeys.toString(), ignoreemptykeys); - } - - /** - * @return value of ReferenceHandling_Template - */ - public final excelimporter.proxies.Template getReferenceHandling_Template() throws com.mendix.core.CoreException - { - return getReferenceHandling_Template(getContext()); - } - - /** - * @param context - * @return value of ReferenceHandling_Template - */ - public final excelimporter.proxies.Template getReferenceHandling_Template(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException - { - excelimporter.proxies.Template result = null; - com.mendix.systemwideinterfaces.core.IMendixIdentifier identifier = getMendixObject().getValue(context, MemberNames.ReferenceHandling_Template.toString()); - if (identifier != null) - result = excelimporter.proxies.Template.load(context, identifier); - return result; - } - - /** - * Set value of ReferenceHandling_Template - * @param referencehandling_template - */ - public final void setReferenceHandling_Template(excelimporter.proxies.Template referencehandling_template) - { - setReferenceHandling_Template(getContext(), referencehandling_template); - } - - /** - * Set value of ReferenceHandling_Template - * @param context - * @param referencehandling_template - */ - public final void setReferenceHandling_Template(com.mendix.systemwideinterfaces.core.IContext context, excelimporter.proxies.Template referencehandling_template) - { - if (referencehandling_template == null) - getMendixObject().setValue(context, MemberNames.ReferenceHandling_Template.toString(), null); - else - getMendixObject().setValue(context, MemberNames.ReferenceHandling_Template.toString(), referencehandling_template.getMendixObject().getId()); - } - - /** - * @return value of ReferenceHandling_MxObjectReference - */ - public final mxmodelreflection.proxies.MxObjectReference getReferenceHandling_MxObjectReference() throws com.mendix.core.CoreException - { - return getReferenceHandling_MxObjectReference(getContext()); - } - - /** - * @param context - * @return value of ReferenceHandling_MxObjectReference - */ - public final mxmodelreflection.proxies.MxObjectReference getReferenceHandling_MxObjectReference(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException - { - mxmodelreflection.proxies.MxObjectReference result = null; - com.mendix.systemwideinterfaces.core.IMendixIdentifier identifier = getMendixObject().getValue(context, MemberNames.ReferenceHandling_MxObjectReference.toString()); - if (identifier != null) - result = mxmodelreflection.proxies.MxObjectReference.load(context, identifier); - return result; - } - - /** - * Set value of ReferenceHandling_MxObjectReference - * @param referencehandling_mxobjectreference - */ - public final void setReferenceHandling_MxObjectReference(mxmodelreflection.proxies.MxObjectReference referencehandling_mxobjectreference) - { - setReferenceHandling_MxObjectReference(getContext(), referencehandling_mxobjectreference); - } - - /** - * Set value of ReferenceHandling_MxObjectReference - * @param context - * @param referencehandling_mxobjectreference - */ - public final void setReferenceHandling_MxObjectReference(com.mendix.systemwideinterfaces.core.IContext context, mxmodelreflection.proxies.MxObjectReference referencehandling_mxobjectreference) - { - if (referencehandling_mxobjectreference == null) - getMendixObject().setValue(context, MemberNames.ReferenceHandling_MxObjectReference.toString(), null); - else - getMendixObject().setValue(context, MemberNames.ReferenceHandling_MxObjectReference.toString(), referencehandling_mxobjectreference.getMendixObject().getId()); - } - - /** - * @return the IMendixObject instance of this proxy for use in the Core interface. - */ - public final com.mendix.systemwideinterfaces.core.IMendixObject getMendixObject() - { - return referenceHandlingMendixObject; - } - - /** - * @return the IContext instance of this proxy, or null if no IContext instance was specified at initialization. - */ - public final com.mendix.systemwideinterfaces.core.IContext getContext() - { - return context; - } - - @java.lang.Override - public boolean equals(Object obj) - { - if (obj == this) - return true; - - if (obj != null && getClass().equals(obj.getClass())) - { - final excelimporter.proxies.ReferenceHandling that = (excelimporter.proxies.ReferenceHandling) obj; - return getMendixObject().equals(that.getMendixObject()); - } - return false; - } - - @java.lang.Override - public int hashCode() - { - return getMendixObject().hashCode(); - } - - /** - * @return String name of this class - */ - public static java.lang.String getType() - { - return "ExcelImporter.ReferenceHandling"; - } - - /** - * @return String GUID from this object, format: ID_0000000000 - * @deprecated Use getMendixObject().getId().toLong() to get a unique identifier for this object. - */ - @java.lang.Deprecated - public java.lang.String getGUID() - { - return "ID_" + getMendixObject().getId().toLong(); - } -} diff --git a/javasource/excelimporter/proxies/ReferenceHandlingEnum.java b/javasource/excelimporter/proxies/ReferenceHandlingEnum.java deleted file mode 100644 index 4ab1d5b..0000000 --- a/javasource/excelimporter/proxies/ReferenceHandlingEnum.java +++ /dev/null @@ -1,34 +0,0 @@ -// This file was generated by Mendix Modeler. -// -// WARNING: Code you write here will be lost the next time you deploy the project. - -package excelimporter.proxies; - -public enum ReferenceHandlingEnum -{ - FindCreate(new java.lang.String[][] { new java.lang.String[] { "en_US", "Find reference, create if not found" }, new java.lang.String[] { "nl_NL", "Zoek referentie creeër wanneer niet gevonden" }, new java.lang.String[] { "en_GB", "Find reference, create if not found" }, new java.lang.String[] { "en_ZA", "Find reference, create if not found" } }), - FindIgnore(new java.lang.String[][] { new java.lang.String[] { "en_US", "Find reference, ignore if not found" }, new java.lang.String[] { "nl_NL", "Zoek referentie negeren wanneer niet gevonden" }, new java.lang.String[] { "en_GB", "Find reference, ignore if not found" }, new java.lang.String[] { "en_ZA", "Find reference, ignore if not found" } }), - CreateEverything(new java.lang.String[][] { new java.lang.String[] { "en_US", "Create all referenced objects" }, new java.lang.String[] { "nl_NL", "Creeër alle gerefereerde objecten" }, new java.lang.String[] { "en_GB", "Create all referenced objects" }, new java.lang.String[] { "en_ZA", "Create all referenced objects" } }), - OnlyCreateNewObjects(new java.lang.String[][] { new java.lang.String[] { "en_US", "Only create not existing objects" }, new java.lang.String[] { "nl_NL", "Creeër alleen niet bestaande objecten" }, new java.lang.String[] { "en_GB", "Only create not existing objects" }, new java.lang.String[] { "en_ZA", "Only create not existing objects" } }); - - private java.util.Map captions; - - private ReferenceHandlingEnum(java.lang.String[][] captionStrings) - { - this.captions = new java.util.HashMap(); - for (java.lang.String[] captionString : captionStrings) - captions.put(captionString[0], captionString[1]); - } - - public java.lang.String getCaption(java.lang.String languageCode) - { - if (captions.containsKey(languageCode)) - return captions.get(languageCode); - return captions.get("en_US"); - } - - public java.lang.String getCaption() - { - return captions.get("en_US"); - } -} diff --git a/javasource/excelimporter/proxies/ReferenceKeyType.java b/javasource/excelimporter/proxies/ReferenceKeyType.java deleted file mode 100644 index d605f76..0000000 --- a/javasource/excelimporter/proxies/ReferenceKeyType.java +++ /dev/null @@ -1,34 +0,0 @@ -// This file was generated by Mendix Modeler. -// -// WARNING: Code you write here will be lost the next time you deploy the project. - -package excelimporter.proxies; - -public enum ReferenceKeyType -{ - NoKey(new java.lang.String[][] { new java.lang.String[] { "en_US", "NoKey" }, new java.lang.String[] { "nl_NL", "Nee" }, new java.lang.String[] { "en_GB", "NoKey" }, new java.lang.String[] { "en_ZA", "NoKey" } }), - YesOnlyAssociatedObject(new java.lang.String[][] { new java.lang.String[] { "en_US", "Yes, only for the associated object" }, new java.lang.String[] { "nl_NL", "Ja, alleen voor het geassocieerde object" }, new java.lang.String[] { "en_GB", "Yes, only for the associated object" }, new java.lang.String[] { "en_ZA", "Yes, only for the associated object" } }), - YesOnlyMainObject(new java.lang.String[][] { new java.lang.String[] { "en_US", "Yes, only for the main object" }, new java.lang.String[] { "nl_NL", "Ja, alleen voor het hoofd object" }, new java.lang.String[] { "en_GB", "Yes, only for the main object" }, new java.lang.String[] { "en_ZA", "Yes, only for the main object" } }), - YesMainAndAssociatedObject(new java.lang.String[][] { new java.lang.String[] { "en_US", "Yes, Both for the main object and the associated object" }, new java.lang.String[] { "nl_NL", "Ja, voor het hoofd object en het geassocieerde object" }, new java.lang.String[] { "en_GB", "Yes, Both for the main object and the associated object" }, new java.lang.String[] { "en_ZA", "Yes, Both for the main object and the associated object" } }); - - private java.util.Map captions; - - private ReferenceKeyType(java.lang.String[][] captionStrings) - { - this.captions = new java.util.HashMap(); - for (java.lang.String[] captionString : captionStrings) - captions.put(captionString[0], captionString[1]); - } - - public java.lang.String getCaption(java.lang.String languageCode) - { - if (captions.containsKey(languageCode)) - return captions.get(languageCode); - return captions.get("en_US"); - } - - public java.lang.String getCaption() - { - return captions.get("en_US"); - } -} diff --git a/javasource/excelimporter/proxies/RemoveIndicator.java b/javasource/excelimporter/proxies/RemoveIndicator.java deleted file mode 100644 index e90cb93..0000000 --- a/javasource/excelimporter/proxies/RemoveIndicator.java +++ /dev/null @@ -1,33 +0,0 @@ -// This file was generated by Mendix Modeler. -// -// WARNING: Code you write here will be lost the next time you deploy the project. - -package excelimporter.proxies; - -public enum RemoveIndicator -{ - TrackChanges(new java.lang.String[][] { new java.lang.String[] { "nl_NL", "Hou alleen de wijzigingen bij" }, new java.lang.String[] { "en_US", "Track changes" }, new java.lang.String[] { "en_GB", "Track changes" }, new java.lang.String[] { "en_ZA", "Track changes" } }), - RemoveUnchangedObjects(new java.lang.String[][] { new java.lang.String[] { "nl_NL", "Verwijder alle ongewijzigde objecten" }, new java.lang.String[] { "en_US", "Remove unchanged objects" }, new java.lang.String[] { "en_GB", "Remove unchanged objects" }, new java.lang.String[] { "en_ZA", "Remove unchanged objects" } }), - Nothing(new java.lang.String[][] { new java.lang.String[] { "nl_NL", "Niets" }, new java.lang.String[] { "en_US", "Nothing" }, new java.lang.String[] { "en_GB", "Nothing" }, new java.lang.String[] { "en_ZA", "Nothing" } }); - - private java.util.Map captions; - - private RemoveIndicator(java.lang.String[][] captionStrings) - { - this.captions = new java.util.HashMap(); - for (java.lang.String[] captionString : captionStrings) - captions.put(captionString[0], captionString[1]); - } - - public java.lang.String getCaption(java.lang.String languageCode) - { - if (captions.containsKey(languageCode)) - return captions.get(languageCode); - return captions.get("en_US"); - } - - public java.lang.String getCaption() - { - return captions.get("en_US"); - } -} diff --git a/javasource/excelimporter/proxies/StatisticsLevel.java b/javasource/excelimporter/proxies/StatisticsLevel.java deleted file mode 100644 index d5796dc..0000000 --- a/javasource/excelimporter/proxies/StatisticsLevel.java +++ /dev/null @@ -1,33 +0,0 @@ -// This file was generated by Mendix Modeler. -// -// WARNING: Code you write here will be lost the next time you deploy the project. - -package excelimporter.proxies; - -public enum StatisticsLevel -{ - AllStatistics(new java.lang.String[][] { new java.lang.String[] { "en_US", "All Statistics" }, new java.lang.String[] { "nl_NL", "Alle Statistieken" }, new java.lang.String[] { "en_GB", "All Statistics" }, new java.lang.String[] { "en_ZA", "All Statistics" } }), - OnlyFinalStatistics(new java.lang.String[][] { new java.lang.String[] { "en_US", "Only Final Statistics" }, new java.lang.String[] { "nl_NL", "Alleen volledige statistieken" }, new java.lang.String[] { "en_GB", "Only Final Statistics" }, new java.lang.String[] { "en_ZA", "Only Final Statistics" } }), - NoStatistics(new java.lang.String[][] { new java.lang.String[] { "en_US", "No Statistics" }, new java.lang.String[] { "nl_NL", "Geen Statistieken" }, new java.lang.String[] { "en_GB", "No Statistics" }, new java.lang.String[] { "en_ZA", "No Statistics" } }); - - private java.util.Map captions; - - private StatisticsLevel(java.lang.String[][] captionStrings) - { - this.captions = new java.util.HashMap(); - for (java.lang.String[] captionString : captionStrings) - captions.put(captionString[0], captionString[1]); - } - - public java.lang.String getCaption(java.lang.String languageCode) - { - if (captions.containsKey(languageCode)) - return captions.get(languageCode); - return captions.get("en_US"); - } - - public java.lang.String getCaption() - { - return captions.get("en_US"); - } -} diff --git a/javasource/excelimporter/proxies/Status.java b/javasource/excelimporter/proxies/Status.java deleted file mode 100644 index 3da8978..0000000 --- a/javasource/excelimporter/proxies/Status.java +++ /dev/null @@ -1,33 +0,0 @@ -// This file was generated by Mendix Modeler. -// -// WARNING: Code you write here will be lost the next time you deploy the project. - -package excelimporter.proxies; - -public enum Status -{ - INFO(new java.lang.String[][] { new java.lang.String[] { "en_US", "INFO" }, new java.lang.String[] { "nl_NL", "INFO" }, new java.lang.String[] { "en_GB", "INFO" }, new java.lang.String[] { "en_ZA", "INFO" } }), - VALID(new java.lang.String[][] { new java.lang.String[] { "en_US", "Valid" }, new java.lang.String[] { "nl_NL", "Geldig" }, new java.lang.String[] { "en_GB", "Valid" }, new java.lang.String[] { "en_ZA", "Valid" } }), - INVALID(new java.lang.String[][] { new java.lang.String[] { "en_US", "INVALID" }, new java.lang.String[] { "nl_NL", "INVALID" }, new java.lang.String[] { "en_GB", "INVALID" }, new java.lang.String[] { "en_ZA", "INVALID" } }); - - private java.util.Map captions; - - private Status(java.lang.String[][] captionStrings) - { - this.captions = new java.util.HashMap(); - for (java.lang.String[] captionString : captionStrings) - captions.put(captionString[0], captionString[1]); - } - - public java.lang.String getCaption(java.lang.String languageCode) - { - if (captions.containsKey(languageCode)) - return captions.get(languageCode); - return captions.get("en_US"); - } - - public java.lang.String getCaption() - { - return captions.get("en_US"); - } -} diff --git a/javasource/excelimporter/proxies/Template.java b/javasource/excelimporter/proxies/Template.java deleted file mode 100644 index 3c5b670..0000000 --- a/javasource/excelimporter/proxies/Template.java +++ /dev/null @@ -1,707 +0,0 @@ -// This file was generated by Mendix Modeler. -// -// WARNING: Code you write here will be lost the next time you deploy the project. - -package excelimporter.proxies; - -/** - * The template is the starting entity for the excel module. This wrapper contains all the settings for the excel import. - * Within this template several columns can be added. - */ -public class Template -{ - private final com.mendix.systemwideinterfaces.core.IMendixObject templateMendixObject; - - private final com.mendix.systemwideinterfaces.core.IContext context; - - /** - * Internal name of this entity - */ - public static final java.lang.String entityName = "ExcelImporter.Template"; - - /** - * Enum describing members of this entity - */ - public enum MemberNames - { - Nr("Nr"), - Title("Title"), - Description("Description"), - SheetIndex("SheetIndex"), - HeaderRowNumber("HeaderRowNumber"), - FirstDataRowNumber("FirstDataRowNumber"), - Status("Status"), - ImportAction("ImportAction"), - TemplateType("TemplateType"), - Template_AdditionalProperties("ExcelImporter.Template_AdditionalProperties"), - Template_MasterTemplate("ExcelImporter.Template_MasterTemplate"), - Template_MxObjectType("ExcelImporter.Template_MxObjectType"), - Template_MxObjectReference_ParentAssociation("ExcelImporter.Template_MxObjectReference_ParentAssociation"); - - private java.lang.String metaName; - - MemberNames(java.lang.String s) - { - metaName = s; - } - - @java.lang.Override - public java.lang.String toString() - { - return metaName; - } - } - - public Template(com.mendix.systemwideinterfaces.core.IContext context) - { - this(context, com.mendix.core.Core.instantiate(context, "ExcelImporter.Template")); - } - - protected Template(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixObject templateMendixObject) - { - if (templateMendixObject == null) - throw new java.lang.IllegalArgumentException("The given object cannot be null."); - if (!com.mendix.core.Core.isSubClassOf("ExcelImporter.Template", templateMendixObject.getType())) - throw new java.lang.IllegalArgumentException("The given object is not a ExcelImporter.Template"); - - this.templateMendixObject = templateMendixObject; - this.context = context; - } - - /** - * @deprecated Use 'Template.load(IContext, IMendixIdentifier)' instead. - */ - @java.lang.Deprecated - public static excelimporter.proxies.Template initialize(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixIdentifier mendixIdentifier) throws com.mendix.core.CoreException - { - return excelimporter.proxies.Template.load(context, mendixIdentifier); - } - - /** - * Initialize a proxy using context (recommended). This context will be used for security checking when the get- and set-methods without context parameters are called. - * The get- and set-methods with context parameter should be used when for instance sudo access is necessary (IContext.createSudoClone() can be used to obtain sudo access). - */ - public static excelimporter.proxies.Template initialize(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixObject mendixObject) - { - return new excelimporter.proxies.Template(context, mendixObject); - } - - public static excelimporter.proxies.Template load(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixIdentifier mendixIdentifier) throws com.mendix.core.CoreException - { - com.mendix.systemwideinterfaces.core.IMendixObject mendixObject = com.mendix.core.Core.retrieveId(context, mendixIdentifier); - return excelimporter.proxies.Template.initialize(context, mendixObject); - } - - public static java.util.List load(com.mendix.systemwideinterfaces.core.IContext context, java.lang.String xpathConstraint) throws com.mendix.core.CoreException - { - java.util.List result = new java.util.ArrayList(); - for (com.mendix.systemwideinterfaces.core.IMendixObject obj : com.mendix.core.Core.retrieveXPathQuery(context, "//ExcelImporter.Template" + xpathConstraint)) - result.add(excelimporter.proxies.Template.initialize(context, obj)); - return result; - } - - /** - * Commit the changes made on this proxy object. - */ - public final void commit() throws com.mendix.core.CoreException - { - com.mendix.core.Core.commit(context, getMendixObject()); - } - - /** - * Commit the changes made on this proxy object using the specified context. - */ - public final void commit(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException - { - com.mendix.core.Core.commit(context, getMendixObject()); - } - - /** - * Delete the object. - */ - public final void delete() - { - com.mendix.core.Core.delete(context, getMendixObject()); - } - - /** - * Delete the object using the specified context. - */ - public final void delete(com.mendix.systemwideinterfaces.core.IContext context) - { - com.mendix.core.Core.delete(context, getMendixObject()); - } - /** - * @return value of Nr - */ - public final java.lang.Long getNr() - { - return getNr(getContext()); - } - - /** - * @param context - * @return value of Nr - */ - public final java.lang.Long getNr(com.mendix.systemwideinterfaces.core.IContext context) - { - return (java.lang.Long) getMendixObject().getValue(context, MemberNames.Nr.toString()); - } - - /** - * Set value of Nr - * @param nr - */ - public final void setNr(java.lang.Long nr) - { - setNr(getContext(), nr); - } - - /** - * Set value of Nr - * @param context - * @param nr - */ - public final void setNr(com.mendix.systemwideinterfaces.core.IContext context, java.lang.Long nr) - { - getMendixObject().setValue(context, MemberNames.Nr.toString(), nr); - } - - /** - * @return value of Title - */ - public final java.lang.String getTitle() - { - return getTitle(getContext()); - } - - /** - * @param context - * @return value of Title - */ - public final java.lang.String getTitle(com.mendix.systemwideinterfaces.core.IContext context) - { - return (java.lang.String) getMendixObject().getValue(context, MemberNames.Title.toString()); - } - - /** - * Set value of Title - * @param title - */ - public final void setTitle(java.lang.String title) - { - setTitle(getContext(), title); - } - - /** - * Set value of Title - * @param context - * @param title - */ - public final void setTitle(com.mendix.systemwideinterfaces.core.IContext context, java.lang.String title) - { - getMendixObject().setValue(context, MemberNames.Title.toString(), title); - } - - /** - * @return value of Description - */ - public final java.lang.String getDescription() - { - return getDescription(getContext()); - } - - /** - * @param context - * @return value of Description - */ - public final java.lang.String getDescription(com.mendix.systemwideinterfaces.core.IContext context) - { - return (java.lang.String) getMendixObject().getValue(context, MemberNames.Description.toString()); - } - - /** - * Set value of Description - * @param description - */ - public final void setDescription(java.lang.String description) - { - setDescription(getContext(), description); - } - - /** - * Set value of Description - * @param context - * @param description - */ - public final void setDescription(com.mendix.systemwideinterfaces.core.IContext context, java.lang.String description) - { - getMendixObject().setValue(context, MemberNames.Description.toString(), description); - } - - /** - * @return value of SheetIndex - */ - public final java.lang.Integer getSheetIndex() - { - return getSheetIndex(getContext()); - } - - /** - * @param context - * @return value of SheetIndex - */ - public final java.lang.Integer getSheetIndex(com.mendix.systemwideinterfaces.core.IContext context) - { - return (java.lang.Integer) getMendixObject().getValue(context, MemberNames.SheetIndex.toString()); - } - - /** - * Set value of SheetIndex - * @param sheetindex - */ - public final void setSheetIndex(java.lang.Integer sheetindex) - { - setSheetIndex(getContext(), sheetindex); - } - - /** - * Set value of SheetIndex - * @param context - * @param sheetindex - */ - public final void setSheetIndex(com.mendix.systemwideinterfaces.core.IContext context, java.lang.Integer sheetindex) - { - getMendixObject().setValue(context, MemberNames.SheetIndex.toString(), sheetindex); - } - - /** - * @return value of HeaderRowNumber - */ - public final java.lang.Integer getHeaderRowNumber() - { - return getHeaderRowNumber(getContext()); - } - - /** - * @param context - * @return value of HeaderRowNumber - */ - public final java.lang.Integer getHeaderRowNumber(com.mendix.systemwideinterfaces.core.IContext context) - { - return (java.lang.Integer) getMendixObject().getValue(context, MemberNames.HeaderRowNumber.toString()); - } - - /** - * Set value of HeaderRowNumber - * @param headerrownumber - */ - public final void setHeaderRowNumber(java.lang.Integer headerrownumber) - { - setHeaderRowNumber(getContext(), headerrownumber); - } - - /** - * Set value of HeaderRowNumber - * @param context - * @param headerrownumber - */ - public final void setHeaderRowNumber(com.mendix.systemwideinterfaces.core.IContext context, java.lang.Integer headerrownumber) - { - getMendixObject().setValue(context, MemberNames.HeaderRowNumber.toString(), headerrownumber); - } - - /** - * @return value of FirstDataRowNumber - */ - public final java.lang.Integer getFirstDataRowNumber() - { - return getFirstDataRowNumber(getContext()); - } - - /** - * @param context - * @return value of FirstDataRowNumber - */ - public final java.lang.Integer getFirstDataRowNumber(com.mendix.systemwideinterfaces.core.IContext context) - { - return (java.lang.Integer) getMendixObject().getValue(context, MemberNames.FirstDataRowNumber.toString()); - } - - /** - * Set value of FirstDataRowNumber - * @param firstdatarownumber - */ - public final void setFirstDataRowNumber(java.lang.Integer firstdatarownumber) - { - setFirstDataRowNumber(getContext(), firstdatarownumber); - } - - /** - * Set value of FirstDataRowNumber - * @param context - * @param firstdatarownumber - */ - public final void setFirstDataRowNumber(com.mendix.systemwideinterfaces.core.IContext context, java.lang.Integer firstdatarownumber) - { - getMendixObject().setValue(context, MemberNames.FirstDataRowNumber.toString(), firstdatarownumber); - } - - /** - * Set value of Status - * @param status - */ - public final excelimporter.proxies.Status getStatus() - { - return getStatus(getContext()); - } - - /** - * @param context - * @return value of Status - */ - public final excelimporter.proxies.Status getStatus(com.mendix.systemwideinterfaces.core.IContext context) - { - Object obj = getMendixObject().getValue(context, MemberNames.Status.toString()); - if (obj == null) - return null; - - return excelimporter.proxies.Status.valueOf((java.lang.String) obj); - } - - /** - * Set value of Status - * @param status - */ - public final void setStatus(excelimporter.proxies.Status status) - { - setStatus(getContext(), status); - } - - /** - * Set value of Status - * @param context - * @param status - */ - public final void setStatus(com.mendix.systemwideinterfaces.core.IContext context, excelimporter.proxies.Status status) - { - if (status != null) - getMendixObject().setValue(context, MemberNames.Status.toString(), status.toString()); - else - getMendixObject().setValue(context, MemberNames.Status.toString(), null); - } - - /** - * Set value of ImportAction - * @param importaction - */ - public final excelimporter.proxies.ImportActions getImportAction() - { - return getImportAction(getContext()); - } - - /** - * @param context - * @return value of ImportAction - */ - public final excelimporter.proxies.ImportActions getImportAction(com.mendix.systemwideinterfaces.core.IContext context) - { - Object obj = getMendixObject().getValue(context, MemberNames.ImportAction.toString()); - if (obj == null) - return null; - - return excelimporter.proxies.ImportActions.valueOf((java.lang.String) obj); - } - - /** - * Set value of ImportAction - * @param importaction - */ - public final void setImportAction(excelimporter.proxies.ImportActions importaction) - { - setImportAction(getContext(), importaction); - } - - /** - * Set value of ImportAction - * @param context - * @param importaction - */ - public final void setImportAction(com.mendix.systemwideinterfaces.core.IContext context, excelimporter.proxies.ImportActions importaction) - { - if (importaction != null) - getMendixObject().setValue(context, MemberNames.ImportAction.toString(), importaction.toString()); - else - getMendixObject().setValue(context, MemberNames.ImportAction.toString(), null); - } - - /** - * Set value of TemplateType - * @param templatetype - */ - public final excelimporter.proxies.TemplateType getTemplateType() - { - return getTemplateType(getContext()); - } - - /** - * @param context - * @return value of TemplateType - */ - public final excelimporter.proxies.TemplateType getTemplateType(com.mendix.systemwideinterfaces.core.IContext context) - { - Object obj = getMendixObject().getValue(context, MemberNames.TemplateType.toString()); - if (obj == null) - return null; - - return excelimporter.proxies.TemplateType.valueOf((java.lang.String) obj); - } - - /** - * Set value of TemplateType - * @param templatetype - */ - public final void setTemplateType(excelimporter.proxies.TemplateType templatetype) - { - setTemplateType(getContext(), templatetype); - } - - /** - * Set value of TemplateType - * @param context - * @param templatetype - */ - public final void setTemplateType(com.mendix.systemwideinterfaces.core.IContext context, excelimporter.proxies.TemplateType templatetype) - { - if (templatetype != null) - getMendixObject().setValue(context, MemberNames.TemplateType.toString(), templatetype.toString()); - else - getMendixObject().setValue(context, MemberNames.TemplateType.toString(), null); - } - - /** - * @return value of Template_AdditionalProperties - */ - public final excelimporter.proxies.AdditionalProperties getTemplate_AdditionalProperties() throws com.mendix.core.CoreException - { - return getTemplate_AdditionalProperties(getContext()); - } - - /** - * @param context - * @return value of Template_AdditionalProperties - */ - public final excelimporter.proxies.AdditionalProperties getTemplate_AdditionalProperties(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException - { - excelimporter.proxies.AdditionalProperties result = null; - com.mendix.systemwideinterfaces.core.IMendixIdentifier identifier = getMendixObject().getValue(context, MemberNames.Template_AdditionalProperties.toString()); - if (identifier != null) - result = excelimporter.proxies.AdditionalProperties.load(context, identifier); - return result; - } - - /** - * Set value of Template_AdditionalProperties - * @param template_additionalproperties - */ - public final void setTemplate_AdditionalProperties(excelimporter.proxies.AdditionalProperties template_additionalproperties) - { - setTemplate_AdditionalProperties(getContext(), template_additionalproperties); - } - - /** - * Set value of Template_AdditionalProperties - * @param context - * @param template_additionalproperties - */ - public final void setTemplate_AdditionalProperties(com.mendix.systemwideinterfaces.core.IContext context, excelimporter.proxies.AdditionalProperties template_additionalproperties) - { - if (template_additionalproperties == null) - getMendixObject().setValue(context, MemberNames.Template_AdditionalProperties.toString(), null); - else - getMendixObject().setValue(context, MemberNames.Template_AdditionalProperties.toString(), template_additionalproperties.getMendixObject().getId()); - } - - /** - * @return value of Template_MasterTemplate - */ - public final excelimporter.proxies.Template getTemplate_MasterTemplate() throws com.mendix.core.CoreException - { - return getTemplate_MasterTemplate(getContext()); - } - - /** - * @param context - * @return value of Template_MasterTemplate - */ - public final excelimporter.proxies.Template getTemplate_MasterTemplate(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException - { - excelimporter.proxies.Template result = null; - com.mendix.systemwideinterfaces.core.IMendixIdentifier identifier = getMendixObject().getValue(context, MemberNames.Template_MasterTemplate.toString()); - if (identifier != null) - result = excelimporter.proxies.Template.load(context, identifier); - return result; - } - - /** - * Set value of Template_MasterTemplate - * @param template_mastertemplate - */ - public final void setTemplate_MasterTemplate(excelimporter.proxies.Template template_mastertemplate) - { - setTemplate_MasterTemplate(getContext(), template_mastertemplate); - } - - /** - * Set value of Template_MasterTemplate - * @param context - * @param template_mastertemplate - */ - public final void setTemplate_MasterTemplate(com.mendix.systemwideinterfaces.core.IContext context, excelimporter.proxies.Template template_mastertemplate) - { - if (template_mastertemplate == null) - getMendixObject().setValue(context, MemberNames.Template_MasterTemplate.toString(), null); - else - getMendixObject().setValue(context, MemberNames.Template_MasterTemplate.toString(), template_mastertemplate.getMendixObject().getId()); - } - - /** - * @return value of Template_MxObjectType - */ - public final mxmodelreflection.proxies.MxObjectType getTemplate_MxObjectType() throws com.mendix.core.CoreException - { - return getTemplate_MxObjectType(getContext()); - } - - /** - * @param context - * @return value of Template_MxObjectType - */ - public final mxmodelreflection.proxies.MxObjectType getTemplate_MxObjectType(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException - { - mxmodelreflection.proxies.MxObjectType result = null; - com.mendix.systemwideinterfaces.core.IMendixIdentifier identifier = getMendixObject().getValue(context, MemberNames.Template_MxObjectType.toString()); - if (identifier != null) - result = mxmodelreflection.proxies.MxObjectType.load(context, identifier); - return result; - } - - /** - * Set value of Template_MxObjectType - * @param template_mxobjecttype - */ - public final void setTemplate_MxObjectType(mxmodelreflection.proxies.MxObjectType template_mxobjecttype) - { - setTemplate_MxObjectType(getContext(), template_mxobjecttype); - } - - /** - * Set value of Template_MxObjectType - * @param context - * @param template_mxobjecttype - */ - public final void setTemplate_MxObjectType(com.mendix.systemwideinterfaces.core.IContext context, mxmodelreflection.proxies.MxObjectType template_mxobjecttype) - { - if (template_mxobjecttype == null) - getMendixObject().setValue(context, MemberNames.Template_MxObjectType.toString(), null); - else - getMendixObject().setValue(context, MemberNames.Template_MxObjectType.toString(), template_mxobjecttype.getMendixObject().getId()); - } - - /** - * @return value of Template_MxObjectReference_ParentAssociation - */ - public final mxmodelreflection.proxies.MxObjectReference getTemplate_MxObjectReference_ParentAssociation() throws com.mendix.core.CoreException - { - return getTemplate_MxObjectReference_ParentAssociation(getContext()); - } - - /** - * @param context - * @return value of Template_MxObjectReference_ParentAssociation - */ - public final mxmodelreflection.proxies.MxObjectReference getTemplate_MxObjectReference_ParentAssociation(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException - { - mxmodelreflection.proxies.MxObjectReference result = null; - com.mendix.systemwideinterfaces.core.IMendixIdentifier identifier = getMendixObject().getValue(context, MemberNames.Template_MxObjectReference_ParentAssociation.toString()); - if (identifier != null) - result = mxmodelreflection.proxies.MxObjectReference.load(context, identifier); - return result; - } - - /** - * Set value of Template_MxObjectReference_ParentAssociation - * @param template_mxobjectreference_parentassociation - */ - public final void setTemplate_MxObjectReference_ParentAssociation(mxmodelreflection.proxies.MxObjectReference template_mxobjectreference_parentassociation) - { - setTemplate_MxObjectReference_ParentAssociation(getContext(), template_mxobjectreference_parentassociation); - } - - /** - * Set value of Template_MxObjectReference_ParentAssociation - * @param context - * @param template_mxobjectreference_parentassociation - */ - public final void setTemplate_MxObjectReference_ParentAssociation(com.mendix.systemwideinterfaces.core.IContext context, mxmodelreflection.proxies.MxObjectReference template_mxobjectreference_parentassociation) - { - if (template_mxobjectreference_parentassociation == null) - getMendixObject().setValue(context, MemberNames.Template_MxObjectReference_ParentAssociation.toString(), null); - else - getMendixObject().setValue(context, MemberNames.Template_MxObjectReference_ParentAssociation.toString(), template_mxobjectreference_parentassociation.getMendixObject().getId()); - } - - /** - * @return the IMendixObject instance of this proxy for use in the Core interface. - */ - public final com.mendix.systemwideinterfaces.core.IMendixObject getMendixObject() - { - return templateMendixObject; - } - - /** - * @return the IContext instance of this proxy, or null if no IContext instance was specified at initialization. - */ - public final com.mendix.systemwideinterfaces.core.IContext getContext() - { - return context; - } - - @java.lang.Override - public boolean equals(Object obj) - { - if (obj == this) - return true; - - if (obj != null && getClass().equals(obj.getClass())) - { - final excelimporter.proxies.Template that = (excelimporter.proxies.Template) obj; - return getMendixObject().equals(that.getMendixObject()); - } - return false; - } - - @java.lang.Override - public int hashCode() - { - return getMendixObject().hashCode(); - } - - /** - * @return String name of this class - */ - public static java.lang.String getType() - { - return "ExcelImporter.Template"; - } - - /** - * @return String GUID from this object, format: ID_0000000000 - * @deprecated Use getMendixObject().getId().toLong() to get a unique identifier for this object. - */ - @java.lang.Deprecated - public java.lang.String getGUID() - { - return "ID_" + getMendixObject().getId().toLong(); - } -} diff --git a/javasource/excelimporter/proxies/TemplateDocument.java b/javasource/excelimporter/proxies/TemplateDocument.java deleted file mode 100644 index 122d695..0000000 --- a/javasource/excelimporter/proxies/TemplateDocument.java +++ /dev/null @@ -1,169 +0,0 @@ -// This file was generated by Mendix Modeler. -// -// WARNING: Code you write here will be lost the next time you deploy the project. - -package excelimporter.proxies; - -/** - * The TemplateDocument acts as a file which can be used for two purposes, 1. generate a template, 2. Import the excel sheet using the associated template - */ -public class TemplateDocument extends system.proxies.FileDocument -{ - /** - * Internal name of this entity - */ - public static final java.lang.String entityName = "ExcelImporter.TemplateDocument"; - - /** - * Enum describing members of this entity - */ - public enum MemberNames - { - FileID("FileID"), - Name("Name"), - DeleteAfterDownload("DeleteAfterDownload"), - Contents("Contents"), - HasContents("HasContents"), - Size("Size"), - TemplateDocument_Template("ExcelImporter.TemplateDocument_Template"); - - private java.lang.String metaName; - - MemberNames(java.lang.String s) - { - metaName = s; - } - - @java.lang.Override - public java.lang.String toString() - { - return metaName; - } - } - - public TemplateDocument(com.mendix.systemwideinterfaces.core.IContext context) - { - this(context, com.mendix.core.Core.instantiate(context, "ExcelImporter.TemplateDocument")); - } - - protected TemplateDocument(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixObject templateDocumentMendixObject) - { - super(context, templateDocumentMendixObject); - if (!com.mendix.core.Core.isSubClassOf("ExcelImporter.TemplateDocument", templateDocumentMendixObject.getType())) - throw new java.lang.IllegalArgumentException("The given object is not a ExcelImporter.TemplateDocument"); - } - - /** - * @deprecated Use 'TemplateDocument.load(IContext, IMendixIdentifier)' instead. - */ - @java.lang.Deprecated - public static excelimporter.proxies.TemplateDocument initialize(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixIdentifier mendixIdentifier) throws com.mendix.core.CoreException - { - return excelimporter.proxies.TemplateDocument.load(context, mendixIdentifier); - } - - /** - * Initialize a proxy using context (recommended). This context will be used for security checking when the get- and set-methods without context parameters are called. - * The get- and set-methods with context parameter should be used when for instance sudo access is necessary (IContext.createSudoClone() can be used to obtain sudo access). - */ - public static excelimporter.proxies.TemplateDocument initialize(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixObject mendixObject) - { - return new excelimporter.proxies.TemplateDocument(context, mendixObject); - } - - public static excelimporter.proxies.TemplateDocument load(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixIdentifier mendixIdentifier) throws com.mendix.core.CoreException - { - com.mendix.systemwideinterfaces.core.IMendixObject mendixObject = com.mendix.core.Core.retrieveId(context, mendixIdentifier); - return excelimporter.proxies.TemplateDocument.initialize(context, mendixObject); - } - - public static java.util.List load(com.mendix.systemwideinterfaces.core.IContext context, java.lang.String xpathConstraint) throws com.mendix.core.CoreException - { - java.util.List result = new java.util.ArrayList(); - for (com.mendix.systemwideinterfaces.core.IMendixObject obj : com.mendix.core.Core.retrieveXPathQuery(context, "//ExcelImporter.TemplateDocument" + xpathConstraint)) - result.add(excelimporter.proxies.TemplateDocument.initialize(context, obj)); - return result; - } - - /** - * @return value of TemplateDocument_Template - */ - public final excelimporter.proxies.Template getTemplateDocument_Template() throws com.mendix.core.CoreException - { - return getTemplateDocument_Template(getContext()); - } - - /** - * @param context - * @return value of TemplateDocument_Template - */ - public final excelimporter.proxies.Template getTemplateDocument_Template(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException - { - excelimporter.proxies.Template result = null; - com.mendix.systemwideinterfaces.core.IMendixIdentifier identifier = getMendixObject().getValue(context, MemberNames.TemplateDocument_Template.toString()); - if (identifier != null) - result = excelimporter.proxies.Template.load(context, identifier); - return result; - } - - /** - * Set value of TemplateDocument_Template - * @param templatedocument_template - */ - public final void setTemplateDocument_Template(excelimporter.proxies.Template templatedocument_template) - { - setTemplateDocument_Template(getContext(), templatedocument_template); - } - - /** - * Set value of TemplateDocument_Template - * @param context - * @param templatedocument_template - */ - public final void setTemplateDocument_Template(com.mendix.systemwideinterfaces.core.IContext context, excelimporter.proxies.Template templatedocument_template) - { - if (templatedocument_template == null) - getMendixObject().setValue(context, MemberNames.TemplateDocument_Template.toString(), null); - else - getMendixObject().setValue(context, MemberNames.TemplateDocument_Template.toString(), templatedocument_template.getMendixObject().getId()); - } - - @java.lang.Override - public boolean equals(Object obj) - { - if (obj == this) - return true; - - if (obj != null && getClass().equals(obj.getClass())) - { - final excelimporter.proxies.TemplateDocument that = (excelimporter.proxies.TemplateDocument) obj; - return getMendixObject().equals(that.getMendixObject()); - } - return false; - } - - @java.lang.Override - public int hashCode() - { - return getMendixObject().hashCode(); - } - - /** - * @return String name of this class - */ - public static java.lang.String getType() - { - return "ExcelImporter.TemplateDocument"; - } - - /** - * @return String GUID from this object, format: ID_0000000000 - * @deprecated Use getMendixObject().getId().toLong() to get a unique identifier for this object. - */ - @java.lang.Override - @java.lang.Deprecated - public java.lang.String getGUID() - { - return "ID_" + getMendixObject().getId().toLong(); - } -} diff --git a/javasource/excelimporter/proxies/TemplateType.java b/javasource/excelimporter/proxies/TemplateType.java deleted file mode 100644 index e6d3d22..0000000 --- a/javasource/excelimporter/proxies/TemplateType.java +++ /dev/null @@ -1,32 +0,0 @@ -// This file was generated by Mendix Modeler. -// -// WARNING: Code you write here will be lost the next time you deploy the project. - -package excelimporter.proxies; - -public enum TemplateType -{ - Normal(new java.lang.String[][] { new java.lang.String[] { "en_US", "Normal" }, new java.lang.String[] { "nl_NL", "Normaal" }, new java.lang.String[] { "en_GB", "Normal" }, new java.lang.String[] { "en_ZA", "Normal" } }), - Wizard(new java.lang.String[][] { new java.lang.String[] { "en_US", "Wizard" }, new java.lang.String[] { "nl_NL", "Wizard" }, new java.lang.String[] { "en_GB", "Wizard" }, new java.lang.String[] { "en_ZA", "Wizard" } }); - - private java.util.Map captions; - - private TemplateType(java.lang.String[][] captionStrings) - { - this.captions = new java.util.HashMap(); - for (java.lang.String[] captionString : captionStrings) - captions.put(captionString[0], captionString[1]); - } - - public java.lang.String getCaption(java.lang.String languageCode) - { - if (captions.containsKey(languageCode)) - return captions.get(languageCode); - return captions.get("en_US"); - } - - public java.lang.String getCaption() - { - return captions.get("en_US"); - } -} diff --git a/javasource/excelimporter/proxies/ValidationResult.java b/javasource/excelimporter/proxies/ValidationResult.java deleted file mode 100644 index 27bd9b2..0000000 --- a/javasource/excelimporter/proxies/ValidationResult.java +++ /dev/null @@ -1,41 +0,0 @@ -// This file was generated by Mendix Modeler. -// -// WARNING: Code you write here will be lost the next time you deploy the project. - -package excelimporter.proxies; - -public enum ValidationResult -{ - UnUsed(new java.lang.String[][] { new java.lang.String[] { "en_US", "UnUsed" }, new java.lang.String[] { "nl_NL", "Ongebruikt" }, new java.lang.String[] { "en_GB", "UnUsed" }, new java.lang.String[] { "en_ZA", "UnUsed" } }), - ValidAttribute(new java.lang.String[][] { new java.lang.String[] { "en_US", "ValidAttribute" }, new java.lang.String[] { "nl_NL", "Geldig attribuut" }, new java.lang.String[] { "en_GB", "ValidAttribute" }, new java.lang.String[] { "en_ZA", "ValidAttribute" } }), - ValidReference(new java.lang.String[][] { new java.lang.String[] { "en_US", "ValidReference" }, new java.lang.String[] { "nl_NL", "Geldige referentie" }, new java.lang.String[] { "en_GB", "ValidReference" }, new java.lang.String[] { "en_ZA", "ValidReference" } }), - NoReferenceSelected(new java.lang.String[][] { new java.lang.String[] { "en_US", "NoReferenceSelected" }, new java.lang.String[] { "nl_NL", "NoReferenceSelected" }, new java.lang.String[] { "en_GB", "NoReferenceSelected" }, new java.lang.String[] { "en_ZA", "NoReferenceSelected" } }), - NoReferencedObjectSelected(new java.lang.String[][] { new java.lang.String[] { "en_US", "NoReferencedObjectSelected" }, new java.lang.String[] { "nl_NL", "NoReferencedObjectSelected" }, new java.lang.String[] { "en_GB", "NoReferencedObjectSelected" }, new java.lang.String[] { "en_ZA", "NoReferencedObjectSelected" } }), - NoAttributeSelected(new java.lang.String[][] { new java.lang.String[] { "en_US", "NoAttributeSelected" }, new java.lang.String[] { "nl_NL", "NoAttributeSelected" }, new java.lang.String[] { "en_GB", "NoAttributeSelected" }, new java.lang.String[] { "en_ZA", "NoAttributeSelected" } }), - InvalidAttribute(new java.lang.String[][] { new java.lang.String[] { "en_US", "InvalidAttribute" }, new java.lang.String[] { "nl_NL", "Ongeldig attribuut" }, new java.lang.String[] { "en_GB", "InvalidAttribute" }, new java.lang.String[] { "en_ZA", "InvalidAttribute" } }), - InvalidReference(new java.lang.String[][] { new java.lang.String[] { "en_US", "InvalidReference" }, new java.lang.String[] { "nl_NL", "Ongeldige referentie" }, new java.lang.String[] { "en_GB", "InvalidReference" }, new java.lang.String[] { "en_ZA", "InvalidReference" } }), - InvalidReferencedObject(new java.lang.String[][] { new java.lang.String[] { "en_US", "InvalidReferencedObject" }, new java.lang.String[] { "nl_NL", "Ongeldig gerefereerd object" }, new java.lang.String[] { "en_GB", "InvalidReferencedObject" }, new java.lang.String[] { "en_ZA", "InvalidReferencedObject" } }), - NoAssociationKeys(new java.lang.String[][] { new java.lang.String[] { "en_US", "No key columns for the association" }, new java.lang.String[] { "nl_NL", "Geen sleutel kolommen voor de associatie" }, new java.lang.String[] { "en_GB", "No key columns for the association" }, new java.lang.String[] { "en_ZA", "No key columns for the association" } }), - InvalidAutoNumberSelection(new java.lang.String[][] { new java.lang.String[] { "en_US", "InvalidAutoNumberSelection" }, new java.lang.String[] { "nl_NL", "InvalidAutoNumberSelection" }, new java.lang.String[] { "en_GB", "InvalidAutoNumberSelection" }, new java.lang.String[] { "en_ZA", "InvalidAutoNumberSelection" } }); - - private java.util.Map captions; - - private ValidationResult(java.lang.String[][] captionStrings) - { - this.captions = new java.util.HashMap(); - for (java.lang.String[] captionString : captionStrings) - captions.put(captionString[0], captionString[1]); - } - - public java.lang.String getCaption(java.lang.String languageCode) - { - if (captions.containsKey(languageCode)) - return captions.get(languageCode); - return captions.get("en_US"); - } - - public java.lang.String getCaption() - { - return captions.get("en_US"); - } -} diff --git a/javasource/excelimporter/proxies/ValidationResult2.java b/javasource/excelimporter/proxies/ValidationResult2.java deleted file mode 100644 index 8c0887a..0000000 --- a/javasource/excelimporter/proxies/ValidationResult2.java +++ /dev/null @@ -1,34 +0,0 @@ -// This file was generated by Mendix Modeler. -// -// WARNING: Code you write here will be lost the next time you deploy the project. - -package excelimporter.proxies; - -public enum ValidationResult2 -{ - NoInputParams(new java.lang.String[][] { new java.lang.String[] { "en_US", "NoInputParams" }, new java.lang.String[] { "nl_NL", "NoInputParams" }, new java.lang.String[] { "en_GB", "NoInputParams" }, new java.lang.String[] { "en_ZA", "NoInputParams" } }), - WrongNrOfInputParams(new java.lang.String[][] { new java.lang.String[] { "en_US", "WrongNrOfInputParams" }, new java.lang.String[] { "nl_NL", "WrongNrOfInputParams" }, new java.lang.String[] { "en_GB", "WrongNrOfInputParams" }, new java.lang.String[] { "en_ZA", "WrongNrOfInputParams" } }), - WrongReturnType(new java.lang.String[][] { new java.lang.String[] { "en_US", "WrongReturnType" }, new java.lang.String[] { "nl_NL", "WrongReturnType" }, new java.lang.String[] { "en_GB", "WrongReturnType" }, new java.lang.String[] { "en_ZA", "WrongReturnType" } }), - Valid(new java.lang.String[][] { new java.lang.String[] { "en_US", "Valid" }, new java.lang.String[] { "nl_NL", "Geldig" }, new java.lang.String[] { "en_GB", "Valid" }, new java.lang.String[] { "en_ZA", "Valid" } }); - - private java.util.Map captions; - - private ValidationResult2(java.lang.String[][] captionStrings) - { - this.captions = new java.util.HashMap(); - for (java.lang.String[] captionString : captionStrings) - captions.put(captionString[0], captionString[1]); - } - - public java.lang.String getCaption(java.lang.String languageCode) - { - if (captions.containsKey(languageCode)) - return captions.get(languageCode); - return captions.get("en_US"); - } - - public java.lang.String getCaption() - { - return captions.get("en_US"); - } -} diff --git a/javasource/excelimporter/proxies/XMLDocumentTemplate.java b/javasource/excelimporter/proxies/XMLDocumentTemplate.java deleted file mode 100644 index 2a5ad75..0000000 --- a/javasource/excelimporter/proxies/XMLDocumentTemplate.java +++ /dev/null @@ -1,166 +0,0 @@ -// This file was generated by Mendix Modeler. -// -// WARNING: Code you write here will be lost the next time you deploy the project. - -package excelimporter.proxies; - -public class XMLDocumentTemplate extends system.proxies.FileDocument -{ - /** - * Internal name of this entity - */ - public static final java.lang.String entityName = "ExcelImporter.XMLDocumentTemplate"; - - /** - * Enum describing members of this entity - */ - public enum MemberNames - { - FileID("FileID"), - Name("Name"), - DeleteAfterDownload("DeleteAfterDownload"), - Contents("Contents"), - HasContents("HasContents"), - Size("Size"), - XMLDocumentTemplate_Template("ExcelImporter.XMLDocumentTemplate_Template"); - - private java.lang.String metaName; - - MemberNames(java.lang.String s) - { - metaName = s; - } - - @java.lang.Override - public java.lang.String toString() - { - return metaName; - } - } - - public XMLDocumentTemplate(com.mendix.systemwideinterfaces.core.IContext context) - { - this(context, com.mendix.core.Core.instantiate(context, "ExcelImporter.XMLDocumentTemplate")); - } - - protected XMLDocumentTemplate(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixObject xMLDocumentTemplateMendixObject) - { - super(context, xMLDocumentTemplateMendixObject); - if (!com.mendix.core.Core.isSubClassOf("ExcelImporter.XMLDocumentTemplate", xMLDocumentTemplateMendixObject.getType())) - throw new java.lang.IllegalArgumentException("The given object is not a ExcelImporter.XMLDocumentTemplate"); - } - - /** - * @deprecated Use 'XMLDocumentTemplate.load(IContext, IMendixIdentifier)' instead. - */ - @java.lang.Deprecated - public static excelimporter.proxies.XMLDocumentTemplate initialize(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixIdentifier mendixIdentifier) throws com.mendix.core.CoreException - { - return excelimporter.proxies.XMLDocumentTemplate.load(context, mendixIdentifier); - } - - /** - * Initialize a proxy using context (recommended). This context will be used for security checking when the get- and set-methods without context parameters are called. - * The get- and set-methods with context parameter should be used when for instance sudo access is necessary (IContext.createSudoClone() can be used to obtain sudo access). - */ - public static excelimporter.proxies.XMLDocumentTemplate initialize(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixObject mendixObject) - { - return new excelimporter.proxies.XMLDocumentTemplate(context, mendixObject); - } - - public static excelimporter.proxies.XMLDocumentTemplate load(com.mendix.systemwideinterfaces.core.IContext context, com.mendix.systemwideinterfaces.core.IMendixIdentifier mendixIdentifier) throws com.mendix.core.CoreException - { - com.mendix.systemwideinterfaces.core.IMendixObject mendixObject = com.mendix.core.Core.retrieveId(context, mendixIdentifier); - return excelimporter.proxies.XMLDocumentTemplate.initialize(context, mendixObject); - } - - public static java.util.List load(com.mendix.systemwideinterfaces.core.IContext context, java.lang.String xpathConstraint) throws com.mendix.core.CoreException - { - java.util.List result = new java.util.ArrayList(); - for (com.mendix.systemwideinterfaces.core.IMendixObject obj : com.mendix.core.Core.retrieveXPathQuery(context, "//ExcelImporter.XMLDocumentTemplate" + xpathConstraint)) - result.add(excelimporter.proxies.XMLDocumentTemplate.initialize(context, obj)); - return result; - } - - /** - * @return value of XMLDocumentTemplate_Template - */ - public final excelimporter.proxies.Template getXMLDocumentTemplate_Template() throws com.mendix.core.CoreException - { - return getXMLDocumentTemplate_Template(getContext()); - } - - /** - * @param context - * @return value of XMLDocumentTemplate_Template - */ - public final excelimporter.proxies.Template getXMLDocumentTemplate_Template(com.mendix.systemwideinterfaces.core.IContext context) throws com.mendix.core.CoreException - { - excelimporter.proxies.Template result = null; - com.mendix.systemwideinterfaces.core.IMendixIdentifier identifier = getMendixObject().getValue(context, MemberNames.XMLDocumentTemplate_Template.toString()); - if (identifier != null) - result = excelimporter.proxies.Template.load(context, identifier); - return result; - } - - /** - * Set value of XMLDocumentTemplate_Template - * @param xmldocumenttemplate_template - */ - public final void setXMLDocumentTemplate_Template(excelimporter.proxies.Template xmldocumenttemplate_template) - { - setXMLDocumentTemplate_Template(getContext(), xmldocumenttemplate_template); - } - - /** - * Set value of XMLDocumentTemplate_Template - * @param context - * @param xmldocumenttemplate_template - */ - public final void setXMLDocumentTemplate_Template(com.mendix.systemwideinterfaces.core.IContext context, excelimporter.proxies.Template xmldocumenttemplate_template) - { - if (xmldocumenttemplate_template == null) - getMendixObject().setValue(context, MemberNames.XMLDocumentTemplate_Template.toString(), null); - else - getMendixObject().setValue(context, MemberNames.XMLDocumentTemplate_Template.toString(), xmldocumenttemplate_template.getMendixObject().getId()); - } - - @java.lang.Override - public boolean equals(Object obj) - { - if (obj == this) - return true; - - if (obj != null && getClass().equals(obj.getClass())) - { - final excelimporter.proxies.XMLDocumentTemplate that = (excelimporter.proxies.XMLDocumentTemplate) obj; - return getMendixObject().equals(that.getMendixObject()); - } - return false; - } - - @java.lang.Override - public int hashCode() - { - return getMendixObject().hashCode(); - } - - /** - * @return String name of this class - */ - public static java.lang.String getType() - { - return "ExcelImporter.XMLDocumentTemplate"; - } - - /** - * @return String GUID from this object, format: ID_0000000000 - * @deprecated Use getMendixObject().getId().toLong() to get a unique identifier for this object. - */ - @java.lang.Override - @java.lang.Deprecated - public java.lang.String getGUID() - { - return "ID_" + getMendixObject().getId().toLong(); - } -} diff --git a/javasource/excelimporter/proxies/YesNo.java b/javasource/excelimporter/proxies/YesNo.java deleted file mode 100644 index e789d27..0000000 --- a/javasource/excelimporter/proxies/YesNo.java +++ /dev/null @@ -1,32 +0,0 @@ -// This file was generated by Mendix Modeler. -// -// WARNING: Code you write here will be lost the next time you deploy the project. - -package excelimporter.proxies; - -public enum YesNo -{ - Yes(new java.lang.String[][] { new java.lang.String[] { "en_US", "Yes" }, new java.lang.String[] { "nl_NL", "Ja" }, new java.lang.String[] { "en_GB", "Yes" }, new java.lang.String[] { "en_ZA", "Yes" } }), - No(new java.lang.String[][] { new java.lang.String[] { "en_US", "No" }, new java.lang.String[] { "nl_NL", "Nee" }, new java.lang.String[] { "en_GB", "No" }, new java.lang.String[] { "en_ZA", "No" } }); - - private java.util.Map captions; - - private YesNo(java.lang.String[][] captionStrings) - { - this.captions = new java.util.HashMap(); - for (java.lang.String[] captionString : captionStrings) - captions.put(captionString[0], captionString[1]); - } - - public java.lang.String getCaption(java.lang.String languageCode) - { - if (captions.containsKey(languageCode)) - return captions.get(languageCode); - return captions.get("en_US"); - } - - public java.lang.String getCaption() - { - return captions.get("en_US"); - } -} diff --git a/javasource/excelimporter/proxies/constants/Constants.java b/javasource/excelimporter/proxies/constants/Constants.java deleted file mode 100644 index 8a5ab6b..0000000 --- a/javasource/excelimporter/proxies/constants/Constants.java +++ /dev/null @@ -1,20 +0,0 @@ -// This file was generated by Mendix Modeler 7.23. -// -// WARNING: Code you write here will be lost the next time you deploy the project. - -package excelimporter.proxies.constants; - -import com.mendix.core.Core; - -public class Constants -{ - // These are the constants for the ExcelImporter module - - /** - * Enables the parsing of external entities from the DTD. This is turned off by default. - */ - public static boolean getEnableExternalEntities() - { - return (java.lang.Boolean)Core.getConfiguration().getConstantValue("ExcelImporter.EnableExternalEntities"); - } -} \ No newline at end of file diff --git a/javasource/excelimporter/proxies/microflows/Microflows.java b/javasource/excelimporter/proxies/microflows/Microflows.java deleted file mode 100644 index 6a4299a..0000000 --- a/javasource/excelimporter/proxies/microflows/Microflows.java +++ /dev/null @@ -1,1067 +0,0 @@ -// This file was generated by Mendix Modeler 7.23. -// -// WARNING: Code you write here will be lost the next time you deploy the project. - -package excelimporter.proxies.microflows; - -import java.util.HashMap; -import java.util.Map; -import com.mendix.core.Core; -import com.mendix.core.CoreException; -import com.mendix.systemwideinterfaces.MendixRuntimeException; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.systemwideinterfaces.core.IMendixObject; - -public class Microflows -{ - // These are the microflows for the ExcelImporter module - public static void _DocumentationDummyXSD(IContext context) - { - try - { - Map params = new HashMap(); - Core.execute(context, "ExcelImporter._DocumentationDummyXSD", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void _DocumentationExportParseFlows(IContext context) - { - try - { - Map params = new HashMap(); - Core.execute(context, "ExcelImporter._DocumentationExportParseFlows", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void _DocumentationImportParseFlows(IContext context) - { - try - { - Map params = new HashMap(); - Core.execute(context, "ExcelImporter._DocumentationImportParseFlows", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void aCr_Template(IContext context, excelimporter.proxies.Template _template) - { - try - { - Map params = new HashMap(); - params.put("Template", _template == null ? null : _template.getMendixObject()); - Core.execute(context, "ExcelImporter.ACr_Template", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - /** - * This microflow shows the actions which should be executed when the application is being started. - * - * First synchronize all objects using the ModelReflection module. Then validate the excel templats - */ - public static boolean aSu_CheckModelAndTemplates(IContext context) - { - try - { - Map params = new HashMap(); - return (java.lang.Boolean)Core.execute(context, "ExcelImporter.ASu_CheckModelAndTemplates", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static boolean bCo_Column(IContext context, excelimporter.proxies.Column _pColumn) - { - try - { - Map params = new HashMap(); - params.put("pColumn", _pColumn == null ? null : _pColumn.getMendixObject()); - return (java.lang.Boolean)Core.execute(context, "ExcelImporter.BCo_Column", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static boolean bDe_Column(IContext context, excelimporter.proxies.Column _column) - { - try - { - Map params = new HashMap(); - params.put("Column", _column == null ? null : _column.getMendixObject()); - return (java.lang.Boolean)Core.execute(context, "ExcelImporter.BDe_Column", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void ch_Column_SetDefaultObject(IContext context, excelimporter.proxies.Column _columns) - { - try - { - Map params = new HashMap(); - params.put("Columns", _columns == null ? null : _columns.getMendixObject()); - Core.execute(context, "ExcelImporter.Ch_Column_SetDefaultObject", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void ch_FindAttribute(IContext context, excelimporter.proxies.Column _column) - { - try - { - Map params = new HashMap(); - params.put("Column", _column == null ? null : _column.getMendixObject()); - Core.execute(context, "ExcelImporter.Ch_FindAttribute", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void ch_FindAttribute_Reference(IContext context, excelimporter.proxies.Column _column) - { - try - { - Map params = new HashMap(); - params.put("Column", _column == null ? null : _column.getMendixObject()); - Core.execute(context, "ExcelImporter.Ch_FindAttribute_Reference", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void ch_FindMicroflow(IContext context, excelimporter.proxies.Column _column) - { - try - { - Map params = new HashMap(); - params.put("Column", _column == null ? null : _column.getMendixObject()); - Core.execute(context, "ExcelImporter.Ch_FindMicroflow", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void ch_FindObjectType_Reference(IContext context, excelimporter.proxies.Column _column) - { - try - { - Map params = new HashMap(); - params.put("Column", _column == null ? null : _column.getMendixObject()); - Core.execute(context, "ExcelImporter.Ch_FindObjectType_Reference", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void ch_FindReference(IContext context, excelimporter.proxies.Column _column) - { - try - { - Map params = new HashMap(); - params.put("Column", _column == null ? null : _column.getMendixObject()); - Core.execute(context, "ExcelImporter.Ch_FindReference", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void ch_SetAttribute(IContext context, excelimporter.proxies.Column _column) - { - try - { - Map params = new HashMap(); - params.put("column", _column == null ? null : _column.getMendixObject()); - Core.execute(context, "ExcelImporter.Ch_SetAttribute", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void ch_SetAttribute_Reference(IContext context, excelimporter.proxies.Column _column) - { - try - { - Map params = new HashMap(); - params.put("column", _column == null ? null : _column.getMendixObject()); - Core.execute(context, "ExcelImporter.Ch_SetAttribute_Reference", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void ch_SetMicroflow(IContext context, excelimporter.proxies.Column _column) - { - try - { - Map params = new HashMap(); - params.put("column", _column == null ? null : _column.getMendixObject()); - Core.execute(context, "ExcelImporter.Ch_SetMicroflow", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void ch_SetObjectType_Reference(IContext context, excelimporter.proxies.Column _column) - { - try - { - Map params = new HashMap(); - params.put("column", _column == null ? null : _column.getMendixObject()); - Core.execute(context, "ExcelImporter.Ch_SetObjectType_Reference", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void ch_SetReference(IContext context, excelimporter.proxies.Column _column) - { - try - { - Map params = new HashMap(); - params.put("column", _column == null ? null : _column.getMendixObject()); - Core.execute(context, "ExcelImporter.Ch_SetReference", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void ch_Template_ChangeObjectType(IContext context, excelimporter.proxies.Template _template) - { - try - { - Map params = new HashMap(); - params.put("Template", _template == null ? null : _template.getMendixObject()); - Core.execute(context, "ExcelImporter.Ch_Template_ChangeObjectType", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static boolean ch_Template_CheckNrs(IContext context, excelimporter.proxies.Template _template) - { - try - { - Map params = new HashMap(); - params.put("Template", _template == null ? null : _template.getMendixObject()); - return (java.lang.Boolean)Core.execute(context, "ExcelImporter.Ch_Template_CheckNrs", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void cleanupOldRefHandling(IContext context, excelimporter.proxies.Template _template) - { - try - { - Map params = new HashMap(); - params.put("Template", _template == null ? null : _template.getMendixObject()); - Core.execute(context, "ExcelImporter.CleanupOldRefHandling", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void column_SetCorrectRefObjectType(IContext context, mxmodelreflection.proxies.MxObjectReference _reference, excelimporter.proxies.Column _column, mxmodelreflection.proxies.MxObjectType _startMxObjectType) - { - try - { - Map params = new HashMap(); - params.put("Reference", _reference == null ? null : _reference.getMendixObject()); - params.put("Column", _column == null ? null : _column.getMendixObject()); - params.put("StartMxObjectType", _startMxObjectType == null ? null : _startMxObjectType.getMendixObject()); - Core.execute(context, "ExcelImporter.Column_SetCorrectRefObjectType", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void column_SetDetails(IContext context, excelimporter.proxies.Column _pColumn) - { - try - { - Map params = new HashMap(); - params.put("pColumn", _pColumn == null ? null : _pColumn.getMendixObject()); - Core.execute(context, "ExcelImporter.Column_SetDetails", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static java.lang.String columnDataSourceToString(IContext context, excelimporter.proxies.DataSource _dataSource) - { - try - { - Map params = new HashMap(); - params.put("DataSource", _dataSource == null ? null : _dataSource.name()); - return (java.lang.String)Core.execute(context, "ExcelImporter.ColumnDataSourceToString", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static java.lang.String columnMappingTypeToString(IContext context, excelimporter.proxies.MappingType _mappingType) - { - try - { - Map params = new HashMap(); - params.put("MappingType", _mappingType == null ? null : _mappingType.name()); - return (java.lang.String)Core.execute(context, "ExcelImporter.ColumnMappingTypeToString", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static java.lang.String columnReferenceKeyTypeToString(IContext context, excelimporter.proxies.ReferenceKeyType _referenceKeyType) - { - try - { - Map params = new HashMap(); - params.put("ReferenceKeyType", _referenceKeyType == null ? null : _referenceKeyType.name()); - return (java.lang.String)Core.execute(context, "ExcelImporter.ColumnReferenceKeyTypeToString", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static java.lang.String columnYesNoToString(IContext context, excelimporter.proxies.YesNo _yesNo) - { - try - { - Map params = new HashMap(); - params.put("YesNo", _yesNo == null ? null : _yesNo.name()); - return (java.lang.String)Core.execute(context, "ExcelImporter.ColumnYesNoToString", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static excelimporter.proxies.Template excelImporterTemplateXSD(IContext context) - { - try - { - Map params = new HashMap(); - IMendixObject result = (IMendixObject)Core.execute(context, "ExcelImporter.ExcelImporterTemplateXSD", params); - return result == null ? null : excelimporter.proxies.Template.initialize(context, result); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static excelimporter.proxies.XMLDocumentTemplate excelTemplate_ExportToXML(IContext context, excelimporter.proxies.Template _template) - { - try - { - Map params = new HashMap(); - params.put("Template", _template == null ? null : _template.getMendixObject()); - IMendixObject result = (IMendixObject)Core.execute(context, "ExcelImporter.ExcelTemplate_ExportToXML", params); - return result == null ? null : excelimporter.proxies.XMLDocumentTemplate.initialize(context, result); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void excelTemplate_ImportFromXml(IContext context, excelimporter.proxies.XMLDocumentTemplate _xMLDocumentTemplate) - { - try - { - Map params = new HashMap(); - params.put("XMLDocumentTemplate", _xMLDocumentTemplate == null ? null : _xMLDocumentTemplate.getMendixObject()); - Core.execute(context, "ExcelImporter.ExcelTemplate_ImportFromXml", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static java.lang.String formatInteger(IContext context, java.lang.String _unformatted) - { - try - { - Map params = new HashMap(); - params.put("Unformatted", _unformatted); - return (java.lang.String)Core.execute(context, "ExcelImporter.FormatInteger", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static excelimporter.proxies.AdditionalProperties getAddProperties(IContext context, excelimporter.proxies.Template _template) - { - try - { - Map params = new HashMap(); - params.put("Template", _template == null ? null : _template.getMendixObject()); - IMendixObject result = (IMendixObject)Core.execute(context, "ExcelImporter.GetAddProperties", params); - return result == null ? null : excelimporter.proxies.AdditionalProperties.initialize(context, result); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static java.lang.String getCorrectString(IContext context, java.lang.String _textNL, java.lang.String _textEN, system.proxies.Language _curLanguage) - { - try - { - Map params = new HashMap(); - params.put("TextNL", _textNL); - params.put("TextEN", _textEN); - params.put("CurLanguage", _curLanguage == null ? null : _curLanguage.getMendixObject()); - return (java.lang.String)Core.execute(context, "ExcelImporter.GetCorrectString", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void iVK_CancelTemplate(IContext context, excelimporter.proxies.Template _template) - { - try - { - Map params = new HashMap(); - params.put("Template", _template == null ? null : _template.getMendixObject()); - Core.execute(context, "ExcelImporter.IVK_CancelTemplate", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void iVK_Column_Save(IContext context, excelimporter.proxies.Column _column) - { - try - { - Map params = new HashMap(); - params.put("Column", _column == null ? null : _column.getMendixObject()); - Core.execute(context, "ExcelImporter.IVK_Column_Save", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void iVK_ColumnEdit(IContext context, excelimporter.proxies.Column _column, excelimporter.proxies.Template _enclosingContext) - { - try - { - Map params = new HashMap(); - params.put("Column", _column == null ? null : _column.getMendixObject()); - params.put("EnclosingContext", _enclosingContext == null ? null : _enclosingContext.getMendixObject()); - Core.execute(context, "ExcelImporter.IVK_ColumnEdit", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void iVK_ColumnNew(IContext context, excelimporter.proxies.Template _enclosingContext) - { - try - { - Map params = new HashMap(); - params.put("EnclosingContext", _enclosingContext == null ? null : _enclosingContext.getMendixObject()); - Core.execute(context, "ExcelImporter.IVK_ColumnNew", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static excelimporter.proxies.Template iVK_DuplicateTemplate(IContext context, excelimporter.proxies.Template _template) - { - try - { - Map params = new HashMap(); - params.put("Template", _template == null ? null : _template.getMendixObject()); - IMendixObject result = (IMendixObject)Core.execute(context, "ExcelImporter.IVK_DuplicateTemplate", params); - return result == null ? null : excelimporter.proxies.Template.initialize(context, result); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - /** - * Example how you can implement your own excel import file - * - * Retrieve a template, this can be from an association or by the use of a constant or some application settings. How exactly the template is retrieved does not really matter. - * - * Next, if the template is found the import java action should be executed. This java action has three parameters. The first parameter is the retrieved template, the second parameter is the excel file. The third parameter is an optional parameter this parameter can contain an object in case you want to set the reference from all imported objects to the object from the parameter. - * - */ - public static void iVK_ImportTemplateDocument(IContext context, excelimporter.proxies.TemplateDocument _templateDocument) - { - try - { - Map params = new HashMap(); - params.put("TemplateDocument", _templateDocument == null ? null : _templateDocument.getMendixObject()); - Core.execute(context, "ExcelImporter.IVK_ImportTemplateDocument", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - /** - * Create an XMLDocumentTemplate object and op the upload form. - */ - public static void iVK_ImportXML_Upload(IContext context) - { - try - { - Map params = new HashMap(); - Core.execute(context, "ExcelImporter.IVK_ImportXML_Upload", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void iVK_SaveContinue_CreateTemplateFromDoc(IContext context, excelimporter.proxies.TemplateDocument _templateDocument) - { - try - { - Map params = new HashMap(); - params.put("TemplateDocument", _templateDocument == null ? null : _templateDocument.getMendixObject()); - Core.execute(context, "ExcelImporter.IVK_SaveContinue_CreateTemplateFromDoc", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void iVK_SaveNewTemplate(IContext context, excelimporter.proxies.Template _template) - { - try - { - Map params = new HashMap(); - params.put("Template", _template == null ? null : _template.getMendixObject()); - Core.execute(context, "ExcelImporter.IVK_SaveNewTemplate", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void iVK_SaveNewTemplate_CreateColumns(IContext context, excelimporter.proxies.Template _template) - { - try - { - Map params = new HashMap(); - params.put("Template", _template == null ? null : _template.getMendixObject()); - Core.execute(context, "ExcelImporter.IVK_SaveNewTemplate_CreateColumns", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static boolean iVK_SaveTemplate(IContext context, excelimporter.proxies.Template _template) - { - try - { - Map params = new HashMap(); - params.put("Template", _template == null ? null : _template.getMendixObject()); - return (java.lang.Boolean)Core.execute(context, "ExcelImporter.IVK_SaveTemplate", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void iVK_Template_ConnectMatchingAttributes(IContext context, excelimporter.proxies.Template _template) - { - try - { - Map params = new HashMap(); - params.put("Template", _template == null ? null : _template.getMendixObject()); - Core.execute(context, "ExcelImporter.IVK_Template_ConnectMatchingAttributes", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void iVK_Template_NewFromFile(IContext context) - { - try - { - Map params = new HashMap(); - Core.execute(context, "ExcelImporter.IVK_Template_NewFromFile", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void iVK_TemplateDoc_Cancel(IContext context, excelimporter.proxies.TemplateDocument _templateDocument) - { - try - { - Map params = new HashMap(); - params.put("TemplateDocument", _templateDocument == null ? null : _templateDocument.getMendixObject()); - Core.execute(context, "ExcelImporter.IVK_TemplateDoc_Cancel", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static java.lang.String mxObjectReferenceAssociationOwnerToString(IContext context, mxmodelreflection.proxies.AssociationOwner _associationOwnerEnum) - { - try - { - Map params = new HashMap(); - params.put("AssociationOwnerEnum", _associationOwnerEnum == null ? null : _associationOwnerEnum.name()); - return (java.lang.String)Core.execute(context, "ExcelImporter.MxObjectReferenceAssociationOwnerToString", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static java.lang.String mxObjectReferenceReferenceTypeToString(IContext context, mxmodelreflection.proxies.ReferenceType _referenceTypeEnum) - { - try - { - Map params = new HashMap(); - params.put("ReferenceTypeEnum", _referenceTypeEnum == null ? null : _referenceTypeEnum.name()); - return (java.lang.String)Core.execute(context, "ExcelImporter.MxObjectReferenceReferenceTypeToString", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static java.lang.String parseEnumToString_StatisticLevel(IContext context, excelimporter.proxies.StatisticsLevel _printStatisticsMessages) - { - try - { - Map params = new HashMap(); - params.put("PrintStatisticsMessages", _printStatisticsMessages == null ? null : _printStatisticsMessages.name()); - return (java.lang.String)Core.execute(context, "ExcelImporter.ParseEnumToString_StatisticLevel", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static excelimporter.proxies.StatisticsLevel parseStringToEnum_StatisticsLevel(IContext context, java.lang.String _printStatisticsMessages) - { - try - { - Map params = new HashMap(); - params.put("PrintStatisticsMessages", _printStatisticsMessages); - java.lang.String result = (java.lang.String)Core.execute(context, "ExcelImporter.ParseStringToEnum_StatisticsLevel", params); - if (result == null) - return null; - return excelimporter.proxies.StatisticsLevel.valueOf(result); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void prepareReferenceHandling(IContext context, excelimporter.proxies.Column _pColumn) - { - try - { - Map params = new HashMap(); - params.put("pColumn", _pColumn == null ? null : _pColumn.getMendixObject()); - Core.execute(context, "ExcelImporter.prepareReferenceHandling", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static java.lang.String referenceHandlingEnumToString(IContext context, excelimporter.proxies.ReferenceHandlingEnum _referenceHandlingEnum) - { - try - { - Map params = new HashMap(); - params.put("ReferenceHandlingEnum", _referenceHandlingEnum == null ? null : _referenceHandlingEnum.name()); - return (java.lang.String)Core.execute(context, "ExcelImporter.ReferenceHandlingEnumToString", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void setColumnStatus(IContext context, excelimporter.proxies.Column _column, excelimporter.proxies.Template _template) - { - try - { - Map params = new HashMap(); - params.put("Column", _column == null ? null : _column.getMendixObject()); - params.put("Template", _template == null ? null : _template.getMendixObject()); - Core.execute(context, "ExcelImporter.SetColumnStatus", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static void setupColumn(IContext context, excelimporter.proxies.Template _template, java.lang.String _attribute, java.lang.Long _colNr, java.util.List _columnList, excelimporter.proxies.YesNo _isKey, java.lang.String _mFName) - { - try - { - Map params = new HashMap(); - params.put("Template", _template == null ? null : _template.getMendixObject()); - params.put("Attribute", _attribute); - params.put("ColNr", _colNr); - java.util.ArrayList listparam_columnList = null; - if (_columnList != null) - { - listparam_columnList = new java.util.ArrayList(); - for (excelimporter.proxies.Column obj : _columnList) - listparam_columnList.add(obj.getMendixObject()); - } - params.put("ColumnList", listparam_columnList); - params.put("IsKey", _isKey == null ? null : _isKey.name()); - params.put("MFName", _mFName); - Core.execute(context, "ExcelImporter.SetupColumn", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static excelimporter.proxies.Template setupTemplate(IContext context, java.lang.String _templateName, java.lang.String _importObjectTypeName, java.lang.String _parentReferenceName, java.lang.Long _dataRowNr, excelimporter.proxies.ImportActions _importActions) - { - try - { - Map params = new HashMap(); - params.put("TemplateName", _templateName); - params.put("ImportObjectTypeName", _importObjectTypeName); - params.put("ParentReferenceName", _parentReferenceName); - params.put("DataRowNr", _dataRowNr); - params.put("ImportActions", _importActions == null ? null : _importActions.name()); - IMendixObject result = (IMendixObject)Core.execute(context, "ExcelImporter.SetupTemplate", params); - return result == null ? null : excelimporter.proxies.Template.initialize(context, result); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static boolean sF_Template_CheckNrs(IContext context, excelimporter.proxies.Template _template, boolean _showWarningPopup) - { - try - { - Map params = new HashMap(); - params.put("Template", _template == null ? null : _template.getMendixObject()); - params.put("ShowWarningPopup", _showWarningPopup); - return (java.lang.Boolean)Core.execute(context, "ExcelImporter.SF_Template_CheckNrs", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static excelimporter.proxies.MappingType stringToColumnMappingType(IContext context, java.lang.String _input) - { - try - { - Map params = new HashMap(); - params.put("Input", _input); - java.lang.String result = (java.lang.String)Core.execute(context, "ExcelImporter.StringToColumnMappingType", params); - if (result == null) - return null; - return excelimporter.proxies.MappingType.valueOf(result); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static excelimporter.proxies.ReferenceKeyType stringToColumnReferenceKeyType(IContext context, java.lang.String _input) - { - try - { - Map params = new HashMap(); - params.put("Input", _input); - java.lang.String result = (java.lang.String)Core.execute(context, "ExcelImporter.StringToColumnReferenceKeyType", params); - if (result == null) - return null; - return excelimporter.proxies.ReferenceKeyType.valueOf(result); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static excelimporter.proxies.YesNo stringToColumnYesNo(IContext context, java.lang.String _input) - { - try - { - Map params = new HashMap(); - params.put("Input", _input); - java.lang.String result = (java.lang.String)Core.execute(context, "ExcelImporter.StringToColumnYesNo", params); - if (result == null) - return null; - return excelimporter.proxies.YesNo.valueOf(result); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static excelimporter.proxies.DataSource stringToDataSource(IContext context, java.lang.String _dataSource) - { - try - { - Map params = new HashMap(); - params.put("DataSource", _dataSource); - java.lang.String result = (java.lang.String)Core.execute(context, "ExcelImporter.StringToDataSource", params); - if (result == null) - return null; - return excelimporter.proxies.DataSource.valueOf(result); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static mxmodelreflection.proxies.AssociationOwner stringToMxObjectReferenceAssociationOwner(IContext context, java.lang.String _input) - { - try - { - Map params = new HashMap(); - params.put("Input", _input); - java.lang.String result = (java.lang.String)Core.execute(context, "ExcelImporter.StringToMxObjectReferenceAssociationOwner", params); - if (result == null) - return null; - return mxmodelreflection.proxies.AssociationOwner.valueOf(result); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static mxmodelreflection.proxies.ReferenceType stringToMxObjectReferenceReferenceType(IContext context, java.lang.String _input) - { - try - { - Map params = new HashMap(); - params.put("Input", _input); - java.lang.String result = (java.lang.String)Core.execute(context, "ExcelImporter.StringToMxObjectReferenceReferenceType", params); - if (result == null) - return null; - return mxmodelreflection.proxies.ReferenceType.valueOf(result); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static excelimporter.proxies.ReferenceDataHandling stringToReferenceDataHandling(IContext context, java.lang.String _dataHandling) - { - try - { - Map params = new HashMap(); - params.put("DataHandling", _dataHandling); - java.lang.String result = (java.lang.String)Core.execute(context, "ExcelImporter.StringToReferenceDataHandling", params); - if (result == null) - return null; - return excelimporter.proxies.ReferenceDataHandling.valueOf(result); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static excelimporter.proxies.ReferenceHandlingEnum stringToReferenceHandlingEnum(IContext context, java.lang.String _input) - { - try - { - Map params = new HashMap(); - params.put("Input", _input); - java.lang.String result = (java.lang.String)Core.execute(context, "ExcelImporter.StringToReferenceHandlingEnum", params); - if (result == null) - return null; - return excelimporter.proxies.ReferenceHandlingEnum.valueOf(result); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static excelimporter.proxies.ImportActions stringToTemplateImportActions(IContext context, java.lang.String _input) - { - try - { - Map params = new HashMap(); - params.put("Input", _input); - java.lang.String result = (java.lang.String)Core.execute(context, "ExcelImporter.StringToTemplateImportActions", params); - if (result == null) - return null; - return excelimporter.proxies.ImportActions.valueOf(result); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static excelimporter.proxies.RemoveIndicator stringToTemplateRemoveIndicator(IContext context, java.lang.String _removeUnsyncedObjects) - { - try - { - Map params = new HashMap(); - params.put("RemoveUnsyncedObjects", _removeUnsyncedObjects); - java.lang.String result = (java.lang.String)Core.execute(context, "ExcelImporter.StringToTemplateRemoveIndicator", params); - if (result == null) - return null; - return excelimporter.proxies.RemoveIndicator.valueOf(result); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static excelimporter.proxies.Status stringToTemplateStatusEnum(IContext context, java.lang.String _input) - { - try - { - Map params = new HashMap(); - params.put("Input", _input); - java.lang.String result = (java.lang.String)Core.execute(context, "ExcelImporter.StringToTemplateStatusEnum", params); - if (result == null) - return null; - return excelimporter.proxies.Status.valueOf(result); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static java.lang.String templateImportActionsToString(IContext context, excelimporter.proxies.ImportActions _importActions) - { - try - { - Map params = new HashMap(); - params.put("ImportActions", _importActions == null ? null : _importActions.name()); - return (java.lang.String)Core.execute(context, "ExcelImporter.TemplateImportActionsToString", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static java.lang.String templateReferenceDataHandlingEnumToString(IContext context, excelimporter.proxies.ReferenceDataHandling _dataHandling) - { - try - { - Map params = new HashMap(); - params.put("DataHandling", _dataHandling == null ? null : _dataHandling.name()); - return (java.lang.String)Core.execute(context, "ExcelImporter.TemplateReferenceDataHandlingEnumToString", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static java.lang.String templateReferenceHandlingEnumToString(IContext context, excelimporter.proxies.ReferenceHandlingEnum _referenceHandling) - { - try - { - Map params = new HashMap(); - params.put("ReferenceHandling", _referenceHandling == null ? null : _referenceHandling.name()); - return (java.lang.String)Core.execute(context, "ExcelImporter.TemplateReferenceHandlingEnumToString", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static java.lang.String templateRemoveIndicatorToString(IContext context, excelimporter.proxies.RemoveIndicator _removeUnsyncedObjects) - { - try - { - Map params = new HashMap(); - params.put("RemoveUnsyncedObjects", _removeUnsyncedObjects == null ? null : _removeUnsyncedObjects.name()); - return (java.lang.String)Core.execute(context, "ExcelImporter.TemplateRemoveIndicatorToString", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static java.lang.String templateStatusEnumToString(IContext context, excelimporter.proxies.Status _input) - { - try - { - Map params = new HashMap(); - params.put("Input", _input == null ? null : _input.name()); - return (java.lang.String)Core.execute(context, "ExcelImporter.TemplateStatusEnumToString", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static boolean validate_TemplateDocument(IContext context, excelimporter.proxies.TemplateDocument _templateDocument) - { - try - { - Map params = new HashMap(); - params.put("TemplateDocument", _templateDocument == null ? null : _templateDocument.getMendixObject()); - return (java.lang.Boolean)Core.execute(context, "ExcelImporter.Validate_TemplateDocument", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } - public static boolean validateTemplate(IContext context, excelimporter.proxies.Template _template, boolean _showWarningPopup) - { - try - { - Map params = new HashMap(); - params.put("Template", _template == null ? null : _template.getMendixObject()); - params.put("ShowWarningPopup", _showWarningPopup); - return (java.lang.Boolean)Core.execute(context, "ExcelImporter.ValidateTemplate", params); - } - catch (CoreException e) - { - throw new MendixRuntimeException(e); - } - } -} \ No newline at end of file diff --git a/javasource/excelimporter/reader/ExcelImporter.java b/javasource/excelimporter/reader/ExcelImporter.java deleted file mode 100644 index d719233..0000000 --- a/javasource/excelimporter/reader/ExcelImporter.java +++ /dev/null @@ -1,133 +0,0 @@ -package excelimporter.reader; - -import java.io.InputStream; -import java.util.HashMap; -import java.util.List; -import java.util.Map.Entry; - -import system.proxies.FileDocument; - -import com.mendix.core.Core; -import com.mendix.core.CoreException; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.systemwideinterfaces.core.IMendixObject; - -import excelimporter.proxies.Column; -import excelimporter.proxies.Template; -import excelimporter.reader.readers.ExcelColumn; -import excelimporter.reader.readers.ExcelReader; - -/** - * - * - * @author J. van der Hoek - Mendix - * @version $Id: ExcelImporter.java 9272 2009-05-11 09:19:47Z Jasper van der Hoek $ - */ -public class ExcelImporter { - - - /** - * Get all columns from the TemplateDocument and store them in the Template - * @param context - * @param template - * @throws CoreException - */ - public static void getColumns(IContext context, IMendixObject template, IMendixObject excelDocument) throws CoreException { - if( excelDocument == null ) - throw new CoreException("You must select a file document before the columns can be extracted."); - if( !Core.isSubClassOf(FileDocument.getType(), excelDocument.getType() ) ) - throw new CoreException("The exceldocument object must be a sublclass of System.FileDocument."); - - String path = (String)excelDocument.getValue(context, "Name"); - if(path != null ) { - //We need to check a radiobutton in the template, not the file extension. - - //Determine file format for header extraction - int lastdot = path.lastIndexOf("."); - if (lastdot < 0) - throw new CoreException("Found file has no extension to derive format from."); - - String extension = path.substring(lastdot).toLowerCase(); - - if (".xls".equals(extension) || ".xlsx".equals(extension)) { - ExcelReader excelXLSReader = new ExcelReader(context, template); - List columnList = excelXLSReader.getHeaders(context, excelDocument); - - if( columnList.size() == 0 ) - throw new CoreException("No column information could be found in document."); - - List columns = Core.retrieveXPathQuery(context, "//" + Column.getType() + "[" + Column.MemberNames.Column_Template + "=" + template.getId().toLong() + "]"); - HashMap existingColumns = new HashMap(columns.size()); - for(IMendixObject col : columns ) - existingColumns.put((Integer)col.getValue(context, Column.MemberNames.ColNumber.toString()), col); - - for( ExcelColumn excelCol : columnList ) { - Integer colNr = excelCol.getColNr(); - - IMendixObject col = null; - if( existingColumns.containsKey(colNr) ) { - col = existingColumns.get(colNr); - existingColumns.remove(colNr); - } - else { - col = Core.instantiate(context, Column.getType()); - col.setValue(context, Column.MemberNames.ColNumber.toString(), colNr); - col.setValue(context, Column.MemberNames.Column_Template.toString(), template.getId()); - } - - col.setValue(context, Column.MemberNames.Column_MxObjectType.toString(), template.getValue(context, Template.MemberNames.Template_MxObjectType.toString())); - col.setValue(context, Column.MemberNames.Text.toString(), excelCol.getCaption()); - Core.commit(context, col); - } - - for( Entry entry : existingColumns.entrySet() ) { - Core.delete(context, entry.getValue()); - } - } - else - throw new CoreException( "The extension: " + extension + " is not supported." ); - } - else - throw new CoreException("No valid filepath found from template"); - } - - /** - * Import the filedocument using the template from the parameter - * - * @param context - * @param template - * @param templateDocument - * @param parentObject the object to which the objects to be imported, must be associated. - */ - public static long startImport(IContext context, IMendixObject template, IMendixObject templateDocument, IMendixObject parentObject) throws CoreException { - if (template == null) - throw new CoreException("Template not found!"); - - try (InputStream content = Core.getFileDocumentContent(context, templateDocument);) { - if (content != null) { - String fileName = (String) templateDocument.getValue(context, "Name"); - if (fileName != null) { - - // Determine file format for header extraction - int lastdot = fileName.lastIndexOf("."); - if (lastdot < 0) - throw new CoreException("Found file has no extension to derive format from."); - - String extension = fileName.substring(lastdot).toLowerCase(); - - if (".xls".equalsIgnoreCase(extension) || ".xlsx".equalsIgnoreCase(extension)) { - ExcelReader reader = new ExcelReader(context, template); - return reader.importData(context, templateDocument, template, parentObject); - } else { - throw new CoreException("The extension: " + extension + " is not supported."); - } - - } else - throw new CoreException("No valid filepath found from template"); - } - } catch (Exception e) { - throw new CoreException(e); - } - return 0l; - } -} diff --git a/javasource/excelimporter/reader/readers/DocProperties.java b/javasource/excelimporter/reader/readers/DocProperties.java deleted file mode 100644 index 9a96d92..0000000 --- a/javasource/excelimporter/reader/readers/DocProperties.java +++ /dev/null @@ -1,36 +0,0 @@ -package excelimporter.reader.readers; - -import excelimporter.proxies.DataSource; -import excelimporter.proxies.MappingType; - -public class DocProperties { - private String columnAlias; - private DataSource ds; - private MappingType mappingType; - private String staticStringValue = null; - - public DocProperties(DataSource ds, MappingType mappingType, String columnAlias) { - this.ds = ds; - this.columnAlias = columnAlias; - this.mappingType = mappingType; - } - - public void setStaticStringValue(String staticStringValue) { - this.staticStringValue = staticStringValue; - } - public String getStaticStringValue() { - return this.staticStringValue; - } - - public String getColumnAlias() { - return this.columnAlias; - } - - public DataSource getDataSource() { - return this.ds; - } - - public MappingType getMappingType() { - return this.mappingType; - } -} diff --git a/javasource/excelimporter/reader/readers/ExcelColumn.java b/javasource/excelimporter/reader/readers/ExcelColumn.java deleted file mode 100644 index d5ff245..0000000 --- a/javasource/excelimporter/reader/readers/ExcelColumn.java +++ /dev/null @@ -1,20 +0,0 @@ -package excelimporter.reader.readers; - -public class ExcelColumn { - - private String caption; - private int colNr; - - protected ExcelColumn( int colNr, String caption) { - this.caption = caption; - this.colNr = colNr; - } - - public String getCaption() { - return this.caption; - } - - public int getColNr() { - return this.colNr; - } -} diff --git a/javasource/excelimporter/reader/readers/ExcelExtension.java b/javasource/excelimporter/reader/readers/ExcelExtension.java deleted file mode 100644 index 75e63a7..0000000 --- a/javasource/excelimporter/reader/readers/ExcelExtension.java +++ /dev/null @@ -1,7 +0,0 @@ -package excelimporter.reader.readers; - -public enum ExcelExtension { - UNKNOWN, - XLS, - XLSX -} diff --git a/javasource/excelimporter/reader/readers/ExcelHeadable.java b/javasource/excelimporter/reader/readers/ExcelHeadable.java deleted file mode 100644 index 40a3cd3..0000000 --- a/javasource/excelimporter/reader/readers/ExcelHeadable.java +++ /dev/null @@ -1,7 +0,0 @@ -package excelimporter.reader.readers; - -import java.util.List; - -public interface ExcelHeadable { - public List getColumns(); -} diff --git a/javasource/excelimporter/reader/readers/ExcelImporterException.java b/javasource/excelimporter/reader/readers/ExcelImporterException.java deleted file mode 100644 index 00f4662..0000000 --- a/javasource/excelimporter/reader/readers/ExcelImporterException.java +++ /dev/null @@ -1,13 +0,0 @@ -package excelimporter.reader.readers; - -public class ExcelImporterException extends Exception { - - public ExcelImporterException(String msg) { - super(msg, null); - } - - public ExcelImporterException(String msg, Exception e) { - super(msg, e); - } - -} diff --git a/javasource/excelimporter/reader/readers/ExcelReader.java b/javasource/excelimporter/reader/readers/ExcelReader.java deleted file mode 100644 index eb9c84e..0000000 --- a/javasource/excelimporter/reader/readers/ExcelReader.java +++ /dev/null @@ -1,614 +0,0 @@ -package excelimporter.reader.readers; - -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import mxmodelreflection.proxies.MxObjectMember; -import mxmodelreflection.proxies.MxObjectReference; -import mxmodelreflection.proxies.MxObjectType; -import mxmodelreflection.proxies.PrimitiveTypes; - -import org.apache.commons.io.FileUtils; -import org.apache.commons.io.IOUtils; -import org.apache.poi.EncryptedDocumentException; -import org.apache.poi.hssf.eventusermodel.HSSFEventFactory; -import org.apache.poi.hssf.eventusermodel.HSSFListener; -import org.apache.poi.hssf.eventusermodel.HSSFRequest; -import org.apache.poi.hssf.record.crypto.Biff8EncryptionKey; -import org.apache.poi.openxml4j.exceptions.NotOfficeXmlFileException; -import org.apache.poi.openxml4j.exceptions.OLE2NotOfficeXmlFileException; -import org.apache.poi.poifs.filesystem.NotOLE2FileException; -import org.apache.poi.poifs.filesystem.POIFSFileSystem; -import org.apache.poi.util.RecordFormatException; - -import replication.AssociationConfig; -import replication.ObjectConfig; -import replication.ReplicationSettings.AssociationDataHandling; -import replication.ReplicationSettings.ChangeTracking; -import replication.ReplicationSettings.KeyType; -import replication.ReplicationSettings.ObjectSearchAction; -import replication.helpers.TimeMeasurement; -import replication.implementation.MFValueParser; -import replication.interfaces.IInfoHandler.StatisticsLevel; - -import com.mendix.core.Core; -import com.mendix.core.CoreException; -import com.mendix.logging.ILogNode; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.systemwideinterfaces.core.IMendixIdentifier; -import com.mendix.systemwideinterfaces.core.IMendixObject; - -import excelimporter.proxies.AdditionalProperties; -import excelimporter.proxies.Column; -import excelimporter.proxies.DataSource; -import excelimporter.proxies.ImportActions; -import excelimporter.proxies.MappingType; -import excelimporter.proxies.ReferenceDataHandling; -import excelimporter.proxies.ReferenceHandling; -import excelimporter.proxies.ReferenceHandlingEnum; -import excelimporter.proxies.ReferenceKeyType; -import excelimporter.proxies.RemoveIndicator; -import excelimporter.proxies.Template; -import excelimporter.reader.readers.replication.ExcelReplicationSettings; - -/** - * Read an excel file can retrieve header information from by - * - * @author J. van der Hoek - Mendix - * @version $Id: ExcelXLSReader.java 9272 2009-05-11 09:19:47Z Jasper van der Hoek $ - */ -public class ExcelReader { - - private final IMendixObject template; - - private ExcelReplicationSettings settings; - private String descr; - private Map> docProperties = new HashMap>(); - private long rowcounts = 0l; - - private TimeMeasurement timeMeasurement; - public static ILogNode logNode = Core.getLogger("ExcelXLSReader"); - - public ExcelReader(IContext context, IMendixObject template) throws CoreException { - if( template == null ) - throw new CoreException( "No template was provided. Therefore the import could not be started." ); - this.template = template; - - this.descr = this.template.getValue(context, Template.MemberNames.Title.toString()); - if( this.descr != null) - this.descr = this.template.getValue(context, Template.MemberNames.Nr.toString()) + " - " + this.descr; - this.timeMeasurement = new TimeMeasurement("ExcelReader-"+this.descr); - } - - private static ExcelExtension getExcelExtension(IContext context, IMendixObject document) { - String s = document.getValue(context, "Name"); - if (s.toLowerCase().endsWith(".xls")) { - return ExcelExtension.XLS; - } else if (s.toLowerCase().endsWith(".xlsx")) { - return ExcelExtension.XLSX; - } else { - return ExcelExtension.UNKNOWN; - } - } - - public List getHeaders(IContext context, IMendixObject templateDocument) throws CoreException { - if(this.template != null && context != null) { - StringBuilder sb = new StringBuilder("Starting XLS Headers import Template: ").append(this.descr); - String s = templateDocument.getValue(context, "Name"); - sb.append(" FileName: ").append(s != null ? s : "[unknown]"); - ExcelExtension extension = getExcelExtension(context, templateDocument); - logNode.info(sb.toString()); - long importStartTime = System.nanoTime(); - - File excelFile = null; - - try { - // we maintain a 0-based rownumber here. - int iCanHasSheet = (Integer) this.template.getValue(context, Template.MemberNames.SheetIndex.toString()); - iCanHasSheet --; - if( iCanHasSheet < 0 ) - throw new CoreException("The sheetnumber must be larger than 1"); - - int iCanHasRow = (Integer) this.template.getValue(context, Template.MemberNames.HeaderRowNumber.toString()); - iCanHasRow --; - if( iCanHasRow < 0 ) - throw new CoreException("The header rownumber must be larger than 1"); - - // Headers - 1st pass - HashMap sstmap = headersFirstPass(context, templateDocument, extension, iCanHasSheet, iCanHasRow); - - ExcelHeadable header = null; - // Headers - 2nd pass - { - switch (extension) { - case XLS: { - try (InputStream content = Core.getFileDocumentContent(context, templateDocument); - POIFSFileSystem poifs = new POIFSFileSystem(content); - InputStream workbook = poifs.createDocumentInputStream("Workbook");) { - - if (sstmap == null) { - throw new CoreException("No headers could be found on sheet: " + iCanHasSheet - + " on row nr: " + iCanHasRow); - } - // second pass - header = new ExcelXLSReaderHeaderSecondPassListener(iCanHasSheet, iCanHasRow, sstmap); - HSSFRequest req = new HSSFRequest(); - req.addListenerForAllRecords((HSSFListener) header); - HSSFEventFactory factory = new HSSFEventFactory(); - factory.processEvents(req, workbook); - } - break; - } - case XLSX: { - excelFile = getExcelFile(context, templateDocument); - header = new ExcelXLSXHeaderReader(excelFile.getAbsolutePath(), iCanHasSheet, iCanHasRow + 1); // we need a 1-based rownumber in this API - break; - } - case UNKNOWN: - throw new CoreException("File extension is not an Excel extension ('.xls' or '.xlsx')."); - } - } - - return header.getColumns(); - - } - catch(Exception e) { - throw new CoreException("Document could not be read, because: " + e.getMessage(), e); - } - finally { - if (excelFile != null) { - boolean success = FileUtils.deleteQuietly(excelFile);//.delete(); - if (!success) logNode.info("Could not delete temp file."); - } - - sb = new StringBuilder("Ready importing Headers "); - sb.append((System.nanoTime() - importStartTime)/1000000).append(" ms"); - logNode.info(sb.toString()); - } - } - - //If this statement is reached no template was set - throw new CoreException("Template or context not set!"); - } - - private HashMap headersFirstPass(IContext context, IMendixObject templateDocument, - ExcelExtension extension, int iCanHasSheet, int iCanHasRow) throws CoreException, IOException { - HashMap sstmap = null; - - try (InputStream content = Core.getFileDocumentContent(context, templateDocument);) { - if (content == null) - throw new CoreException("No content found in templatedocument"); - switch (extension) { - case XLS: { - try (POIFSFileSystem poifs = new POIFSFileSystem(content); - InputStream workbook = poifs.createDocumentInputStream("Workbook");) { - ExcelXLSReaderHeaderFirstPassListener firstPass = new ExcelXLSReaderHeaderFirstPassListener(iCanHasSheet, iCanHasRow); - - HSSFRequest req = new HSSFRequest(); - req.addListenerForAllRecords(firstPass); - HSSFEventFactory factory = new HSSFEventFactory(); - factory.processEvents(req, workbook); - - sstmap = firstPass.getSSTMap(); - } - break; - } - case XLSX: { - // nothing - break; - } - case UNKNOWN: - throw new CoreException("File extension is not an Excel extension ('.xls' or '.xlsx')."); - } - } - return sstmap; - } - - public long importData(IContext context, IMendixObject fileDocument, IMendixObject template, IMendixObject parentObject) throws CoreException, ExcelImporterException { - this.timeMeasurement.startPerformanceTest("Importing data"); - - this.timeMeasurement.startPerformanceTest("Preparing all import settings"); - - IMendixIdentifier mxObjectType = (IMendixIdentifier) template.getValue(context, Template.MemberNames.Template_MxObjectType.toString() ); - if( mxObjectType == null ) - throw new CoreException( "There is no object type selected for the template" ); - String objectTypeName = Core.retrieveId(context, mxObjectType).getValue(context, MxObjectType.MemberNames.CompleteName.toString()); - - this.settings = new ExcelReplicationSettings(context, objectTypeName); - ObjectConfig mainConfig = this.settings.getMainObjectConfig(); - - switch (ImportActions.valueOf((String)this.template.getValue(this.settings.getContext(), Template.MemberNames.ImportAction.toString()))) { - case CreateObjects: - mainConfig.setObjectSearchAction( ObjectSearchAction.CreateEverything ); - break; - case SynchronizeObjects: - mainConfig.setObjectSearchAction( ObjectSearchAction.FindCreate ); - break; - case SynchronizeOnlyExisting: - mainConfig.setObjectSearchAction( ObjectSearchAction.FindIgnore ); - break; - case OnlyCreateNewObjects: - mainConfig.setObjectSearchAction( ObjectSearchAction.OnlyCreateNewObjects ); - break; - } - setAdditionalProperties( this.settings.getContext(), this.settings, template ); - - HashMap sortMap = new HashMap(); - sortMap.put(Column.MemberNames.ColNumber.toString(), "ASC"); - List columns = Core.retrieveXPathQuery(this.settings.getContext(), "//" + Column.getType() + "[" + Column.MemberNames.Column_Template + "=" + template.getId().toLong() + "]", Integer.MAX_VALUE, 0, sortMap); - for( IMendixObject column : columns ) { - DataSource ds = DataSource.valueOf( (String)column.getValue(this.settings.getContext(), Column.MemberNames.DataSource.toString()) ); - MappingType type = MappingType.valueOf((String)column.getValue(this.settings.getContext(), Column.MemberNames.MappingType.toString())); - String fieldIdentifier = ""; - - DocProperties docProps = null; - if( ds == DataSource.CellValue ) { - Integer colNr = (Integer) column.getValue(this.settings.getContext(), Column.MemberNames.ColNumber.toString()); - fieldIdentifier = colNr.toString(); - } - else { - fieldIdentifier = String.valueOf( column.getId().toLong() ); - - docProps = new DocProperties(ds, type, fieldIdentifier); - if( ds == DataSource.StaticValue ) - docProps.setStaticStringValue( (String) column.getValue(context, Column.MemberNames.Text.toString())); - } - - if( type == MappingType.Attribute ) { - MFValueParser parser = null; - boolean isKey = false; - if( "Yes".equals(column.getValue(this.settings.getContext(), Column.MemberNames.IsKey.toString())) ) - isKey = true; - - boolean isCaseSensitive = false; - if( "Yes".equals(column.getValue(this.settings.getContext(), Column.MemberNames.CaseSensitive.toString())) ) - isCaseSensitive = true; - - IMendixIdentifier mf = (IMendixIdentifier) column.getValue(this.settings.getContext(), Column.MemberNames.Column_Microflows.toString()); - if( mf != null ) { - parser = new MFValueParser( this.settings.getContext(), Core.retrieveId(this.settings.getContext(), mf)); - } - - IMendixObject member = Core.retrieveId(this.settings.getContext(), (IMendixIdentifier)column.getValue(this.settings.getContext(), Column.MemberNames.Column_MxObjectMember.toString())); - this.settings.addColumnMapping(fieldIdentifier, (String)member.getValue(this.settings.getContext(), MxObjectMember.MemberNames.AttributeName.toString()), isKey, isCaseSensitive, parser); - - if( docProps != null ) { - if( !this.docProperties.containsKey(objectTypeName) ) - this.docProperties.put(objectTypeName, new HashSet()); - - this.docProperties.get(objectTypeName).add(docProps); - } - } - - else if( type == MappingType.Reference ) { - MFValueParser parser = null; - KeyType isKey = KeyType.NoKey; - if( column.getValue(this.settings.getContext(), Column.MemberNames.IsReferenceKey.toString()) != null && !"".equals(column.getValue(this.settings.getContext(), Column.MemberNames.IsReferenceKey.toString())) ) { - switch( ReferenceKeyType.valueOf((String) column.getValue(this.settings.getContext(), Column.MemberNames.IsReferenceKey.toString())) ) { - case NoKey: - isKey = KeyType.NoKey; - break; - case YesMainAndAssociatedObject: - isKey = KeyType.AssociationAndObjectKey; - break; - case YesOnlyAssociatedObject: - isKey = KeyType.AssociationKey; - break; - case YesOnlyMainObject: - isKey = KeyType.ObjectKey; - break; - } - } - - boolean isCaseSensitive = false; - if( "Yes".equals(column.getValue(this.settings.getContext(), Column.MemberNames.CaseSensitive.toString())) ) - isCaseSensitive = true; - - IMendixIdentifier mf = (IMendixIdentifier) column.getValue(this.settings.getContext(), Column.MemberNames.Column_Microflows.toString()); - if( mf != null ) { - parser = new MFValueParser(this.settings.getContext(), Core.retrieveId(this.settings.getContext(), mf)); - } - - IMendixObject member = Core.retrieveId(this.settings.getContext(), (IMendixIdentifier)column.getValue(this.settings.getContext(), Column.MemberNames.Column_MxObjectMember_Reference.toString())); - IMendixObject association = Core.retrieveId(this.settings.getContext(), (IMendixIdentifier)column.getValue(this.settings.getContext(), Column.MemberNames.Column_MxObjectReference.toString())); - IMendixObject objectType = Core.retrieveId(this.settings.getContext(), (IMendixIdentifier)column.getValue(this.settings.getContext(), Column.MemberNames.Column_MxObjectType_Reference.toString())); - - String associationName = (String)association.getValue(this.settings.getContext(), MxObjectReference.MemberNames.CompleteName.toString()); - this.settings.addAssociationMapping(fieldIdentifier, associationName, (String)objectType.getValue(this.settings.getContext(), MxObjectType.MemberNames.CompleteName.toString()), (String)member.getValue(this.settings.getContext(), MxObjectMember.MemberNames.AttributeName.toString()), parser, isKey, isCaseSensitive); - - if( docProps != null ) { - if( !this.docProperties.containsKey(associationName) ) - this.docProperties.put(associationName, new HashSet()); - - this.docProperties.get(associationName).add(docProps); - } - } - - if( PrimitiveTypes.DateTime.toString().equals( column.getValue(context, Column.MemberNames.AttributeTypeEnum.toString()) ) ) { - this.settings.addDefaultInputMask(fieldIdentifier, (String) column.getValue(context, Column.MemberNames.InputMask.toString())); - } - } - - List refHandlingList = Core.retrieveXPathQuery(this.settings.getContext(), "//" + ReferenceHandling.getType() + "[" + ReferenceHandling.MemberNames.ReferenceHandling_Template + "=" + template.getId().toLong() + "]"); - for(IMendixObject object : refHandlingList ) { - IMendixObject refObj = Core.retrieveId(this.settings.getContext(), (IMendixIdentifier) object.getValue(this.settings.getContext(), ReferenceHandling.MemberNames.ReferenceHandling_MxObjectReference.toString())); - String associationName = (String)refObj.getValue(this.settings.getContext(), MxObjectReference.MemberNames.CompleteName.toString()); - ReferenceHandlingEnum selecteReferenceHandling =ReferenceHandlingEnum.valueOf((String)object.getValue(this.settings.getContext(), ReferenceHandling.MemberNames.Handling.toString())); - - AssociationConfig config = this.settings.getAssociationConfig(associationName); - - switch( selecteReferenceHandling ) { - case FindCreate: - config.setObjectSearchAction(ObjectSearchAction.FindCreate); - break; - case FindIgnore: - config.setObjectSearchAction(ObjectSearchAction.FindIgnore); - break; - case CreateEverything: - config.setObjectSearchAction(ObjectSearchAction.CreateEverything); - break; - case OnlyCreateNewObjects: - config.setObjectSearchAction(ObjectSearchAction.OnlyCreateNewObjects); - break; - } - - ReferenceDataHandling refDataHandling = ReferenceDataHandling.valueOf((String)object.getValue(context, ReferenceHandling.MemberNames.DataHandling.toString())); - switch( refDataHandling ) { - case Append: - config.setAssociationDataHandling(AssociationDataHandling.Append); - break; - case Overwrite: - config.setAssociationDataHandling(AssociationDataHandling.Overwrite); - break; - } - - config.setPrintNotFoundMessages( (Boolean) object.getValue(this.settings.getContext(), ReferenceHandling.MemberNames.PrintNotFoundMessages.toString()) ); - config.setCommitUnchangedObjects( (Boolean) object.getValue(this.settings.getContext(), ReferenceHandling.MemberNames.CommitUnchangedObjects.toString()) ); - config.setIgnoreEmptyKeys( (Boolean) object.getValue(context, ReferenceHandling.MemberNames.IgnoreEmptyKeys.toString()) ); - } - - IMendixIdentifier pAssociationId = template.getValue(this.settings.getContext(), Template.MemberNames.Template_MxObjectReference_ParentAssociation.toString() ); - if( pAssociationId != null ) { - String associationName = Core.retrieveId(this.settings.getContext(), pAssociationId).getValue(this.settings.getContext(), MxObjectReference.MemberNames.CompleteName.toString()); - - this.settings.setParentAssociation(associationName); - this.settings.setParentObjectId( parentObject ); - } - this.timeMeasurement.endPerformanceTest("Preparing all import settings"); - logNode.info("Starting XLS import Template: " + this.descr); - - long importStartTime = System.nanoTime(); - - File excelFile = null; - - try { - // we store sheetnr and startrow as a zero-based number - // Start importing at this sheet / row - int iCanHasSheet = (Integer) template.getValue(this.settings.getContext(), Template.MemberNames.SheetIndex.toString()); - iCanHasSheet --; - if( iCanHasSheet < 0 ) - throw new CoreException("The sheetnumber must be larger than 1"); - - int startRow = (Integer) template.getValue(this.settings.getContext(), Template.MemberNames.FirstDataRowNumber.toString()); - startRow --; - if( startRow < 0 ) - throw new CoreException("The rownumber must be larger than 1"); - - - // Data - 1st pass ... make a sstmap describing which strings we want to load from the excel SST - switch(getExcelExtension(this.settings.getContext(), fileDocument)) { - case XLS: { - ExcelXLSReaderDataFirstPassListener firstPass = new ExcelXLSReaderDataFirstPassListener(iCanHasSheet, startRow, this); - { - try (InputStream content = Core.getFileDocumentContent(this.settings.getContext(), fileDocument); - POIFSFileSystem poifs = new POIFSFileSystem(content); - InputStream workbook = getInputStreamFromPOIFS(poifs);) { - HSSFRequest req = new HSSFRequest(); - req.addListenerForAllRecords(firstPass); - HSSFEventFactory factory = new HSSFEventFactory(); - factory.processEvents(req, workbook); - } - } - HashMap sstmap = firstPass.getSSTMap(); - - // Data - 2nd pass - ExcelXLSReaderDataSecondPassListener secondPass = new ExcelXLSReaderDataSecondPassListener(iCanHasSheet, startRow, sstmap, this, firstPass.getNrOfColumns()); - { - try (InputStream content = Core.getFileDocumentContent(this.settings.getContext(), fileDocument); - POIFSFileSystem poifs = new POIFSFileSystem(content); - InputStream workbook = getInputStreamFromPOIFS(poifs);) { - HSSFRequest req = new HSSFRequest(); - req.addListenerForAllRecords(secondPass); - HSSFEventFactory factory = new HSSFEventFactory(); - factory.processEvents(req, workbook); - } - } - this.rowcounts = secondPass.getRowCounter(); - - break; - } - case XLSX: { - String xpath = String.format("count(//%s[%s = %d])", - Column.entityName, - Column.MemberNames.Column_Template, - template.getId().toLong()); - - logNode.debug(xpath); - Long nrOfCols = Core.retrieveXPathQueryAggregate(this.settings.getContext(), xpath); - - logNode.debug("nrOfCols: " + nrOfCols); - - // xlsx rows are 1-based - excelFile = getExcelFile(this.settings.getContext(), fileDocument); - this.rowcounts = ExcelXLSXDataReader.readData(excelFile.getAbsolutePath(), iCanHasSheet, startRow + 1, this); - break; - } - case UNKNOWN: - throw new CoreException("File extension is not an Excel extension ('.xls' or '.xlsx')."); - } - - logNode.info( "Successfully finished importing " + this.descr + " in " + ((System.nanoTime() - importStartTime)/1000000) + " ms"); - } - catch (OLE2NotOfficeXmlFileException e) { - logNode.info( "Error while importing " + this.descr + " " + ((System.nanoTime() - importStartTime)/1000000) + " ms, because: " + e.getMessage()); - throw new ExcelImporterException("Document could not be imported because this file is an XLS and not an XLSX file. Please make sure the file is valid and has the correct extension."); - } - catch (NotOfficeXmlFileException | NotOLE2FileException e) { - logNode.info( "Error while importing " + this.descr + " " + ((System.nanoTime() - importStartTime)/1000000) + " ms, because: " + e.getMessage()); - throw new ExcelImporterException("Document could not be imported because this file is not XLS or XLSX. Please make sure the file is valid and has the correct extension."); - } - catch (RecordFormatException e) { - logNode.info( "Error while importing " + this.descr + " " + ((System.nanoTime() - importStartTime)/1000000) + " ms, because: " + e.getMessage()); - throw new ExcelImporterException("Document could not be imported because one of its cell values is invalid or cannot be read."); - } - catch (EncryptedDocumentException e) { - logNode.info( "Error while importing " + this.descr + " " + ((System.nanoTime() - importStartTime)/1000000) + " ms, because: " + e.getMessage()); - throw new ExcelImporterException("Document could not be imported because it is encrypted."); - } - catch (Exception e) { - logNode.info( "Error while importing " + this.descr + " " + ((System.nanoTime() - importStartTime)/1000000) + " ms, because: " + e.getMessage()); - throw new CoreException("Document could not be imported, because: " + e.getMessage(), e); - } - finally { - this.docProperties.clear(); - this.settings.clear(); - if (excelFile != null) { - boolean success = FileUtils.deleteQuietly(excelFile);//.delete(); - if (!success) logNode.info("Could not delete temp file."); - } - - this.timeMeasurement.endPerformanceTest("Importing data"); - } - return rowcounts; - } - - private InputStream getInputStreamFromPOIFS(POIFSFileSystem poifs) throws CoreException, IOException { - Set entryNames = poifs.getRoot().getEntryNames(); - InputStream inStream = null; - - if (entryNames.contains("Workbook")) - inStream = poifs.createDocumentInputStream("Workbook"); - else if (entryNames.contains("EncryptedPackage")) { - try { // We try the default password as it might just be a write-protected file, as documented in https://poi.apache.org/encryption.html - Biff8EncryptionKey.setCurrentUserPassword("VelvetSweatshop"); - inStream = poifs.createDocumentInputStream("EncryptedPackage"); - Biff8EncryptionKey.setCurrentUserPassword(null); - } catch (IOException e) { - throw new CoreException("Unable to open encrypted Excel files.", e); - } - } - - return inStream; - } - - private static File getExcelFile(IContext context, IMendixObject file) throws IOException { - File f = new File(Core.getConfiguration().getTempPath().getAbsolutePath() + "/Mendix_ExcelImporter_" + file.getId().toLong(), ""); - try (InputStream inputstream = Core.getFileDocumentContent(context, file); - OutputStream outputstream = new FileOutputStream(f);) { - IOUtils.copy(inputstream, outputstream); - } - return f; - } - - /** - * Set the additional properties in the settings object - * This is done by retrieving the associated AdditionalProperties object from the Template. - * - * @param context - * @param settings - * @param template - * @throws CoreException - */ - private static void setAdditionalProperties(IContext context, ExcelReplicationSettings settings, IMendixObject template) throws CoreException { - IMendixIdentifier addPropertyId = template.getValue(context, Template.MemberNames.Template_AdditionalProperties.toString()); - if( addPropertyId != null ) { - IMendixObject addProperties = Core.retrieveId(context, addPropertyId); - if( addProperties != null ) { - if( addProperties.getValue(context, AdditionalProperties.MemberNames.PrintStatisticsMessages.toString()) == null ) - settings.printImportStatistics( StatisticsLevel.AllStatistics ); - else { - switch ( excelimporter.proxies.StatisticsLevel.valueOf( (String) addProperties.getValue(context, AdditionalProperties.MemberNames.PrintStatisticsMessages.toString()) ) ) { - case AllStatistics : - settings.printImportStatistics( StatisticsLevel.AllStatistics ); - break; - case OnlyFinalStatistics : - settings.printImportStatistics( StatisticsLevel.OnlyFinalStatistics ); - break; - case NoStatistics : - settings.printImportStatistics( StatisticsLevel.NoStatistics ); - break; - default: - settings.printImportStatistics( StatisticsLevel.AllStatistics ); - break; - } - } - settings.getMainObjectConfig().setPrintNotFoundMessages( (Boolean)addProperties.getValue(context, AdditionalProperties.MemberNames.PrintNotFoundMessages_MainObject.toString()) ); - settings.ignoreEmptyKeys( (Boolean)addProperties.getValue(context, AdditionalProperties.MemberNames.IgnoreEmptyKeys.toString()) ); - - settings.getMainObjectConfig().setCommitUnchangedObjects( (Boolean)addProperties.getValue(context, AdditionalProperties.MemberNames.CommitUnchangedObjects_MainObject.toString()) ); - settings.resetEmptyAssociations( (Boolean)addProperties.getValue(context, AdditionalProperties.MemberNames.ResetEmptyAssociations.toString()) ); - - - settings.useTransactions(false); - settings.importInNewContext(false); - - RemoveIndicator indicator = RemoveIndicator.valueOf( (String) addProperties.getValue(context, AdditionalProperties.MemberNames.RemoveUnsyncedObjects.toString()) ); - ObjectConfig mainConfig = settings.getMainObjectConfig(); - IMendixIdentifier identifier; - switch ( indicator ) { - case RemoveUnchangedObjects : - identifier = addProperties.getValue(context, AdditionalProperties.MemberNames.AdditionalProperties_MxObjectMember_RemoveIndicator.toString()); - if (identifier != null) - mainConfig.removeUnusedObjects( ChangeTracking.RemoveUnchangedObjects, (String) Core.retrieveId(context, identifier).getValue(context, MxObjectMember.MemberNames.AttributeName.toString()) ); - - break; - case TrackChanges : - identifier = addProperties.getValue(context, AdditionalProperties.MemberNames.AdditionalProperties_MxObjectMember_RemoveIndicator.toString()); - if (identifier != null) - mainConfig.removeUnusedObjects( ChangeTracking.TrackChanges, (String) Core.retrieveId(context, identifier).getValue(context, MxObjectMember.MemberNames.AttributeName.toString()) ); - break; - case Nothing : - default : - mainConfig.removeUnusedObjects( ChangeTracking.Nothing, null ); - break; - } - - if( addProperties.hasMember("RetrieveOQL_Limit") ) { - Integer limit = (Integer) addProperties.getValue(context, "RetrieveOQL_Limit"); - if( limit != null ) { - logNode.debug("Changing retrieve limit to: " + limit); - settings.Configuration.RetrieveOQL_Limit = limit; - } - } - } - } - } - - /** - * Convert column number to Excel column text (0=A, 25=Z, 26=AA, 77=BZ, 78=CA etc) - * @param col - * @return string representation of this column number - */ - public static String colNumberToText(short col) { - char firstChar = (char)((col/26)+64); - char secondChar = (char)((col%26)+65); - if (firstChar == '@') return String.valueOf(secondChar); - return "" + firstChar + secondChar; - } - - public ExcelReplicationSettings getSettings() { - return this.settings; - } - - public Map> getDocPropertiesMapping() { - return this.docProperties ; - } -} diff --git a/javasource/excelimporter/reader/readers/ExcelRowProcessor.java b/javasource/excelimporter/reader/readers/ExcelRowProcessor.java deleted file mode 100644 index 54bf202..0000000 --- a/javasource/excelimporter/reader/readers/ExcelRowProcessor.java +++ /dev/null @@ -1,175 +0,0 @@ -package excelimporter.reader.readers; - -import java.util.HashMap; -import java.util.Map; -import java.util.Set; - -import replication.MetaInfo; -import replication.MetaInfo.MetaInfoObject; -import replication.ReplicationSettings.MendixReplicationException; -import replication.ValueParser.ParseException; - -import com.mendix.systemwideinterfaces.core.meta.IMetaPrimitive.PrimitiveType; - -import excelimporter.reader.readers.replication.ExcelReplicationSettings; -import excelimporter.reader.readers.replication.ExcelValueParser; - -public class ExcelRowProcessor { - - private ExcelValueParser valueParser; - private MetaInfo info; - private ExcelReader xlsReader; - - private long rowCounter; - private boolean hasDocProps; - private Map> docProps; - - - public ExcelRowProcessor( ExcelReader xlsReader ) throws MendixReplicationException { - this.xlsReader = xlsReader; - this.valueParser = new ExcelValueParser(this.xlsReader.getSettings().getValueParsers(), this.xlsReader.getSettings()); - this.info = new MetaInfo(this.xlsReader.getSettings(), this.valueParser, "XLSReader"); - this.docProps = xlsReader.getDocPropertiesMapping(); - this.hasDocProps = this.docProps.size() > 0; - - this.rowCounter = 0; - } - - public void processValues( ExcelCellData[] values, int rowNow, int sheetNow ) throws MendixReplicationException { - ExcelReplicationSettings settings = this.xlsReader.getSettings(); - try { - String objectKey = this.valueParser.buildObjectKey(values, settings.getMainObjectConfig()); - if ( ExcelReader.logNode.isTraceEnabled() ) - ExcelReader.logNode - .trace("Start procssing excel row: " + this.rowCounter + " found: " + values.length + " columns to process. Using ObjectKey: " + objectKey); - - - Map prevObject = null; - if ( this.hasDocProps ) - prevObject = new HashMap(); - rowNow++; - sheetNow++; - - for( int i = 0; i < values.length; i++ ) { - String alias = String.valueOf(i); - if ( settings.aliasIsMapped(alias) ) { - - String id; - PrimitiveType type = this.xlsReader.getSettings().getMemberType(alias); - MetaInfoObject miObject; - - Object processedValue = this.valueParser.getValueFromDataSet(alias, type, values); - - if ( settings.treatFieldAsReference(alias) ) { - miObject = this.info.setAssociationValue(objectKey, alias, processedValue); - id = this.xlsReader.getSettings().getAssociationNameByAlias(alias); - } - else if ( settings.treatFieldAsReferenceSet(alias) ) { - miObject = this.info.addAssociationValue(objectKey, alias, processedValue); - id = this.xlsReader.getSettings().getAssociationNameByAlias(alias); - } - else { - miObject = this.info.addValue(objectKey, alias, processedValue); - id = this.xlsReader.getSettings().getMainObjectConfig().getObjectType(); - } - Long columnObjectID = (miObject == null ? null : miObject.getId()); - - if ( this.hasDocProps && this.docProps.containsKey(id) ) { - if ( !prevObject.containsKey(id) || columnObjectID != prevObject.get(id) ) { - prevObject.put(id, columnObjectID); - - for( DocProperties props : this.docProps.get(id) ) { - Object value = null; - switch (props.getDataSource()) { - case DocumentPropertyRowNr: - value = rowNow; - break; - case DocumentPropertySheetNr: - value = sheetNow; - break; - case StaticValue: - value = props.getStaticStringValue(); - break; - case CellValue: - break; - } - - switch (props.getMappingType()) { - case Attribute: - this.info.addValue(objectKey, props.getColumnAlias(), value); - break; - case Reference: - this.info.addAssociationValue(objectKey, props.getColumnAlias(), value); - break; - default: - break; - } - } - } - } - } - } - - - } - catch( ParseException e ) { - if ( !settings.getErrorHandler().valueException(e, e.getMessage()) ) - throw e; - } - - this.rowCounter++; - resetValuesArray(values); - } - - public static class ExcelCellData { - - private Object formattedData; - private Object rawData; - private int colNr; - private String displayMask; - - public ExcelCellData( int colNr, Object rawData, Object formattedData ) { - this.colNr = colNr; - this.rawData = rawData; - this.formattedData = formattedData; - } - - - public ExcelCellData( int colNr, Object rawData, Object formattedData, String displayMask ) { - this.colNr = colNr; - this.rawData = rawData; - this.formattedData = formattedData; - this.displayMask = displayMask; - } - - public String getDisplayMask() { - return this.displayMask; - } - - public int getColNr() { - return this.colNr; - } - - public Object getFormattedData() { - return this.formattedData; - } - - public Object getRawData() { - return this.rawData; - } - } - - private static void resetValuesArray( Object[] values ) { - for( int i = 0; i < values.length; i++ ) { - values[i] = null; - } - } - - public void finish() throws MendixReplicationException { - this.info.finished(); - } - - public long getRowCounter() { - return this.rowCounter; - } -} diff --git a/javasource/excelimporter/reader/readers/ExcelXLSReaderDataFirstPassListener.java b/javasource/excelimporter/reader/readers/ExcelXLSReaderDataFirstPassListener.java deleted file mode 100644 index 965ae17..0000000 --- a/javasource/excelimporter/reader/readers/ExcelXLSReaderDataFirstPassListener.java +++ /dev/null @@ -1,129 +0,0 @@ -package excelimporter.reader.readers; - -import java.util.HashMap; - -import org.apache.poi.hssf.eventusermodel.HSSFListener; -import org.apache.poi.hssf.record.BOFRecord; -import org.apache.poi.hssf.record.BoolErrRecord; -import org.apache.poi.hssf.record.FormulaRecord; -import org.apache.poi.hssf.record.LabelSSTRecord; -import org.apache.poi.hssf.record.NumberRecord; -import org.apache.poi.hssf.record.Record; -import org.apache.poi.hssf.record.SSTRecord; - -/** - * - * - * @author J. van der Hoek - Mendix - * @version $Id: ExcelXLSReaderDataFirstPassListener.java 8202 2008-10-03 10:05:54Z Jonathan Veldhuizen $ - */ -public class ExcelXLSReaderDataFirstPassListener implements HSSFListener { - private final int iCanHasSheet; - private final int startRow; - private int nrOfColumns = 1; - - private ExcelReader xlsReader; - - int workbookNow = -1; - int sheetNow = -1; - - private HashMap sstmap; - - public ExcelXLSReaderDataFirstPassListener(int iCanHasSheet, int startRow, ExcelReader xlsReader ) { - this.iCanHasSheet = iCanHasSheet; - this.startRow = startRow; - this.xlsReader = xlsReader; - } - - /** - * This method listens for incoming records and handles them as required. - * @param record The record that was found while reading. - */ - @Override - public void processRecord(Record record) { - // Most frequent encountered first... - switch (record.getSid()) { -// case FormatRecord.sid: { -// FormatRecord frec = (FormatRecord) record; -// frec.getIndexCode(); -// frec.getFormatString(); -// break; -// } - case LabelSSTRecord.sid: - if (this.sheetNow == this.iCanHasSheet) { - LabelSSTRecord lrec = (LabelSSTRecord) record; - int row = lrec.getRow(); - short col = lrec.getColumn(); - if( this.nrOfColumns < col ) - this.nrOfColumns = col; - if( this.mayUseValue(row, col)) { - int sstindex = lrec.getSSTIndex(); - - if( ExcelReader.logNode.isDebugEnabled() ) - ExcelReader.logNode.debug("XLS_DATA-1stPass: LabelSSTRecord found for row: " + (row+1) + " col: " + ExcelReader.colNumberToText(col) + " sstindex: " + sstindex); - // mark this spot in the sstlist, so it will be filled with the string at second pass - this.sstmap.put(sstindex, ""); - } - } - break; - case NumberRecord.sid: - if (this.sheetNow == this.iCanHasSheet) { - NumberRecord nrec = (NumberRecord) record; - short col = nrec.getColumn(); - if( this.nrOfColumns < col ) - this.nrOfColumns = col; - } - break; - case BoolErrRecord.sid: - if (this.sheetNow == this.iCanHasSheet) { - BoolErrRecord brec = (BoolErrRecord) record; - short col = brec.getColumn(); - if( this.nrOfColumns < col ) - this.nrOfColumns = col; - } - break; - // the BOFRecord can represent either the beginning of a sheet or the workbook - case BOFRecord.sid: - BOFRecord bof = (BOFRecord) record; - if (bof.getType() == BOFRecord.TYPE_WORKBOOK) { - ++this.workbookNow; - - if( ExcelReader.logNode.isDebugEnabled() ) - ExcelReader.logNode.debug("XLS_DATA-1stPass: Now at workbook " + (this.workbookNow+1)); - } else if (bof.getType() == BOFRecord.TYPE_WORKSHEET) { - ++this.sheetNow; - - if( ExcelReader.logNode.isDebugEnabled() ) - ExcelReader.logNode.debug("XLS_DATA-1stPass: Now at worksheet " + (this.sheetNow+1)); - } - break; - case org.apache.poi.hssf.record.FormulaRecord.sid: - if (this.sheetNow == this.iCanHasSheet) { - FormulaRecord lrec = (FormulaRecord) record; - short col = lrec.getColumn(); - if( this.nrOfColumns < col ) - this.nrOfColumns = col; - } - break; - case SSTRecord.sid: - SSTRecord sstrec = (SSTRecord) record; - this.sstmap = new HashMap(); // don't know the preferred size here... - - if( ExcelReader.logNode.isDebugEnabled() ) - ExcelReader.logNode.debug("XLS_DATA-1stPass: Static String Table found with NumUniqueStrings: " + sstrec.getNumUniqueStrings()); - break; - } - } - - public HashMap getSSTMap() { - return this.sstmap; - } - - private boolean mayUseValue( int row, int col ) { - return row >= this.startRow && this.xlsReader.getSettings().aliasIsMapped( String.valueOf(col) ); - } - - public int getNrOfColumns() { - return this.nrOfColumns; - } -} diff --git a/javasource/excelimporter/reader/readers/ExcelXLSReaderDataSecondPassListener.java b/javasource/excelimporter/reader/readers/ExcelXLSReaderDataSecondPassListener.java deleted file mode 100644 index 2e2848e..0000000 --- a/javasource/excelimporter/reader/readers/ExcelXLSReaderDataSecondPassListener.java +++ /dev/null @@ -1,328 +0,0 @@ -package excelimporter.reader.readers; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Hashtable; -import java.util.List; -import java.util.Map; - -import org.apache.poi.hssf.eventusermodel.HSSFListener; -import org.apache.poi.hssf.record.BOFRecord; -import org.apache.poi.hssf.record.BoolErrRecord; -import org.apache.poi.hssf.record.CellValueRecordInterface; -import org.apache.poi.hssf.record.EOFRecord; -import org.apache.poi.hssf.record.ExtendedFormatRecord; -import org.apache.poi.hssf.record.FormatRecord; -import org.apache.poi.hssf.record.FormulaRecord; -import org.apache.poi.hssf.record.LabelSSTRecord; -import org.apache.poi.hssf.record.NumberRecord; -import org.apache.poi.hssf.record.Record; -import org.apache.poi.hssf.record.SSTRecord; -import org.apache.poi.hssf.record.StringRecord; -import org.apache.poi.hssf.usermodel.HSSFDataFormat; -import org.apache.poi.hssf.usermodel.HSSFDataFormatter; - -import com.mendix.core.CoreException; - -import excelimporter.reader.readers.ExcelRowProcessor.ExcelCellData; - -/** - * - * - * @author J. van der Hoek - Mendix - * @version $Id: ExcelXLSReaderDataSecondPassListener.java 9272 2009-05-11 - * 09:19:47Z Jasper van der Hoek $ - */ -public class ExcelXLSReaderDataSecondPassListener implements HSSFListener { - - private final int iCanHasSheet; - private final int startRow; - private final HashMap sstmap; - - private int workbookNow = -1; - private int sheetNow = -1; - private int rowNow = -1; - private long rowCounter = 0; - - private boolean nextRecordIsFormulaCachedStringResult = false; - private int lastRow = -1; - private short lastCol = -1; - - private ExcelCellData[] values; - private ExcelReader xlsReader; - private ExcelRowProcessor excelRowProcessor; - - private HSSFDataFormatter _formatter = new HSSFDataFormatter(); - private final Map _customFormatRecords = new Hashtable(); - private final List _xfRecords = new ArrayList(); - - public ExcelXLSReaderDataSecondPassListener(int iCanHasSheet, int startRow, HashMap sstmap, - ExcelReader xlsReader, int nrOfColumns) throws CoreException { - this.iCanHasSheet = iCanHasSheet; - this.startRow = startRow; - this.sstmap = sstmap; - - this.xlsReader = xlsReader; - this.values = new ExcelCellData[++nrOfColumns]; - this.excelRowProcessor = new ExcelRowProcessor(xlsReader); - } - - /** - * This method listens for incoming records and handles them as required. - * - * @param record The record that was found while reading. - */ - @Override - public void processRecord(Record record) throws ExcelRuntimeException { - try { - switch (record.getSid()) { - case LabelSSTRecord.sid: - if (this.sheetNow == this.iCanHasSheet) { - LabelSSTRecord lrec = (LabelSSTRecord) record; - int row = lrec.getRow(); - short col = lrec.getColumn(); - - this.processRecord(row, col, this.sstmap.get(lrec.getSSTIndex()), null, null); - } - break; - case FormatRecord.sid: { - FormatRecord fr = (FormatRecord) record; - this._customFormatRecords.put(Integer.valueOf(fr.getIndexCode()), fr); - break; - } - case ExtendedFormatRecord.sid: { - ExtendedFormatRecord xr = (ExtendedFormatRecord) record; - this._xfRecords.add(xr); - break; - } - case NumberRecord.sid: - if (this.sheetNow == this.iCanHasSheet) { - NumberRecord nrec = (NumberRecord) record; - int row = nrec.getRow(); - short col = nrec.getColumn(); - - // Get the built in format, if there is one - String formatString = getFormatString(nrec); - - this.processRecord(row, col, nrec.getValue(), formatNumberDateCell(nrec), formatString); - } - break; - case BoolErrRecord.sid: - if (this.sheetNow == this.iCanHasSheet) { - BoolErrRecord brec = (BoolErrRecord) record; - int row = brec.getRow(); - short col = brec.getColumn(); - - this.processRecord(row, col, brec.getBooleanValue(), brec.getBooleanValue(), null); - } - break; - case FormulaRecord.sid: - if (this.sheetNow == this.iCanHasSheet) { - FormulaRecord frec = (FormulaRecord) record; - this.lastRow = frec.getRow(); - this.lastCol = frec.getColumn(); - - // TODO: Use frec.getCachedResultType (?) to get other result types (e.g. - // boolean); is resulting int - // a sid? - if (frec.hasCachedResultString()) { - this.nextRecordIsFormulaCachedStringResult = true; - } else { - this.processRecord(this.lastRow, this.lastCol, frec.getValue(), frec.getValue(), null); - } - } - break; - case StringRecord.sid: - if (this.sheetNow == this.iCanHasSheet) { - StringRecord srec = (StringRecord) record; - if (this.nextRecordIsFormulaCachedStringResult) { - this.nextRecordIsFormulaCachedStringResult = false; - - this.processRecord(this.lastRow, this.lastCol, srec.getString(), srec.getString(), null); - } - } - break; - case BOFRecord.sid: - // the BOFRecord can represent either the beginning of a sheet or the workbook - BOFRecord bof = (BOFRecord) record; - if (bof.getType() == BOFRecord.TYPE_WORKBOOK) { - ++this.workbookNow; - if (ExcelReader.logNode.isDebugEnabled()) - ExcelReader.logNode.debug("XLS_DATA-2ndPass: Now at workbook " + (this.workbookNow + 1)); - } else if (bof.getType() == BOFRecord.TYPE_WORKSHEET) { - ++this.sheetNow; - if (ExcelReader.logNode.isDebugEnabled()) - ExcelReader.logNode.debug("XLS_DATA-2ndPass: Now at worksheet " + (this.sheetNow + 1)); - } - break; - case SSTRecord.sid: - // Static String Table - SSTRecord sstrec = (SSTRecord) record; - if (ExcelReader.logNode.isDebugEnabled()) - ExcelReader.logNode.debug("XLS_DATA-2ndPass: Static String Table found .. filling sstlist with " - + this.sstmap.size() + " Strings"); - - for (int i = 0; i < sstrec.getNumUniqueStrings(); i++) { - if (this.sstmap.get(i) != null) - this.sstmap.put(i, sstrec.getString(i).toString().trim()); - } - break; - case EOFRecord.sid: - if (this.sheetNow == this.iCanHasSheet) { - if (this.values.length > 0) { - this.excelRowProcessor.processValues(this.values, this.rowNow, this.sheetNow); - this.rowCounter++; // This is for the last record(row) - } - this.excelRowProcessor.finish(); - } - break; - } - - } catch (ExcelRuntimeException e) { - throw e; - } catch (Exception e) { - throw new ExcelRuntimeException(e); - } - } - - /** - * Formats the given numeric of date Cell's contents as a String, in as close as - * we can to the way that Excel would do so. Uses the various format records to - * manage this. - * - * TODO - move this to a central class in such a way that hssf.usermodel can - * make use of it too - */ - public String formatNumberDateCell(CellValueRecordInterface cell) { - double value; - if (cell instanceof NumberRecord) { - value = ((NumberRecord) cell).getValue(); - } else if (cell instanceof FormulaRecord) { - value = ((FormulaRecord) cell).getValue(); - } else { - throw new IllegalArgumentException("Unsupported CellValue Record passed in " + cell); - } - - // Get the built in format, if there is one - int formatIndex = getFormatIndex(cell); - String formatString = getFormatString(cell); - - if (formatString != null) { - // Format, using the nice new - // HSSFDataFormatter to do the work for us - String returnValue = this._formatter.formatRawCellContents(value, formatIndex, formatString); - - if (ExcelReader.logNode.isTraceEnabled()) - ExcelReader.logNode - .trace("Formatting " + (cell.getRow() + 1) + ExcelReader.colNumberToText(cell.getColumn()) - + " / '" + value + "' using format: '" + formatString + "' as " + returnValue); - - return returnValue; - } else { - return Double.toString(value); - } - } - - /** - * Returns the format string, eg $##.##, for the given number format index. - */ - public String getFormatString(int formatIndex) { - String format = null; - if (formatIndex >= HSSFDataFormat.getNumberOfBuiltinBuiltinFormats()) { - FormatRecord tfr = this._customFormatRecords.get(Integer.valueOf(formatIndex)); - if (tfr == null) { - ExcelReader.logNode.error("Requested format at index " + formatIndex + ", but it wasn't found"); - } else { - format = tfr.getFormatString(); - } - } else { - format = HSSFDataFormat.getBuiltinFormat((short) formatIndex); - } - return format; - } - - /** - * Returns the format string, eg $##.##, used by your cell - */ - public String getFormatString(CellValueRecordInterface cell) { - int formatIndex = getFormatIndex(cell); - if (formatIndex == -1) { - // Not found - return null; - } - return getFormatString(formatIndex); - } - - /** - * Returns the index of the format string, used by your cell, or -1 if none - * found - */ - public int getFormatIndex(CellValueRecordInterface cell) { - ExtendedFormatRecord xfr = this._xfRecords.get(cell.getXFIndex()); - if (xfr == null) { - ExcelReader.logNode.error("Cell " + cell.getRow() + "," + cell.getColumn() + " uses XF with index " - + cell.getXFIndex() + ", but we don't have that"); - return -1; - } - return xfr.getFormatIndex(); - } - - private void processRecord(int row, short col, Object rawValue, Object formattedValue, String displayMask) { - if (this.mayUseValue(row, col)) { - if (this.rowNow != row) { - if (row > this.startRow) { - try { - if (this.values.length > 0) { - this.excelRowProcessor.processValues(this.values, this.rowNow, this.sheetNow); - this.rowCounter++; - } - } catch (Exception e) { - throw new ExcelRuntimeException("XLS_DATA-2ndPass: an exception occurred near row: " + row - + ", the exception is: " + e.getMessage(), e); - } - } - this.rowNow = row; - } - - try { - if (ExcelReader.logNode.isTraceEnabled()) - ExcelReader.logNode - .trace("Reading " + (row + 1) + ExcelReader.colNumberToText(col) + " / '" + rawValue + "'"); - - this.values[col] = new ExcelCellData(col, rawValue, formattedValue, displayMask); - } catch (Exception e) { - throw new ExcelRuntimeException("XLS_DATA-2ndPass: FormulaRecord row: " + (row) + " col: " + col - + ", Value: " + rawValue + "|" + formattedValue + " triggers Exception: " + e.getMessage(), e); - } - } - } - - public long getRowCounter() { - return this.rowCounter; - } - - private boolean mayUseValue(int row, int col) { - return row >= this.startRow && this.xlsReader.getSettings().aliasIsMapped(String.valueOf(col)); - } - - public class ExcelRuntimeException extends RuntimeException { - - private static final long serialVersionUID = 123456L; - - public ExcelRuntimeException() { - super(); - } - - public ExcelRuntimeException(String message) { - super(message); - } - - public ExcelRuntimeException(Exception e) { - super(e); - } - - public ExcelRuntimeException(String message, Exception e) { - super(message, e); - } - } -} diff --git a/javasource/excelimporter/reader/readers/ExcelXLSReaderHeaderFirstPassListener.java b/javasource/excelimporter/reader/readers/ExcelXLSReaderHeaderFirstPassListener.java deleted file mode 100644 index 992fade..0000000 --- a/javasource/excelimporter/reader/readers/ExcelXLSReaderHeaderFirstPassListener.java +++ /dev/null @@ -1,96 +0,0 @@ -package excelimporter.reader.readers; - -import java.util.HashMap; - -import org.apache.poi.hssf.eventusermodel.HSSFListener; -import org.apache.poi.hssf.record.BOFRecord; -import org.apache.poi.hssf.record.LabelSSTRecord; -import org.apache.poi.hssf.record.Record; -import org.apache.poi.hssf.record.RowRecord; - -/** - * - * - * @author H. van Kranenburg, J. van der Hoek, J. Veldhuizen - * @version $Id: ExcelXLSReaderHeaderFirstPassListener.java 8202 2008-10-03 10:05:54Z Jonathan Veldhuizen $ - */ -public class ExcelXLSReaderHeaderFirstPassListener implements HSSFListener { - - private final int sheet; - private final int row; - - int workbookNow = -1; - int sheetNow = -1; - int firstcol; - int lastcol; - - // sstmap: list of unique strings occurring - // at first pass these will be marked with an empty dummy string when processing - // the LabelSSTRecord fields that are relevant to us - // at second pass this dummy string will be replaced by the actual string from the sst map - private HashMap sstmap; - - public ExcelXLSReaderHeaderFirstPassListener( int sheet, int row ) { - // this worksheet contains the row with template header fields - this.sheet = sheet; - // the row that contains template header fields - this.row = row; - } - - /** - * This method listens for incoming records and handles them as required. - * - * @param record The record that was found while reading. - */ - @Override - public void processRecord( Record record ) { - // Most frequent encountered first... - switch (record.getSid()) { - case LabelSSTRecord.sid: - // LabelSSTRecord is a record that holds a pointer to a unicode string in the Static String Table - if ( this.sheetNow == this.sheet ) { - LabelSSTRecord lrec = (LabelSSTRecord) record; - // is this cell of interest to us? - if ( lrec.getRow() == this.row ) { - int sstindex = lrec.getSSTIndex(); - - // mark this spot in the sstlist, so it will be filled with the string at second pass - this.sstmap.put(sstindex, ""); - } - } - break; - case RowRecord.sid: - if ( this.sheetNow == this.sheet ) { - RowRecord rowrec = (RowRecord) record; - if ( rowrec.getRowNumber() == this.row ) { - this.firstcol = Integer.valueOf(rowrec.getFirstCol()); - this.lastcol = Integer.valueOf(rowrec.getLastCol()); - - // http://java.sun.com/j2se/1.5.0/docs/api/java/util/HashMap.html - // "As a general rule, the default load factor (.75) offers a good tradeoff between time and space costs." - int sstmapsize = (int) ((this.lastcol - this.firstcol) / 0.75); - this.sstmap = new HashMap(sstmapsize); - } - } - break; - case BOFRecord.sid: - // BOFRecord can represent either the beginning of a sheet or the workbook - BOFRecord bof = (BOFRecord) record; - if ( bof.getType() == BOFRecord.TYPE_WORKBOOK ) { - ++this.workbookNow; - } - else if ( bof.getType() == BOFRecord.TYPE_WORKSHEET ) { - ++this.sheetNow; - } - break; - } - } - - public HashMap getSSTMap() { - return this.sstmap; - } - - public int getRowWidth() { - return this.lastcol - this.firstcol; - } -} diff --git a/javasource/excelimporter/reader/readers/ExcelXLSReaderHeaderSecondPassListener.java b/javasource/excelimporter/reader/readers/ExcelXLSReaderHeaderSecondPassListener.java deleted file mode 100644 index 68d7b52..0000000 --- a/javasource/excelimporter/reader/readers/ExcelXLSReaderHeaderSecondPassListener.java +++ /dev/null @@ -1,115 +0,0 @@ -package excelimporter.reader.readers; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; - -import org.apache.poi.hssf.eventusermodel.HSSFListener; -import org.apache.poi.hssf.record.BOFRecord; -import org.apache.poi.hssf.record.BoolErrRecord; -import org.apache.poi.hssf.record.FormulaRecord; -import org.apache.poi.hssf.record.LabelSSTRecord; -import org.apache.poi.hssf.record.NumberRecord; -import org.apache.poi.hssf.record.Record; -import org.apache.poi.hssf.record.SSTRecord; - -/** - * - * - * @author H. van Kranenburg, J. van der Hoek, J. Veldhuizen - * @version $Id: ExcelXLSReaderHeaderSecondPassListener.java 8202 2008-10-03 10:05:54Z Jonathan Veldhuizen $ - */ -public class ExcelXLSReaderHeaderSecondPassListener implements HSSFListener, ExcelHeadable { - - private final int sheet; - private final int row; - private final HashMap sstmap; - - private List excelColumns = new ArrayList(); - - int workbookNow = -1; - int sheetNow = -1; - - public ExcelXLSReaderHeaderSecondPassListener( int sheet, int row, HashMap sstmap ) { - this.sheet = sheet; - this.row = row; - this.sstmap = sstmap; - } - - /** - * This method listens for incoming records and handles them as required. - * - * @param record The record that was found while reading. - */ - @Override - public void processRecord( Record record ) { - // Most frequent encountered first... - switch (record.getSid()) { - case LabelSSTRecord.sid: - if ( this.sheetNow == this.sheet ) { - LabelSSTRecord lrec = (LabelSSTRecord) record; - if ( lrec.getRow() == this.row ) { - short col = lrec.getColumn(); - String text = this.sstmap.get(lrec.getSSTIndex()); - this.processRecord(col, text); - } - } - break; - case NumberRecord.sid: - if ( this.sheetNow == this.sheet ) { - NumberRecord nrec = (NumberRecord) record; - if ( nrec.getRow() == this.row ) { - short col = nrec.getColumn(); - this.processRecord(col, nrec.getValue()); - } - } - break; - case BoolErrRecord.sid: - if ( this.sheetNow == this.sheet ) { - BoolErrRecord brec = (BoolErrRecord) record; - if ( brec.getRow() == this.row ) { - short col = brec.getColumn(); - this.processRecord(col, brec.getBooleanValue()); - } - } - break; - case FormulaRecord.sid: - if ( this.sheetNow == this.sheet ) { - FormulaRecord frec = (FormulaRecord) record; - if ( frec.getRow() == this.row ) { - short col = frec.getColumn(); - this.processRecord(col, frec.getValue()); - } - } - break; - // the BOFRecord can represent either the beginning of a sheet or the workbook - case BOFRecord.sid: - BOFRecord bof = (BOFRecord) record; - if ( bof.getType() == BOFRecord.TYPE_WORKBOOK ) { - ++this.workbookNow; - } - else if ( bof.getType() == BOFRecord.TYPE_WORKSHEET ) { - ++this.sheetNow; - } - break; - case SSTRecord.sid: - // Here's the SST again... now read in strings that we need - SSTRecord sstrec = (SSTRecord) record; - for( int i = 0; i < sstrec.getNumUniqueStrings(); i++ ) { - if ( this.sstmap.get(i) != null ) - this.sstmap.put(i, sstrec.getString(i).toString().trim()); - } - break; - } - } - - private void processRecord( short col, Object value ) { - ExcelColumn column = new ExcelColumn(new Integer(col), String.valueOf(value)); - this.excelColumns.add(column); - } - - @Override - public List getColumns() { - return this.excelColumns; - } -} diff --git a/javasource/excelimporter/reader/readers/ExcelXLSXDataReader.java b/javasource/excelimporter/reader/readers/ExcelXLSXDataReader.java deleted file mode 100644 index 334fb23..0000000 --- a/javasource/excelimporter/reader/readers/ExcelXLSXDataReader.java +++ /dev/null @@ -1,141 +0,0 @@ -package excelimporter.reader.readers; - -import java.io.IOException; -import java.io.InputStream; - -import org.apache.poi.openxml4j.exceptions.OpenXML4JException; -import org.apache.poi.openxml4j.opc.OPCPackage; -import org.apache.poi.openxml4j.opc.PackageAccess; -import org.apache.poi.xssf.eventusermodel.XSSFReader; -import org.apache.poi.xssf.model.StylesTable; -import org.xml.sax.Attributes; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; -import org.xml.sax.XMLReader; -import org.xml.sax.helpers.XMLReaderFactory; - -import replication.ReplicationSettings.MendixReplicationException; -import excelimporter.reader.readers.replication.ExcelReplicationSettings; - -public class ExcelXLSXDataReader extends ExcelXLSXReader { - - public static long readData(String fullPathExcelFile, int sheetNr, int startRowNr, ExcelReader xlsReader) - throws IOException, OpenXML4JException, SAXException, MendixReplicationException { - OPCPackage opcPackage = null; - InputStream sheet = null; - ExcelRowProcessor excelRowProcessor = null; - try { - opcPackage = OPCPackage.open(fullPathExcelFile, PackageAccess.READ); - XSSFReader reader = new XSSFReader(opcPackage); - ReadOnlySharedStringsTable stringsTable = new ReadOnlySharedStringsTable(opcPackage); - StylesTable stylesTable = reader.getStylesTable(); - - excelRowProcessor = new ExcelRowProcessor(xlsReader); - - XMLReader parser = XMLReaderFactory.createXMLReader(); - ExcelXLSXReader.setXMLReaderProperties(parser); - ExcelReader.logNode.trace("Loaded SAX Parser: " + parser); - SheetHandler handler = new SheetHandler(xlsReader, stringsTable, stylesTable, startRowNr, excelRowProcessor, - sheetNr); - parser.setContentHandler(handler); - - sheet = reader.getSheet("rId" + (sheetNr + 1)); // API is 1-based; parameter is zero-based. - InputSource sheetSource = new InputSource(sheet); - parser.parse(sheetSource); - } finally { - try { - if (excelRowProcessor != null) { - excelRowProcessor.finish(); - if (excelRowProcessor.getRowCounter() == 0) - ExcelReader.logNode - .warn("Excel Importer could not import any rows. Please check if the template is configured correctly. If the file was not created with Microsoft Excel for desktop, try opening the file with Excel and saving it with the same name before importing."); - else - ExcelReader.logNode.info( - "Excel Importer successfully imported " + excelRowProcessor.getRowCounter() + " rows"); - return excelRowProcessor.getRowCounter(); - } - } catch (MendixReplicationException e) { - } // Quitely finishing - try { - if (sheet != null) - sheet.close(); - } catch (IOException ioe) { - } // Quitely closing - if (opcPackage != null) - opcPackage.revert(); - } - return 0l; - } - - private static class SheetHandler extends ExcelSheetHandler { - - private boolean[] columnsUsed; - private boolean handleCol = false; - - private ExcelRowProcessor excelRowProcessor; - private ExcelReplicationSettings settings; - - private SheetHandler(ExcelReader xlsReader, ReadOnlySharedStringsTable stringsTable, StylesTable stylesTable, - int startRowNr, ExcelRowProcessor excelRowProcessor, int sheetNr) throws MendixReplicationException { - super(stringsTable, stylesTable, sheetNr, startRowNr); - this.excelRowProcessor = excelRowProcessor; - - this.settings = xlsReader.getSettings(); - } - - @Override - public void startElement(String uri, String localName, String name, Attributes attributes) throws SAXException { - if (evaluateTextTag(localName, this.handleCol)) { - } else if (evaluateColumn(localName, attributes)) { - if (this.getCurrentColumnNr() < this.columnsUsed.length) - this.handleCol = this.columnsUsed[this.getCurrentColumnNr()]; - else - this.handleCol = false; - - if (this.handleCol) { - evaluateCellStyle(attributes); - } - } else if (evaluateFormula(name)) { - } else if (evaluateRow(localName, attributes)) { - } else if (localName.equals("dimension")) { // only encountered once - int colTo = evaluateDimension(attributes); - - this.columnsUsed = new boolean[colTo + 1]; - for (int i = 0; i < this.columnsUsed.length; i++) { - this.columnsUsed[i] = this.settings.aliasIsMapped(String.valueOf(i)); - } - } - } - - @Override - public void endElement(String uri, String localName, String name) throws SAXException { - // If there is something wrong with the Excel XML then we don't try to fix it - // here. - if (this.shouldHandleRow()) { - closeTextProcessing(localName, this.handleCol); - - if (localName.equals("row")) { - boolean processRow = false; - // Check that at least one value is present, we want to skip blank lines - for (Object value : this.getValues()) { - if (null != value && value.toString().trim().length() != 0) { - processRow = true; - break; - } - } - - if (processRow) { - try { - this.excelRowProcessor.processValues(this.getValues(), this.getCurrentRow() - 1, - this.getCurrentSheet()); - } catch (MendixReplicationException e) { - throw new SAXException("Unable to store Excel row. Error found in row of cell nr: " - + this.getCurrentColumnStr(), e); - } - } - } - } - } - - } -} diff --git a/javasource/excelimporter/reader/readers/ExcelXLSXHeaderReader.java b/javasource/excelimporter/reader/readers/ExcelXLSXHeaderReader.java deleted file mode 100644 index cfff05e..0000000 --- a/javasource/excelimporter/reader/readers/ExcelXLSXHeaderReader.java +++ /dev/null @@ -1,138 +0,0 @@ -package excelimporter.reader.readers; - -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; - -import org.apache.poi.openxml4j.exceptions.OpenXML4JException; -import org.apache.poi.openxml4j.opc.OPCPackage; -import org.apache.poi.openxml4j.opc.PackageAccess; -import org.apache.poi.xssf.eventusermodel.XSSFReader; -import org.apache.poi.xssf.model.StylesTable; -import org.xml.sax.Attributes; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; -import org.xml.sax.XMLReader; -import org.xml.sax.helpers.XMLReaderFactory; - -import replication.ValueParser.ParseException; - -import com.mendix.core.Core; -import com.mendix.core.CoreException; -import com.mendix.logging.ILogNode; -import com.mendix.systemwideinterfaces.core.meta.IMetaPrimitive.PrimitiveType; - -import excelimporter.reader.readers.ExcelRowProcessor.ExcelCellData; -import excelimporter.reader.readers.replication.ExcelValueParser; - -public class ExcelXLSXHeaderReader extends ExcelXLSXReader implements ExcelHeadable { - - public static ILogNode logNode = Core.getLogger("ExcelXLSXHeaderReader"); - private List excelColumns; - - public ExcelXLSXHeaderReader( String fullPathExcelFile, int sheetNr, int rowNr ) throws CoreException, IOException, SAXException, OpenXML4JException { - OPCPackage opcPackage = null; - InputStream sheet = null; - try { - this.excelColumns = new ArrayList(); - opcPackage = OPCPackage.open(fullPathExcelFile, PackageAccess.READ); - XSSFReader reader; - try { - reader = new XSSFReader(opcPackage); - } - catch( NullPointerException e ) { - throw new CoreException("Invalid excel file structure, validate your document", e); - } - ReadOnlySharedStringsTable stringsTable = new ReadOnlySharedStringsTable(opcPackage); - StylesTable stylesTable = reader.getStylesTable(); - - XMLReader parser = XMLReaderFactory.createXMLReader(); - ExcelXLSXReader.setXMLReaderProperties(parser); - logNode.trace("Loaded SAX Parser: " + parser); - SheetHandler handler = new SheetHandler(stringsTable, stylesTable, rowNr, sheetNr); - parser.setContentHandler(handler); - - sheet = reader.getSheet("rId" + (sheetNr + 1)); // API is 1-based; parameter is zero-based. - InputSource sheetSource = new InputSource(sheet); - parser.parse(sheetSource); - } - finally { - if ( sheet != null ) - sheet.close(); - if ( opcPackage != null ) - opcPackage.revert(); - } - } - - @Override - public List getColumns() { - return this.excelColumns; - } - - /** - * See org.xml.sax.helpers.DefaultHandler javadocs - */ - private class SheetHandler extends ExcelSheetHandler { - - private boolean isProcessingHeaderRow = false; - private int headerRowNr = -1; - private ExcelValueParser valueParser; - - private SheetHandler( ReadOnlySharedStringsTable stringsTable, StylesTable stylesTable, int rowNr, int sheetNr ) { - super(stringsTable, stylesTable, sheetNr, rowNr); - - this.headerRowNr = rowNr; - this.valueParser = new ExcelValueParser(null, null); - } - - @Override - public void startElement( String uri, String localName, String name, Attributes attributes ) throws SAXException { - - if ( evaluateTextTag(localName, true) ) { - } - else if ( evaluateColumn(localName, attributes) ) { - evaluateCellStyle(attributes); - } - else if ( evaluateFormula(name) ) { - } - else if ( evaluateRow(localName, attributes) ) { - if ( this.getCurrentRow() == this.headerRowNr ) - this.isProcessingHeaderRow = true; - else - this.isProcessingHeaderRow = false; - } - else if ( localName.equals("dimension") ) { // only encountered once - evaluateDimension(attributes); - } - } - - @Override - public void endElement( String uri, String localName, String name ) throws SAXException { - - // If there is something wrong with the Excel XML then we don't try to fix it here. - if ( this.isProcessingHeaderRow && this.shouldHandleRow() ) { - closeTextProcessing(localName, true); - - if ( localName.equals("row") ) { - ExcelCellData[] values = this.getValues(); - for( int i = 0; i < values.length; i++ ) { - String alias = String.valueOf(i); - String processedValue; - try { - processedValue = (String) this.valueParser.getValueFromDataSet(alias, PrimitiveType.String, values); - } - catch( ParseException e ) { - throw new SAXException("Unable to process Excel Header value. Error found in row: " + this.getCurrentRow() + " column: " + values[i].getColNr(), e); - } - - if ( values[i] != null ) - ExcelXLSXHeaderReader.this.excelColumns.add(new ExcelColumn(values[i].getColNr(), processedValue)); - } - } - } - } - } - - -} diff --git a/javasource/excelimporter/reader/readers/ExcelXLSXReader.java b/javasource/excelimporter/reader/readers/ExcelXLSXReader.java deleted file mode 100644 index 2a47bbd..0000000 --- a/javasource/excelimporter/reader/readers/ExcelXLSXReader.java +++ /dev/null @@ -1,374 +0,0 @@ -package excelimporter.reader.readers; - -import java.util.ArrayList; -import java.util.List; - -import org.apache.poi.ss.usermodel.BuiltinFormats; -import org.apache.poi.ss.usermodel.DataFormatter; -import org.apache.poi.xssf.model.StylesTable; -import org.apache.poi.xssf.usermodel.XSSFCellStyle; -import org.apache.poi.xssf.usermodel.XSSFRichTextString; -import org.xml.sax.Attributes; -import org.xml.sax.SAXException; -import org.xml.sax.SAXNotRecognizedException; -import org.xml.sax.SAXNotSupportedException; -import org.xml.sax.XMLReader; -import org.xml.sax.helpers.DefaultHandler; - -import com.mendix.core.Core; - -import replication.ValueParser; -import replication.ValueParser.ParseException; -import excelimporter.reader.readers.ExcelRowProcessor.ExcelCellData; - -public abstract class ExcelXLSXReader { - - protected static abstract class ExcelSheetHandler extends DefaultHandler { - - private StylesTable stylesTable; - private ReadOnlySharedStringsTable stringsTable; - - private int startRowNr = 1; - private boolean handleRow = false; - private short excelStyle = -1; - private ExcelType excelType; - private int colNr = 0; - private String colString = ""; - private int currentRow = 0; - private int currentSheet = 0; - - private String formatString; - private short formatIndex; - private final DataFormatter formatter; - - private StringBuilder cellValue; - private StringBuilder formula; - private boolean isProcessingCellValue = false; - private boolean isProcessingFormula = false; - - private ExcelCellData[] values; - - - protected ExcelSheetHandler( ReadOnlySharedStringsTable stringsTable, StylesTable stylesTable, int sheetNr, int startRowNr ) { - this.formatter = new DataFormatter(); - this.stylesTable = stylesTable; - this.stringsTable = stringsTable; - - this.currentSheet = sheetNr; - this.startRowNr = startRowNr; - - this.cellValue = new StringBuilder(); - this.formula = new StringBuilder(); - - this.values = null; // will be assigned when we encounter the dimension node. (Parser will fail without this - // node, but it seems always present.) - } - - @Override - public void characters( char[] ch, int start, int length ) throws SAXException { - if ( this.handleRow && this.isProcessingCellValue ) - this.cellValue.append(ch, start, length); - - else if ( this.handleRow && this.isProcessingFormula ) - this.formula.append(ch, start, length); - } - - protected boolean evaluateRow( String localName, Attributes attributes ) { - if ( localName.equals("row") ) { - String rowNr = attributes.getValue("r"); - this.currentRow = Integer.parseInt(rowNr); - if ( !this.handleRow ) { - this.handleRow = null != rowNr && this.currentRow >= this.startRowNr; - } - - if ( ExcelReader.logNode.isDebugEnabled() && (this.currentRow % 100) == 0 ) - ExcelReader.logNode.debug("Start evaluating row: " + this.currentRow); - - return true; - } - return false; - } - - protected boolean evaluateFormula( String name ) throws SAXException { - if ( "f".equals(name) ) { - // Clear contents cache - this.formula.setLength(0); - // Mark us as being a formula if not already - if ( this.excelType == ExcelType.NUMBER ) { - this.excelType = ExcelType.FORMULA; - } - - this.isProcessingFormula = true; - return true; - } - return false; - } - - protected boolean evaluateColumn( String localName, Attributes attributes ) throws SAXException { - if ( localName.equals("c") && this.handleRow ) { - this.colString = attributes.getValue("r"); - this.colNr = parseCol(this.colString); - - return true; - } - - return false; - } - - protected boolean evaluateTextTag( String localName, boolean useColumn ) { - if ( isTextTag(localName, useColumn) ) { - this.isProcessingCellValue = true; - this.cellValue.setLength(0); - - return true; - } - - return false; - } - - protected void evaluateCellStyle( Attributes attributes ) { - /* - * Track the excel cell style so we can print a warning later on when we have a fall through in the processing of function: evaluateCellData - * When we have a style but can't identify the type there is something wrong with the excel sheet - */ - this.excelStyle = -1; - String cellStyle = attributes.getValue("s"); - if ( cellStyle != null ) { - XSSFCellStyle style = this.stylesTable.getStyleAt(Integer.parseInt(cellStyle)); - this.excelStyle = style.getDataFormat(); - - if ( ExcelReader.logNode.isTraceEnabled() ) - ExcelReader.logNode.trace("Found excel style: " + style.getDataFormatString()); - } - else { - this.excelStyle = -1; - } - - - this.formatString = null; - String cellType = attributes.getValue("t"); - // Source: http://www.schemacentral.com/sc/ooxml/a-t-8.html - this.excelType = ExcelType.NUMBER; - if ( "b".equals(cellType) ) - this.excelType = ExcelType.BOOLEAN; - else if ( "e".equals(cellType) ) - this.excelType = ExcelType.ERROR; - else if ( "inlineStr".equals(cellType) ) - this.excelType = ExcelType.STRING; - else if ( "s".equals(cellType) ) - this.excelType = ExcelType.SHARED_STRING; - else if ( "str".equals(cellType) ) - this.excelType = ExcelType.FORMULA; - else { - String cellStyleStr = attributes.getValue("s"); - if ( cellStyleStr != null ) { - // Number, but almost certainly with a special style or format - int styleIndex = Integer.parseInt(cellStyleStr); - XSSFCellStyle style = this.stylesTable.getStyleAt(styleIndex); - this.formatIndex = style.getDataFormat(); - this.formatString = style.getDataFormatString(); - if ( this.formatString == null ) - this.formatString = BuiltinFormats.getBuiltinFormat(this.formatIndex); - } - } - } - - protected ExcelCellData evaluateCellData() throws SAXException { - String cellValueString = this.cellValue.toString(); - ExcelCellData cellData = null; - - try { - if ( this.excelType != null ) { - - if ( ExcelReader.logNode.isTraceEnabled() ) - ExcelReader.logNode.trace("Reading " + this.colString + " / '" + cellValueString + "' / " + this.excelType); - - switch (this.excelType) { - case BOOLEAN: - cellData = new ExcelCellData(this.getCurrentColumnNr(), cellValueString, Integer.parseInt(cellValueString) == 1); - break; - case ERROR: - // imported as null, because this can be handled in Mendix - cellData = new ExcelCellData(this.getCurrentColumnNr(), cellValueString, "ERROR:" + cellValueString); - break; - case FORMULA: - cellData = new ExcelCellData(this.getCurrentColumnNr(), cellValueString, cellValueString); - - // We have the formula available, but it makes sense not to use it - this.formula.toString()); - break; - - case STRING: // We haven't seen this yet. - XSSFRichTextString rtsi = new XSSFRichTextString(cellValueString); - cellData = new ExcelCellData(this.getCurrentColumnNr(), cellValueString, rtsi.toString()); - break; - case SHARED_STRING: - String rtsValue = null; - try { - int idx = Integer.parseInt(cellValueString); - XSSFRichTextString rtss = new XSSFRichTextString(this.stringsTable.getEntryAt(idx)); - rtsValue = rtss.toString(); - } - catch( NumberFormatException ex ) { - ExcelReader.logNode.warn("Failed to parse SST index '" + cellValueString + "': " + ex.toString()); - } - cellData = new ExcelCellData(this.getCurrentColumnNr(), cellValueString, rtsValue); - - break; - case NUMBER: - if ( this.formatString != null ) { - Double dblCellValue = Double.parseDouble(cellValueString); - cellData = new ExcelCellData(this.getCurrentColumnNr(), dblCellValue, this.formatter.formatRawCellContents( - dblCellValue, this.formatIndex, this.formatString), this.formatString); - - if ( ExcelReader.logNode.isTraceEnabled() ) - ExcelReader.logNode - .trace("Formatting " + this.colString + " / '" + cellValueString + "' using format: '" + this.formatString + "' as " + this.formatter - .formatRawCellContents(dblCellValue, this.formatIndex, this.formatString)); - } - else - cellData = new ExcelCellData(this.getCurrentColumnNr(), cellValueString, null); - - break; - } - } - - // Only print debugging if the cell was intended to be rendered different than a String - else if ( ExcelReader.logNode.isTraceEnabled() && this.excelStyle != 0 && this.excelStyle != -1 ) - ExcelReader.logNode - .trace("Skipping style analysis for row: " + this.currentRow + " column: " + this.colNr + " style: " + this.excelStyle + " value: | " + cellValueString); - - if ( cellData == null && this.excelType != ExcelType.ERROR ) { - try { - // Parsing as a double is necessary, since a custom date/time format/style will have to - // be parsed as a double. - // Parsing a generally styled cell that contains an integer as a double here, is also - // safe, - // since it will be cast to its destination (Mendix) type inside the replication engine. - // - // All strings created in xlsx-format are usually stored in the shared strings table, - // so an actual string here, will never occur, since inline strings are handled in the - // "t" if statement below. - cellData = new ExcelCellData(this.colNr, cellValueString, ValueParser.getDoubleValue(cellValueString)); - } - catch( NumberFormatException nfe ) { - cellData = new ExcelCellData(this.colNr, cellValueString, null); - } - } - } - catch( ParseException e ) { - throw new SAXException("Unable to parse the value for column: " + this.colNr + " with original value: " + cellValueString, e); - } - return cellData; - } - - protected int evaluateDimension( Attributes attributes ) throws SAXException { - String dim = null; - try { - dim = attributes.getValue("ref"); - String[] fromTo = dim.split(":"); - - int colTo = parseCol(fromTo[1]); - this.values = new ExcelCellData[colTo + 1]; - - return colTo; - } - catch( Exception e ) { - throw new SAXException("Problem parsing Excel sheet dimension: " + (dim != null ? dim : "no ref attribute?")); - } - } - - - protected void closeTextProcessing( String localName, boolean useColumn ) throws SAXException { - if ( isTextTag(localName, useColumn) ) { - this.isProcessingCellValue = false; - ExcelCellData cellData = evaluateCellData(); - - this.values[this.getCurrentColumnNr()] = cellData; - this.isProcessingCellValue = false; - } - - } - - - protected boolean isTextTag( String localName, boolean useColumn ) { - if ( this.handleRow && useColumn ) { - if ( localName.equals("v") ) - return true; - if ( "inlineStr".equals(localName) ) - return true; - if ( localName.equals("t") && this.isProcessingCellValue ) - return true; - } - return false; - } - - protected static int parseCol( String col ) throws SAXException { - if ( col == null ) { - throw new SAXException("Column designation not specified. Excel file is broken."); - } - - List colList = new ArrayList(3); // cannot be more than 3 chars in col designation - // according to Excel 2007 / OOXML spec - for( int i = 0; i < col.length(); i++ ) { - char c = col.charAt(i); - // should check if it is actually a latin letter (not just isLetter; how does isLetter work exactly - // internally?); not a problem for correctly created excel docs. - if ( Character.isLetter(c) ) { - colList.add(c); - } - } - if ( !colList.isEmpty() ) { - int colNumber = 0; - int colListSize = colList.size(); - for( int i = 0; i < colListSize; ++i ) { - int colPartNumber = Character.getNumericValue(colList.get(i)) - 9; - int colPartWeight = (int) Math.pow(26, colListSize - i - 1); - colNumber += colPartNumber * colPartWeight; - } - return colNumber - 1; - } - else { - throw new SAXException("Column designation could not be parsed: '" + col + "'."); - } - } - - protected final ExcelCellData[] getValues() { - return this.values; - } - - protected boolean shouldHandleRow() { - return this.handleRow; - } - - protected int getCurrentSheet() { - return this.currentSheet; - } - - protected int getCurrentRow() { - return this.currentRow; - } - - protected int getCurrentColumnNr() { - return this.colNr; - } - - protected String getCurrentColumnStr() { - return this.colString; - } - } - - /** - * Sets sensible defaults for the XML parser used to read excel XLSX files. - */ - static void setXMLReaderProperties(XMLReader parser) throws SAXNotRecognizedException, SAXNotSupportedException { - boolean isExternalEntitiesEnabled = Boolean.valueOf("true").equals(Core.getConfiguration().getConstantValue("ExcelImporter.EnableExternalEntities")); - - parser.setFeature("http://xml.org/sax/features/external-general-entities", isExternalEntitiesEnabled); - parser.setFeature("http://xml.org/sax/features/external-parameter-entities", isExternalEntitiesEnabled); - parser.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", isExternalEntitiesEnabled); - } - - protected enum ExcelType { - STRING, SHARED_STRING, NUMBER, BOOLEAN, ERROR, FORMULA - } -} diff --git a/javasource/excelimporter/reader/readers/ReadOnlySharedStringsTable.java b/javasource/excelimporter/reader/readers/ReadOnlySharedStringsTable.java deleted file mode 100644 index fb743fe..0000000 --- a/javasource/excelimporter/reader/readers/ReadOnlySharedStringsTable.java +++ /dev/null @@ -1,224 +0,0 @@ -/* ==================================================================== - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -==================================================================== */ -package excelimporter.reader.readers; - -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; - -import javax.xml.parsers.ParserConfigurationException; -import javax.xml.parsers.SAXParser; -import javax.xml.parsers.SAXParserFactory; - -import org.apache.poi.openxml4j.opc.OPCPackage; -import org.apache.poi.openxml4j.opc.PackagePart; -import org.apache.poi.openxml4j.opc.PackageRelationship; -import org.apache.poi.xssf.usermodel.XSSFRelation; -import org.xml.sax.Attributes; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; -import org.xml.sax.XMLReader; -import org.xml.sax.helpers.DefaultHandler; - -/** - *

This is a lightweight way to process the Shared Strings - * table. Most of the text cells will reference something - * from in here. - *

Note that each SI entry can have multiple T elements, if the - * string is made up of bits with different formatting. - *

Example input: - *

-<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
-<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" count="2" uniqueCount="2">
- <si>
-   <r>
-     <rPr>
-       <b />
-       <sz val="11" />
-       <color theme="1" />
-       <rFont val="Calibri" />
-       <family val="2" />
-       <scheme val="minor" />
-     </rPr>
-     <t>This:</t>
-   </r>
-   <r>
-     <rPr>
-       <sz val="11" />
-       <color theme="1" />
-       <rFont val="Calibri" />
-       <family val="2" />
-       <scheme val="minor" />
-     </rPr>
-     <t xml:space="preserve">Causes Problems</t>
-   </r>
- </si>
- <si>
-   <t>This does not</t>
- </si>
-</sst>
-* 
- * - */ -public class ReadOnlySharedStringsTable extends DefaultHandler { - /** - * An integer representing the total count of strings in the workbook. This count does not - * include any numbers, it counts only the total of text strings in the workbook. - */ - private int count; - - /** - * An integer representing the total count of unique strings in the Shared String Table. - * A string is unique even if it is a copy of another string, but has different formatting applied - * at the character level. - */ - private int uniqueCount; - - /** - * The shared strings table. - */ - private String[] strings; - - /** - * @param pkg - * @throws IOException - * @throws SAXException - * @throws ParserConfigurationException - */ - public ReadOnlySharedStringsTable(OPCPackage pkg) - throws IOException, SAXException { - ArrayList parts = - pkg.getPartsByContentType(XSSFRelation.SHARED_STRINGS.getContentType()); - - // Some workbooks have no shared strings table. - if (parts.size() > 0) { - PackagePart sstPart = parts.get(0); - readFrom(sstPart.getInputStream()); - } - } - - /** - * Like POIXMLDocumentPart constructor - * - * @param part - * @param rel_ignored - * @throws IOException - */ - public ReadOnlySharedStringsTable(PackagePart part, @SuppressWarnings("unused") PackageRelationship rel_ignored) throws IOException, SAXException { - readFrom(part.getInputStream()); - } - - /** - * Read this shared strings table from an XML file. - * - * @param is The input stream containing the XML document. - * @throws IOException if an error occurs while reading. - * @throws SAXException - * @throws ParserConfigurationException - */ - public void readFrom(InputStream is) throws IOException, SAXException { - InputSource sheetSource = new InputSource(is); - SAXParserFactory saxFactory = SAXParserFactory.newInstance(); - try { - SAXParser saxParser = saxFactory.newSAXParser(); - XMLReader sheetParser = saxParser.getXMLReader(); - ExcelXLSXReader.setXMLReaderProperties(sheetParser); - sheetParser.setContentHandler(this); - sheetParser.parse(sheetSource); - } catch(ParserConfigurationException e) { - throw new RuntimeException("SAX parser appears to be broken - " + e.getMessage()); - } - } - - /** - * Return an integer representing the total count of strings in the workbook. This count does not - * include any numbers, it counts only the total of text strings in the workbook. - * - * @return the total count of strings in the workbook - */ - public int getCount() { - return this.count; - } - - /** - * Returns an integer representing the total count of unique strings in the Shared String Table. - * A string is unique even if it is a copy of another string, but has different formatting applied - * at the character level. - * - * @return the total count of unique strings in the workbook - */ - public int getUniqueCount() { - return this.uniqueCount; - } - - /** - * Return the string at a given index. - * Formatting is ignored. - * - * @param idx index of item to return. - * @return the item at the specified position in this Shared String table. - */ - public String getEntryAt(int idx) { - return this.strings[idx]; - } - - //// ContentHandler methods //// - - private StringBuffer characters; - private boolean tIsOpen; - private int index; - - @Override - public void startElement(String uri, String localName, String name, - Attributes attributes) throws SAXException { - if ("sst".equals(name)) { - String count = attributes.getValue("count"); - String uniqueCount = attributes.getValue("uniqueCount"); - this.count = Integer.parseInt(count); - this.uniqueCount = Integer.parseInt(uniqueCount); - this.strings = new String[this.uniqueCount]; - this.index = 0; - this.characters = new StringBuffer(); - } else if ("si".equals(name)) { - this.characters.setLength(0); - } else if ("t".equals(name)) { - this.tIsOpen = true; - } - } - - @Override - public void endElement(String uri, String localName, String name) - throws SAXException { - if ("si".equals(name)) { - this.strings[this.index] = this.characters.toString(); - ++this.index; - } else if ("t".equals(name)) { - this.tIsOpen = false; - } - } - - /** - * Captures characters only if a t(ext) element is open. - */ - @Override - public void characters(char[] ch, int start, int length) - throws SAXException { - if (this.tIsOpen) - this.characters.append(ch, start, length); - } - -} diff --git a/javasource/excelimporter/reader/readers/replication/ExcelReplicationSettings.java b/javasource/excelimporter/reader/readers/replication/ExcelReplicationSettings.java deleted file mode 100644 index 3b170b7..0000000 --- a/javasource/excelimporter/reader/readers/replication/ExcelReplicationSettings.java +++ /dev/null @@ -1,26 +0,0 @@ -package excelimporter.reader.readers.replication; - -import replication.ReplicationSettings; -import replication.implementation.ErrorHandler; -import replication.implementation.InfoHandler; -import replication.interfaces.IValueParser; - -import com.mendix.core.CoreException; -import com.mendix.systemwideinterfaces.core.IContext; - -public class ExcelReplicationSettings extends ReplicationSettings { - - public ExcelReplicationSettings(IContext context, String objectType) throws MendixReplicationException { - super(context, objectType, new ErrorHandler()); - this.setInfoHandler( new InfoHandler("ExcelImporter") ); - } - - public void addColumnMapping(String columnAlias, String memberName, boolean isKey, Boolean isCaseSensitive, IValueParser parser) throws CoreException { - this.addMappingForAttribute(columnAlias, memberName, (isKey ? KeyType.ObjectKey : KeyType.NoKey), isCaseSensitive, parser); - } - - public void addAssociationMapping(String columnAlias, String associationName, String associatedObjectType, String memberName, IValueParser parser, KeyType isKey, Boolean isCaseSensitive) throws CoreException { - this.addMappingForAssociation(columnAlias, associationName, associatedObjectType, memberName, parser, isKey, isCaseSensitive); - } - -} diff --git a/javasource/excelimporter/reader/readers/replication/ExcelValueParser.java b/javasource/excelimporter/reader/readers/replication/ExcelValueParser.java deleted file mode 100644 index fbc565c..0000000 --- a/javasource/excelimporter/reader/readers/replication/ExcelValueParser.java +++ /dev/null @@ -1,241 +0,0 @@ -package excelimporter.reader.readers.replication; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.Calendar; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.HashMap; -import java.util.Map; -import java.util.TimeZone; -import java.util.regex.Pattern; - -import org.apache.poi.hssf.usermodel.HSSFDateUtil; - -import replication.ReplicationSettings; -import replication.ValueParser; -import replication.interfaces.IValueParser; - -import com.mendix.core.Core; -import com.mendix.systemwideinterfaces.core.meta.IMetaPrimitive.PrimitiveType; - -import excelimporter.reader.readers.ExcelRowProcessor.ExcelCellData; - -public class ExcelValueParser extends ValueParser { - - private static HashMap displayMaskMap = new HashMap(); - static { - displayMaskMap.put("m/d/yy", "MM/dd/yy"); - displayMaskMap.put("m/d/yy\\ h:mm;@", "MM/dd/yy HH:mm"); - displayMaskMap.put("m/d/yyyy", "MM/dd/yyyy"); - displayMaskMap.put("m/d/yyyy\\ h:mm;@", "MM/dd/yyyy HH:mm"); - - displayMaskMap.put("dd\\-mmm\\-yy;@\\", "dd-MMMM-yy"); - displayMaskMap.put("[$-409]dd\\-mmm\\-yy;@\\", "dd-MMMM-yy"); - displayMaskMap.put("dd\\-mmm\\-yyyy;@\\", "dd-MMMM-yyyy"); - displayMaskMap.put("[$-409]dd\\-mmm\\-yyyy;@\\", "dd-MMMM-yyyy"); - displayMaskMap.put("h:mm:ss\\ AM/PM", "hh:mm:ss aa"); - displayMaskMap.put("[$-409]h:mm:ss\\ AM/PM", "hh:mm:ss aa"); - displayMaskMap.put("dddd\\,\\ mmmm\\ dd\\,\\ yyyy", "EEEE, MMMM dd, yyyy"); - displayMaskMap.put("[$-409]dddd\\,\\ mmmm\\ dd\\,\\ yyyy", "EEEE, MMMM dd, yyyy"); - - displayMaskMap.put("\"$\"#,##0_);\\(\"$\"#,##0\\)", "#,##0"); - displayMaskMap.put("\"$\"#,##0_);[Red]\\(\"$\"#,##0\\)", "#,##0"); - - displayMaskMap.put("\"$\"#,##0.00_);\\(\"$\"#,##0.00\\)", "#,##0.00"); - displayMaskMap.put("\"$\"#,##0.00_);[Red]\\(\"$\"#,##0.00\\)", "#,##0.00"); - - displayMaskMap.put("0.0%", "#0.0%"); - displayMaskMap.put("0.00%", "#0.0%"); - displayMaskMap.put("0.000%", "#0.0%"); - displayMaskMap.put("0.0000%", "#0.0%"); - } - - public ExcelValueParser( Map customValueParsers, ReplicationSettings settings ) { - super(settings, customValueParsers); - } - - @Override - // public Object getValueFromDataSet( String keyAlias, PrimitiveType type, Object dataSet ) throws ParseException { - // return ((ExcelCellData[]) dataSet)[Integer.valueOf(keyAlias)].getRawData(); - // } - // public Object getDataFromExcelDataSet( ExcelCellData data ) { - // if( data.getFormattedData() != null ) - // return data.getFormattedData(); - // else - // return data.getRawData(); - // } - public Object getValueFromDataSet( String column, PrimitiveType type, Object dataSet ) throws ParseException { - ExcelCellData[] objects = (ExcelCellData[]) dataSet; - if ( objects.length > Integer.valueOf(column) ) - return getValue(type, column, objects[Integer.valueOf(column)]); - else { - Core.getLogger("ValueParser").warn("There is no column nr: " + column + " found on the current row"); - return null; - } - } - - @SuppressWarnings("static-access") - private Object getValue( PrimitiveType type, String column, ExcelCellData cellData ) throws ParseException { - if ( cellData == null ) - return null; - - - Object value; - if ( type == PrimitiveType.DateTime ) { - value = cellData.getFormattedData(); - if ( value == null ) - value = cellData.getRawData(); - - if ( cellData.getRawData() instanceof Double ) - value = cellData.getRawData(); - else if ( cellData.getRawData() instanceof String && this.nrPattern.matcher((String) cellData.getRawData()).matches() ) - value = Double.valueOf((String) cellData.getRawData()); - - else if ( value instanceof String ) { - if ( this.nrPattern.matcher((String) value).matches() ) - value = Double.valueOf((String) value); - else if ( cellData.getDisplayMask() != null ) { - String displayMask = cellData.getDisplayMask(); - if ( this.displayMaskMap.containsKey(displayMask) ) - this.settings.addDisplayMask(column, this.displayMaskMap.get(displayMask)); - } - else if ( this.settings.hasDefaultInputMask(column) != null ) { - this.settings.addDisplayMask(column, this.settings.getDefaultInputMask(column)); - } - else if ( !this.settings.hasValueParser(column) ) - this.logNode.warn("Unable to parse the Date(" + value + ") in field: " + cellData.getColNr()); - } - - - if ( value instanceof Double ) { - if ( HSSFDateUtil.isValidExcelDate((Double) value) ) { - - /* - * Workaround for a library conflict within the platform. The platfrom implements version 1.5 of - * poi. This classes with the current implementation - */ - Object dateResult = null; - try { - Method m = Class.forName("org.apache.poi.ss.usermodel.DateUtil").getDeclaredMethod("getJavaDate", double.class, - TimeZone.class); - - dateResult = m.invoke(Class.forName("org.apache.poi.hssf.usermodel.HSSFDateUtil").newInstance(), (Double) value, - this.settings.getTimeZoneForMember(column)); - } - catch( IllegalAccessException | IllegalArgumentException | InvocationTargetException | InstantiationException | ClassNotFoundException | NoSuchMethodException | SecurityException e ) { - this.logNode.info("Unable to use HSSF date parser, falling back to default implementation", e); - } - - if ( dateResult != null ) - value = dateResult; - else { - // ----------------- WORK AROUND ---------- - int wholeDays = (int) Math.floor((Double) value); - int millisecondsInDay = (int) (((Double) value - wholeDays) * ((24 * 60 * 60) * 1000L) + 0.5); - Calendar calendar = new GregorianCalendar(this.settings.getTimeZoneForMember(column)); - setCalendar(calendar, wholeDays, millisecondsInDay, false); - value = calendar.getTime(); - // returnValue = getDateValue(HSSFDateUtil.getJavaDate((Double)value)); - } - } - else - throw new ParseException("The value was not stored in excel as a valid date."); - } - - return getValue(type, column, value); - } - else if ( cellData.getFormattedData() != null ) { - try { - return getValue(type, column, cellData.getFormattedData()); - } - catch( Exception e ) { - } - } - - return getValue(type, column, cellData.getRawData()); - } - - private final Pattern nrPattern = Pattern.compile("^\\d{0,6}(\\.\\d{1,})$"); - - // @Override - // public Object getValue( PrimitiveType type, String alias, Object value ) throws ParseException { - // Object returnValue = null; - // returnValue = super.getValue(type, alias, value); - // switch (type) { - // case DateTime: - // if ( value instanceof String ) { - // if ( this.nrPattern.matcher((String) value).matches() ) - // value = Double.valueOf((String) value); - // } - // if ( value instanceof Double ) { - // if ( HSSFDateUtil.isValidExcelDate((Double) value) ) { - // - // // ----------------- WORK AROUND ---------- - // int wholeDays = (int) Math.floor((Double) value); - // int millisecondsInDay = (int) (((Double) value - wholeDays) * ((24 * 60 * 60) * 1000L) + 0.5); - // Calendar calendar = new GregorianCalendar((this.settings.shouldLocalizeDate(alias) ? - // this.settings.getContext().getSession().getTimeZone() : TimeZone.getTimeZone("UTC"))); - // setCalendar(calendar, wholeDays, millisecondsInDay, false); - // returnValue = calendar.getTime(); - // // returnValue = getDateValue(HSSFDateUtil.getJavaDate((Double)value)); - // } - // else - // throw new ParseException("The value was not stored in excel as a valid date."); - // } - // else if ( value instanceof String || value instanceof Long ) { - // returnValue = getDateValue(value); - // } - // else if ( value != null ) - // throw new ParseException("The value(" + value + - // ") is of the wrong type, it was not stored in excel as a valid date."); - // - // break; - // default: - // returnValue = super.getValue(type, alias, value); - // } - // return returnValue; - // } - - /** - * Given an Excel date with either 1900 or 1904 date windowing, converts it to a java.util.Date. - * - * NOTE: If the default TimeZone in Java uses Daylight Saving Time then the conversion back to an Excel - * date may not give the same value, that is the comparison - * excelDate == getExcelDate(getJavaDate(excelDate,false)) is not always true. For example if default - * timezone is Europe/Copenhagen, on 2004-03-28 the minute after 01:59 CET is 03:00 CEST, if the excel - * date represents a time between 02:00 and 03:00 then it is converted to past 03:00 summer time - * - * @param date The Excel date. - * @param use1904windowing true if date uses 1904 windowing, or false if using 1900 date windowing. - * @return Java representation of the date, or null if date is not a valid Excel date - * @see java.util.TimeZone - */ - @SuppressWarnings("static-access") - public static Date getJavaDate( double date, boolean use1904windowing ) { - if ( !HSSFDateUtil.isValidExcelDate(date) ) { - return null; - } - int wholeDays = (int) Math.floor(date); - int millisecondsInDay = (int) ((date - wholeDays) * ((24 * 60 * 60) * 1000L) + 0.5); - Calendar calendar = new GregorianCalendar(); // using default time-zone - setCalendar(calendar, wholeDays, millisecondsInDay, use1904windowing); - return calendar.getTime(); - } - - public static void setCalendar( Calendar calendar, int wholeDays, int millisecondsInDay, boolean use1904windowing ) { - int startYear = 1900; - int dayAdjust = -1; // Excel thinks 2/29/1900 is a valid date, which it isn't - if ( use1904windowing ) { - startYear = 1904; - dayAdjust = 1; // 1904 date windowing uses 1/2/1904 as the first day - } - else if ( wholeDays < 61 ) { - // Date is prior to 3/1/1900, so adjust because Excel thinks 2/29/1900 exists - // If Excel date == 2/29/1900, will become 3/1/1900 in Java representation - dayAdjust = 0; - } - calendar.set(startYear, 0, wholeDays + dayAdjust, 0, 0, 0); - calendar.set(Calendar.MILLISECOND, millisecondsInDay); - } -} diff --git a/javasource/system/UserActionsRegistrar.java b/javasource/system/UserActionsRegistrar.java index 843fe0a..82ab471 100644 --- a/javasource/system/UserActionsRegistrar.java +++ b/javasource/system/UserActionsRegistrar.java @@ -7,9 +7,6 @@ public class UserActionsRegistrar public void registerActions(IActionRegistrator registrator) { registrator.bundleComponentLoaded(); - registrator.registerUserAction(excelimporter.actions.GetHeaderInformationFromExcelFile.class); - registrator.registerUserAction(excelimporter.actions.RefreshClass.class); - registrator.registerUserAction(excelimporter.actions.StartImportByTemplate.class); registrator.registerUserAction(mxmodelreflection.actions.ReplaceToken.class); registrator.registerUserAction(mxmodelreflection.actions.SyncObjects.class); registrator.registerUserAction(mxmodelreflection.actions.TestThePattern.class); diff --git a/javasource/system/proxies/FileDocument.java b/javasource/system/proxies/FileDocument.java index 574e6bc..fd848b8 100644 --- a/javasource/system/proxies/FileDocument.java +++ b/javasource/system/proxies/FileDocument.java @@ -78,12 +78,6 @@ public static system.proxies.FileDocument initialize(com.mendix.systemwideinterf if (com.mendix.core.Core.isSubClassOf("System.Image", mendixObject.getType())) return system.proxies.Image.initialize(context, mendixObject); - if (com.mendix.core.Core.isSubClassOf("ExcelImporter.TemplateDocument", mendixObject.getType())) - return excelimporter.proxies.TemplateDocument.initialize(context, mendixObject); - - if (com.mendix.core.Core.isSubClassOf("ExcelImporter.XMLDocumentTemplate", mendixObject.getType())) - return excelimporter.proxies.XMLDocumentTemplate.initialize(context, mendixObject); - return new system.proxies.FileDocument(context, mendixObject); } diff --git a/pom.xml b/pom.xml index ccbb7a2..33738bd 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ com.mendix.excelexporter excelexporter - 6.0.5 + 6.0.6 @@ -18,19 +18,19 @@ - commons-io - commons-io - 2.6 + org.apache.commons + commons-math3 + 3.6.1 joda-time joda-time - 2.10.6 + 2.10.9 com.opencsv opencsv - 5.0 + 5.3 org.apache.commons @@ -45,14 +45,21 @@ org.apache.poi poi-ooxml - 4.1.1 + 4.1.2 + - com.github.virtuald - curvesapi + org.apache.commons + commons-compress + + + org.apache.commons + commons-compress + 1.21 + diff --git a/userlib/com.github.virtuald.curvesapi-1.06.jar b/userlib/com.github.virtuald.curvesapi-1.06.jar new file mode 100644 index 0000000..800ab9b Binary files /dev/null and b/userlib/com.github.virtuald.curvesapi-1.06.jar differ diff --git a/userlib/commons-codec-1.13.jar.XLSReport.RequiredLib b/userlib/com.github.virtuald.curvesapi-1.06.jar.XLSReport.RequiredLib similarity index 100% rename from userlib/commons-codec-1.13.jar.XLSReport.RequiredLib rename to userlib/com.github.virtuald.curvesapi-1.06.jar.XLSReport.RequiredLib diff --git a/userlib/com.zaxxer.SparseBitSet-1.2.jar b/userlib/com.zaxxer.SparseBitSet-1.2.jar new file mode 100644 index 0000000..bdb6771 Binary files /dev/null and b/userlib/com.zaxxer.SparseBitSet-1.2.jar differ diff --git a/userlib/commons-collections4-4.4.jar.XLSReport.RequiredLib b/userlib/com.zaxxer.SparseBitSet-1.2.jar.XLSReport.RequiredLib similarity index 100% rename from userlib/commons-collections4-4.4.jar.XLSReport.RequiredLib rename to userlib/com.zaxxer.SparseBitSet-1.2.jar.XLSReport.RequiredLib diff --git a/userlib/commons-codec-1.13.jar.ExcelImporter.RequiredLib b/userlib/commons-codec-1.13.jar.ExcelImporter.RequiredLib deleted file mode 100644 index b4acfd6..0000000 --- a/userlib/commons-codec-1.13.jar.ExcelImporter.RequiredLib +++ /dev/null @@ -1 +0,0 @@ -Required by: poi-4.1.1 diff --git a/userlib/commons-codec-1.13.jar b/userlib/commons-codec.commons-codec-1.13.jar similarity index 100% rename from userlib/commons-codec-1.13.jar rename to userlib/commons-codec.commons-codec-1.13.jar diff --git a/userlib/commons-compress-1.19.jar.XLSReport.RequiredLib b/userlib/commons-codec.commons-codec-1.13.jar.XLSReport.RequiredLib similarity index 100% rename from userlib/commons-compress-1.19.jar.XLSReport.RequiredLib rename to userlib/commons-codec.commons-codec-1.13.jar.XLSReport.RequiredLib diff --git a/userlib/commons-collections4-4.4.jar.ExcelImporter.RequiredLib b/userlib/commons-collections4-4.4.jar.ExcelImporter.RequiredLib deleted file mode 100644 index b4acfd6..0000000 --- a/userlib/commons-collections4-4.4.jar.ExcelImporter.RequiredLib +++ /dev/null @@ -1 +0,0 @@ -Required by: poi-4.1.1 diff --git a/userlib/commons-compress-1.19.jar b/userlib/commons-compress-1.19.jar deleted file mode 100644 index 5c9f52a..0000000 Binary files a/userlib/commons-compress-1.19.jar and /dev/null differ diff --git a/userlib/commons-compress-1.19.jar.ExcelImporter.RequiredLib b/userlib/commons-compress-1.19.jar.ExcelImporter.RequiredLib deleted file mode 100644 index 09a6788..0000000 --- a/userlib/commons-compress-1.19.jar.ExcelImporter.RequiredLib +++ /dev/null @@ -1 +0,0 @@ -Required by: poi-ooxml-4.1.1 diff --git a/userlib/commons-io-2.6.jar b/userlib/commons-io-2.6.jar deleted file mode 100644 index 00556b1..0000000 Binary files a/userlib/commons-io-2.6.jar and /dev/null differ diff --git a/userlib/commons-lang3-3.11.jar b/userlib/commons-lang3-3.11.jar new file mode 100644 index 0000000..bbaa8a6 Binary files /dev/null and b/userlib/commons-lang3-3.11.jar differ diff --git a/userlib/commons-io-2.6.jar.ExcelImporter.RequiredLib b/userlib/commons-lang3-3.11.jar.XLSReport.RequiredLib similarity index 100% rename from userlib/commons-io-2.6.jar.ExcelImporter.RequiredLib rename to userlib/commons-lang3-3.11.jar.XLSReport.RequiredLib diff --git a/userlib/commons-lang3-3.9.jar b/userlib/commons-lang3-3.9.jar deleted file mode 100644 index 0d89693..0000000 Binary files a/userlib/commons-lang3-3.9.jar and /dev/null differ diff --git a/userlib/commons-math3-3.6.1.jar.ExcelImporter.RequiredLib b/userlib/commons-math3-3.6.1.jar.ExcelImporter.RequiredLib deleted file mode 100644 index b4acfd6..0000000 --- a/userlib/commons-math3-3.6.1.jar.ExcelImporter.RequiredLib +++ /dev/null @@ -1 +0,0 @@ -Required by: poi-4.1.1 diff --git a/userlib/joda-time-2.10.5.jar b/userlib/joda-time-2.10.9.jar similarity index 75% rename from userlib/joda-time-2.10.5.jar rename to userlib/joda-time-2.10.9.jar index 3750fd2..4e2aa52 100644 Binary files a/userlib/joda-time-2.10.5.jar and b/userlib/joda-time-2.10.9.jar differ diff --git a/userlib/commons-io-2.6.jar.XLSReport.RequiredLib b/userlib/joda-time-2.10.9.jar.XLSReport.RequiredLib similarity index 100% rename from userlib/commons-io-2.6.jar.XLSReport.RequiredLib rename to userlib/joda-time-2.10.9.jar.XLSReport.RequiredLib diff --git a/userlib/opencsv-5.0.jar b/userlib/opencsv-5.0.jar deleted file mode 100644 index b2dc4ef..0000000 Binary files a/userlib/opencsv-5.0.jar and /dev/null differ diff --git a/userlib/opencsv-5.3.jar b/userlib/opencsv-5.3.jar new file mode 100644 index 0000000..8495feb Binary files /dev/null and b/userlib/opencsv-5.3.jar differ diff --git a/userlib/commons-lang3-3.9.jar.XLSReport.RequiredLib b/userlib/opencsv-5.3.jar.XLSReport.RequiredLib similarity index 100% rename from userlib/commons-lang3-3.9.jar.XLSReport.RequiredLib rename to userlib/opencsv-5.3.jar.XLSReport.RequiredLib diff --git a/userlib/commons-collections4-4.4.jar b/userlib/org.apache.commons.commons-collections4-4.4.jar similarity index 100% rename from userlib/commons-collections4-4.4.jar rename to userlib/org.apache.commons.commons-collections4-4.4.jar diff --git a/userlib/commons-math3-3.6.1.jar.XLSReport.RequiredLib b/userlib/org.apache.commons.commons-collections4-4.4.jar.XLSReport.RequiredLib similarity index 100% rename from userlib/commons-math3-3.6.1.jar.XLSReport.RequiredLib rename to userlib/org.apache.commons.commons-collections4-4.4.jar.XLSReport.RequiredLib diff --git a/userlib/org.apache.commons.commons-compress-1.21.jar b/userlib/org.apache.commons.commons-compress-1.21.jar new file mode 100644 index 0000000..4892334 Binary files /dev/null and b/userlib/org.apache.commons.commons-compress-1.21.jar differ diff --git a/userlib/joda-time-2.10.5.jar.XLSReport.RequiredLib b/userlib/org.apache.commons.commons-compress-1.21.jar.XLSReport.RequiredLib similarity index 100% rename from userlib/joda-time-2.10.5.jar.XLSReport.RequiredLib rename to userlib/org.apache.commons.commons-compress-1.21.jar.XLSReport.RequiredLib diff --git a/userlib/commons-math3-3.6.1.jar b/userlib/org.apache.commons.commons-math3-3.6.1.jar similarity index 100% rename from userlib/commons-math3-3.6.1.jar rename to userlib/org.apache.commons.commons-math3-3.6.1.jar diff --git a/userlib/opencsv-5.0.jar.XLSReport.RequiredLib b/userlib/org.apache.commons.commons-math3-3.6.1.jar.XLSReport.RequiredLib similarity index 100% rename from userlib/opencsv-5.0.jar.XLSReport.RequiredLib rename to userlib/org.apache.commons.commons-math3-3.6.1.jar.XLSReport.RequiredLib diff --git a/userlib/poi-4.1.1.jar b/userlib/org.apache.poi.poi-4.1.2.jar similarity index 58% rename from userlib/poi-4.1.1.jar rename to userlib/org.apache.poi.poi-4.1.2.jar index 5b12817..3803353 100644 Binary files a/userlib/poi-4.1.1.jar and b/userlib/org.apache.poi.poi-4.1.2.jar differ diff --git a/userlib/poi-4.1.1.jar.XLSReport.RequiredLib b/userlib/org.apache.poi.poi-4.1.2.jar.XLSReport.RequiredLib similarity index 100% rename from userlib/poi-4.1.1.jar.XLSReport.RequiredLib rename to userlib/org.apache.poi.poi-4.1.2.jar.XLSReport.RequiredLib diff --git a/userlib/poi-ooxml-4.1.1.jar b/userlib/org.apache.poi.poi-ooxml-4.1.2.jar similarity index 61% rename from userlib/poi-ooxml-4.1.1.jar rename to userlib/org.apache.poi.poi-ooxml-4.1.2.jar index bf3569d..6038a51 100644 Binary files a/userlib/poi-ooxml-4.1.1.jar and b/userlib/org.apache.poi.poi-ooxml-4.1.2.jar differ diff --git a/userlib/poi-ooxml-4.1.1.jar.XLSReport.RequiredLib b/userlib/org.apache.poi.poi-ooxml-4.1.2.jar.XLSReport.RequiredLib similarity index 100% rename from userlib/poi-ooxml-4.1.1.jar.XLSReport.RequiredLib rename to userlib/org.apache.poi.poi-ooxml-4.1.2.jar.XLSReport.RequiredLib diff --git a/userlib/poi-ooxml-schemas-4.1.1.jar b/userlib/org.apache.poi.poi-ooxml-schemas-4.1.2.jar similarity index 88% rename from userlib/poi-ooxml-schemas-4.1.1.jar rename to userlib/org.apache.poi.poi-ooxml-schemas-4.1.2.jar index d4d0292..74d3cd5 100644 Binary files a/userlib/poi-ooxml-schemas-4.1.1.jar and b/userlib/org.apache.poi.poi-ooxml-schemas-4.1.2.jar differ diff --git a/userlib/poi-ooxml-schemas-4.1.1.jar.XLSReport.RequiredLib b/userlib/org.apache.poi.poi-ooxml-schemas-4.1.2.jar.XLSReport.RequiredLib similarity index 100% rename from userlib/poi-ooxml-schemas-4.1.1.jar.XLSReport.RequiredLib rename to userlib/org.apache.poi.poi-ooxml-schemas-4.1.2.jar.XLSReport.RequiredLib diff --git a/userlib/xmlbeans-3.1.0.jar b/userlib/org.apache.xmlbeans.xmlbeans-3.1.0.jar similarity index 100% rename from userlib/xmlbeans-3.1.0.jar rename to userlib/org.apache.xmlbeans.xmlbeans-3.1.0.jar diff --git a/userlib/replication.jar.ExcelImporter.RequiredLib b/userlib/org.apache.xmlbeans.xmlbeans-3.1.0.jar.XLSReport.RequiredLib similarity index 100% rename from userlib/replication.jar.ExcelImporter.RequiredLib rename to userlib/org.apache.xmlbeans.xmlbeans-3.1.0.jar.XLSReport.RequiredLib diff --git a/userlib/poi-4.1.1.jar.ExcelImporter.RequiredLib b/userlib/poi-4.1.1.jar.ExcelImporter.RequiredLib deleted file mode 100644 index 5742b23..0000000 --- a/userlib/poi-4.1.1.jar.ExcelImporter.RequiredLib +++ /dev/null @@ -1 +0,0 @@ -Requires: poi-ooxml-4.1.1 diff --git a/userlib/poi-ooxml-4.1.1.jar.ExcelImporter.RequiredLib b/userlib/poi-ooxml-4.1.1.jar.ExcelImporter.RequiredLib deleted file mode 100644 index 7697168..0000000 --- a/userlib/poi-ooxml-4.1.1.jar.ExcelImporter.RequiredLib +++ /dev/null @@ -1,2 +0,0 @@ -Required by: poi-4.1.1 -Requires: poi-ooxml-schemas-4.1.1 diff --git a/userlib/poi-ooxml-schemas-4.1.1.jar.ExcelImporter.RequiredLib b/userlib/poi-ooxml-schemas-4.1.1.jar.ExcelImporter.RequiredLib deleted file mode 100644 index 09a6788..0000000 --- a/userlib/poi-ooxml-schemas-4.1.1.jar.ExcelImporter.RequiredLib +++ /dev/null @@ -1 +0,0 @@ -Required by: poi-ooxml-4.1.1 diff --git a/userlib/replication.jar b/userlib/replication.jar deleted file mode 100644 index b9d577d..0000000 Binary files a/userlib/replication.jar and /dev/null differ diff --git a/userlib/replication.jar.XLSReport.RequiredLib b/userlib/replication.jar.XLSReport.RequiredLib deleted file mode 100644 index e69de29..0000000 diff --git a/userlib/xmlbeans-3.1.0.jar.ExcelImporter.RequiredLib b/userlib/xmlbeans-3.1.0.jar.ExcelImporter.RequiredLib deleted file mode 100644 index 87f3d4e..0000000 --- a/userlib/xmlbeans-3.1.0.jar.ExcelImporter.RequiredLib +++ /dev/null @@ -1 +0,0 @@ -Required by: poi-ooxml-schemas-4.1.1 diff --git a/userlib/xmlbeans-3.1.0.jar.XLSReport.RequiredLib b/userlib/xmlbeans-3.1.0.jar.XLSReport.RequiredLib deleted file mode 100644 index e69de29..0000000