diff --git a/OQLModule.mpr b/OQLModule.mpr
index 3293576..3302863 100644
Binary files a/OQLModule.mpr and b/OQLModule.mpr differ
diff --git a/SiemensMendixOQL__5.0.0__READMEOSS.html b/SiemensMendixOQL__5.1.0__READMEOSS.html
similarity index 99%
rename from SiemensMendixOQL__5.0.0__READMEOSS.html
rename to SiemensMendixOQL__5.1.0__READMEOSS.html
index c5e7238..b3efb54 100644
--- a/SiemensMendixOQL__5.0.0__READMEOSS.html
+++ b/SiemensMendixOQL__5.1.0__READMEOSS.html
@@ -120,13 +120,13 @@
- Siemens Mendix OQL 5.0.0 -
+ Siemens Mendix OQL 5.1.0 -
Siemens Third-Party Software Disclosure Document English / English Note to Resellers: Please pass on this document to your customers to avoid license infringements. Third-Party Software Information This product, solution or service ("Product") contains third-party software components listed in this document. These components are Open Source Software licensed under a license approved by the Open Source Initiative (www.opensource.org) or similar licenses as determined by SIEMENS ("OSS") and/or commercial or freeware software components. With respect to the OSS components, the applicable OSS license conditions prevail over any other terms and conditions covering the Product. The OSS portions of this Product are provided royalty-free and can be used at no charge. If SIEMENS has combined or linked certain components of the Product with/to OSS components licensed under the GNU LGPL version 2 or later as per the definition of the applicable license, and if use of the corresponding object file is not unrestricted ("LGPL Licensed Module", whereas the LGPL Licensed Module and the components that the LGPL Licensed Module is combined with or linked to is the "Combined Product"), the following additional rights apply, if the relevant LGPL license criteria are met: (i) you are entitled to modify the Combined Product for your own use, including but not limited to the right to modify the Combined Product to relink modified versions of the LGPL Licensed Module, and (ii) you may reverse-engineer the Combined Product, but only to debug your modifications. The modification right does not include the right to distribute such modifications and you shall maintain in confidence any information resulting from such reverse-engineering of a Combined Product. Certain OSS licenses require SIEMENS to make source code available, for example, the GNU General Public License, the GNU Lesser General Public License and the Mozilla Public License. If such licenses are applicable and this Product is not shipped with the required source code, a copy of this source code can be obtained by anyone in receipt of this information during the period required by the applicable OSS licenses by contacting the following address. SIEMENS may charge a handling fee of up to 5 Euro to fulfil the request. Warranty regarding further use of the Open Source Software SIEMENS' warranty obligations are set forth in your agreement with SIEMENS. SIEMENS does not provide any warranty or technical support for this Product or any OSS components contained in it if they are modified or used in any manner not specified by SIEMENS. The license conditions listed below may contain disclaimers that apply between you and the respective licensor. For the avoidance of doubt, SIEMENS does not make any warranty commitment on behalf of or binding upon any third party licensor. German / Deutsch Hinweis an die Vertriebspartner: Bitte geben Sie dieses Dokument an Ihre Kunden weiter, um urheberrechtliche Lizenzverstöße zu vermeiden. Informationen zu Fremdsoftware Dieses Produkt, diese Lösung oder dieser Service ("Produkt") enthält die nachfolgend aufgelisteten Fremdsoftwarekomponenten. Bei diesen handelt es sich entweder um Open Source Software, die unter einer von der Open Source Initiative (www.opensource.org) anerkannten Lizenz oder einer durch Siemens als vergleichbar definierten Lizenz ("OSS") lizenziert ist und/oder um kommerzielle Software oder Freeware. Hinsichtlich der OSS Komponenten gelten die einschlägigen OSS Lizenzbedingungen vorrangig vor allen anderen auf dieses Produkt anwendbaren Bedingungen. SIEMENS stellt Ihnen die OSS-Anteile dieses Produkts ohne zusätzliche Kosten zur Verfügung. Soweit SIEMENS bestimmte Komponenten des Produkts mit OSS Komponenten gemäß der Definition der anwendbaren Lizenz kombiniert oder verlinkt hat, die unter der GNU LGPL Version 2 oder einer späteren Version lizenziert werden und soweit die entsprechende Objektdatei nicht unbeschränkt genutzt werden darf ("LGPL-lizenziertes Modul", wobei das LGPL-lizenzierte Modul und die Komponenten, mit welchen das LGPL-lizenzierte Modul verbunden ist, nachfolgend "verbundenes Produkt" genannt werden) und die entsprechenden LGPL Lizenzkriterien erfüllt sind, dürfen Sie zusätzlich (i) das verbundene Produkt für eigene Verwendungszwecke bearbeiten und erhalten insbesondere das Recht, das verbundene Produkt zu bearbeiten, um es mit einer modifizierten Version des LGPL lizenzierten Moduls zu verlinken und (ii) das verbundene Produkt rückentwickeln, jedoch ausschließlich zum Zwecke der Fehlerkorrektur Ihrer Bearbeitungen. Das Recht zur Bearbeitung schließt nicht das Recht ein, diese zu distribuieren. Sie müssen sämtliche Informationen, die Sie aus dem Reverse Engineering des verbundenen Produktes gewinnen, vertraulich behandeln. Bestimmte OSS Lizenzen verpflichten SIEMENS zur Herausgabe des Quellcodes, z.B. die GNU General Public License, die GNU Lesser General Public License sowie die Mozilla Public License. Soweit diese Lizenzen Anwendung finden und das Produkt nicht bereits mit dem notwendigen Quellcode ausgeliefert wurde, so kann eine Kopie des Quellcodes von jedermann während des in der anwendbaren OSS Lizenz angegebenen Zeitraums unter der folgenden Anschrift angefordert werden. SIEMENS kann für die Erfüllung der Anfrage eine Bearbeitungsgebühr von bis zu 5 Euro in Rechnung stellen. Gewährleistung betreffend Verwendung der Open Source Software Die Gewährleistungspflichten von SIEMENS sind in dem jeweiligen Vertrag mit SIEMENS geregelt. Soweit Sie das Produkt oder die OSS Komponenten modifizieren oder in einer anderen als der von SIEMENS spezifizierten Weise verwenden, ist die Gewährleistung ausgeschlossen und eine technische Unterstützung erfolgt nicht. Die nachfolgenden Lizenzbedingungen können Haftungsbeschränkungen enthalten, die zwischen Ihnen und dem jeweiligen Lizenzgeber gelten. Klarstellend wird darauf hingewiesen, dass SIEMENS keine Gewährleistungsverpflichtungen im Namen von oder verpflichtend für einen Drittlizenzgeber abgibt. Chinese / 中文 经销商须知: 请将本文件转发给您的客户,以避免构成对许可证的侵权。 第三方软件信息 本产品、解决方案或服务(统称“本产品”)中包含本文件列出的第三方软件组件。 这些组件是开放源代码促进会 (www.opensource.org) 批准的许可证或西门子确定的类似许可证所许可的开放源代码软件(简称“OSS”)和/或商业或免费软件组件。 针对 OSS组件,适用的 OSS 许可证条件优先于涵盖本产品的任何其他条款和条件。 本产品的 OSS 部分免许可费,可以免费使用。 如果西门子已经按照所适用的许可证的定义,根据第 2版或之后版本的GNU LGPL将本产品的某些组件与获得许可证的 OSS组件相组合或关联,并且如果使用相应的目标文件并非不受限制(“LGPL许可模块”,LGPL 许可模块以及与 LGPL 许可模块相组合或关联的组件统称为“组合产品”),则在符合以下相关LGPL许可标准的前提下,以下附加权利予以适用: (i) 您有权修改组合产品供自己使用,包括但不限于修改组合产品以重新连接 LGPL 许可模块修改版本的权利,并且 (ii) 您可以对组合产品进行逆向工程(但仅限于调试您的修改)。修改权不包括散布此类修改的权利,您应对此类组合产品逆向工程所获得的任何信息予以保密。 某些 OSS 许可证需要西门子提供源代码,例如 GNU 通用公共许可证、GNU 宽通用公共许可证和 Mozilla 公共许可证。如果适用此类许可证并且本产品发货时未随附所需的源代码,收到本信息的任何 人可以在所适用的OSS许可证要求的期限内通过以下地址联系获取这些源代码的副本。 西门子可收取最多 5 欧元的手续费以完成该请求。 关于进一步使用开放源代码软件的保修 您与西门子的协议中规定了西门子的保修义务。如果以西门子未指明的任何方式修改或使用本产品或其中包含的任何 OSS组件,西门子不为其提供任何保修或技术支持服务。下面列出的许可证条件可能包含适用于您和相应许可人之间的免责声明。为了避免产生疑问,西门子不代表或约束任何第三方许可人作出任何保修承诺。 Spanish / Español Indicación para los distribuidores: Sírvase entregar este documento a sus clientes para prevenir infracciones de licencia sobre los aspectos de los derechos de autor. Información sobre software de terceros Este producto, solución o servicio ("producto") contiene los siguientes componentes de software de terceros listados a continuación. Se trata de Open Source Software cuya licencia ha sido otorgada por la Open Source Initiative (www.opensource.org) o que corresponde a una licencia definida por Siemens como comparable ("OSS") y/o de software o freeware comercial. En relación a los componentes OSS prevalecen las condiciones de concesión de licencia OSS pertinentes por sobre todas las demás condiciones aplicables para este producto. SIEMENS le entrega estas partes OSS del producto sin coste adicional. En la medida en que SIEMENS haya combinado o enlazado determinados componentes del producto con componentes OSS según la definición de la licencia aplicable, cuya licencia está sujeta a la GNU LGPL versión 2 o una versión posterior y que no se puede utilizar sin restricciones ("módulo con licencia LGPL", denominándose a continuación el módulo de licencia LGPL y los componentes combinados con el módulo de licencia LGPL, como "producto integrado") y que se hayan cumplido los criterios de licencia LGPL correspondientes, usted está autorizado para adicionalmente (i) procesar el producto conectado para sus propios fines de uso y obtener particularmente el derecho a procesar el producto conectado para enlazarlo con una versión modificada del módulo de licencia LGPL y (ii) realizar ingeniería inversa para el producto conectado, pero exclusivamente para fines de corrección de errores de sus procesamientos. El derecho al procesamiento no incluye el derecho a su distribución. Está obligado a tratar de manera confidencial toda la información que obtiene en el marco de la ingeniería inversa del producto conectado. Determinadas licencias OSS obligan a Siemens a la publicación del código fuente, p. ej. la GNU General Public License, la GNU Lesser General Public License así como la Mozilla Public License. En la medida que se apliquen estas licencias y que el producto no se haya suministrado con el código fuente necesario, puede solicitarse una copia del código fuente por parte de cualquier persona durante el período indicado en la licencia OSS, mediante envío de la solicitud correspondiente a la siguiente dirección. SIEMENS puede facturar una tasa de servicio de hasta 5 Euros para la tramitación de la consulta. Garantía en relación al uso del Open Source Software Las obligaciones de Siemens relacionadas a la garantía del Software, están especificados en el contrato correspondiente con SIEMENS. En caso de modificar el producto o los componentes OSS o usarse de una manera que difiera del modo especificado por SIEMENS, dejará de tener vigencia la garantía y no habrá derechoal soporte técnico asociado a ella. Las siguientes condiciones de concesión de licencia pueden contener limitaciones de responsabilidad que rigen entre su parte y el licenciador correspondiente. Se aclara que SIEMENS no asume obligaciones de garantía en nombre de o en forma vinculante para licenciadores de terceros. French / Français Note pour les partenaires de distribution: veuillez transmettre ce document à vos clients pour éviter toutes infractions aux dispositions en matière de droits d’auteur. Informations sur des logiciels de tiers Le présent produit, solution ou service (« Produit ») contient des éléments de logiciels indiqués ci-après, appartenant à des tiers. Ces logiciels sont des Open Source Software dont l’utilisation est accordée en vertu d’une licence reconnue par la Open Service Initiative (www.opensource.org), ou d’une licence équivalente définie comme telle par Siemens ("OSS"), et/ou en vertu d’un logiciel commercial ou un freeware. En ce qui concerne les composants OSS, les conditions de licence OSS pertinentes priment sur toutes les autres conditions éventuellement applicables au Produit. SIEMENS met à votre disposition gratuitement et sans frais supplémentaires les parties OSS du Produit. Si SIEMENS a combiné ou relié certains composants du Produit avec des éléments OSS dont l’utilisation est accordée en vertu de la licence GNU LGPL version 2 ou d'une version postérieure, conformément à la licence applicable, et si l’utilisation du fichier objet correspondant est soumise à des restrictions (« Module Sous Licence LGPL », le module sous licence LGPL et les composants avec lesquels ce module est lié, sont dénommés ci-après "Produit Lié"), si les critères de licence LGPL applicables sont respectés, vous avez également les droits suivants : (i) droit de modifier le Produit Lié pour votre propre usage , inclus notamment le droit de modifier le Produit Lié afin de le relier différentes versions modifiées du Module Sous Licence LGPL et (ii) droit de faire de la retro-ingénierie sur le Produit Lié, mais exclusivement afin de corriger les éventuels dysfonctionnements des modifications que vous y avez apportées. Le droit de modifier n’inclut pas le droit de distribuer ces modifications et toutes les informations que vous avez obtenues à l’occasion d’opérations de retro-ingénierie du Produit Lié seront strictement confidentielles. Certaines licences OSS, comme par exemple la GNU General Public License, la GNU Lesser General Public License, ainsi que la Mozilla Public License, obligent SIEMENS à divulguer le code source. Si ces licences sont applicables et si le Produit n’a pas été préalablement livré avec le code source nécessaire, une copie du code source peut être demandée pendant la durée de la licence OSS applicable, en s’adressant à l’adresse suivante. SIEMENS peut facturer des frais de traitement allant jusqu’à 5 Euro pour répondre à cette demande. Garantie relative à l’utilisation du logiciel Open Source Les obligations de garantie de SIEMENS sont définies dans votre contrat. Si vous modifiez le Produit ou les éléments OSS y contenus ou si vous les utilisez d’une manière autre que celle spécifiée par SIEMENS, vous perdez le bénéfice de la garantie et aucune assistance technique ne vous sera fournie. Les conditions de licence ci-après peuvent contenir des limitations de responsabilités applicables entre vous et le concédant. En tout état de cause, nous vous signalons que SIEMENS ne prend aucun engagement de garantie au nom et pour le compte de tiers concédants. Italian / Italiano IMPORTANTE per i partner commerciali: si prega di inoltrare il presente documento ai clienti per evitare violazioni delle condizioni di licenza. Informazioni relative al software di altri produttori Il presente prodotto, soluzione o servizio ("Prodotto") contengono componenti software di altri produttori elencati qui di seguito. Questi software di altri produttori possono essere Open Source Software (OSS), concessi in licenza con una licenza riconosciuta dall'Open Source Initiative (www.opensource.org) o ritenuta equivalente da Siemens ("OSS"), e/o software o freeware commerciali. Per quanto riguarda i componenti dell'OSS, le relative condizioni di licenza pertinenti prevalgono rispetto a tutte le altre condizioni applicabili al presente Prodotto. SIEMENS mette a disposizione i componenti dell'OSS contenuti nel presente Prodotto senza costi aggiuntivi. Se SIEMENS ha combinato o linkato determinati componenti del Prodotto con prodotti dell'OSS secondo la definizione indicata nella licenza applicabile e concessa ai sensi della licenza GNU LGPL Version 2 o successiva, se il relativo file di oggetto non può essere utilizzato in maniera illimitata ("modulo concesso con licenza LGPL", vale a dire il modulo con licenza LGPL e i componenti a cui detto modello è collegato, denominati qui di seguito "Prodotto Collegato") e, infine, se i relativi criteri di licenza LGPL sono stati soddisfatti, sarà possibile inoltre (i) modificare il Prodotto Collegato per propri scopi di impiego, in particolare elaborare il Prodotto Collegato per linkarlo ad una versione modificata del modulo con licenza LGPL, e (ii) effettuare il reverse engineering del Prodotto Collegato, esclusivamente a fini di correzione degli errori di elaborazione. Il diritto di elaborazione non include il diritto di distribuire tali modifiche. Inoltre, tutte le informazioni ottenute con il reverse engineering del Prodotto Collegato devono essere trattate come riservate. Determinate licenze OSS obbligano SIEMENS a pubblicare il codice sorgente, ad es. la GNU General Public License, la GNU Lesser General Public License e la Mozilla Public License. Se queste licenze sono applicabili, e il presente Prodotto non è stato già fornito con il necessario codice sorgente, è possibile richiedere una copia di detto codice nel periodo di validità indicato nella licenza OSS applicabile al seguente indirizzo. Per l'evasione della richiesta, SIEMENS potrà addebitare fino a 5 Euro. Garanzia di utilizzo dell'Open Source Software Le obbligazioni di garanzia di SIEMENS sono disciplinate dal vostro contratto sottoscritto con SIEMENS. Se si modifica il Prodotto o i componenti dell'OSS, oppure li si utilizza in un modo diverso da quello specificato da SIEMENS, la garanzia e il supporto tecnico decadono. Le seguenti condizioni di licenza possono contenere limitazioni di responsabilità valevoli nel rapporto tra l'utente e il licenziante. Per maggiore chiarezza, si ribadisce che SIEMENS non concede alcuna garanzia a nome di, o vincolante per, qualsiasi terza parte licenziante. Japanese / 日本語 再販業者への注意事項:ライセンス違反を防ぐため、本書を顧客の皆様に配布してください。 他社製ソフトウェアの使用に関する情報 本製品、ソリューション、またはサービス(以下「本製品」)には、本書に記載の他社製ソフトウェ アのコンポーネントが含まれています。該当するコンポーネントとは、Open Source Initiative (www.opensource.org) によって認可されたライセンスのもとで使用許諾を得たオープンソースソフ トウェア、または SIEMENS によって決定された同様のライセンス(以下「OSS」)、および/または商用もしくはフリーウェアのソフトウェアコンポーネントを指します。本製品を対象とするその他いかなる契約条件に対しても、OSS のコンポーネントに関しては、適用される OSS ライセンス条件が優先するものとします。本製品の OSS の部分に関しては、著作権使用料無料で提供され、無料で使用する ことができます。 SIEMENS が、本製品の特定のコンポーネントと適用されるライセンスの定義の通りに GNU LGPLのバージョン 2 以降のもとで使用許諾を得た OSS コンポーネントを組み合わせるか、関連付け、なおかつ付随するオブジェクト・ファイルの使用が制限されていない場合(以下「LGPL 使用許諾モジュー ル」、それに対し、LGPL使用許諾モジュールが組み合わされているか、関連付けられている LGPL 使用許諾済みモジュールとコンポーネントを「組み合わせ製品」という)、関連する LGPL 使用許諾の基準を満たしていれば、次の追加の権利が適用されます。(i) 個人的な使用のために組み合わせ製品を変更することができる(LGPL 使用許諾モジュールの変更したバージョンを再度関連付けるために組み合わせ製品を変更する権利を含むが、それに限定されるものではない)、および (ii) 組み合わせ製品にリバースエンジニアリングを行うことができる(ただし変更のデバッグのみ)。変更に関する権利には、該当する変更を配布する権利は含まれていません。また契約者の方は、このような組み合わせ製品のリバースエンジニアリングから生じるいかなる情報に関しても極秘として維持するものとします。 例えば、GNU General Public License (GNU一般公衆利用許諾書)、GNU Lesser General Public License(GNU劣等一般公衆利用許諾書)、Mozilla Public License 等の特定の OSSライセンスでは、SIEMENS がソースコードを利用できるようにする必要があります。該当するライセンスが適用可能であり、本製品が必要とされるソースコードとともに出荷されなかった場合、この情報を受け取った人物が適用される OSS ライセンスによって義務付けられている期間中に以下の住所まで連絡することで、このソースコードのコピーを入手することができます。 リクエストを実行するために SIEMENS では、最高 5 ユーロの手数料を請求する場合があります。 オープンソースソフトウェアのさらなる使用に関する保証 SIEMENS の保証義務は、契約者と SIEMENS との契約書に記載されています。本製品を SIEMENS が指定した以外の方法で変更したり、使用したりした場合、SIEMENS では本製品、またはいかなる OSS コンポーネントに対しても保証やテクニカルサポートを提供いたしません。以下に記載のライセンス条件には、 契約者と個別のライセンサーとの間で適用される免責事項が含まれる場合があります。誤解を避けるため、SIEMENSでは他社のライセンサーを代表、または他社を拘束するいかなる保証義務も負いません。 Russian / Русский Информация для партнёров по сбыту: просим передать этот документ вашим клиентам во избежание нарушений лицензионных прав. Информация о программном обеспечении сторонних разработчиков Настоящий продукт, настоящее решение или сервис ("Продукт") включает в себя программные компоненты сторонних разработчиков, перечисленные ниже. Это компоненты программного обеспечения с открытым кодом, имеющие лицензию, признанную организацией Open Source Initiative (www.opensource.org), либо иную лицензию согласно определению компании SIEMENS ("OSS"), и / или компоненты коммерческого либо свободно распространяемого программного обеспечения. В отношении компонентов OSS соответствующие условия лицензии OSS имеют приоритет перед всеми прочими положениями, применимыми к данному Продукту. SIEMENS предоставляет вам долевые права на OSS в отношении данного Продукта на безвозмездной основе. Если SIEMENS комбинирует или связывает определённые компоненты Продукта с компонентами OSS в соответствии с определением применимой лицензии, лицензированными по версии 2 или более поздней GNU LGPL, и если неограниченное использование соответствующего объектного файла не разрешено ("Модуль по лицензии LGPL", причём Модуль по лицензии LGPL и компоненты, с которыми скомбинирован или связан Модуль по лицензии LGPL, далее именуются "Комбинированный продукт") и выполнены соответствующие критерии лицензии LGPL, вам разрешается дополнительно (i) обрабатывать Комбинированный продукт в собственных целях и, в частности, но не ограничиваясь, обрабатывать Комбинированный продукт таким образом, чтобы связать его с модифицированной версией Модуля по лицензии LGPL, а также (ii) проводить обратную разработку Комбинированного продукта, но только в целях исправления ошибок вашей обработки. Право на обработку не включает в себя право на дистрибуцию. Вы обязаны сохранять конфиденциальность в отношении всей информации, полученной вами в ходе обратной разработки Комбинированного продукта. Определённые лицензии OSS обязывают SIEMENS раскрывать исходный код, например, GNU General Public License, GNU Lesser General Public License и Mozilla Public License. Если указанные лицензии применимы и Продукт поставлен без необходимого исходного кода, копия исходного кода может быть запрошена обладателем настоящей информации в течение времени, указанного в применимой лицензии OSS, по следующему адресу. За выполнение запроса SIEMENS может взимать сбор в размере до 5 евро. Гарантия в отношении дальнейшего применения программного обеспечения с открытым кодом Гарантийные обязательства SIEMENS регулируются соответствующим договором с компанией SIEMENS. Если вы модифицируете Продукт или компоненты OSS либо используете их иным образом, чем указано компанией SIEMENS, гарантия аннулируется, техническая поддержка не предоставляется. Приведённые ниже лицензионные условия могут включать в себя положения об ограничении ответственности, действующие в отношениях между вами и соответствующим лицензиаром. Во избежание сомнений подчёркиваем, что SIEMENS не даёт гарантии от имени сторонних лицензиаров и гарантии, налагающей обязательства на сторонних лицензиаров. Korean / 한국어 제3자 소프트웨어 정보 본 제품, 솔루션 또는 서비스(이하 “제품”)는 본 문서에 기재된 제3자 소프트웨어 구성요소를 포함한다. 이들 구성요소는 오픈 소스 이니셔티브(www.opensource.org)가 승인한 라이선스 또는 지멘스가 유사 라이선스로 판단하는 라이선스 하에 사용 권한이 부여된 오픈 소스 소프트웨어(이하 "OSS") 및/또는 상용 또는 무료 소프트웨어 구성요소이다. OSS 구성요소와 관련하여, 해당되는 OSS 라이선스 조건은 본 제품을 포괄하는 기타 모든 약관에 우선한다. 본 제품의 OSS 일부는 로열티 없이 제공되며 무료로 사용할 수 있다. 지멘스가 해당되는 라이선스의 정의에 따라 GNU LGPL 버전 2 또는 그 이상의 사용 권한이 부여된 OSS 구성요소와 본 제품의 특정 구성요소를 조합 또는 연결한 경우 그리고 해당 오브젝트 파일의 사용이 제한되지 않는 경우(이하 "LGPL 라이선스 모듈"인반면, LGPL 라이선스 모듈과 LGPL 라이선스 모듈이 조합 또는 연결된 구성요소는 "조합 제품"이라 한다) 관련 LPGL 라이선스 기준이 충족되는 경우에 한하여 다음과 같은 추가적인 권한을 가진다. (i) 귀하는 사용을 위한 조합 제품을 수정할 권리가 있으며, 이는 조합 제품을 수정하여 LGPL 라이선스 모듈의 수정 버전에 재연결할 수 있는 권리를 포함하되 이에 한정하지 않는다. 그리고 (ii) 귀하는 조합 제품을 역엔지니어링할 수 있지만 이는 귀하의 수정 항목을 디버깅하기 위해서만 가능하다. 본 수정 권한은 그러한 수정 항목을 배포할 권리는 포함하지 않으며, 귀하는 조합 제품의 그러한 역엔지니어링으로부터 발생한 모든 정보를 기밀로 유지해야 한다. 일부 OSS 라이선스는 지멘스가 소스 코드를 사용할 수 있게 만들 것을 요구하며, 이러한 소스 코드의 예는 GNU 일반 공중 사용 허가서(GNU General Public License), GNU 약소 일반 공중 사용 허가서(GNU Lesser General Public License), 모질라 공용 허가서(Mozilla Public License)가 있다. 이러한 라이선스가 적용되고 본 제품이 요구하는 소스 코드와 함께 배송되지 않은 경우, 해당 OSS 라이선스가 요구하는 기간 동안 본 정보를 받아보는 누구나 다음 주소로 연락하여 해당 소스 코드의 사본을 얻을 수 있다 지멘스는 이 요청을 충족하기 위해 최대 5유로의 취급 수수료를 부과할 수 있다. 오픈 소스 소프트웨어의 추가적 사용과 관련한 보증 지멘스의 보증 의무는 지멘스와 귀하 간의 계약서에 명시되어 있다. 본 제품 또는 본 제품에 포함된 OSS 구성요소가 지멘스에서 지정하지 않은 방식으로 수정 또는 사용된 경우, 지멘스는 본 제품 또는 본 제품에 포함된 어떠한 OSS 구성요소에도 어떠한 보증이나 기술 지원도 제공하지 않는다. 아래 나열된 라이선스 조건에는 귀하와 관련 라이선스 소유자 간에 적용되는 면책 조항이 포함되어 있을 수 있다. 혼동을 피하기 위해 명확히 하자면, 지멘스는 어떠한 제3자 라이선스 소유자를 대신하여 또는 그를 구속하는 어떠한 보증 약속도 하지 않는다. Open Source Software and/or other third-party software contained in this Product If you like to receive a copy of the source code, please contact SIEMENS at the following address: Siemens AG Attn: Software Licensing LC TEC IT&SL Hertha-Sponer-Weg 3 91058 Erlangen Germany Subject: Open Source Request (please specify Product name and version)
-
+
diff --git a/build.gradle b/build.gradle
index 4f63ff0..92eb70e 100644
--- a/build.gradle
+++ b/build.gradle
@@ -26,7 +26,7 @@ mxMarketplace {
filterWidgets = false
filterRequiredLibs = true
appDirectory = "."
- includeFiles = List.of(licenseFile, CsvAsTableWidgetFile)
+ includeFiles = List.of(licenseFile)
versionPathPrefix = "__Version " // the path prefix within the module to the version folder
}
@@ -36,16 +36,6 @@ String junitHelperVersion = (value[0].toInteger() * 100 + value[1].toInteger())
dependencies {
implementation(fileTree(mxRuntimeBundles).include('*.jar'))
- //MxCommons v11.1.0 module dependencies, not included with module release
- implementation(
- [group: 'com.google.guava', name: 'guava', version: '33.4.7-jre'],
- [group: 'com.googlecode.owasp-java-html-sanitizer', name: 'owasp-java-html-sanitizer', version: '20211018.2'],
- [group: 'commons-io', name: 'commons-io', version: '2.17.0'],
- [group: 'org.apache.pdfbox', name: 'pdfbox', version: '2.0.30'],
- [group: 'org.apache.commons', name: 'commons-lang3', version: '3.18.0'],
- [group: 'org.apache.commons', name: 'commons-text', version: '1.10.0']
- )
-
testImplementation('com.mendix.util:junit-helper:' + junitHelperVersion) {
exclude group: 'com.mendix', module: 'public-api'
}
diff --git a/environment.gradle b/environment.gradle
index 8228f91..a161e6b 100644
--- a/environment.gradle
+++ b/environment.gradle
@@ -9,6 +9,5 @@ System.out.println("mxInstallVersion = ${mxInstallVersion}")
project.ext.mxInstallVersion = mxInstallVersion
project.ext.mxInstallPath = "${mxPath}/${mxInstallVersion}"
project.ext.mxRuntimeBundles = new File("${mxInstallPath}/runtime/bundles")
-project.ext.ossClearanceFile = file("SiemensMendixOQL__5.0.0__READMEOSS.html")
+project.ext.ossClearanceFile = file("SiemensMendixOQL__5.1.0__READMEOSS.html")
project.ext.licenseFile = file("LICENSE.txt")
-project.ext.CsvAsTableWidgetFile = file("widgets/mendix.CsvAsTable.mpk")
diff --git a/gradle.properties b/gradle.properties
index f81469e..0e24ef5 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1 +1 @@
-version=5.0.0
\ No newline at end of file
+version=5.1.0
\ No newline at end of file
diff --git a/javasource/communitycommons/DateTime.java b/javasource/communitycommons/DateTime.java
deleted file mode 100644
index d030469..0000000
--- a/javasource/communitycommons/DateTime.java
+++ /dev/null
@@ -1,65 +0,0 @@
-package communitycommons;
-
-import communitycommons.proxies.DatePartSelector;
-import static communitycommons.proxies.DatePartSelector.day;
-import static communitycommons.proxies.DatePartSelector.month;
-import static communitycommons.proxies.DatePartSelector.year;
-import java.util.Date;
-
-import java.time.LocalDate;
-import java.time.Period;
-import java.time.ZoneId;
-import java.util.Calendar;
-
-public class DateTime {
-
- /**
- * @author mwe
- * @author res
- * @param firstDate The begin of the period
- * @param compareDate The end of the period
- * @return The period between the firstDate in the system default timezone, and the compareDate in the system
- * default timezone as a Java Period
- *
- * Code is based on http://stackoverflow.com/questions/1116123/how-do-i-calculate-someones-age-in-java
- *
- * Adjusted to Java 8 APIs (April, 2019)
- */
- public static Period periodBetween(Date firstDate, Date compareDate) {
- return Period.between(toLocalDate(firstDate), toLocalDate(compareDate));
- }
-
- private static LocalDate toLocalDate(Date someDate) {
- return someDate.toInstant()
- .atZone(ZoneId.systemDefault())
- .toLocalDate();
- }
-
- public static long dateTimeToInteger(Date date, DatePartSelector selectorObj) {
- Calendar newDate = Calendar.getInstance();
- newDate.setTime(date);
- int value = -1;
- switch (selectorObj) {
- case year:
- value = newDate.get(Calendar.YEAR);
- break;
- case month:
- value = newDate.get(Calendar.MONTH) + 1;
- break; // Return starts at 0
- case day:
- value = newDate.get(Calendar.DAY_OF_MONTH);
- break;
- default:
- break;
- }
- return value;
- }
-
- public static long dateTimeToLong(Date date) {
- return date.getTime();
- }
-
- public static Date longToDateTime(Long value) {
- return new Date(value);
- }
-}
diff --git a/javasource/communitycommons/ImmutablePair.java b/javasource/communitycommons/ImmutablePair.java
deleted file mode 100644
index c787a53..0000000
--- a/javasource/communitycommons/ImmutablePair.java
+++ /dev/null
@@ -1,58 +0,0 @@
-package communitycommons;
-
-import org.apache.commons.lang3.builder.HashCodeBuilder;
-
-
-public class ImmutablePair
-{
- public static ImmutablePair of(T left, U right) {
- return new ImmutablePair(left, right);
- }
-
- private final T left;
- private final U right;
-
- private ImmutablePair(T left, U right) {
- if (left == null)
- throw new IllegalArgumentException("Left is NULL");
- if (right == null)
- throw new IllegalArgumentException("Right is NULL");
-
- this.left = left;
- this.right = right;
- }
-
- public T getLeft() {
- return left;
- }
-
- public U getRight() {
- return right;
- }
-
- @Override
- public String toString() {
- return "<" + left.toString()+ "," + right.toString() + ">";
- }
-
- @Override
- public boolean equals(Object other) {
- if (!(other instanceof ImmutablePair,?>))
- return false;
-
- if (this == other)
- return true;
-
- ImmutablePair,?> o = (ImmutablePair, ?>) other;
- return left.equals(o.getLeft()) && right.equals(o.getRight());
- }
-
- @Override
- public int hashCode() {
- return new HashCodeBuilder(19, 85)
- .append(left)
- .append(right)
- .toHashCode();
- }
-
-}
diff --git a/javasource/communitycommons/Logging.java b/javasource/communitycommons/Logging.java
deleted file mode 100644
index dfbf47e..0000000
--- a/javasource/communitycommons/Logging.java
+++ /dev/null
@@ -1,90 +0,0 @@
-package communitycommons;
-
-import com.mendix.core.Core;
-import com.mendix.logging.ILogNode;
-import communitycommons.proxies.LogLevel;
-import communitycommons.proxies.LogNodes;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-
-public class Logging {
-
- private static Map timers = new HashMap();
-
- public static void trace(String lognode, String message) {
- log(lognode, LogLevel.Trace, message, null);
- }
-
- public static void info(String lognode, String message) {
- log(lognode, LogLevel.Info, message, null);
- }
-
- public static void debug(String lognode, String message) {
- log(lognode, LogLevel.Debug, message, null);
- }
-
- public static void warn(String lognode, String message, Throwable e) {
- log(lognode, LogLevel.Warning, message, e);
- }
-
- public static void warn(String lognode, String message) {
- warn(lognode, message, null);
- }
-
- public static void error(String lognode, String message, Throwable e) {
- log(lognode, LogLevel.Error, message, e);
- }
-
- public static void error(String lognode, String message) {
- error(lognode, message, null);
- }
-
- public static void critical(String lognode, String message, Throwable e) {
- log(lognode, LogLevel.Critical, message, e);
- }
-
- public static void log(String lognode, LogLevel loglevel, String message, Throwable e) {
- ILogNode logger = createLogNode(lognode);
- switch (loglevel) {
- case Critical:
- logger.critical(message, e);
- break;
- case Warning:
- logger.warn(message, e);
- break;
- case Debug:
- logger.debug(message);
- break;
- case Error:
- logger.error(message, e);
- break;
- case Info:
- logger.info(message);
- break;
- case Trace:
- logger.trace(message);
- break;
- }
- }
-
- public static Long measureEnd(String timerName, LogLevel loglevel,
- String message) {
- Long cur = new Date().getTime();
- if (!timers.containsKey(timerName)) {
- throw new IllegalArgumentException(String.format("Timer with key %s not found", timerName));
- }
- Long timeTaken = cur - timers.get(timerName);
- String time = String.format("%d", timeTaken);
- log(LogNodes.CommunityCommons.name(), loglevel, "Timer " + timerName + " finished in " + time + " ms. " + message, null);
- return timeTaken;
- }
-
- public static void measureStart(String timerName) {
- timers.put(timerName, new Date().getTime());
- }
-
- public static ILogNode createLogNode(String logNode) {
- return Core.getLogger(logNode);
- }
-}
diff --git a/javasource/communitycommons/Misc.java b/javasource/communitycommons/Misc.java
deleted file mode 100644
index 0a7d5eb..0000000
--- a/javasource/communitycommons/Misc.java
+++ /dev/null
@@ -1,744 +0,0 @@
-package communitycommons;
-
-import com.mendix.core.Core;
-import com.mendix.core.CoreException;
-import com.mendix.core.objectmanagement.member.MendixBoolean;
-import com.mendix.integration.WebserviceException;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import com.mendix.systemwideinterfaces.core.ISession;
-import com.mendix.systemwideinterfaces.core.IUser;
-import communitycommons.proxies.LogNodes;
-import static communitycommons.proxies.constants.Constants.getMergeMultiplePdfs_MaxAtOnce;
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.nio.charset.StandardCharsets;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Optional;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.atomic.AtomicLong;
-import java.util.stream.Collectors;
-import org.apache.commons.io.IOUtils;
-import org.apache.pdfbox.multipdf.Overlay;
-import org.apache.pdfbox.multipdf.PDFMergerUtility;
-import org.apache.pdfbox.pdmodel.PDDocument;
-import system.proxies.FileDocument;
-import system.proxies.Language;
-
-public class Misc {
-
- private static final String LOGNODE = LogNodes.CommunityCommons.name();
- private static boolean UNDER_TEST = false;
-
- static {
- try {
- // if this succeeds, we have a runtime
- Logging.createLogNode(LOGNODE);
- } catch (NullPointerException npe) {
- UNDER_TEST = true;
- }
- }
-
- public abstract static class IterateCallback {
-
- boolean start = false;
- boolean stop = false;
- private Iterator mapIter;
-
- public abstract void hit(T1 key, T2 value) throws Exception;
-
- synchronized public void exit() {
- stop = true;
- }
-
- synchronized public void remove() {
- mapIter.remove();
- }
-
- synchronized void runOn(Map map) throws Exception {
- if (start) {
- throw new IllegalMonitorStateException();
- }
- start = true;
-
- try {
- this.mapIter = map.keySet().iterator();
-
- while (mapIter.hasNext()) {
- T1 key = mapIter.next();
- T2 value = map.get(key);
-
- hit(key, value);
-
- if (stop) {
- break;
- }
- }
- } finally {
- //reset state to allow reuse, even when exceptions occur
- mapIter = null;
- stop = false;
- start = false;
- }
- }
- }
-
- /**
- *
- * @param Any Java enumeration, such as a proxy class for a Mendix enumeration
- * @param enumClass For instance: LogLevel.class
- * @param value The value to look up in the enumeration
- * @return An Optional of the requested enumeration. Will have the requested value if found,
- * Optional.empty() otherwise.
- */
- public static > Optional enumFromString(final Class enumClass, final String value) {
- try {
- if (value != null) {
- return Optional.of(E.valueOf(enumClass, value));
- }
- } catch (IllegalArgumentException iae) {
- if (!UNDER_TEST) {
- Logging.warn(LOGNODE, String.format("No enumeration with value %s found", value));
- }
- }
- return Optional.empty();
- }
-
- /**
- * Because you cannot remove items from a map while iteration, this function is introduced. In
- * the callback, you can use this.remove() or this.exit() to either remove or break the loop.
- * Use return; to continue
- *
- * @throws Exception
- */
- public static void iterateMap(Map map, IterateCallback callback) throws Exception {
- //http://marxsoftware.blogspot.com/2008/04/removing-entry-from-java-map-during.html
- if (map == null || callback == null) {
- throw new IllegalArgumentException();
- }
-
- callback.runOn(map);
- }
-
- public static String getApplicationURL() {
- final String applicationURL = UNDER_TEST ? "http://localhost:8080/" : Core.getConfiguration().getApplicationRootUrl();
- return StringUtils.removeEnd(applicationURL, "/");
- }
-
- /**
- * @return the runtime version
- * @deprecated since 11.0.0. Use {@link com.mendix.core.Core.getRuntimeVersion} instead
- */
- @Deprecated
- public static String getRuntimeVersion() {
- return Core.getRuntimeVersion();
- }
-
- /**
- * @return the model version
- * @deprecated since 11.0.0. Use {@link com.mendix.core.Core.getModelVersion} instead
- */
- @Deprecated
- public static String getModelVersion() {
- return Core.getModelVersion();
- }
-
- public static void throwException(String message) throws UserThrownException {
- throw new UserThrownException(message);
- }
-
- public static void throwWebserviceException(String faultstring) throws WebserviceException {
- throw new WebserviceException(WebserviceException.clientFaultCode, faultstring);
- }
-
- public static String retrieveURL(String url, String postdata) throws Exception {
- // Send data, appname
- URLConnection conn = new URI(url).toURL().openConnection();
-
- conn.setDoInput(true);
- conn.setDoOutput(true);
- conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
-
- if (postdata != null) {
- try (
- OutputStream os = conn.getOutputStream()) {
- IOUtils.copy(new ByteArrayInputStream(postdata.getBytes(StandardCharsets.UTF_8)), os);
- }
- }
-
- String result;
- try (
- InputStream is = conn.getInputStream()) {
- // Get the response
- result = IOUtils.toString(is, StandardCharsets.UTF_8);
- }
-
- return result;
- }
-
- public static Boolean duplicateFileDocument(IContext context, IMendixObject toClone, IMendixObject target) throws Exception {
- if (toClone == null || target == null) {
- throw new Exception("No file to clone or to clone into provided");
- }
-
- MendixBoolean hasContents = (MendixBoolean) toClone.getMember(FileDocument.MemberNames.HasContents.toString());
- if (!hasContents.getValue(context)) {
- return false;
- }
-
- try (
- InputStream inputStream = Core.getFileDocumentContent(context, toClone)) {
- Core.storeFileDocumentContent(context, target, (String) toClone.getValue(context, system.proxies.FileDocument.MemberNames.Name.toString()), inputStream);
- }
-
- return true;
- }
-
- public static Boolean duplicateImage(IContext context, IMendixObject toClone, IMendixObject target, int thumbWidth, int thumbHeight) throws Exception {
- if (toClone == null || target == null) {
- throw new Exception("No file to clone or to clone into provided");
- }
-
- MendixBoolean hasContents = (MendixBoolean) toClone.getMember(FileDocument.MemberNames.HasContents.toString());
- if (!hasContents.getValue(context)) {
- return false;
- }
-
- try (
- InputStream inputStream = Core.getImage(context, toClone, false)) {
- Core.storeImageDocumentContent(context, target, inputStream, thumbWidth, thumbHeight);
-
- }
-
- return true;
- }
-
- public static Boolean storeURLToFileDocument(IContext context, String url, IMendixObject __document, String filename) throws IOException, URISyntaxException {
- if (__document == null || url == null || filename == null) {
- throw new IllegalArgumentException("No document, filename or URL provided");
- }
-
- final int MAX_REMOTE_FILESIZE = 1024 * 1024 * 200; //maximum of 200 MB
- try {
- URL imageUrl = new URI(url).toURL();
- URLConnection connection = imageUrl.openConnection();
- //we connect in 20 seconds or not at all
- connection.setConnectTimeout(20000);
- connection.setReadTimeout(20000);
- connection.connect();
-
- int contentLength = connection.getContentLength();
-
- //check on forehand the size of the remote file, we don't want to kill the server by providing a 3 terabyte image.
- Logging.trace(LOGNODE, String.format("Remote filesize: %d", contentLength));
-
- if (contentLength > MAX_REMOTE_FILESIZE) { //maximum of 200 mb
- throw new IllegalArgumentException(String.format("Wrong filesize of remote url: %d (max: %d)", contentLength, MAX_REMOTE_FILESIZE));
- }
-
- InputStream fileContentIS;
- try (InputStream connectionInputStream = connection.getInputStream()) {
- if (contentLength >= 0) {
- fileContentIS = connectionInputStream;
- } else { // contentLength is negative or unknown
- Logging.trace(LOGNODE, String.format("Unknown content length; limiting to %d", MAX_REMOTE_FILESIZE));
- byte[] outBytes = new byte[MAX_REMOTE_FILESIZE];
- int actualLength = IOUtils.read(connectionInputStream, outBytes, 0, MAX_REMOTE_FILESIZE);
- fileContentIS = new ByteArrayInputStream(Arrays.copyOf(outBytes, actualLength));
- }
- Core.storeFileDocumentContent(context, __document, filename, fileContentIS);
- }
- } catch (IOException | URISyntaxException e) {
- Logging.error(LOGNODE, String.format("A problem occurred while reading from URL %s: %s", url, e.getMessage()));
- throw e;
- }
-
- return true;
- }
-
- public static Long getFileSize(IContext context, IMendixObject document) {
- final int BUFFER_SIZE = 4096;
- long size = 0;
-
- if (context != null) {
- byte[] buffer = new byte[BUFFER_SIZE];
-
- try (
- InputStream inputStream = Core.getFileDocumentContent(context, document)) {
- int i;
- while ((i = inputStream.read(buffer)) != -1) {
- size += i;
- }
- } catch (IOException e) {
- Logging.error(LOGNODE, "Couldn't determine filesize of FileDocument '" + document.getId());
- }
- }
-
- return size;
- }
-
- public static void delay(long delaytime) throws InterruptedException {
- Thread.sleep(delaytime);
- }
-
- public static IContext getContextFor(IContext context, String username, boolean sudoContext) {
- if (username == null || username.isEmpty()) {
- throw new RuntimeException("Assertion: No username provided");
- }
-
- if (username.equals(context.getSession().getUserName())) {
- return context;
- } else { // when it is a scheduled event, then get the right session.
- ISession session = getSessionFor(context, username);
-
- IContext c = session.createContext();
- if (sudoContext) {
- return c.createSudoClone();
- }
-
- return c;
- }
- }
-
- private static ISession getSessionFor(IContext context, String username) {
- ISession session = Core.getActiveSession(username);
-
- if (session == null) {
- IContext newContext = context.getSession().createContext().createSudoClone();
- newContext.startTransaction();
- try {
- session = initializeSessionForUser(newContext, username);
- } catch (CoreException e) {
- newContext.rollbackTransaction();
-
- throw new RuntimeException("Failed to initialize session for user: " + username + ": " + e.getMessage(), e);
- } finally {
- newContext.endTransaction();
- }
- }
-
- return session;
- }
-
- private static ISession initializeSessionForUser(IContext context, String username) throws CoreException {
- IUser user = Core.getUser(context, username);
-
- if (user == null) {
- throw new RuntimeException("Assertion: user with username '" + username + "' does not exist");
- }
-
- return Core.initializeSession(user, null);
- }
-
- public static Object executeMicroflowAsUser(IContext context,
- String microflowName, String username, Boolean sudoContext, Object... args) throws Exception {
-
- if (context == null) {
- throw new Exception("Assertion: No context provided");
- }
- if (microflowName == null || microflowName.isEmpty()) {
- throw new Exception("Assertion: No context provided");
- }
- if (!Core.getMicroflowNames().contains(microflowName)) {
- throw new Exception("Assertion: microflow not found: " + microflowName);
- }
- if (args.length % 2 != 0) {
- throw new Exception("Assertion: odd number of dynamic arguments provided, please name every argument: " + args.length);
- }
-
- Map params = new LinkedHashMap();
- for (int i = 0; i < args.length; i += 2) {
- if (args[i] != null) {
- params.put(args[i].toString(), args[i + 1]);
- }
- }
-
- IContext c = getContextFor(context, username, sudoContext);
-
- return Core.microflowCall(microflowName).withParams(params).execute(c);
- }
-
- //MWE: based on: http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Executor.html
- static class MFSerialExecutor {
-
- private static MFSerialExecutor _instance = new MFSerialExecutor();
-
- private final AtomicLong tasknr = new AtomicLong();
- private final ExecutorService executor;
-
- public static MFSerialExecutor instance() {
- return _instance;
- }
-
- private MFSerialExecutor() {
- executor = Executors.newSingleThreadExecutor(new ThreadFactory() {
-
- //Default thread factory takes care of setting the proper thread context
- private final ThreadFactory defaultFactory = Executors.defaultThreadFactory();
-
- @Override
- public Thread newThread(Runnable runnable) {
- Thread t = defaultFactory.newThread(runnable);
- t.setPriority(Thread.MIN_PRIORITY);
- t.setName("CommunityCommons background pool executor thread");
- return t;
- }
-
- });
- }
-
- public void execute(final Runnable command) {
- if (command == null) {
- throw new NullPointerException("command");
- }
-
- final long currenttasknr = tasknr.incrementAndGet();
- Logging.debug(LOGNODE, "[RunMicroflowAsyncInQueue] Scheduling task #" + currenttasknr);
-
- executor.submit(new Runnable() {
- @Override
- public void run() {
- Logging.debug(LOGNODE, "[RunMicroflowAsyncInQueue] Running task #" + currenttasknr);
- try {
- command.run();
- } catch (RuntimeException e) {
- Logging.error(LOGNODE, "[RunMicroflowAsyncInQueue] Execution of task #" + currenttasknr + " failed: " + e.getMessage(), e);
- throw e; //single thread executor will continue, even if an exception is thrown.
- }
- Logging.debug(LOGNODE, "[RunMicroflowAsyncInQueue] Completed task #" + currenttasknr + ". Tasks left: " + (tasknr.get() - currenttasknr));
- }
- });
- }
- }
-
- public static Boolean runMicroflowAsyncInQueue(final String microflowName) {
- MFSerialExecutor.instance().execute(new Runnable() {
- @Override
- public void run() {
- try {
- Future future = Core.executeAsync(Core.createSystemContext(), microflowName, true, new HashMap<>()); //MWE: somehow, it only works with system context... well thats OK for now.
- future.get();
- } catch (CoreException | InterruptedException | ExecutionException e) {
- throw new RuntimeException("Failed to run Async: " + microflowName + ": " + e.getMessage(), e);
- }
- }
- });
- return true;
- }
-
- public static Boolean runMicroflowInBackground(final IContext context, final String microflowName,
- final IMendixObject paramObject) {
-
- MFSerialExecutor.instance().execute(new Runnable() {
-
- @Override
- public void run() {
- try {
- IContext c = Core.createSystemContext();
- if (paramObject != null) {
- Core.executeAsync(c, microflowName, true, paramObject).get(); //MWE: somehow, it only works with system context... well thats OK for now.
- } else {
- Core.executeAsync(c, microflowName, true, new HashMap<>()).get(); //MWE: somehow, it only works with system context... well thats OK for now.
- }
- } catch (CoreException | InterruptedException | ExecutionException e) {
- throw new RuntimeException("Failed to run Async: " + microflowName + ": " + e.getMessage(), e);
- }
-
- }
-
- });
- return true;
- }
-
- private interface IBatchItemHandler {
-
- void exec(IContext context, IMendixObject obj) throws Exception;
-
- }
-
- private static class BatchState {
-
- private int state = 0; //-1 = error, 1 = done.
- private final IBatchItemHandler callback;
-
- public BatchState(IBatchItemHandler callback) {
- this.callback = callback;
- }
-
- public void setState(int state) {
- this.state = state;
- }
-
- public int getState() {
- return state;
- }
-
- public void handle(IContext context, IMendixObject obj) throws Exception {
- callback.exec(context, obj);
- }
- }
-
- public static Boolean executeMicroflowInBatches(String xpath, final String microflow, int batchsize, boolean waitUntilFinished, boolean asc) throws CoreException, InterruptedException {
- Logging.debug(LOGNODE, "[ExecuteInBatches] Starting microflow batch '" + microflow + "...");
-
- return executeInBatches(xpath, new BatchState(new IBatchItemHandler() {
-
- @Override
- public void exec(IContext context, IMendixObject obj) throws Exception {
- Core.executeAsync(context, microflow, true, obj).get();
- }
-
- }), batchsize, waitUntilFinished, asc);
- }
-
- public static Boolean recommitInBatches(String xpath, int batchsize,
- boolean waitUntilFinished, Boolean asc) throws CoreException, InterruptedException {
- Logging.debug(LOGNODE, "[ExecuteInBatches] Starting recommit batch...");
-
- return executeInBatches(xpath, new BatchState(new IBatchItemHandler() {
-
- @Override
- public void exec(IContext context, IMendixObject obj) throws Exception {
- Core.commit(context, obj);
- }
-
- }), batchsize, waitUntilFinished, asc);
- }
-
- public static Boolean executeInBatches(String xpathRaw, BatchState batchState, int batchsize, boolean waitUntilFinished, boolean asc) throws CoreException, InterruptedException {
- String xpath = xpathRaw.startsWith("//") ? xpathRaw : "//" + xpathRaw;
-
- long count = Core.createXPathQuery("count(" + xpath + ")").executeAggregateLong(Core.createSystemContext());
- int loop = (int) Math.ceil(((float) count) / ((float) batchsize));
-
- Logging.debug(LOGNODE,
- "[ExecuteInBatches] Starting batch on ~ " + count + " objects divided over ~ " + loop + " batches. "
- + (waitUntilFinished ? "Waiting until the batch has finished..." : "")
- );
-
- executeInBatchesHelper(xpath, batchsize, 0, batchState, count, asc);
-
- if (waitUntilFinished) {
- while (batchState.getState() == 0) {
- Thread.sleep(5000);
- }
- if (batchState.getState() == 1) {
- Logging.debug(LOGNODE, "[ExecuteInBatches] Successfully finished batch");
- return true;
- }
- Logging.error(LOGNODE, "[ExecuteInBatches] Failed to finish batch. Please check the application log for more details.");
- return false;
- }
-
- return true;
- }
-
- static void executeInBatchesHelper(final String xpath, final int batchsize, final long last, final BatchState batchState, final long count, final boolean asc) {
- MFSerialExecutor.instance().execute(new Runnable() {
-
- @Override
- public void run() {
- try {
- Thread.sleep(200);
- IContext c = Core.createSystemContext();
-
- List objects =
- Core.createXPathQuery(xpath + (last > 0 ? "[id " + (asc ? "> " : "< ") + last + "]" : ""))
- .setAmount(batchsize)
- .setOffset(0)
- .addSort("id", asc ? true : false)
- .execute(c);
-
- //no new objects found :)
- if (objects.isEmpty()) {
- Logging.debug(LOGNODE, "[ExecuteInBatches] Succesfully finished batch on ~" + count + " objects.");
- batchState.setState(1);
- } else {
-
- //process objects
- for (IMendixObject obj : objects) {
- batchState.handle(c, obj);
- }
-
- //invoke next batch
- executeInBatchesHelper(xpath, batchsize, objects.get(objects.size() - 1).getId().toLong(), batchState, count, asc);
- }
- } catch (Exception e) {
- batchState.setState(-1);
- throw new RuntimeException("[ExecuteInBatches] Failed to run in batch: " + e.getMessage(), e);
- }
- }
-
- });
- }
-
- /**
- * Tests if two objects are equal with throwing unecessary null pointer exceptions.
- *
- * This is almost the most stupid function ever, since it should be part of Java itself.
- *
- * @param left
- * @param right
- * @return
- * @deprecated Native Java function Objects.equals() is available since Java 7
- */
- @Deprecated
- public static boolean objectsAreEqual(Object left, Object right) {
- if (left == null && right == null) {
- return true;
- }
- if (left == null || right == null) {
- return false;
- }
- return left.equals(right);
- }
-
- /**
- * Get the default language
- *
- * @param context
- * @return The default language
- * @throws CoreException
- */
- public static Language getDefaultLanguage(IContext context) throws CoreException {
- String languageCode = Core.getDefaultLanguage().getCode();
- List languageList = Language.load(context, "[Code = '" + languageCode + "']");
- if (languageList == null || languageList.isEmpty()) {
- throw new RuntimeException("No language found for default language constant value " + languageCode);
- }
- return languageList.get(0);
- }
-
- public static boolean mergePDF(IContext context, List documents, IMendixObject mergedDocument) throws IOException {
- if (getMergeMultiplePdfs_MaxAtOnce() <= 0 || documents.size() <= getMergeMultiplePdfs_MaxAtOnce()) {
-
- List sources = new ArrayList<>();
- try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
- PDFMergerUtility mergePdf = new PDFMergerUtility();
-
- for (FileDocument file : documents) {
- InputStream content = Core.getFileDocumentContent(context, file.getMendixObject());
- sources.add(content);
- }
- mergePdf.addSources(sources);
- mergePdf.setDestinationStream(out);
- mergePdf.mergeDocuments(null);
-
- Core.storeFileDocumentContent(context, mergedDocument, new ByteArrayInputStream(out.toByteArray()));
-
- out.reset();
- documents.clear();
- } catch (IOException e) {
- throw new RuntimeException("Failed to merge documents" + e.getMessage(), e);
- } finally { // We cannot use try-with-resources because streams would be prematurely closed
- for (InputStream is : sources) {
- is.close();
- }
- }
-
- return true;
- } else {
- throw new IllegalArgumentException("MergeMultiplePDFs: you cannot merge more than " + getMergeMultiplePdfs_MaxAtOnce()
- + " PDF files at once. You are trying to merge " + documents.size() + " PDF files.");
- }
- }
-
- /**
- * Overlay a generated PDF document with another PDF (containing the company stationary for
- * example)
- *
- * @param context
- * @param generatedDocumentMendixObject The document to overlay
- * @param overlayMendixObject The document containing the overlay
- * @param onTopOfContent if true, puts overlay position in the foreground, otherwise in the
- * background
- * @return boolean
- * @throws IOException
- */
- public static boolean overlayPdf(IContext context, IMendixObject generatedDocumentMendixObject, IMendixObject overlayMendixObject, boolean onTopOfContent) throws IOException {
- Logging.trace(LOGNODE, "Retrieve generated document");
- try (
- PDDocument inputDoc = PDDocument.load(Core.getFileDocumentContent(context, generatedDocumentMendixObject));
- PDDocument overlayDoc = PDDocument.load(Core.getFileDocumentContent(context, overlayMendixObject));
- ByteArrayOutputStream baos = new ByteArrayOutputStream()) {
- Logging.trace(LOGNODE, "Overlay PDF start, retrieve overlay PDF");
-
- Logging.trace(LOGNODE, "Perform overlay");
- try (Overlay overlay = new Overlay()) {
- overlay.setInputPDF(inputDoc);
- overlay.setDefaultOverlayPDF(overlayDoc);
- if (onTopOfContent) {
- overlay.setOverlayPosition(Overlay.Position.FOREGROUND);
- } else {
- overlay.setOverlayPosition(Overlay.Position.BACKGROUND);
- }
-
- Logging.trace(LOGNODE, "Save result in output stream");
-
- overlay.overlay(new HashMap<>()).save(baos);
- }
-
- Logging.trace(LOGNODE, "Duplicate result in input stream");
- try (InputStream overlayedContent = new ByteArrayInputStream(baos.toByteArray())) {
- Logging.trace(LOGNODE, "Store result in original document");
- Core.storeFileDocumentContent(context, generatedDocumentMendixObject, overlayedContent);
- }
- }
-
- Logging.trace(LOGNODE, "Overlay PDF end");
- return true;
- }
-
- /**
- * Get the Cloud Foundry Instance Index (0 for leader and >0 for slave)
- *
- * @return CF_INSTANCE_INDEX environment variable if available, otherwise -1
- */
- public static long getCFInstanceIndex() {
- long cfInstanceIndex = -1L;
-
- try {
- cfInstanceIndex = Long.parseLong(System.getenv("CF_INSTANCE_INDEX"));
- } catch (SecurityException securityException) {
- Logging.info(LOGNODE, "GetCFInstanceIndex: Could not access environment variable CF_INSTANCE_INDEX, permission denied. Value of -1 is returned.");
- } catch (NumberFormatException numberFormatException) {
- Logging.info(LOGNODE, "GetCFInstanceIndex: Could not parse value of environment variable CF_INSTANCE_INDEX as Long. Value of -1 is returned.");
- } catch (NullPointerException nullPointerException) {
- Logging.info(LOGNODE, "GetCFInstanceIndex: Could not find value for environment variable CF_INSTANCE_INDEX. This could indicate a local deployment is running. Value of -1 is returned.");
- }
-
- return cfInstanceIndex;
- }
-
- /**
- * Returns the top n items of a List
- *
- * @param the type of the list elements
- * @param objects the list to take the top n items from
- * @param top the number of items to take
- * @return the sublist of objects with max
- * top elements
- */
- public static List listTop(List objects, int top) {
- return objects.stream()
- .limit(top)
- .collect(Collectors.toList());
- }
-}
diff --git a/javasource/communitycommons/ORM.java b/javasource/communitycommons/ORM.java
deleted file mode 100644
index fb257fc..0000000
--- a/javasource/communitycommons/ORM.java
+++ /dev/null
@@ -1,380 +0,0 @@
-package communitycommons;
-
-import com.mendix.core.Core;
-import com.mendix.core.CoreException;
-import com.mendix.core.objectmanagement.member.MendixAutoNumber;
-import com.mendix.core.objectmanagement.member.MendixDateTime;
-import com.mendix.core.objectmanagement.member.MendixEnum;
-import com.mendix.core.objectmanagement.member.MendixObjectReference;
-import com.mendix.core.objectmanagement.member.MendixObjectReferenceSet;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.IMendixIdentifier;
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import com.mendix.systemwideinterfaces.core.IMendixObject.ObjectState;
-import com.mendix.systemwideinterfaces.core.IMendixObjectMember;
-import com.mendix.systemwideinterfaces.core.meta.IMetaAssociation;
-import com.mendix.systemwideinterfaces.core.meta.IMetaAssociation.AssociationType;
-import com.mendix.systemwideinterfaces.core.meta.IMetaEnumValue;
-import com.mendix.systemwideinterfaces.core.meta.IMetaEnumeration;
-import com.mendix.systemwideinterfaces.core.meta.IMetaObject;
-import com.mendix.systemwideinterfaces.core.meta.IMetaPrimitive;
-import com.mendix.systemwideinterfaces.core.meta.IMetaPrimitive.PrimitiveType;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-public class ORM {
-
- public static Long getGUID(IMendixObject item) {
- return item.getId().toLong();
- }
-
- public static String getOriginalValueAsString(IContext context, IMendixObject item,
- String member) {
- return String.valueOf(item.getMember(member).getOriginalValue(context));
- }
-
- public static boolean objectHasChanged(IMendixObject anyobject) {
- if (anyobject == null) {
- throw new IllegalArgumentException("The provided object is empty");
- }
- return anyobject.isChanged();
- }
-
- /** Returns true if any member has a value other than its original value. */
- public static boolean objectHasChangedMemberValue(IContext context, IMendixObject object) {
- if (object == null) throw new IllegalArgumentException("The provided object is empty");
- return object.hasChangedMemberValue(context);
- }
-
- /**
- * checks whether a certain member of an object has changed. If the objects itself is still new,
- * we consider to be changes as well.
- *
- * @param item
- * @param member
- * @param context
- * @return
- */
- public static boolean memberHasChanged(IContext context, IMendixObject item, String member) {
- if (item == null) {
- throw new IllegalArgumentException("The provided object is empty");
- }
- if (!item.hasMember(member)) {
- throw new IllegalArgumentException("Unknown member: " + member);
- }
- return item.getMember(member).isChanged() || item.getState() != ObjectState.NORMAL;
- }
-
- /** Check if the value of the member was changed to something other than its original value. */
- public static boolean memberHasChangedValue(IContext context, IMendixObject item, String member) {
- if (item == null) throw new IllegalArgumentException("The provided object is empty");
- if (!item.hasMember(member)) throw new IllegalArgumentException("Unknown member: " + member);
- return item.getMember(member).isValueChanged(context);
- }
-
- public static void deepClone(IContext c, IMendixObject source, IMendixObject target, String membersToSkip, String membersToKeep, String reverseAssociations, String excludeEntities, String excludeModules) throws CoreException {
- List toskip = Arrays.asList((membersToSkip + ",createdDate,changedDate").split(","));
- List tokeep = Arrays.asList((membersToKeep + ",System.owner,System.changedBy").split(","));
- List revAssoc = Arrays.asList(reverseAssociations.split(","));
- List skipEntities = Arrays.asList(excludeEntities.split(","));
- List skipModules = Arrays.asList(excludeModules.split(","));
- Map mappedIDs = new HashMap();
- duplicate(c, source, target, toskip, tokeep, revAssoc, skipEntities, skipModules, mappedIDs);
- }
-
- private static void duplicate(IContext ctx, IMendixObject src, IMendixObject tar,
- List toskip, List tokeep, List revAssoc,
- List skipEntities, List skipModules,
- Map mappedObjects) throws CoreException {
- mappedObjects.put(src.getId(), tar.getId());
-
- Map> members = src.getMembers(ctx);
- String type = src.getType() + "/";
-
- for (var entry : members.entrySet()) {
- String key = entry.getKey();
- if (!toskip.contains(key) && !toskip.contains(type + key)) {
- IMendixObjectMember> m = entry.getValue();
- if (m.isVirtual() || m instanceof MendixAutoNumber) {
- continue;
- }
-
- boolean keep = tokeep.contains(key) || tokeep.contains(type + key);
-
- if (m instanceof MendixObjectReference && !keep && m.getValue(ctx) != null) {
- IMendixObject o = Core.retrieveId(ctx, ((MendixObjectReference) m).getValue(ctx));
- IMendixIdentifier refObj = getCloneOfObject(ctx, o, toskip, tokeep, revAssoc, skipEntities, skipModules, mappedObjects);
- tar.setValue(ctx, key, refObj);
- } else if (m instanceof MendixObjectReferenceSet && !keep && m.getValue(ctx) != null) {
- MendixObjectReferenceSet rs = (MendixObjectReferenceSet) m;
- List res = new ArrayList();
- for (IMendixIdentifier item : rs.getValue(ctx)) {
- IMendixObject o = Core.retrieveId(ctx, item);
- IMendixIdentifier refObj = getCloneOfObject(ctx, o, toskip, tokeep, revAssoc, skipEntities, skipModules, mappedObjects);
- res.add(refObj);
- }
- tar.setValue(ctx, key, res);
- } else if (m instanceof MendixAutoNumber) //skip autonumbers! Ticket 14893
- {
- // do nothing
- } else if ("__UUID__".equals(key) && (isFileDocument(src) || isFileDocument(tar))) {
- // do nothing
- } else {
- tar.setValue(ctx, key, m.getValue(ctx));
- }
- }
- }
- Core.commitWithoutEvents(ctx, tar);
- duplicateReverseAssociations(ctx, src, tar, toskip, tokeep, revAssoc, skipEntities, skipModules, mappedObjects);
- }
-
- private static IMendixIdentifier getCloneOfObject(IContext ctx, IMendixObject src,
- List toskip, List tokeep, List revAssoc,
- List skipEntities, List skipModules,
- Map mappedObjects) throws CoreException {
- String objType = src.getMetaObject().getName();
- String modName = src.getMetaObject().getModuleName();
-
- // if object is already being cloned, return ref to clone
- if (mappedObjects.containsKey(src.getId())) {
- return mappedObjects.get(src.getId());
- // if object should be skipped based on module or entity, return source object
- } else if (skipEntities.contains(objType) || skipModules.contains(modName)) {
- return src.getId();
- // if not already being cloned, create clone
- } else {
- IMendixObject clone = Core.instantiate(ctx, src.getType());
- duplicate(ctx, src, clone, toskip, tokeep, revAssoc, skipEntities, skipModules, mappedObjects);
- return clone.getId();
- }
- }
-
- private static void duplicateReverseAssociations(IContext ctx, IMendixObject src, IMendixObject tar,
- List toskip, List tokeep, List revAssocs,
- List skipEntities, List skipModules,
- Map mappedObjects) throws CoreException {
- for (String fullAssocName : revAssocs) {
- String[] parts = fullAssocName.split("/");
-
- if (parts.length != 1 && parts.length != 3) //specifying entity has no meaning anymore, but remain backward compatible.
- {
- throw new IllegalArgumentException("Reverse association is not defined correctly, please mention the relation name only: '" + fullAssocName + "'");
- }
-
- String assocname = parts.length == 3 ? parts[1] : parts[0]; //support length 3 for backward compatibility
-
- IMetaAssociation massoc = src.getMetaObject().getDeclaredMetaAssociationChild(assocname);
-
- if (massoc != null) {
- IMetaObject relationParent = massoc.getParent();
- // if the parent is in the exclude list, we can't clone the parent, and setting the
- // references to the newly cloned target object will screw up the source data.
- if (skipEntities.contains(relationParent.getName()) || skipModules.contains(relationParent.getModuleName())) {
- throw new IllegalArgumentException("A reverse reference has been specified that starts at an entity in the exclude list, this is not possible to clone: '" + fullAssocName + "'");
- }
-
- //MWE: what to do with reverse reference sets? -> to avoid spam creating objects on
- //reverse references, do not support referenceset (todo: we could keep a map of converted guids and reuse that!)
- if (massoc.getType() == AssociationType.REFERENCESET) {
- throw new IllegalArgumentException("It is not possible to clone reverse referencesets: '" + fullAssocName + "'");
- }
-
- List objs = Core.createXPathQuery(String.format("//%s[%s=$value]", relationParent.getName(), assocname))
- .setVariable("value", src)
- .execute(ctx);
-
- for (IMendixObject obj : objs) {
- @SuppressWarnings("unused") // object is unused on purpose
- IMendixIdentifier refObj = getCloneOfObject(ctx, obj, toskip, tokeep, revAssocs, skipEntities, skipModules, mappedObjects);
- // setting reference explicitly is not necessary, this has been done in the
- // duplicate() call.
- }
- }
- }
- }
-
- public static Boolean commitWithoutEvents(IContext context, IMendixObject subject) throws CoreException {
- Core.commitWithoutEvents(context, subject);
- return true;
- }
-
- public static String getValueOfPath(IContext context, IMendixObject substitute, String fullpath, String datetimeformat) throws Exception {
- String[] path = fullpath.split("/");
- if (path.length == 1) {
- IMendixObjectMember> member = substitute.getMember(path[0]);
-
- //special case, see ticket 9135, format datetime.
- if (member instanceof MendixDateTime) {
- Date time = ((MendixDateTime) member).getValue(context);
- if (time == null) {
- return "";
- }
- String f = datetimeformat != null && !datetimeformat.isEmpty() ? datetimeformat : "EEE dd MMM yyyy, HH:mm";
- return new SimpleDateFormat(f).format(time);
- }
-
- if (member instanceof MendixEnum) {
- String value = member.parseValueToString(context);
- if (value == null || value.isEmpty()) {
- return "";
- }
-
- IMetaEnumeration enumeration = ((MendixEnum) member).getEnumeration();
- IMetaEnumValue evalue = enumeration.getEnumValues().get(value);
- return Core.getInternationalizedString(context, evalue.getI18NCaptionKey());
- }
- //default
- return member.parseValueToString(context);
- } else if (path.length == 0) {
- throw new Exception("communitycommons.ORM.getValueOfPath: Unexpected end of path.");
- } else {
- IMendixObjectMember> member = substitute.getMember(path[0]);
- if (member instanceof MendixObjectReference) {
- MendixObjectReference ref = (MendixObjectReference) member;
- IMendixIdentifier id = ref.getValue(context);
- if (id == null) {
- return "";
- }
- IMendixObject obj = Core.retrieveId(context, id);
- if (obj == null) {
- return "";
- }
- return getValueOfPath(context, obj, fullpath.substring(fullpath.indexOf("/") + 1), datetimeformat);
- } else if (member instanceof MendixObjectReferenceSet) {
- MendixObjectReferenceSet ref = (MendixObjectReferenceSet) member;
- List ids = ref.getValue(context);
- if (ids == null) {
- return "";
- }
- StringBuilder res = new StringBuilder();
- for (IMendixIdentifier id : ids) {
- if (id == null) {
- continue;
- }
- IMendixObject obj = Core.retrieveId(context, id);
- if (obj == null) {
- continue;
- }
- res.append(", ");
- res.append(getValueOfPath(context, obj, fullpath.substring(fullpath.indexOf("/") + 1), datetimeformat));
- }
- return res.length() > 1 ? res.toString().substring(2) : "";
- } else {
- throw new Exception("communitycommons.ORM.getValueOfPath: Not a valid reference: '" + path[0] + "' in '" + fullpath + "'");
- }
- }
- }
-
- private static boolean isFileDocument(IMendixObject object) {
- return object.getMetaObject().isFileDocument();
- }
-
- public static Boolean cloneObject(IContext c, IMendixObject source,
- IMendixObject target, Boolean withAssociations) {
- return cloneObject(c, source, target, withAssociations, false);
- }
-
- public static Boolean cloneObject(IContext c, IMendixObject source,
- IMendixObject target, Boolean withAssociations, Boolean skipIsBoth) {
- Map> members = source.getMembers(c);
-
- for (var entry : members.entrySet()) {
- IMendixObjectMember> m = entry.getValue();
- if (m.isVirtual()) {
- continue;
- }
- if (m instanceof MendixAutoNumber) {
- continue;
- }
- if ("__UUID__".equals(m.getName()) && (isFileDocument(source) || isFileDocument(target))) {
- continue;
- }
- if (withAssociations || ((!(m instanceof MendixObjectReference) && !(m instanceof MendixObjectReferenceSet) && !(m instanceof MendixAutoNumber)))) {
- if (skipIsBoth && (
- (m instanceof MendixObjectReference && ((MendixObjectReference) m).isBoth()) ||
- (m instanceof MendixObjectReferenceSet && ((MendixObjectReferenceSet) m).isBoth())))
- continue;
- target.setValue(c, entry.getKey(), m.getValue(c));
- }
- }
- return true;
- }
-
- public static IMendixObject firstWhere(IContext c, String entityName,
- Object member, String value) throws CoreException {
- List items =
- Core.createXPathQuery(String.format("//%s[%s = '%s']", entityName, member, value))
- .setAmount(1)
- .setOffset(0)
- .execute(c);
-
- if (items == null || items.size() == 0) {
- return null;
- }
- return items.get(0);
- }
-
- public static IMendixObject getLastChangedByUser(IContext context,
- IMendixObject thing) throws CoreException {
- if (thing == null || !thing.hasChangedByAttribute()) {
- return null;
- }
-
- IMendixIdentifier itemId = thing.getChangedBy(context);
- if (itemId == null) {
- return null;
- }
-
- return Core.retrieveId(context, itemId);
- }
-
- public static IMendixObject getCreatedByUser(IContext context,
- IMendixObject thing) throws CoreException {
- if (thing == null || !thing.hasOwnerAttribute()) {
- return null;
- }
-
- IMendixIdentifier itemId = thing.getOwner(context);
- if (itemId == null) {
- return null;
- }
-
- return Core.retrieveId(context, itemId);
- }
-
- public static void commitSilent(IContext c, IMendixObject mendixObject) {
- try {
- Core.commit(c, mendixObject);
- } catch (CoreException e) {
- throw new RuntimeException(e);
- }
- }
-
- public static void copyAttributes(IContext context, IMendixObject source, IMendixObject target) {
- if (source == null) {
- throw new IllegalStateException("source is null");
- }
- if (target == null) {
- throw new IllegalStateException("target is null");
- }
-
- for (IMetaPrimitive e : target.getMetaObject().getMetaPrimitives()) {
- if (!source.hasMember(e.getName())) {
- continue;
- }
- if (e.isVirtual() || e.getType() == PrimitiveType.AutoNumber) {
- continue;
- }
- if ("__UUID__".equals(e.getName()) && (isFileDocument(source) || isFileDocument(target))) {
- continue;
- }
-
- target.setValue(context, e.getName(), source.getValue(context, e.getName()));
- }
- }
-}
diff --git a/javasource/communitycommons/StringUtils.java b/javasource/communitycommons/StringUtils.java
deleted file mode 100644
index b61b7b9..0000000
--- a/javasource/communitycommons/StringUtils.java
+++ /dev/null
@@ -1,514 +0,0 @@
-package communitycommons;
-
-import com.mendix.core.Core;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import communitycommons.proxies.SanitizerPolicy;
-
-import static communitycommons.proxies.SanitizerPolicy.BLOCKS;
-import static communitycommons.proxies.SanitizerPolicy.FORMATTING;
-import static communitycommons.proxies.SanitizerPolicy.IMAGES;
-import static communitycommons.proxies.SanitizerPolicy.LINKS;
-import static communitycommons.proxies.SanitizerPolicy.STYLES;
-import static communitycommons.proxies.SanitizerPolicy.TABLES;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringReader;
-import java.io.UnsupportedEncodingException;
-import java.nio.charset.Charset;
-import java.nio.charset.StandardCharsets;
-import java.security.*;
-import java.text.Normalizer;
-import java.util.*;
-import java.util.AbstractMap.SimpleEntry;
-import java.util.function.Function;
-import java.util.regex.MatchResult;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.stream.Collectors;
-import javax.crypto.Mac;
-import javax.crypto.spec.SecretKeySpec;
-import javax.swing.text.MutableAttributeSet;
-import javax.swing.text.html.HTML;
-import javax.swing.text.html.HTMLEditorKit;
-import javax.swing.text.html.parser.ParserDelegator;
-
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.io.input.BOMInputStream;
-import org.apache.commons.text.StringEscapeUtils;
-import org.owasp.html.PolicyFactory;
-import org.owasp.html.Sanitizers;
-import system.proxies.FileDocument;
-
-public class StringUtils {
-
- private static final Random RANDOM = new SecureRandom();
-
- private static final String UPPERCASE_ALPHA = stringRange('A', 'Z');
- private static final String LOWERCASE_ALPHA = stringRange('a', 'z');
- private static final String DIGITS = stringRange('0', '9');
- // Used in tests as well
- static final String SPECIAL = stringRange('!', '/');
- private static final String ALPHANUMERIC = UPPERCASE_ALPHA + LOWERCASE_ALPHA + DIGITS;
-
- static final Map SANITIZER_POLICIES =
- Map.ofEntries(
- new SimpleEntry<>(BLOCKS.name(), Sanitizers.BLOCKS),
- new SimpleEntry<>(FORMATTING.name(), Sanitizers.FORMATTING),
- new SimpleEntry<>(IMAGES.name(), Sanitizers.IMAGES),
- new SimpleEntry<>(LINKS.name(), Sanitizers.LINKS),
- new SimpleEntry<>(STYLES.name(), Sanitizers.STYLES),
- new SimpleEntry<>(TABLES.name(), Sanitizers.TABLES)
- );
-
- public static final String HASH_ALGORITHM = "SHA-256";
-
- public static String hash(String value) throws NoSuchAlgorithmException, DigestException {
- int LENGTH = 32;
- return hash(value, LENGTH);
- }
-
- @Deprecated
- public static String hash(String value, int length) throws NoSuchAlgorithmException, DigestException {
- byte[] inBytes = value.getBytes(StandardCharsets.UTF_8);
- byte[] outBytes = new byte[length];
-
- MessageDigest alg = MessageDigest.getInstance(HASH_ALGORITHM);
- alg.update(inBytes);
-
- alg.digest(outBytes, 0, length);
-
- StringBuilder hexString = new StringBuilder();
- for (int i = 0; i < outBytes.length; i++) {
- String hex = Integer.toHexString(0xff & outBytes[i]);
- if (hex.length() == 1) {
- hexString.append('0');
- }
- hexString.append(hex);
- }
-
- return hexString.toString();
- }
-
- /**
- * The default replaceAll microflow function doesn't support capture variables such as $1, $2
- * etc. so for that reason we do not deprecate this method.
- *
- * @param haystack The string to replace patterns in
- * @param needleRegex The regular expression pattern
- * @param replacement The string that should come in place of the pattern matches.
- * @return The resulting string, where all matches have been replaced by the replacement.
- */
- public static String regexReplaceAll(String haystack, String needleRegex,
- String replacement) {
- Pattern pattern = Pattern.compile(needleRegex);
- Matcher matcher = pattern.matcher(haystack);
- return matcher.replaceAll(replacement);
- }
-
- public static String leftPad(String value, Long amount, String fillCharacter) {
- if (fillCharacter == null || fillCharacter.length() == 0) {
- return org.apache.commons.lang3.StringUtils.leftPad(value, amount.intValue(), " ");
- }
- return org.apache.commons.lang3.StringUtils.leftPad(value, amount.intValue(), fillCharacter);
- }
-
- public static String rightPad(String value, Long amount, String fillCharacter) {
- if (fillCharacter == null || fillCharacter.length() == 0) {
- return org.apache.commons.lang3.StringUtils.rightPad(value, amount.intValue(), " ");
- }
- return org.apache.commons.lang3.StringUtils.rightPad(value, amount.intValue(), fillCharacter);
- }
-
- public static String randomString(int length) {
- return randomStringFromCharArray(length, ALPHANUMERIC.toCharArray());
- }
-
- public static String substituteTemplate(final IContext context, String template,
- final IMendixObject substitute, final boolean HTMLEncode, final String datetimeformat) {
- return regexReplaceAll(template, "\\{(@)?([\\w./]+)\\}", (MatchResult match) -> {
- String value;
- String path = match.group(2);
- if (match.group(1) != null) {
- value = String.valueOf(Core.getConfiguration().getConstantValue(path));
- } else {
- try {
- value = ORM.getValueOfPath(context, substitute, path, datetimeformat);
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
- return HTMLEncode ? HTMLEncode(value) : value;
- });
- }
-
- public static String regexReplaceAll(String source, String regexString, Function replaceFunction) {
- if (source == null || source.trim().isEmpty()) // avoid NPE's, save CPU
- {
- return "";
- }
-
- StringBuffer resultString = new StringBuffer();
- Pattern regex = Pattern.compile(regexString);
- Matcher regexMatcher = regex.matcher(source);
-
- while (regexMatcher.find()) {
- MatchResult match = regexMatcher.toMatchResult();
- String value = replaceFunction.apply(match);
- regexMatcher.appendReplacement(resultString, Matcher.quoteReplacement(value));
- }
- regexMatcher.appendTail(resultString);
-
- return resultString.toString();
- }
-
- public static String HTMLEncode(String value) {
- return StringEscapeUtils.escapeHtml4(value);
- }
-
- public static String randomHash() {
- return UUID.randomUUID().toString();
- }
-
- public static String base64Decode(String encoded) {
- if (encoded == null) {
- return null;
- }
- return new String(Base64.getDecoder().decode(encoded.getBytes()));
- }
-
- public static void base64DecodeToFile(IContext context, String encoded, FileDocument targetFile) throws Exception {
- if (targetFile == null) {
- throw new IllegalArgumentException("Source file is null");
- }
- if (encoded == null) {
- throw new IllegalArgumentException("Source data is null");
- }
-
- byte[] decoded = Base64.getDecoder().decode(encoded.getBytes());
-
- try (ByteArrayInputStream bais = new ByteArrayInputStream(decoded)) {
- Core.storeFileDocumentContent(context, targetFile.getMendixObject(), bais);
- }
- }
-
- public static String base64Encode(String value) {
- if (value == null) {
- return null;
- }
- return Base64.getEncoder().encodeToString(value.getBytes());
- }
-
- public static String base64EncodeFile(IContext context, FileDocument file) throws IOException {
- if (file == null) {
- throw new IllegalArgumentException("Source file is null");
- }
- if (!file.getHasContents()) {
- throw new IllegalArgumentException("Source file has no contents!");
- }
-
- try (InputStream f = Core.getFileDocumentContent(context, file.getMendixObject())) {
- return Base64.getEncoder().encodeToString(IOUtils.toByteArray(f));
- }
- }
-
- public static String stringFromFile(IContext context, FileDocument source) throws IOException {
- return stringFromFile(context, source, StandardCharsets.UTF_8);
- }
-
- public static String stringFromFile(IContext context, FileDocument source, Charset charset) throws IOException {
- if (source == null) {
- return null;
- }
- try (InputStream f = Core.getFileDocumentContent(context, source.getMendixObject())) {
- return stringFromInputStream(f, charset);
- }
- }
-
- public static String stringFromInputStream(InputStream inputStream, Charset charset) throws IOException {
- return IOUtils.toString(BOMInputStream.builder().setInputStream(inputStream).get(), charset);
- }
-
- public static void stringToFile(IContext context, String value, FileDocument destination) throws IOException {
- stringToFile(context, value, destination, StandardCharsets.UTF_8);
- }
-
- public static void stringToFile(IContext context, String value, FileDocument destination, Charset charset) throws IOException {
- if (destination == null) {
- throw new IllegalArgumentException("Destination file is null");
- }
- if (value == null) {
- throw new IllegalArgumentException("Value to write is null");
- }
-
- try (InputStream is = IOUtils.toInputStream(value, charset)) {
- Core.storeFileDocumentContent(context, destination.getMendixObject(), is);
- }
- }
-
- public static String HTMLToPlainText(String html) throws IOException {
- if (html == null) {
- return "";
- }
- final StringBuilder result = new StringBuilder();
-
- HTMLEditorKit.ParserCallback callback = new HTMLEditorKit.ParserCallback() {
- @Override
- public void handleText(char[] data, int pos) {
- result.append(data); // TODO: needs to be html entity decode?
- }
-
- @Override
- public void handleSimpleTag(HTML.Tag tag, MutableAttributeSet a, int pos) {
- if (tag.breaksFlow()) {
- result.append("\r\n");
- }
- }
-
- @Override
- public void handleEndTag(HTML.Tag tag, int pos) {
- if (tag.breaksFlow() && tag != HTML.Tag.HTML && tag != HTML.Tag.HEAD && tag != HTML.Tag.BODY) {
- result.append("\r\n");
- }
- }
- };
-
- new ParserDelegator().parse(new StringReader(html), callback, true);
-
- return result.toString();
- }
-
- /**
- * Returns a random strong password containing a specified minimum number of uppercase, digits
- * and the exact number of special characters.
- *
- * @param minLen Minimum length
- * @param maxLen Maximum length
- * @param noOfCAPSAlpha Minimum number of capitals
- * @param noOfDigits Minimum number of digits
- * @param noOfSplChars Exact number of special characters
- * @deprecated Use the overload randomStrongPassword instead
- */
- @Deprecated
- public static String randomStrongPassword(int minLen, int maxLen, int noOfCAPSAlpha, int noOfDigits, int noOfSplChars) {
- if (minLen > maxLen) {
- throw new IllegalArgumentException("Min. Length > Max. Length!");
- }
- if ((noOfCAPSAlpha + noOfDigits + noOfSplChars) > minLen) {
- throw new IllegalArgumentException("Min. Length should be atleast sum of (CAPS, DIGITS, SPL CHARS) Length!");
- }
- return generateCommonLangPassword(minLen, maxLen, noOfCAPSAlpha, 0, noOfDigits, noOfSplChars);
- }
-
- /**
- * Returns a random strong password containing a specified minimum number of uppercase, lowercase, digits
- * and the exact number of special characters.
- *
- * @param minLen Minimum length
- * @param maxLen Maximum length
- * @param noOfCAPSAlpha Minimum number of capitals
- * @param noOfLowercaseAlpha Minimum number of lowercase letters
- * @param noOfDigits Minimum number of digits
- * @param noOfSplChars Exact number of special characters
- */
- public static String randomStrongPassword(int minLen, int maxLen, int noOfCAPSAlpha, int noOfLowercaseAlpha, int noOfDigits, int noOfSplChars) {
- if (minLen > maxLen) {
- throw new IllegalArgumentException("Min. Length > Max. Length!");
- }
- if ((noOfCAPSAlpha + noOfLowercaseAlpha + noOfDigits + noOfSplChars) > minLen) {
- throw new IllegalArgumentException("Min. Length should be atleast sum of (CAPS, LOWER, DIGITS, SPL CHARS) Length!");
- }
- return generateCommonLangPassword(minLen, maxLen, noOfCAPSAlpha, noOfLowercaseAlpha, noOfDigits, noOfSplChars);
- }
-
- // See https://www.baeldung.com/java-generate-secure-password
- // Implementation inspired by https://github.com/eugenp/tutorials/tree/master/core-java-modules/core-java-string-apis (under MIT license)
- private static String generateCommonLangPassword(int minLen, int maxLen, int noOfCapsAlpha, int noOfLowercaseAlpha, int noOfDigits, int noOfSplChars) {
- String upperCaseLetters = randomStringFromCharArray(noOfCapsAlpha, UPPERCASE_ALPHA.toCharArray());
- String lowerCaseLetters = randomStringFromCharArray(noOfLowercaseAlpha, LOWERCASE_ALPHA.toCharArray());
- String numbers = randomStringFromCharArray(noOfDigits, DIGITS.toCharArray());
- String specialChar = randomStringFromCharArray(noOfSplChars, SPECIAL.toCharArray());
-
- final int fixedNumber = noOfCapsAlpha + noOfLowercaseAlpha + noOfDigits + noOfSplChars;
- final int lowerBound = minLen - fixedNumber;
- final int upperBound = maxLen - fixedNumber;
- String totalChars = randomStringFromCharArray(lowerBound, upperBound, ALPHANUMERIC.toCharArray());
-
- String combinedChars = upperCaseLetters
- .concat(lowerCaseLetters)
- .concat(numbers)
- .concat(specialChar)
- .concat(totalChars);
- List pwdChars = combinedChars.chars()
- .mapToObj(c -> (char) c)
- .collect(Collectors.toList());
- Collections.shuffle(pwdChars);
- String password = pwdChars.stream()
- .collect(StringBuilder::new, StringBuilder::append, StringBuilder::append)
- .toString();
- return password;
- }
-
- /**
- * Generate a secure random string using the given array of characters, of which the resulting
- * string will be composed of.
- *
- * @param count The length of the random string.
- * @param allowedChars The characters used for constructing the random string.
- * @return A random string.
- * @throws IllegalArgumentException if count is negative or allowedChars is null or empty.
- */
- private static String randomStringFromCharArray(int count, final char[] allowedChars) {
- if (count == 0)
- return "";
- if (count < 0)
- throw new IllegalArgumentException("The requested length for the random string was negative: " + count);
- if (allowedChars == null)
- throw new IllegalArgumentException("The char array 'allowedChars' cannot be null.");
- if (allowedChars.length == 0)
- throw new IllegalArgumentException("The char array 'allowedChars' cannot be empty.");
-
- StringBuilder builder = new StringBuilder();
-
- while (count-- > 0) {
- int index = RANDOM.nextInt(allowedChars.length);
- builder.append(allowedChars[index]);
- }
-
- return builder.toString();
- }
-
- /**
- * Generate a random string with a random length between minLengthBound and maxLengthBound (inclusive),
- * using the given set of allowed characters.
- *
- * @param minLengthBound The lower bound for the random length of the string.
- * @param maxLengthBound The upper bound for the random length of the string.
- * @param allowedChars An array of characters of which the resulting string will be made up of.
- * @return A random string with a length between minLengthBound and maxLengthBound.
- * @throws IllegalArgumentException if minLengthBound is larger than maxLengthBound.
- */
- private static String randomStringFromCharArray(int minLengthBound, int maxLengthBound, final char[] allowedChars) {
- if (minLengthBound == maxLengthBound)
- return randomStringFromCharArray(minLengthBound, allowedChars);
- if (minLengthBound > maxLengthBound)
- throw new IllegalArgumentException("The minimum bound (" + minLengthBound + ") was larger than the maximum bound (" + maxLengthBound + ".");
- final int randomLength = minLengthBound + RANDOM.nextInt(maxLengthBound - minLengthBound + 1); // add one to make the range inclusive.
- return randomStringFromCharArray(randomLength, allowedChars);
- }
-
- /**
- * Produces a 'range' string starting from the begin character up to
- * the end character (inclusive range). For example, for the range (a-z),
- * this method will generate the lowercase alphabet.
- *
- * @param begin The starting point of the string.
- * @param end The ending point of the string.
- * @return A string from begin to end (inclusive range).
- * @throws IllegalArgumentException if the begin character has a higher code point than the end character.
- */
- private static String stringRange(char begin, char end) {
- if (begin > end) {
- throw new IllegalArgumentException("The 'begin' character cannot be larger than the 'end' character.");
- }
-
- StringBuilder builder = new StringBuilder();
- while (begin <= end)
- builder.append(begin++);
- return builder.toString();
- }
-
- private static byte[] generateHmacSha256Bytes(String key, String valueToEncrypt) throws UnsupportedEncodingException, IllegalStateException, InvalidKeyException, NoSuchAlgorithmException {
- SecretKeySpec secretKey = new SecretKeySpec(key.getBytes("UTF-8"), "HmacSHA256");
- Mac mac = Mac.getInstance("HmacSHA256");
- mac.init(secretKey);
- mac.update(valueToEncrypt.getBytes("UTF-8"));
- byte[] hmacData = mac.doFinal();
-
- return hmacData;
- }
-
- public static String generateHmacSha256(String key, String valueToEncrypt) {
- try {
- byte[] hash = generateHmacSha256Bytes(key, valueToEncrypt);
- StringBuilder result = new StringBuilder();
- for (byte b : hash) {
- result.append(String.format("%02x", b));
- }
- return result.toString();
- } catch (UnsupportedEncodingException | IllegalStateException | InvalidKeyException | NoSuchAlgorithmException e) {
- throw new RuntimeException("CommunityCommons::generateHmacSha256::Unable to encode: " + e.getMessage(), e);
- }
- }
-
- public static String generateHmacSha256Hash(String key, String valueToEncrypt) {
- try {
- return Base64.getEncoder().encodeToString(generateHmacSha256Bytes(key, valueToEncrypt));
- } catch (UnsupportedEncodingException | IllegalStateException | InvalidKeyException | NoSuchAlgorithmException e) {
- throw new RuntimeException("CommunityCommons::generateHmacSha256Hash::Unable to encode: " + e.getMessage(), e);
- }
- }
-
- public static String escapeHTML(String input) {
- return input.replace("&", "&")
- .replace("<", "<")
- .replace(">", ">")
- .replace("\"", """)
- .replace("'", "'");// notice this one: for xml "'" would be "'" (http://blogs.msdn.com/b/kirillosenkov/archive/2010/03/19/apos-is-in-xml-in-html-use-39.aspx)
- // OWASP also advises to escape "/" but give no convincing reason why: https://www.owasp.org/index.php/XSS_%28Cross_Site_Scripting%29_Prevention_Cheat_Sheet
- }
-
- public static String regexQuote(String unquotedLiteral) {
- return Pattern.quote(unquotedLiteral);
- }
-
- public static String substringBefore(String str, String separator) {
- return org.apache.commons.lang3.StringUtils.substringBefore(str, separator);
- }
-
- public static String substringBeforeLast(String str, String separator) {
- return org.apache.commons.lang3.StringUtils.substringBeforeLast(str, separator);
- }
-
- public static String substringAfter(String str, String separator) {
- return org.apache.commons.lang3.StringUtils.substringAfter(str, separator);
- }
-
- public static String substringAfterLast(String str, String separator) {
- return org.apache.commons.lang3.StringUtils.substringAfterLast(str, separator);
- }
-
- public static String removeEnd(String str, String toRemove) {
- return org.apache.commons.lang3.StringUtils.removeEnd(str, toRemove);
- }
-
- public static String sanitizeHTML(String html, List policyParams) {
- PolicyFactory policyFactory = null;
-
- for (SanitizerPolicy param : policyParams) {
- PolicyFactory policyFactoryForParam = SANITIZER_POLICIES.get(param.name());
- policyFactory = (policyFactory == null) ? policyFactoryForParam : policyFactory.and(policyFactoryForParam);
- }
-
- if (policyFactory == null) {
- throw new IllegalArgumentException("Sanitizer policy not found.");
- }
-
- return sanitizeHTML(html, policyFactory);
- }
-
- public static String sanitizeHTML(String html, PolicyFactory policyFactory) {
- return policyFactory.sanitize(html);
- }
-
- public static String stringSimplify(String value) {
- String normalized = Normalizer.normalize(value, Normalizer.Form.NFD);
- return normalized.replaceAll("\\p{M}", ""); // removes all characters in Unicode Mark category
- }
-
- public static Boolean isStringSimplified(String value) {
- return Normalizer.isNormalized(value, Normalizer.Form.NFD);
- }
-}
diff --git a/javasource/communitycommons/UserThrownException.java b/javasource/communitycommons/UserThrownException.java
deleted file mode 100644
index 5c67787..0000000
--- a/javasource/communitycommons/UserThrownException.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package communitycommons;
-
-public class UserThrownException extends Exception
-{
- /**
- *
- */
- private static final long serialVersionUID = -55911261625752858L;
-
- public UserThrownException(String arg0)
- {
- super(arg0);
- }
-
-}
diff --git a/javasource/communitycommons/XPath.java b/javasource/communitycommons/XPath.java
deleted file mode 100644
index a10fb83..0000000
--- a/javasource/communitycommons/XPath.java
+++ /dev/null
@@ -1,893 +0,0 @@
-package communitycommons;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.text.NumberFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.Callable;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.Future;
-
-import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.text.translate.AggregateTranslator;
-import org.apache.commons.text.translate.CharSequenceTranslator;
-import org.apache.commons.text.translate.EntityArrays;
-import org.apache.commons.text.translate.LookupTranslator;
-
-import com.mendix.core.Core;
-import com.mendix.core.CoreException;
-import com.mendix.datastorage.XPathQuery;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.IMendixIdentifier;
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-
-public class XPath {
- /**
- * Built-in tokens, see:
- * https://docs.mendix.com/refguide/xpath-keywords-and-system-variables/
- */
-
- /* Keywords */
- public static final String ID = "id";
- public static final String NULL = "NULL";
- public static final String Empty = "empty";
-
- /* Object related */
- public static final String CurrentUser = "[%CurrentUser%]";
- public static final String CurrentObject = "[%CurrentObject%]";
-
- /* Time related */
- public static final String CurrentDateTime = "[%CurrentDateTime%]";
- public static final String BeginOfCurrentMinute = "[%BeginOfCurrentMinute%]";
- public static final String BeginOfCurrentMinuteUTC = "[%BeginOfCurrentMinuteUTC%]";
- public static final String EndOfCurrentMinute = "[%EndOfCurrentMinute%]";
- public static final String EndOfCurrentMinuteUTC = "[%EndOfCurrentMinuteUTC%]";
- public static final String BeginOfCurrentHour = "[%BeginOfCurrentHour%]";
- public static final String BeginOfCurrentHourUTC = "[%BeginOfCurrentHourUTC%]";
- public static final String EndOfCurrentHour = "[%EndOfCurrentHour%]";
- public static final String EndOfCurrentHourUTC = "[%EndOfCurrentHourUTC%]";
- public static final String BeginOfCurrentDay = "[%BeginOfCurrentDay%]";
- public static final String BeginOfCurrentDayUTC = "[%BeginOfCurrentDayUTC%]";
- public static final String EndOfCurrentDay = "[%EndOfCurrentDay%]";
- public static final String EndOfCurrentDayUTC = "[%EndOfCurrentDayUTC%]";
- public static final String BeginOfYesterday = "[%BeginOfYesterday%]";
- public static final String BeginOfYesterdayUTC = "[%BeginOfYesterdayUTC%]";
- public static final String EndOfYesterday = "[%EndOfYesterday%]";
- public static final String EndOfYesterdayUTC = "[%EndOfYesterdayUTC%]";
- public static final String BeginOfTomorrow = "[%BeginOfTomorrow%]";
- public static final String BeginOfTomorrowUTC = "[%BeginOfTomorrowUTC%]";
- public static final String EndOfTomorrow = "[%EndOfTomorrow%]";
- public static final String EndOfTomorrowUTC = "[%EndOfTomorrowUTC%]";
- public static final String BeginOfCurrentWeek = "[%BeginOfCurrentWeek%]";
- public static final String BeginOfCurrentWeekUTC = "[%BeginOfCurrentWeekUTC%]";
- public static final String EndOfCurrentWeek = "[%EndOfCurrentWeek%]";
- public static final String EndOfCurrentWeekUTC = "[%EndOfCurrentWeekUTC%]";
- public static final String BeginOfCurrentMonth = "[%BeginOfCurrentMonth%]";
- public static final String BeginOfCurrentMonthUTC = "[%BeginOfCurrentMonthUTC%]";
- public static final String EndOfCurrentMonth = "[%EndOfCurrentMonth%]";
- public static final String EndOfCurrentMonthUTC = "[%EndOfCurrentMonthUTC%]";
- public static final String BeginOfCurrentYear = "[%BeginOfCurrentYear%]";
- public static final String BeginOfCurrentYearUTC = "[%BeginOfCurrentYearUTC%]";
- public static final String EndOfCurrentYear = "[%EndOfCurrentYear%]";
- public static final String EndOfCurrentYearUTC = "[%EndOfCurrentYearUTC%]";
-
- public static final String DayLength = "[%DayLength%]";
- public static final String HourLength = "[%HourLength%]";
- public static final String MinuteLength = "[%MinuteLength%]";
- public static final String SecondLength = "[%SecondLength%]";
- public static final String WeekLength = "[%WeekLength%]";
- public static final String MonthLength = "[%MonthLength%]";
- public static final String YearLength = "[%YearLength%]";
-
- private String entity;
- private int offset = 0;
- private int limit = -1;
- // important, linked map, insertion order is relevant!
- private LinkedHashMap sorting = new LinkedHashMap();
- private LinkedList closeStack = new LinkedList();
- private StringBuilder builder = new StringBuilder();
- private IContext context;
- private Class proxyClass;
- // state property, indicates whether 'and' needs to be inserted before the next
- // constraint
- private boolean requiresBinOp = false;
-
- public static XPath create(IContext c, String entityType) {
- XPath res = new XPath(c, IMendixObject.class);
- res.entity = entityType;
- return res;
- }
-
- public static XPath create(IContext c, Class proxyClass) {
- return new XPath(c, proxyClass);
- }
-
- private XPath(IContext c, Class proxyClass) {
- try {
- if (proxyClass != IMendixObject.class)
- entity = (String) proxyClass.getMethod("getType").invoke(null);
- } catch (Exception e) {
- throw new IllegalArgumentException(
- "Failed to determine entity type of proxy class. Did you provide a valid proxy class? '"
- + proxyClass.getName() + "'");
- }
-
- this.proxyClass = proxyClass;
- this.context = c;
- }
-
- private XPath autoInsertAnd() {
- if (requiresBinOp)
- and();
- return this;
- }
-
- private XPath requireBinOp(boolean requires) {
- requiresBinOp = requires;
- return this;
- }
-
- public XPath offset(int offset) {
- if (offset < 0)
- throw new IllegalArgumentException("Offset should not be negative");
-
- this.offset = offset;
- return this;
- }
-
- public XPath limit(int limit) {
- if (limit < -1 || limit == 0)
- throw new IllegalArgumentException("Limit should be larger than zero or -1. ");
-
- this.limit = limit;
- return this;
- }
-
- public XPath addSortingAsc(Object... sortparts) {
- assertOdd(sortparts);
- sorting.put(StringUtils.join(sortparts, '/'), "asc");
- return this;
- }
-
- public XPath addSortingDesc(Object... sortparts) {
- sorting.put(StringUtils.join(sortparts, "/"), "desc");
- return this;
- }
-
- public XPath eq(Object attr, Object valuecomparison) {
- return compare(attr, "=", valuecomparison);
- }
-
- public XPath eq(Object... pathAndValue) {
- return compare("=", pathAndValue);
- }
-
- public XPath equalsIgnoreCase(Object attr, String value) {
- // (contains(Name, $email) and length(Name) = length($email)
- return subconstraint()
- .contains(attr, value)
- .and()
- .append(" length(" + attr + ") = ").append(value == null ? "0" : valueToXPathValue(value.length()))
- .close();
- }
-
- public XPath notEq(Object attr, Object valuecomparison) {
- return compare(attr, "!=", valuecomparison);
- }
-
- public XPath notEq(Object... pathAndValue) {
- return compare("!=", pathAndValue);
- }
-
- public XPath gt(Object attr, Object valuecomparison) {
- return compare(attr, ">", valuecomparison);
- }
-
- public XPath gt(Object... pathAndValue) {
- return compare(">", pathAndValue);
- }
-
- public XPath gte(Object attr, Object valuecomparison) {
- return compare(attr, ">=", valuecomparison);
- }
-
- public XPath gte(Object... pathAndValue) {
- return compare(">=", pathAndValue);
- }
-
- public XPath lt(Object attr, Object valuecomparison) {
- return compare(attr, "<", valuecomparison);
- }
-
- public XPath lt(Object... pathAndValue) {
- return compare("<", pathAndValue);
- }
-
- public XPath lte(Object attr, Object valuecomparison) {
- return compare(attr, "<=", valuecomparison);
- }
-
- public XPath lte(Object... pathAndValue) {
- return compare("<=", pathAndValue);
- }
-
- public XPath contains(Object attr, String value) {
- return functionCall("contains", String.valueOf(attr), valueToXPathValue(value));
- }
-
- public XPath startsWith(Object attr, String value) {
- return functionCall("starts-with", String.valueOf(attr), valueToXPathValue(value));
- }
-
- public XPath endsWith(Object attr, String value) {
- return functionCall("ends-with", String.valueOf(attr), valueToXPathValue(value));
- }
-
- private XPath functionCall(String functionName, String... args) {
- autoInsertAnd();
- append(" " + functionName + "(");
-
- if (args.length > 0) {
- append(args[0]);
- for (int i = 1; i < args.length; i++) {
- append(",");
- append(args[i]);
- }
- }
- append(") ");
- return requireBinOp(true);
- }
-
- public XPath compare(Object attr, String operator, Object value) {
- return compare(new Object[] { attr }, operator, value);
- }
-
- private XPath compare(String operator, Object[] pathAndValue) {
- assertEven(pathAndValue);
- int lastIndex = pathAndValue.length - 1;
- return compare(Arrays.copyOf(pathAndValue, lastIndex), operator, pathAndValue[lastIndex]);
- }
-
- public XPath compare(Object[] path, String operator, Object value) {
- assertOdd(path);
- autoInsertAnd().append(StringUtils.join(path, '/')).append(" ").append(operator).append(" ")
- .append(valueToXPathValue(value));
- return requireBinOp(true);
- }
-
- public XPath hasReference(Object... path) {
- assertEven(path); // Reference + entity type
- autoInsertAnd().append(StringUtils.join(path, '/'));
- return requireBinOp(true);
- }
-
- public XPath subconstraint(Object... path) {
- assertEven(path);
- autoInsertAnd().append(StringUtils.join(path, '/')).append("[");
- closeStack.push("]");
- return requireBinOp(false);
- }
-
- public XPath subconstraint() {
- autoInsertAnd().append("(");
- closeStack.push(")");
- return requireBinOp(false);
- }
-
- public XPath addConstraint() {
- if (!closeStack.isEmpty() && !closeStack.peek().equals("]"))
- throw new IllegalStateException("Cannot add a constraint while in the middle of something else..");
-
- return append("][").requireBinOp(false);
- }
-
- public XPath close() {
- if (closeStack.isEmpty())
- throw new IllegalStateException("XPathbuilder close stack is empty!");
- append(closeStack.pop());
- return requireBinOp(true);
- // MWE: note that a close does not necessary require a binary operator, for
- // example with two subsequent block([bla][boe]) constraints,
- // but openening a binary constraint reset the flag, so that should be no issue
- }
-
- public XPath or() {
- if (!requiresBinOp)
- throw new IllegalStateException("Received 'or' but no binary operator was expected");
- return append(" or ").requireBinOp(false);
- }
-
- public XPath and() {
- if (!requiresBinOp)
- throw new IllegalStateException("Received 'and' but no binary operator was expected");
- return append(" and ").requireBinOp(false);
- }
-
- public XPath not() {
- autoInsertAnd();
- closeStack.push(")");
- return append(" not(").requireBinOp(false);
- }
-
- private void assertOdd(Object[] stuff) {
- if (stuff == null || stuff.length == 0 || stuff.length % 2 == 0)
- throw new IllegalArgumentException("Expected an odd number of xpath path parts");
- }
-
- private void assertEven(Object[] stuff) {
- if (stuff == null || stuff.length == 0 || stuff.length % 2 == 1)
- throw new IllegalArgumentException("Expected an even number of xpath path parts");
- }
-
- public XPath append(String s) {
- builder.append(s);
- return this;
- }
-
- public String getXPath() {
- if (builder.length() > 0)
- return "//" + entity + "[" + builder + "]";
- return "//" + entity;
- }
-
- private void assertEmptyStack() throws IllegalStateException {
- if (!closeStack.isEmpty())
- throw new IllegalStateException("Invalid xpath expression, not all items where closed");
- }
-
- public long count() throws CoreException {
- assertEmptyStack();
-
- return Core.createXPathQuery("count(" + getXPath() + ")").executeAggregateLong(context);
- }
-
- public IMendixObject firstMendixObject() throws CoreException {
- assertEmptyStack();
-
- XPathQuery query = (XPathQuery) Core.createXPathQuery(getXPath()).setAmount(1).setOffset(offset);
- for (Map.Entry sort : sorting.entrySet())
- query.addSort(sort.getKey(), sort.getValue() == "asc");
- List result = query.execute(context);
-
- if (result.isEmpty())
- return null;
- return result.get(0);
- }
-
- public T first() throws CoreException {
- return createProxy(context, proxyClass, firstMendixObject());
- }
-
- /**
- * Given a set of attribute names and values, tries to find the first object
- * that matches all conditions, or creates one
- *
- * @param keysAndValues
- * @return
- * @throws CoreException
- */
- public T findOrCreateNoCommit(Object... keysAndValues) throws CoreException {
- T res = findFirst(keysAndValues);
-
- return res != null ? res : constructInstance(false, keysAndValues);
- }
-
- public T findOrCreate(Object... keysAndValues) throws CoreException {
- T res = findFirst(keysAndValues);
-
- return res != null ? res : constructInstance(true, keysAndValues);
-
- }
-
- public T findOrCreateSynchronized(Object... keysAndValues) throws CoreException, InterruptedException {
- T res = findFirst(keysAndValues);
-
- if (res != null) {
- return res;
- } else {
- synchronized (Core.getMetaObject(entity)) {
- IContext synchronizedContext = context.getSession().createContext().createSudoClone();
- try {
- synchronizedContext.startTransaction();
- res = createProxy(synchronizedContext, proxyClass,
- XPath.create(synchronizedContext, entity).findOrCreate(keysAndValues));
- synchronizedContext.endTransaction();
- return res;
- } catch (CoreException e) {
- if (synchronizedContext.isInTransaction()) {
- synchronizedContext.rollbackTransaction();
- }
- throw e;
- }
- }
- }
- }
-
- public T findFirst(Object... keysAndValues)
- throws IllegalStateException, CoreException {
- if (builder.length() > 0)
- throw new IllegalStateException("FindFirst can only be used on XPath which do not have constraints already");
-
- assertEven(keysAndValues);
- for (int i = 0; i < keysAndValues.length; i += 2)
- eq(keysAndValues[i], keysAndValues[i + 1]);
-
- return first();
- }
-
- /**
- * Creates one instance of the type of this XPath query, and initializes the
- * provided attributes to the provided values.
- *
- * @param keysAndValues AttributeName, AttributeValue, AttributeName2,
- * AttributeValue2... list.
- * @return
- * @throws CoreException
- */
- public T constructInstance(boolean autoCommit, Object... keysAndValues) throws CoreException {
- assertEven(keysAndValues);
- IMendixObject newObj = Core.instantiate(context, entity);
-
- for (int i = 0; i < keysAndValues.length; i += 2)
- newObj.setValue(context, String.valueOf(keysAndValues[i]), toMemberValue(keysAndValues[i + 1]));
-
- if (autoCommit)
- Core.commit(context, newObj);
-
- return createProxy(context, proxyClass, newObj);
- }
-
- /**
- * Given a current collection of primitive values, checks if for each value in
- * the collection an object in the database exists.
- * It creates a new object if needed, and removes any superfluos objects in the
- * database that are no longer in the collection.
- *
- * @param currentCollection The collection that act as reference for the
- * objects that should be in this database in the
- * end.
- * @param comparisonAttribute The attribute that should store the value as
- * decribed in the collection
- * @param autoDelete Automatically remove any superfluous objects form
- * the database
- * @param keysAndValues Constraints that should hold for the set of
- * objects that are deleted or created. Objects
- * outside this constraint are not processed.
- *
- * @return A pair of lists. The first list contains the newly created objects,
- * the second list contains the objects that (should be or are) removed.
- * @throws CoreException
- */
- public ImmutablePair, List> syncDatabaseWithCollection(Collection currentCollection,
- Object comparisonAttribute, boolean autoDelete, Object... keysAndValues) throws CoreException {
- if (builder.length() > 0)
- throw new IllegalStateException(
- "syncDatabaseWithCollection can only be used on XPath which do not have constraints already");
-
- List added = new ArrayList();
- List removed = new ArrayList();
-
- Set col = new HashSet(currentCollection);
-
- for (int i = 0; i < keysAndValues.length; i += 2)
- eq(keysAndValues[i], keysAndValues[i + 1]);
-
- for (IMendixObject existingItem : allMendixObjects()) {
- // Item is still available
- if (col.remove(existingItem.getValue(context, String.valueOf(comparisonAttribute))))
- continue;
-
- // No longer available
- removed.add(createProxy(context, proxyClass, existingItem));
- if (autoDelete)
- Core.delete(context, existingItem);
- }
-
- // Some items where not found in the database
- for (U value : col) {
-
- // In apache lang3, this would just be: ArrayUtils.addAll(keysAndValues,
- // comparisonAttribute, value)
- Object[] args = new Object[keysAndValues.length + 2];
- for (int i = 0; i < keysAndValues.length; i++)
- args[i] = keysAndValues[i];
- args[keysAndValues.length] = comparisonAttribute;
- args[keysAndValues.length + 1] = value;
-
- T newItem = constructInstance(true, args);
- added.add(newItem);
- }
-
- // Oké, stupid, Pair is also only available in apache lang3, so lets use a
- // simple pair implementation for now
- return ImmutablePair.of(added, removed);
- }
-
- public T firstOrWait(long timeoutMSecs) throws CoreException, InterruptedException {
- IMendixObject result = null;
-
- long start = System.currentTimeMillis();
- int sleepamount = 200;
- int loopcount = 0;
-
- while (result == null) {
- loopcount += 1;
- result = firstMendixObject();
-
- long now = System.currentTimeMillis();
-
- if (start + timeoutMSecs < now) // Time expired
- break;
-
- if (loopcount % 5 == 0)
- sleepamount = (int)(sleepamount * 1.5);
-
- // not expired, wait a bit
- if (result == null)
- Thread.sleep(sleepamount);
- }
-
- return createProxy(context, proxyClass, result);
- }
-
- public List allMendixObjects() throws CoreException {
- assertEmptyStack();
-
- XPathQuery query = (XPathQuery) Core.createXPathQuery(getXPath()).setAmount(limit).setOffset(offset);
- for (Map.Entry sort : sorting.entrySet())
- query.addSort(sort.getKey(), sort.getValue() == "asc");
- return query.execute(context);
- }
-
- public List all() throws CoreException {
- List res = new ArrayList();
- for (IMendixObject o : allMendixObjects())
- res.add(createProxy(context, proxyClass, o));
-
- return res;
- }
-
- @Override
- public String toString() {
- return getXPath();
- }
-
- /* Static utility functions */
-
- // Cache for proxy constructors. Reflection is slow, so reuse as much as
- // possible
- private static Map initializers = new HashMap();
-
- public static List createProxyList(IContext c, Class proxieClass, List objects) {
- List res = new ArrayList();
- if (objects == null || objects.size() == 0)
- return res;
-
- for (IMendixObject o : objects)
- res.add(createProxy(c, proxieClass, o));
-
- return res;
- }
-
- public static T createProxy(IContext c, Class proxieClass, IMendixObject object) {
- // Borrowed from nl.mweststrate.pages.MxQ package
-
- if (object == null)
- return null;
-
- if (c == null || proxieClass == null)
- throw new IllegalArgumentException("[CreateProxy] No context or proxieClass provided. ");
-
- // jeuj, we expect IMendixObject's. Thats nice..
- if (proxieClass == IMendixObject.class)
- return proxieClass.cast(object); // .. since we can do a direct cast
-
- try {
- String entityType = object.getType();
-
- if (!initializers.containsKey(entityType)) {
-
- String[] entType = object.getType().split("\\.");
- Class> realClass = Class.forName(entType[0].toLowerCase() + ".proxies." + entType[1]);
-
- initializers.put(entityType, realClass.getMethod("initialize", IContext.class, IMendixObject.class));
- }
-
- // find constructor
- Method m = initializers.get(entityType);
-
- // create proxy object
- Object result = m.invoke(null, c, object);
-
- // cast, but check first is needed because the actual type might be a subclass
- // of the requested type
- if (!proxieClass.isAssignableFrom(result.getClass()))
- throw new IllegalArgumentException("The type of the object ('" + object.getType()
- + "') is not (a subclass) of '" + proxieClass.getName() + "'");
-
- T proxie = proxieClass.cast(result);
- return proxie;
- } catch (Exception e) {
- throw new RuntimeException("Unable to instantiate proxie: " + e.getMessage(), e);
- }
- }
-
- public static String valueToXPathValue(Object value) {
- if (value == null)
- return NULL;
-
- // Complex objects
- if (value instanceof IMendixIdentifier)
- return "'" + String.valueOf(((IMendixIdentifier) value).toLong()) + "'";
- if (value instanceof IMendixObject)
- return valueToXPathValue(((IMendixObject) value).getId());
- if (value instanceof List>)
- throw new IllegalArgumentException("List based values are not supported!");
-
- // Primitives
- if (value instanceof Date)
- return String.valueOf(((Date) value).getTime());
- if (value instanceof Long || value instanceof Integer)
- return String.valueOf(value);
- if (value instanceof Double || value instanceof Float) {
- // make sure xpath understands our number formatting
- NumberFormat format = NumberFormat.getNumberInstance(Locale.ENGLISH);
- format.setMaximumFractionDigits(10);
- format.setGroupingUsed(false);
- return format.format(value);
- }
- if (value instanceof Boolean) {
- return value.toString() + "()"; // xpath boolean, you know..
- }
- if (value instanceof String) {
- return "'" + ESCAPE_XML.translate(String.valueOf(value)) + "'";
- }
-
- // Object, assume its a proxy and deproxiefy
- try {
- IMendixObject mo = proxyToMendixObject(value);
- return valueToXPathValue(mo);
- } catch (NoSuchMethodException e) {
- // This is O.K. just not a proxy object...
- } catch (Exception e) {
- throw new RuntimeException("Failed to retrieve MendixObject from proxy: " + e.getMessage(), e);
- }
-
- // assume some string representation
- return "'" + ESCAPE_XML.translate(String.valueOf(value)) + "'";
- }
-
- public static IMendixObject proxyToMendixObject(Object value)
- throws NoSuchMethodException, SecurityException, IllegalAccessException,
- IllegalArgumentException, InvocationTargetException {
- Method m = value.getClass().getMethod("getMendixObject");
- IMendixObject mo = (IMendixObject) m.invoke(value);
- return mo;
- }
-
- public static List proxyListToMendixObjectList(
- List objects) throws SecurityException, IllegalArgumentException, NoSuchMethodException,
- IllegalAccessException, InvocationTargetException {
- ArrayList res = new ArrayList(objects.size());
- for (T i : objects)
- res.add(proxyToMendixObject(i));
- return res;
- }
-
- public static Object toMemberValue(Object value) {
- if (value == null)
- return null;
-
- // Complex objects
- if (value instanceof IMendixIdentifier)
- return value;
- if (value instanceof IMendixObject)
- return ((IMendixObject) value).getId();
-
- if (value instanceof List>)
- throw new IllegalArgumentException("List based values are not supported!");
-
- // Primitives
- if (value instanceof Date
- || value instanceof Long
- || value instanceof Integer
- || value instanceof Double
- || value instanceof Float
- || value instanceof Boolean
- || value instanceof String) {
- return value;
- }
-
- if (value.getClass().isEnum())
- return value.toString();
-
- // Object, assume its a proxy and deproxiefy
- try {
- Method m = value.getClass().getMethod("getMendixObject");
- IMendixObject mo = (IMendixObject) m.invoke(value);
- return toMemberValue(mo);
- } catch (NoSuchMethodException e) {
- // This is O.K. just not a proxy object...
- } catch (Exception e) {
- throw new RuntimeException(
- "Failed to convert object to IMendixMember compatible value '" + value + "': " + e.getMessage(), e);
- }
-
- throw new RuntimeException("Failed to convert object to IMendixMember compatible value: " + value);
- }
-
- public static interface IBatchProcessor {
- public void onItem(T item, long offset, long total) throws Exception;
- }
-
- private static final class ParallelJobRunner implements Callable {
- private final XPath self;
- private final IBatchProcessor batchProcessor;
- private final IMendixObject item;
- private long index;
- private long count;
-
- ParallelJobRunner(XPath self, IBatchProcessor batchProcessor, IMendixObject item, long index, long count) {
- this.self = self;
- this.batchProcessor = batchProcessor;
- this.item = item;
- this.index = index;
- this.count = count;
- }
-
- @Override
- public Boolean call() {
- try {
- batchProcessor.onItem(XPath.createProxy(Core.createSystemContext(), self.proxyClass, item), index, count);
- return true;
- } catch (Exception e) {
- throw new RuntimeException(String.format("Failed to execute batch on '%s' offset %d: %s", self.toString(),
- self.offset, e.getMessage()), e);
- }
- }
- }
-
- /**
- * Retreives all items in this xpath query in batches of a limited size.
- * Not that this function does not start a new transaction for all the batches,
- * rather, it just limits the number of objects being retrieved and kept in
- * memory at the same time.
- *
- * So it only batches the retrieve process, not the optional manipulations done
- * in the onItem method.
- *
- * @param batchsize
- * @param batchProcessor
- * @throws CoreException
- */
- public void batch(int batchsize, IBatchProcessor batchProcessor) throws CoreException {
- if (sorting.isEmpty())
- addSortingAsc(XPath.ID);
-
- final long itemcount = count();
-
- int baseoffset = offset;
- int baselimit = limit;
-
- boolean useBaseLimit = baselimit > -1;
-
- offset(baseoffset);
- List data;
-
- long i = 0;
-
- do {
- int newlimit = useBaseLimit ? Math.min(batchsize, baseoffset + baselimit - offset) : batchsize;
- if (newlimit == 0)
- break; // where done, no more data is needed
-
- limit(newlimit);
- data = all();
-
- for (T item : data) {
- i += 1;
- try {
- batchProcessor.onItem(item, i, Math.max(i, itemcount));
- } catch (Exception e) {
- throw new RuntimeException(String.format("Failed to execute batch on '%s' offset %d: %s", this,
- offset, e.getMessage()), e);
- }
- }
-
- offset(offset + data.size());
- } while (data.size() > 0);
- }
-
- /**
- * Batch with parallelization.
- *
- * IMPORTANT NOTE: DO NOT USE THE CONTEXT OF THE XPATH OBJECT ITSELF INSIDE THE
- * BATCH PROCESSOR!
- *
- * Instead, use: Item.getContext(); !!
- *
- *
- * @param batchsize
- * @param threads
- * @param batchProcessor
- * @throws CoreException
- * @throws InterruptedException
- * @throws ExecutionException
- */
- public void batch(int batchsize, int threads, final IBatchProcessor batchProcessor)
- throws CoreException, InterruptedException, ExecutionException {
- if (sorting.isEmpty())
- addSortingAsc(XPath.ID);
-
- ExecutorService pool = Executors.newFixedThreadPool(threads);
-
- final long itemcount = count();
-
- int progress = 0;
- List> futures = new ArrayList>(batchsize); // no need to synchronize
-
- offset(0);
- limit(batchsize);
-
- List data = allMendixObjects();
-
- while (data.size() > 0) {
- for (final IMendixObject item : data) {
- futures.add(pool.submit(new ParallelJobRunner(this, batchProcessor, item, progress, itemcount)));
- progress += 1;
- }
-
- while (!futures.isEmpty())
- futures.remove(0).get(); // wait for all futures before proceeding to next iteration
-
- offset(offset + data.size());
- data = allMendixObjects();
- }
-
- if (pool.shutdownNow().size() > 0)
- throw new IllegalStateException("Not all tasks where finished!");
- }
-
- public static Class> getProxyClassForEntityName(String entityname) {
- {
- String[] parts = entityname.split("\\.");
- try {
- return Class.forName(parts[0].toLowerCase() + ".proxies." + parts[1]);
- } catch (ClassNotFoundException e) {
- throw new RuntimeException("Cannot find class for entity: " + entityname + ": " + e.getMessage(), e);
- }
- }
- }
-
- public boolean deleteAll() throws CoreException {
- limit(1000);
- List objs = allMendixObjects();
- while (!objs.isEmpty()) {
- if (!Core.delete(context, objs.toArray(new IMendixObject[objs.size()])))
- return false; // TODO: throw?
-
- objs = allMendixObjects();
- }
- return true;
- }
-
- // Implement our own ESCAPE_XML because the original got deprecated and we
- // originally translated only a very small
- // subset of characters.
- private static final CharSequenceTranslator ESCAPE_XML = new AggregateTranslator(
- new LookupTranslator(EntityArrays.BASIC_ESCAPE),
- new LookupTranslator(EntityArrays.APOS_ESCAPE));
-}
diff --git a/javasource/communitycommons/actions/Base64Decode.java b/javasource/communitycommons/actions/Base64Decode.java
deleted file mode 100644
index e3e60ad..0000000
--- a/javasource/communitycommons/actions/Base64Decode.java
+++ /dev/null
@@ -1,52 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import communitycommons.StringUtils;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Converts a base64 encoded string to the plain, original string
- */
-public class Base64Decode extends UserAction
-{
- private final java.lang.String encoded;
-
- public Base64Decode(
- IContext context,
- java.lang.String _encoded
- )
- {
- super(context);
- this.encoded = _encoded;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- return StringUtils.base64Decode(encoded);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "Base64Decode";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/Base64DecodeToFile.java b/javasource/communitycommons/actions/Base64DecodeToFile.java
deleted file mode 100644
index 96e0c51..0000000
--- a/javasource/communitycommons/actions/Base64DecodeToFile.java
+++ /dev/null
@@ -1,63 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import communitycommons.StringUtils;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Stores an base 64 encoded string plain in the provided target file document
- *
- * Note that targetFile will be committed.
- */
-public class Base64DecodeToFile extends UserAction
-{
- private final java.lang.String encoded;
- /** @deprecated use targetFile.getMendixObject() instead. */
- @java.lang.Deprecated(forRemoval = true)
- private final IMendixObject __targetFile;
- private final system.proxies.FileDocument targetFile;
-
- public Base64DecodeToFile(
- IContext context,
- java.lang.String _encoded,
- IMendixObject _targetFile
- )
- {
- super(context);
- this.encoded = _encoded;
- this.__targetFile = _targetFile;
- this.targetFile = _targetFile == null ? null : system.proxies.FileDocument.initialize(getContext(), _targetFile);
- }
-
- @java.lang.Override
- public java.lang.Boolean executeAction() throws Exception
- {
- // BEGIN USER CODE
- StringUtils.base64DecodeToFile(getContext(), encoded, targetFile);
- return true;
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "Base64DecodeToFile";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/Base64Encode.java b/javasource/communitycommons/actions/Base64Encode.java
deleted file mode 100644
index e7f89b9..0000000
--- a/javasource/communitycommons/actions/Base64Encode.java
+++ /dev/null
@@ -1,52 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import communitycommons.StringUtils;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Converts a plain string to a base64 encoded string
- */
-public class Base64Encode extends UserAction
-{
- private final java.lang.String value;
-
- public Base64Encode(
- IContext context,
- java.lang.String _value
- )
- {
- super(context);
- this.value = _value;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- return StringUtils.base64Encode(value);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "Base64Encode";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/Base64EncodeFile.java b/javasource/communitycommons/actions/Base64EncodeFile.java
deleted file mode 100644
index 3fb6d3e..0000000
--- a/javasource/communitycommons/actions/Base64EncodeFile.java
+++ /dev/null
@@ -1,57 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import communitycommons.StringUtils;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Converts an unencoded file to a base 64 encoded string.
- */
-public class Base64EncodeFile extends UserAction
-{
- /** @deprecated use file.getMendixObject() instead. */
- @java.lang.Deprecated(forRemoval = true)
- private final IMendixObject __file;
- private final system.proxies.FileDocument file;
-
- public Base64EncodeFile(
- IContext context,
- IMendixObject _file
- )
- {
- super(context);
- this.__file = _file;
- this.file = _file == null ? null : system.proxies.FileDocument.initialize(getContext(), _file);
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- return StringUtils.base64EncodeFile(getContext(), file);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "Base64EncodeFile";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/Clone.java b/javasource/communitycommons/actions/Clone.java
deleted file mode 100644
index 9f3a919..0000000
--- a/javasource/communitycommons/actions/Clone.java
+++ /dev/null
@@ -1,65 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import communitycommons.ORM;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Clones objects
- *
- * - Source: the original object to copy
- * - Target: the object to copy it into (should be of the same type, or a specialization)
- * - includeAssociations: whether to clone associations.
- *
- * If associated objects need to be cloned as well, use deepClone, this function only copies the references, not the reffered objects. Target is not committed automatically.
- */
-public class Clone extends UserAction
-{
- private final IMendixObject source;
- private final IMendixObject target;
- private final java.lang.Boolean withAssociations;
-
- public Clone(
- IContext context,
- IMendixObject _source,
- IMendixObject _target,
- java.lang.Boolean _withAssociations
- )
- {
- super(context);
- this.source = _source;
- this.target = _target;
- this.withAssociations = _withAssociations;
- }
-
- @java.lang.Override
- public java.lang.Boolean executeAction() throws Exception
- {
- // BEGIN USER CODE
- return ORM.cloneObject(this.getContext(), source, target, withAssociations);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "Clone";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/CreateLogNode.java b/javasource/communitycommons/actions/CreateLogNode.java
deleted file mode 100644
index 2506ceb..0000000
--- a/javasource/communitycommons/actions/CreateLogNode.java
+++ /dev/null
@@ -1,53 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import communitycommons.Logging;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Initializes a log node for later use. Useful to set logging to a more detailed log level before the first time a certain log action is executed.
- */
-public class CreateLogNode extends UserAction
-{
- private final java.lang.String logNodeParameter;
-
- public CreateLogNode(
- IContext context,
- java.lang.String _logNodeParameter
- )
- {
- super(context);
- this.logNodeParameter = _logNodeParameter;
- }
-
- @java.lang.Override
- public java.lang.Boolean executeAction() throws Exception
- {
- // BEGIN USER CODE
- Logging.createLogNode(logNodeParameter);
- return true;
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "CreateLogNode";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/DateTimeToLong.java b/javasource/communitycommons/actions/DateTimeToLong.java
deleted file mode 100644
index a44fc75..0000000
--- a/javasource/communitycommons/actions/DateTimeToLong.java
+++ /dev/null
@@ -1,52 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import communitycommons.DateTime;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Converts a DateTime to a Unix timestamps. (Milliseconds since 1-1-1970)
- */
-public class DateTimeToLong extends UserAction
-{
- private final java.util.Date dateObject;
-
- public DateTimeToLong(
- IContext context,
- java.util.Date _dateObject
- )
- {
- super(context);
- this.dateObject = _dateObject;
- }
-
- @java.lang.Override
- public java.lang.Long executeAction() throws Exception
- {
- // BEGIN USER CODE
- return DateTime.dateTimeToLong(dateObject);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "DateTimeToLong";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/DeepClone.java b/javasource/communitycommons/actions/DeepClone.java
deleted file mode 100644
index 0c47ddb..0000000
--- a/javasource/communitycommons/actions/DeepClone.java
+++ /dev/null
@@ -1,96 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import communitycommons.ORM;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Clones objects, their associations and even referred objects.
- *
- * - Source: the original object to copy
- * - Target: the object to copy it into (should be of the same type, or a specialization)
- * - MembersToSkip: members which should not be set at all
- * - MembersToKeep: references which should be set, but not cloned. (so source and target will refer to exactly the same object). If an association is not part of this property, it will be cloned.
- * - ReverseAssociations: 1 - 0 assications which refer to target, which will be cloned as well. Only the reference name itself needs to be mentioned.
- * - excludeEntities: entities that will not be cloned. references to these entities will refer to the same object as the source did.
- * - excludeModules: modules that will have none of their enities cloned. Behaves similar to excludeEntities.
- *
- * members format: or or , where objecttype is the concrete type of the object being cloned.
- *
- * reverseAssociation:
- *
- *
- * membersToSkip by automatically contains createdDate and changedDate.
- * membersToKeep by automatically contains System.owner and System.changedBy
- *
- * Note that DeepClone does commit all objects, where Clone does not.
- */
-public class DeepClone extends UserAction
-{
- private final IMendixObject source;
- private final IMendixObject target;
- private final java.lang.String membersToSkip;
- private final java.lang.String membersToKeep;
- private final java.lang.String reverseAssociations;
- private final java.lang.String excludeEntities;
- private final java.lang.String excludeModules;
-
- public DeepClone(
- IContext context,
- IMendixObject _source,
- IMendixObject _target,
- java.lang.String _membersToSkip,
- java.lang.String _membersToKeep,
- java.lang.String _reverseAssociations,
- java.lang.String _excludeEntities,
- java.lang.String _excludeModules
- )
- {
- super(context);
- this.source = _source;
- this.target = _target;
- this.membersToSkip = _membersToSkip;
- this.membersToKeep = _membersToKeep;
- this.reverseAssociations = _reverseAssociations;
- this.excludeEntities = _excludeEntities;
- this.excludeModules = _excludeModules;
- }
-
- @java.lang.Override
- public java.lang.Boolean executeAction() throws Exception
- {
- // BEGIN USER CODE
- java.lang.String membersToSkip = this.membersToSkip == null ? "" : this.membersToSkip;
- java.lang.String membersToKeep = this.membersToKeep == null ? "" : this.membersToKeep;
- java.lang.String reverseAssociations = this.reverseAssociations == null ? "" : this.reverseAssociations;
- java.lang.String excludeEntities = this.excludeEntities == null ? "" : this.excludeEntities;
- java.lang.String excludeModules = this.excludeModules == null ? "" : this.excludeModules;
-
- ORM.deepClone(getContext(), source, target, membersToSkip, membersToKeep, reverseAssociations, excludeEntities, excludeModules);
- return true;
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "DeepClone";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/Delay.java b/javasource/communitycommons/actions/Delay.java
deleted file mode 100644
index e23adf4..0000000
--- a/javasource/communitycommons/actions/Delay.java
+++ /dev/null
@@ -1,55 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import communitycommons.Misc;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Causes this request to sleep for a while. Useful to prevent brute force attacks or to simulate latency delays.
- *
- * Delaytime : time in ms
- */
-public class Delay extends UserAction
-{
- private final java.lang.Long delaytime;
-
- public Delay(
- IContext context,
- java.lang.Long _delaytime
- )
- {
- super(context);
- this.delaytime = _delaytime;
- }
-
- @java.lang.Override
- public java.lang.Boolean executeAction() throws Exception
- {
- // BEGIN USER CODE
- Misc.delay(delaytime);
- return true;
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "Delay";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/DuplicateFileDocument.java b/javasource/communitycommons/actions/DuplicateFileDocument.java
deleted file mode 100644
index 7a9beb5..0000000
--- a/javasource/communitycommons/actions/DuplicateFileDocument.java
+++ /dev/null
@@ -1,69 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import communitycommons.Misc;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Clones the contents of one file document into another.
- * - fileToClone : the source file
- * - cloneTarget : an initialized file document, in which the file will be stored.
- *
- * Returns true if copied, returns file if the source had no contents, throws exception in any other case.
- * Pre condition: HasContents of the 'fileToClone' need to be set to true, otherwise the action will not copy anything.
- */
-public class DuplicateFileDocument extends UserAction
-{
- /** @deprecated use fileToClone.getMendixObject() instead. */
- @java.lang.Deprecated(forRemoval = true)
- private final IMendixObject __fileToClone;
- private final system.proxies.FileDocument fileToClone;
- /** @deprecated use cloneTarget.getMendixObject() instead. */
- @java.lang.Deprecated(forRemoval = true)
- private final IMendixObject __cloneTarget;
- private final system.proxies.FileDocument cloneTarget;
-
- public DuplicateFileDocument(
- IContext context,
- IMendixObject _fileToClone,
- IMendixObject _cloneTarget
- )
- {
- super(context);
- this.__fileToClone = _fileToClone;
- this.fileToClone = _fileToClone == null ? null : system.proxies.FileDocument.initialize(getContext(), _fileToClone);
- this.__cloneTarget = _cloneTarget;
- this.cloneTarget = _cloneTarget == null ? null : system.proxies.FileDocument.initialize(getContext(), _cloneTarget);
- }
-
- @java.lang.Override
- public java.lang.Boolean executeAction() throws Exception
- {
- // BEGIN USER CODE
- return Misc.duplicateFileDocument(this.getContext(), fileToClone.getMendixObject(), cloneTarget.getMendixObject());
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "DuplicateFileDocument";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/DuplicateImageDocument.java b/javasource/communitycommons/actions/DuplicateImageDocument.java
deleted file mode 100644
index f62c156..0000000
--- a/javasource/communitycommons/actions/DuplicateImageDocument.java
+++ /dev/null
@@ -1,75 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import communitycommons.Misc;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Clones the contents of one image document into another, and generates a thumbnail as well.
- * - fileToClone : the source file
- * - cloneTarget : an initialized file document, in which the file will be stored.
- *
- * Returns true if copied, returns file if the source had no contents, throws exception in any other case.
- * Pre condition: HasContents of the 'fileToClone' need to be set to true, otherwise the action will not copy anything.
- */
-public class DuplicateImageDocument extends UserAction
-{
- /** @deprecated use fileToClone.getMendixObject() instead. */
- @java.lang.Deprecated(forRemoval = true)
- private final IMendixObject __fileToClone;
- private final system.proxies.Image fileToClone;
- /** @deprecated use cloneTarget.getMendixObject() instead. */
- @java.lang.Deprecated(forRemoval = true)
- private final IMendixObject __cloneTarget;
- private final system.proxies.Image cloneTarget;
- private final java.lang.Long thumbWidth;
- private final java.lang.Long thumbHeight;
-
- public DuplicateImageDocument(
- IContext context,
- IMendixObject _fileToClone,
- IMendixObject _cloneTarget,
- java.lang.Long _thumbWidth,
- java.lang.Long _thumbHeight
- )
- {
- super(context);
- this.__fileToClone = _fileToClone;
- this.fileToClone = _fileToClone == null ? null : system.proxies.Image.initialize(getContext(), _fileToClone);
- this.__cloneTarget = _cloneTarget;
- this.cloneTarget = _cloneTarget == null ? null : system.proxies.Image.initialize(getContext(), _cloneTarget);
- this.thumbWidth = _thumbWidth;
- this.thumbHeight = _thumbHeight;
- }
-
- @java.lang.Override
- public java.lang.Boolean executeAction() throws Exception
- {
- // BEGIN USER CODE
- return Misc.duplicateImage(this.getContext(), fileToClone.getMendixObject(), cloneTarget.getMendixObject(), thumbWidth.intValue(), thumbHeight.intValue());
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "DuplicateImageDocument";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/EndTransaction.java b/javasource/communitycommons/actions/EndTransaction.java
deleted file mode 100644
index 5b2d0f7..0000000
--- a/javasource/communitycommons/actions/EndTransaction.java
+++ /dev/null
@@ -1,46 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Commit the transaction, this will end this transaction or remove a save point from the queue if the transaction is nested
- */
-public class EndTransaction extends UserAction
-{
- public EndTransaction(IContext context)
- {
- super(context);
- }
-
- @java.lang.Override
- public java.lang.Boolean executeAction() throws Exception
- {
- // BEGIN USER CODE
- getContext().endTransaction();
- return true;
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "EndTransaction";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/EnumerationFromString.java b/javasource/communitycommons/actions/EnumerationFromString.java
deleted file mode 100644
index 9a9aacd..0000000
--- a/javasource/communitycommons/actions/EnumerationFromString.java
+++ /dev/null
@@ -1,59 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import communitycommons.Misc;
-import communitycommons.proxies.LogLevel;
-import java.util.Optional;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Use this Java action as a template for your own String-to-Enumeration conversions.
- * Studio Pro requires specifying the exact Enumeration to return in the definition of a Java action so we cannot provide a generic implementation.
- * This implementation will throw a NoSuchElementException if an invalid toConvert parameter is given, so remember to handle this error gracefully.
- */
-public class EnumerationFromString extends UserAction
-{
- private final java.lang.String toConvert;
-
- public EnumerationFromString(
- IContext context,
- java.lang.String _toConvert
- )
- {
- super(context);
- this.toConvert = _toConvert;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
-
- // Replace LogLevel.class by the proxy class for your Enumeration
- Optional result = Misc.enumFromString(LogLevel.class, toConvert);
- return result.orElseThrow().name();
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "EnumerationFromString";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/EscapeHTML.java b/javasource/communitycommons/actions/EscapeHTML.java
deleted file mode 100644
index 6c3ecbe..0000000
--- a/javasource/communitycommons/actions/EscapeHTML.java
+++ /dev/null
@@ -1,55 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import communitycommons.StringUtils;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Given a, escapes it to html codes, for example
- *
- * "< Joe & John >" will be converted to
- * "< Joe & John >"
- */
-public class EscapeHTML extends UserAction
-{
- private final java.lang.String rawString;
-
- public EscapeHTML(
- IContext context,
- java.lang.String _rawString
- )
- {
- super(context);
- this.rawString = _rawString;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- return StringUtils.escapeHTML(rawString);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "EscapeHTML";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/FileDocumentFromFile.java b/javasource/communitycommons/actions/FileDocumentFromFile.java
deleted file mode 100644
index 337eed0..0000000
--- a/javasource/communitycommons/actions/FileDocumentFromFile.java
+++ /dev/null
@@ -1,69 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import java.io.File;
-import java.io.FileInputStream;
-import com.mendix.core.Core;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Loads a file from the local (server) storage and stores it inside a FileDocument.
- */
-public class FileDocumentFromFile extends UserAction
-{
- private final java.lang.String file;
- /** @deprecated use fileDocument.getMendixObject() instead. */
- @java.lang.Deprecated(forRemoval = true)
- private final IMendixObject __fileDocument;
- private final system.proxies.FileDocument fileDocument;
-
- public FileDocumentFromFile(
- IContext context,
- java.lang.String _file,
- IMendixObject _fileDocument
- )
- {
- super(context);
- this.file = _file;
- this.__fileDocument = _fileDocument;
- this.fileDocument = _fileDocument == null ? null : system.proxies.FileDocument.initialize(getContext(), _fileDocument);
- }
-
- @java.lang.Override
- public java.lang.Boolean executeAction() throws Exception
- {
- // BEGIN USER CODE
- try (
- FileInputStream fis = new FileInputStream(new File(this.file))
- ) {
- Core.storeFileDocumentContent(getContext(), fileDocument.getMendixObject(),
- this.file, fis);
- }
-
- return true;
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "FileDocumentFromFile";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/FileFromFileDocument.java b/javasource/communitycommons/actions/FileFromFileDocument.java
deleted file mode 100644
index 59b2263..0000000
--- a/javasource/communitycommons/actions/FileFromFileDocument.java
+++ /dev/null
@@ -1,73 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import org.apache.commons.io.IOUtils;
-import com.mendix.core.Core;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Reads contents from a FileDocument and stores it in a file on the local (server) storage.
- */
-public class FileFromFileDocument extends UserAction
-{
- private final java.lang.String targetFile;
- /** @deprecated use fileDocument.getMendixObject() instead. */
- @java.lang.Deprecated(forRemoval = true)
- private final IMendixObject __fileDocument;
- private final system.proxies.FileDocument fileDocument;
-
- public FileFromFileDocument(
- IContext context,
- java.lang.String _targetFile,
- IMendixObject _fileDocument
- )
- {
- super(context);
- this.targetFile = _targetFile;
- this.__fileDocument = _fileDocument;
- this.fileDocument = _fileDocument == null ? null : system.proxies.FileDocument.initialize(getContext(), _fileDocument);
- }
-
- @java.lang.Override
- public java.lang.Boolean executeAction() throws Exception
- {
- // BEGIN USER CODE
- File output = new File(targetFile);
-
- try (
- FileOutputStream fos = new FileOutputStream(output);
- InputStream is = Core.getFileDocumentContent(getContext(), fileDocument.getMendixObject());
- ) {
- IOUtils.copy(is, fos);
- }
-
- return true;
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "FileFromFileDocument";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/GenerateHMAC_SHA256.java b/javasource/communitycommons/actions/GenerateHMAC_SHA256.java
deleted file mode 100644
index 75b7e3e..0000000
--- a/javasource/communitycommons/actions/GenerateHMAC_SHA256.java
+++ /dev/null
@@ -1,55 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import communitycommons.StringUtils;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Generates and asymmetric hexadecimal hash using the HMAC_SHA256 hash algorithm
- */
-public class GenerateHMAC_SHA256 extends UserAction
-{
- private final java.lang.String key;
- private final java.lang.String valueToEncrypt;
-
- public GenerateHMAC_SHA256(
- IContext context,
- java.lang.String _key,
- java.lang.String _valueToEncrypt
- )
- {
- super(context);
- this.key = _key;
- this.valueToEncrypt = _valueToEncrypt;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- return StringUtils.generateHmacSha256(key, valueToEncrypt);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "GenerateHMAC_SHA256";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/GenerateHMAC_SHA256_hash.java b/javasource/communitycommons/actions/GenerateHMAC_SHA256_hash.java
deleted file mode 100644
index b889a7d..0000000
--- a/javasource/communitycommons/actions/GenerateHMAC_SHA256_hash.java
+++ /dev/null
@@ -1,55 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import communitycommons.StringUtils;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Generates an asymmetric hash using the HMAC_SHA256 hash algorithm
- */
-public class GenerateHMAC_SHA256_hash extends UserAction
-{
- private final java.lang.String key;
- private final java.lang.String valueToEncrypt;
-
- public GenerateHMAC_SHA256_hash(
- IContext context,
- java.lang.String _key,
- java.lang.String _valueToEncrypt
- )
- {
- super(context);
- this.key = _key;
- this.valueToEncrypt = _valueToEncrypt;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- return StringUtils.generateHmacSha256Hash(key, valueToEncrypt);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "GenerateHMAC_SHA256_hash";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/GetApplicationUrl.java b/javasource/communitycommons/actions/GetApplicationUrl.java
deleted file mode 100644
index 8f9c68e..0000000
--- a/javasource/communitycommons/actions/GetApplicationUrl.java
+++ /dev/null
@@ -1,46 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import communitycommons.Misc;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Returns the runtime URL of this application.
- */
-public class GetApplicationUrl extends UserAction
-{
- public GetApplicationUrl(IContext context)
- {
- super(context);
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- return Misc.getApplicationURL();
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "GetApplicationUrl";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/GetCFInstanceIndex.java b/javasource/communitycommons/actions/GetCFInstanceIndex.java
deleted file mode 100644
index fd5b3ff..0000000
--- a/javasource/communitycommons/actions/GetCFInstanceIndex.java
+++ /dev/null
@@ -1,50 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import communitycommons.Misc;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Returns the Cloud Foundry Instance Index that is set during deployment of the application in a Cloud native environment. Based on the Cloud Foundry Instance Index, Mendix determines what is the leader instance (index 0 executes scheduled events, db sync, session management etc.) or slave instance.
- *
- * Returns 0 for the leader instance, 1 or higher for slave instances or -1 when the environment variable could not be read (when running locally or on premise). When -1 is returned, it will probably be the leader in the cluster.
- *
- * Make sure emulate cloud security is disabled. Otherwise, the policy restrictions will prevent the method to be executed. Action is tested in Mendix Cloud on 19-12-2018.
- */
-public class GetCFInstanceIndex extends UserAction
-{
- public GetCFInstanceIndex(IContext context)
- {
- super(context);
- }
-
- @java.lang.Override
- public java.lang.Long executeAction() throws Exception
- {
- // BEGIN USER CODE
- return Misc.getCFInstanceIndex();
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "GetCFInstanceIndex";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/GetDefaultLanguage.java b/javasource/communitycommons/actions/GetDefaultLanguage.java
deleted file mode 100644
index 4dbca97..0000000
--- a/javasource/communitycommons/actions/GetDefaultLanguage.java
+++ /dev/null
@@ -1,49 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import system.proxies.Language;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import communitycommons.Misc;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Get default language
- */
-public class GetDefaultLanguage extends UserAction
-{
- public GetDefaultLanguage(IContext context)
- {
- super(context);
- }
-
- @java.lang.Override
- public IMendixObject executeAction() throws Exception
- {
- // BEGIN USER CODE
- Language defaultLanguage = Misc.getDefaultLanguage(getContext());
- return defaultLanguage.getMendixObject();
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "GetDefaultLanguage";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/GetFileContentsFromResource.java b/javasource/communitycommons/actions/GetFileContentsFromResource.java
deleted file mode 100644
index d05566a..0000000
--- a/javasource/communitycommons/actions/GetFileContentsFromResource.java
+++ /dev/null
@@ -1,71 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import java.io.File;
-import java.io.FileInputStream;
-import com.mendix.core.Core;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Set the contents of a FileDocument with the contents of a file which is a resource.
- */
-public class GetFileContentsFromResource extends UserAction
-{
- private final java.lang.String filename;
- /** @deprecated use fileDocument.getMendixObject() instead. */
- @java.lang.Deprecated(forRemoval = true)
- private final IMendixObject __fileDocument;
- private final system.proxies.FileDocument fileDocument;
-
- public GetFileContentsFromResource(
- IContext context,
- java.lang.String _filename,
- IMendixObject _fileDocument
- )
- {
- super(context);
- this.filename = _filename;
- this.__fileDocument = _fileDocument;
- this.fileDocument = _fileDocument == null ? null : system.proxies.FileDocument.initialize(getContext(), _fileDocument);
- }
-
- @java.lang.Override
- public java.lang.Boolean executeAction() throws Exception
- {
- // BEGIN USER CODE
- File myFile = new File(Core.getConfiguration().getResourcesPath() +
- File.separator + filename);
-
- try (
- FileInputStream fis = new FileInputStream(myFile)
- ) {
- Core.storeFileDocumentContent(getContext(), fileDocument.getMendixObject(), filename, fis);
- }
-
- return true;
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "GetFileContentsFromResource";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/GetImageDimensions.java b/javasource/communitycommons/actions/GetImageDimensions.java
deleted file mode 100644
index ee173f1..0000000
--- a/javasource/communitycommons/actions/GetImageDimensions.java
+++ /dev/null
@@ -1,67 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import java.awt.image.BufferedImage;
-import javax.imageio.ImageIO;
-import com.mendix.core.Core;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import communitycommons.proxies.ImageDimensions;
-import java.io.InputStream;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-public class GetImageDimensions extends UserAction
-{
- /** @deprecated use ImageParameter.getMendixObject() instead. */
- @java.lang.Deprecated(forRemoval = true)
- private final IMendixObject __ImageParameter;
- private final system.proxies.Image ImageParameter;
-
- public GetImageDimensions(
- IContext context,
- IMendixObject _imageParameter
- )
- {
- super(context);
- this.__ImageParameter = _imageParameter;
- this.ImageParameter = _imageParameter == null ? null : system.proxies.Image.initialize(getContext(), _imageParameter);
- }
-
- @java.lang.Override
- public IMendixObject executeAction() throws Exception
- {
- // BEGIN USER CODE
- ImageDimensions imageDimensions = new ImageDimensions(getContext());
- try (InputStream inputStream = Core.getImage(getContext(), this.ImageParameter.getMendixObject(), false)) {
- BufferedImage bimg = ImageIO.read(inputStream);
- if (bimg != null) {
- imageDimensions.setHeight(bimg.getHeight());
- imageDimensions.setWidth(bimg.getWidth());
- }
- }
-
- return imageDimensions.getMendixObject();
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "GetImageDimensions";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/GetIntFromDateTime.java b/javasource/communitycommons/actions/GetIntFromDateTime.java
deleted file mode 100644
index c03b41f..0000000
--- a/javasource/communitycommons/actions/GetIntFromDateTime.java
+++ /dev/null
@@ -1,60 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import communitycommons.DateTime;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Converts a datetime to an integer based on the selector used.
- *
- * Selectors available are:
- * - year (returns f. ex. 1980)
- * - month (returns 1-12)
- * - day (returns 1-31)
- */
-public class GetIntFromDateTime extends UserAction
-{
- private final java.util.Date dateObj;
- private final communitycommons.proxies.DatePartSelector selectorObj;
-
- public GetIntFromDateTime(
- IContext context,
- java.util.Date _dateObj,
- java.lang.String _selectorObj
- )
- {
- super(context);
- this.dateObj = _dateObj;
- this.selectorObj = _selectorObj == null ? null : communitycommons.proxies.DatePartSelector.valueOf(_selectorObj);
- }
-
- @java.lang.Override
- public java.lang.Long executeAction() throws Exception
- {
- // BEGIN USER CODE
- return DateTime.dateTimeToInteger(dateObj, selectorObj);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "GetIntFromDateTime";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/GetModelVersion.java b/javasource/communitycommons/actions/GetModelVersion.java
deleted file mode 100644
index abf7637..0000000
--- a/javasource/communitycommons/actions/GetModelVersion.java
+++ /dev/null
@@ -1,46 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.core.Core;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Returns the model version of the deployed application.
- */
-public class GetModelVersion extends UserAction
-{
- public GetModelVersion(IContext context)
- {
- super(context);
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- return Core.getModelVersion();
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "GetModelVersion";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/GetRuntimeVersion.java b/javasource/communitycommons/actions/GetRuntimeVersion.java
deleted file mode 100644
index 51d7b9b..0000000
--- a/javasource/communitycommons/actions/GetRuntimeVersion.java
+++ /dev/null
@@ -1,46 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.core.Core;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Returns the runtime version of this application.
- */
-public class GetRuntimeVersion extends UserAction
-{
- public GetRuntimeVersion(IContext context)
- {
- super(context);
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- return Core.getRuntimeVersion();
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "GetRuntimeVersion";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/HTMLEncode.java b/javasource/communitycommons/actions/HTMLEncode.java
deleted file mode 100644
index d41d0ce..0000000
--- a/javasource/communitycommons/actions/HTMLEncode.java
+++ /dev/null
@@ -1,57 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import communitycommons.StringUtils;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Encodes a string to HTML Entities, so that they can be displayed in the browser without breaking any layout.
- *
- * This is useful for special widgets which allow HTML to be rendered properly, including special characters as '<' and '&'.
- * For example '<' will be encoded as '<' and '&' will be encoded as '&'
- *
- * Returns the encoded string.
- */
-public class HTMLEncode extends UserAction
-{
- private final java.lang.String value;
-
- public HTMLEncode(
- IContext context,
- java.lang.String _value
- )
- {
- super(context);
- this.value = _value;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- return StringUtils.HTMLEncode(value);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "HTMLEncode";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/HTMLToPlainText.java b/javasource/communitycommons/actions/HTMLToPlainText.java
deleted file mode 100644
index 17927e8..0000000
--- a/javasource/communitycommons/actions/HTMLToPlainText.java
+++ /dev/null
@@ -1,53 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import communitycommons.StringUtils;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Use this function to convert HTML text to plain text.
- * It will preserve linebreaks but strip all other markup. including html entity decoding.
- */
-public class HTMLToPlainText extends UserAction
-{
- private final java.lang.String html;
-
- public HTMLToPlainText(
- IContext context,
- java.lang.String _html
- )
- {
- super(context);
- this.html = _html;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- return StringUtils.HTMLToPlainText(html);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "HTMLToPlainText";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/Hash.java b/javasource/communitycommons/actions/Hash.java
deleted file mode 100644
index 140cee3..0000000
--- a/javasource/communitycommons/actions/Hash.java
+++ /dev/null
@@ -1,59 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import communitycommons.StringUtils;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Hashes a value using the SHA-256 hash algorithm.
- *
- * - value : the value to hash
- *
- * Returns a SHA-256 hash of 'value'
- */
-public class Hash extends UserAction
-{
- private final java.lang.String value;
- private final java.lang.Long length;
-
- public Hash(
- IContext context,
- java.lang.String _value,
- java.lang.Long _length
- )
- {
- super(context);
- this.value = _value;
- this.length = _length;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- return StringUtils.hash(value);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "Hash";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/IsInDevelopment.java b/javasource/communitycommons/actions/IsInDevelopment.java
deleted file mode 100644
index 33002ec..0000000
--- a/javasource/communitycommons/actions/IsInDevelopment.java
+++ /dev/null
@@ -1,46 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.core.Core;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Returns true if the environment is a development environment. Calls Core.getConfiguration().isInDevelopment().
- */
-public class IsInDevelopment extends UserAction
-{
- public IsInDevelopment(IContext context)
- {
- super(context);
- }
-
- @java.lang.Override
- public java.lang.Boolean executeAction() throws Exception
- {
- // BEGIN USER CODE
- return Core.getConfiguration().isInDevelopment();
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "IsInDevelopment";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/IsStringSimplified.java b/javasource/communitycommons/actions/IsStringSimplified.java
deleted file mode 100644
index 7fd9102..0000000
--- a/javasource/communitycommons/actions/IsStringSimplified.java
+++ /dev/null
@@ -1,52 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import communitycommons.StringUtils;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * True if a string can be simplified by the removal of diacritics.
- */
-public class IsStringSimplified extends UserAction
-{
- private final java.lang.String value;
-
- public IsStringSimplified(
- IContext context,
- java.lang.String _value
- )
- {
- super(context);
- this.value = _value;
- }
-
- @java.lang.Override
- public java.lang.Boolean executeAction() throws Exception
- {
- // BEGIN USER CODE
- return StringUtils.isStringSimplified(this.value);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "IsStringSimplified";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/ListTop.java b/javasource/communitycommons/actions/ListTop.java
deleted file mode 100644
index b0725c8..0000000
--- a/javasource/communitycommons/actions/ListTop.java
+++ /dev/null
@@ -1,56 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import communitycommons.Misc;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Takes the top n items of a given list and returns the resulting list.
- */
-public class ListTop extends UserAction>
-{
- private final java.util.List ObjectList;
- private final java.lang.Long Top;
-
- public ListTop(
- IContext context,
- java.util.List _objectList,
- java.lang.Long _top
- )
- {
- super(context);
- this.ObjectList = _objectList;
- this.Top = _top;
- }
-
- @java.lang.Override
- public java.util.List executeAction() throws Exception
- {
- // BEGIN USER CODE
- return Misc.listTop(ObjectList, Top.intValue());
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "ListTop";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/LongToDateTime.java b/javasource/communitycommons/actions/LongToDateTime.java
deleted file mode 100644
index 3f1e103..0000000
--- a/javasource/communitycommons/actions/LongToDateTime.java
+++ /dev/null
@@ -1,52 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import communitycommons.DateTime;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Converts a Unix timestamp to a dateTime object
- */
-public class LongToDateTime extends UserAction
-{
- private final java.lang.Long value;
-
- public LongToDateTime(
- IContext context,
- java.lang.Long _value
- )
- {
- super(context);
- this.value = _value;
- }
-
- @java.lang.Override
- public java.util.Date executeAction() throws Exception
- {
- // BEGIN USER CODE
- return DateTime.longToDateTime(value);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "LongToDateTime";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/MergeMultiplePdfs.java b/javasource/communitycommons/actions/MergeMultiplePdfs.java
deleted file mode 100644
index bd3757f..0000000
--- a/javasource/communitycommons/actions/MergeMultiplePdfs.java
+++ /dev/null
@@ -1,68 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import communitycommons.Misc;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Restricted to 10 files at once for Mendix Cloud v4 compatibility. If you need to merge more than 10 files at once merge recursively instead or change the MergeMultiplePdfs_MaxAtOnce constant.
- */
-public class MergeMultiplePdfs extends UserAction
-{
- /** @deprecated use com.mendix.utils.ListUtils.map(FilesToMerge, com.mendix.systemwideinterfaces.core.IEntityProxy::getMendixObject) instead. */
- @java.lang.Deprecated(forRemoval = true)
- private final java.util.List __FilesToMerge;
- private final java.util.List FilesToMerge;
- /** @deprecated use MergedDocument.getMendixObject() instead. */
- @java.lang.Deprecated(forRemoval = true)
- private final IMendixObject __MergedDocument;
- private final system.proxies.FileDocument MergedDocument;
-
- public MergeMultiplePdfs(
- IContext context,
- java.util.List _filesToMerge,
- IMendixObject _mergedDocument
- )
- {
- super(context);
- this.__FilesToMerge = _filesToMerge;
- this.FilesToMerge = java.util.Optional.ofNullable(_filesToMerge)
- .orElse(java.util.Collections.emptyList())
- .stream()
- .map(filesToMergeElement -> system.proxies.FileDocument.initialize(getContext(), filesToMergeElement))
- .collect(java.util.stream.Collectors.toList());
- this.__MergedDocument = _mergedDocument;
- this.MergedDocument = _mergedDocument == null ? null : system.proxies.FileDocument.initialize(getContext(), _mergedDocument);
- }
-
- @java.lang.Override
- public java.lang.Boolean executeAction() throws Exception
- {
- // BEGIN USER CODE
- return Misc.mergePDF(this.getContext(), this.FilesToMerge, this.MergedDocument.getMendixObject());
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "MergeMultiplePdfs";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/MonthsBetween.java b/javasource/communitycommons/actions/MonthsBetween.java
deleted file mode 100644
index cba194e..0000000
--- a/javasource/communitycommons/actions/MonthsBetween.java
+++ /dev/null
@@ -1,67 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import communitycommons.DateTime;
-import communitycommons.Logging;
-import communitycommons.proxies.LogLevel;
-import communitycommons.proxies.LogNodes;
-import java.util.Date;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Calculates the number of months between two dates.
- * - dateTime : the original (oldest) dateTime
- * - compareDate: the second date. If EMPTY, the current datetime will be used. Effectively this means that the age of the dateTime is calculated.
- */
-public class MonthsBetween extends UserAction
-{
- private final java.util.Date date1;
- private final java.util.Date date2;
-
- public MonthsBetween(
- IContext context,
- java.util.Date _date1,
- java.util.Date _date2
- )
- {
- super(context);
- this.date1 = _date1;
- this.date2 = _date2;
- }
-
- @java.lang.Override
- public java.lang.Long executeAction() throws Exception
- {
- // BEGIN USER CODE
- try {
- return DateTime.periodBetween(date1, date2 == null ? new Date() : date2).toTotalMonths();
- } catch (Exception e) {
-
- Logging.log(LogNodes.CommunityCommons.name(), LogLevel.Warning, "DateTime calculation error, returning -1", e);
- return -1L;
- }
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "MonthsBetween";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/OverlayPdfDocument.java b/javasource/communitycommons/actions/OverlayPdfDocument.java
deleted file mode 100644
index d2cc4ef..0000000
--- a/javasource/communitycommons/actions/OverlayPdfDocument.java
+++ /dev/null
@@ -1,67 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import communitycommons.Misc;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Overlay a generated PDF document with another PDF (containing the company stationary for example)
- */
-public class OverlayPdfDocument extends UserAction
-{
- /** @deprecated use generatedDocument.getMendixObject() instead. */
- @java.lang.Deprecated(forRemoval = true)
- private final IMendixObject __generatedDocument;
- private final system.proxies.FileDocument generatedDocument;
- /** @deprecated use overlay.getMendixObject() instead. */
- @java.lang.Deprecated(forRemoval = true)
- private final IMendixObject __overlay;
- private final system.proxies.FileDocument overlay;
- private final java.lang.Boolean onTopOfContent;
-
- public OverlayPdfDocument(
- IContext context,
- IMendixObject _generatedDocument,
- IMendixObject _overlay,
- java.lang.Boolean _onTopOfContent
- )
- {
- super(context);
- this.__generatedDocument = _generatedDocument;
- this.generatedDocument = _generatedDocument == null ? null : system.proxies.FileDocument.initialize(getContext(), _generatedDocument);
- this.__overlay = _overlay;
- this.overlay = _overlay == null ? null : system.proxies.FileDocument.initialize(getContext(), _overlay);
- this.onTopOfContent = _onTopOfContent;
- }
-
- @java.lang.Override
- public java.lang.Boolean executeAction() throws Exception
- {
- // BEGIN USER CODE
- return Misc.overlayPdf(getContext(), __generatedDocument, __overlay, onTopOfContent);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "OverlayPdfDocument";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/ParseDateTimeWithTimezone.java b/javasource/communitycommons/actions/ParseDateTimeWithTimezone.java
deleted file mode 100644
index 3383db5..0000000
--- a/javasource/communitycommons/actions/ParseDateTimeWithTimezone.java
+++ /dev/null
@@ -1,78 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import java.text.SimpleDateFormat;
-import java.util.TimeZone;
-import com.mendix.systemwideinterfaces.core.IContext;
-import communitycommons.Logging;
-import communitycommons.proxies.LogLevel;
-import communitycommons.proxies.LogNodes;
-import java.text.ParseException;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * This method parses a date from a string with a given pattern according to a specific timezone.
- * The timezone has to be a valid timezone id http://docs.oracle.com/javase/7/docs/api/java/util/TimeZone.html (e.g. one of https://garygregory.wordpress.com/2013/06/18/what-are-the-java-timezone-ids/)
- */
-public class ParseDateTimeWithTimezone extends UserAction
-{
- private final java.lang.String date;
- private final java.lang.String pattern;
- private final java.lang.String timeZone;
- private final java.util.Date defaultValue;
-
- public ParseDateTimeWithTimezone(
- IContext context,
- java.lang.String _date,
- java.lang.String _pattern,
- java.lang.String _timeZone,
- java.util.Date _defaultValue
- )
- {
- super(context);
- this.date = _date;
- this.pattern = _pattern;
- this.timeZone = _timeZone;
- this.defaultValue = _defaultValue;
- }
-
- @java.lang.Override
- public java.util.Date executeAction() throws Exception
- {
- // BEGIN USER CODE
- if (date == null || date.trim().equals("")) {
- return defaultValue;
- }
-
- try {
- SimpleDateFormat sdf = new SimpleDateFormat(pattern);
- sdf.setTimeZone(TimeZone.getTimeZone(timeZone));
- return sdf.parse(date);
- } catch (ParseException e) {
- Logging.log(LogNodes.CommunityCommons.name(), LogLevel.Warning, "Unable to parse date " + date, e);
- return defaultValue;
- }
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "ParseDateTimeWithTimezone";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/RandomHash.java b/javasource/communitycommons/actions/RandomHash.java
deleted file mode 100644
index 788844f..0000000
--- a/javasource/communitycommons/actions/RandomHash.java
+++ /dev/null
@@ -1,46 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import communitycommons.StringUtils;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Generates a random hash, perfectly to use as random but unique identifier
- */
-public class RandomHash extends UserAction
-{
- public RandomHash(IContext context)
- {
- super(context);
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- return StringUtils.randomHash();
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "RandomHash";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/RandomString.java b/javasource/communitycommons/actions/RandomString.java
deleted file mode 100644
index 06e7644..0000000
--- a/javasource/communitycommons/actions/RandomString.java
+++ /dev/null
@@ -1,52 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import communitycommons.StringUtils;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Generates a random alphanumeric string of the desired length.
- */
-public class RandomString extends UserAction
-{
- private final java.lang.Long length;
-
- public RandomString(
- IContext context,
- java.lang.Long _length
- )
- {
- super(context);
- this.length = _length;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- return StringUtils.randomString(length.intValue());
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "RandomString";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/RandomStrongPassword.java b/javasource/communitycommons/actions/RandomStrongPassword.java
deleted file mode 100644
index 8c8ef81..0000000
--- a/javasource/communitycommons/actions/RandomStrongPassword.java
+++ /dev/null
@@ -1,80 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import communitycommons.StringUtils;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Returns a random strong password containing a specified minimum number of digits, uppercase and special characters.
- *
- * Note:Minimumlength should be equal or larger than NrOfCapitalizedCharacters, NrOfDigits and NrOfSpecialCharacters
- */
-public class RandomStrongPassword extends UserAction
-{
- private final java.lang.Long MinLength;
- private final java.lang.Long MaxLength;
- private final java.lang.Long NrOfCapitalizedCharacters;
- private final java.lang.Long NrOfDigits;
- private final java.lang.Long NrOfSpecialCharacters;
-
- public RandomStrongPassword(
- IContext context,
- java.lang.Long _minLength,
- java.lang.Long _maxLength,
- java.lang.Long _nrOfCapitalizedCharacters,
- java.lang.Long _nrOfDigits,
- java.lang.Long _nrOfSpecialCharacters
- )
- {
- super(context);
- this.MinLength = _minLength;
- this.MaxLength = _maxLength;
- this.NrOfCapitalizedCharacters = _nrOfCapitalizedCharacters;
- this.NrOfDigits = _nrOfDigits;
- this.NrOfSpecialCharacters = _nrOfSpecialCharacters;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- return StringUtils.randomStrongPassword(
- safeLongToInt(MinLength),
- safeLongToInt(MaxLength),
- safeLongToInt(NrOfCapitalizedCharacters),
- 0,
- safeLongToInt(NrOfDigits),
- safeLongToInt(NrOfSpecialCharacters)
- );
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "RandomStrongPassword";
- }
-
- // BEGIN EXTRA CODE
- public static int safeLongToInt(Long l) {
- if (l == null) return 0;
- if (l < Integer.MIN_VALUE || l > Integer.MAX_VALUE) {
- throw new IllegalArgumentException(l + " cannot be cast to int without changing its value.");
- }
- return l.intValue();
- }
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/RandomStrongPasswordWithLowercase.java b/javasource/communitycommons/actions/RandomStrongPasswordWithLowercase.java
deleted file mode 100644
index 9ddec88..0000000
--- a/javasource/communitycommons/actions/RandomStrongPasswordWithLowercase.java
+++ /dev/null
@@ -1,83 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import communitycommons.StringUtils;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Returns a random strong password containing a specified minimum number of digits, uppercase, lowercase and special characters.
- *
- * Note:Minimumlength should be equal or larger than NrOfCapitalizedCharacters, NrOfLowercaseCharacters, NrOfDigits and NrOfSpecialCharacters
- */
-public class RandomStrongPasswordWithLowercase extends UserAction
-{
- private final java.lang.Long MinLength;
- private final java.lang.Long MaxLength;
- private final java.lang.Long NrOfCapitalizedCharacters;
- private final java.lang.Long NrOfLowercaseCharacters;
- private final java.lang.Long NrOfDigits;
- private final java.lang.Long NrOfSpecialCharacters;
-
- public RandomStrongPasswordWithLowercase(
- IContext context,
- java.lang.Long _minLength,
- java.lang.Long _maxLength,
- java.lang.Long _nrOfCapitalizedCharacters,
- java.lang.Long _nrOfLowercaseCharacters,
- java.lang.Long _nrOfDigits,
- java.lang.Long _nrOfSpecialCharacters
- )
- {
- super(context);
- this.MinLength = _minLength;
- this.MaxLength = _maxLength;
- this.NrOfCapitalizedCharacters = _nrOfCapitalizedCharacters;
- this.NrOfLowercaseCharacters = _nrOfLowercaseCharacters;
- this.NrOfDigits = _nrOfDigits;
- this.NrOfSpecialCharacters = _nrOfSpecialCharacters;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- return StringUtils.randomStrongPassword(
- safeLongToInt(MinLength),
- safeLongToInt(MaxLength),
- safeLongToInt(NrOfCapitalizedCharacters),
- safeLongToInt(NrOfLowercaseCharacters),
- safeLongToInt(NrOfDigits),
- safeLongToInt(NrOfSpecialCharacters)
- );
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "RandomStrongPasswordWithLowercase";
- }
-
- // BEGIN EXTRA CODE
- public static int safeLongToInt(Long l) {
- if (l == null) return 0;
- if (l < Integer.MIN_VALUE || l > Integer.MAX_VALUE) {
- throw new IllegalArgumentException(l + " cannot be cast to int without changing its value.");
- }
- return l.intValue();
- }
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/RegexQuote.java b/javasource/communitycommons/actions/RegexQuote.java
deleted file mode 100644
index 8ad891a..0000000
--- a/javasource/communitycommons/actions/RegexQuote.java
+++ /dev/null
@@ -1,52 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import communitycommons.StringUtils;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Escapes a string value so that it can be used literally with Mendix build-in regex replacement functions. (Otherwise the dollar sign would be interpreted as back reference to a match for example).
- */
-public class RegexQuote extends UserAction
-{
- private final java.lang.String unquotedLiteral;
-
- public RegexQuote(
- IContext context,
- java.lang.String _unquotedLiteral
- )
- {
- super(context);
- this.unquotedLiteral = _unquotedLiteral;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- return StringUtils.regexQuote(unquotedLiteral);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "RegexQuote";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/RegexReplaceAll.java b/javasource/communitycommons/actions/RegexReplaceAll.java
deleted file mode 100644
index b1bc81a..0000000
--- a/javasource/communitycommons/actions/RegexReplaceAll.java
+++ /dev/null
@@ -1,64 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import communitycommons.StringUtils;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Performs a regular expression. Similar to the replaceAll microflow function, but supports more advanced usages such as capture variables.
- *
- * For the regexp specification see:
- * https://docs.oracle.com/javase/8/docs/api/java/util/regex/Pattern.html
- *
- * A decent regexp tester can be found at:
- * http://www.fileformat.info/tool/regex.htm
- */
-public class RegexReplaceAll extends UserAction
-{
- private final java.lang.String haystack;
- private final java.lang.String needleRegex;
- private final java.lang.String replacement;
-
- public RegexReplaceAll(
- IContext context,
- java.lang.String _haystack,
- java.lang.String _needleRegex,
- java.lang.String _replacement
- )
- {
- super(context);
- this.haystack = _haystack;
- this.needleRegex = _needleRegex;
- this.replacement = _replacement;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- return StringUtils.regexReplaceAll(haystack, needleRegex, replacement);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "RegexReplaceAll";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/RemoveEnd.java b/javasource/communitycommons/actions/RemoveEnd.java
deleted file mode 100644
index 64405ed..0000000
--- a/javasource/communitycommons/actions/RemoveEnd.java
+++ /dev/null
@@ -1,55 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import communitycommons.StringUtils;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Removes a string (if present) from the end of an input string,
- */
-public class RemoveEnd extends UserAction
-{
- private final java.lang.String input;
- private final java.lang.String toRemove;
-
- public RemoveEnd(
- IContext context,
- java.lang.String _input,
- java.lang.String _toRemove
- )
- {
- super(context);
- this.input = _input;
- this.toRemove = _toRemove;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- return StringUtils.removeEnd(input, toRemove);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "RemoveEnd";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/RunMicroflowAsyncInQueue.java b/javasource/communitycommons/actions/RunMicroflowAsyncInQueue.java
deleted file mode 100644
index b644a4e..0000000
--- a/javasource/communitycommons/actions/RunMicroflowAsyncInQueue.java
+++ /dev/null
@@ -1,54 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import communitycommons.Misc;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Runs a microflow asynchronous, that is, this action immediately returns but schedules the microflow to be run in the near future. The queue guarantees a first come first serve order of the microflows, and only one action is served at a time.
- *
- * The microflow is run with system rights in its own transaction, and is very useful to run heavy microflows on the background.
- */
-public class RunMicroflowAsyncInQueue extends UserAction
-{
- private final java.lang.String microflow;
-
- public RunMicroflowAsyncInQueue(
- IContext context,
- java.lang.String _microflow
- )
- {
- super(context);
- this.microflow = _microflow;
- }
-
- @java.lang.Override
- public java.lang.Boolean executeAction() throws Exception
- {
- // BEGIN USER CODE
- return Misc.runMicroflowAsyncInQueue(microflow);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "RunMicroflowAsyncInQueue";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/StartTransaction.java b/javasource/communitycommons/actions/StartTransaction.java
deleted file mode 100644
index 7ed5304..0000000
--- a/javasource/communitycommons/actions/StartTransaction.java
+++ /dev/null
@@ -1,46 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Start a transaction, if a transaction is already started for this context, a savepoint will be added
- */
-public class StartTransaction extends UserAction
-{
- public StartTransaction(IContext context)
- {
- super(context);
- }
-
- @java.lang.Override
- public java.lang.Boolean executeAction() throws Exception
- {
- // BEGIN USER CODE
- getContext().startTransaction();
- return true;
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "StartTransaction";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/StringFromFile.java b/javasource/communitycommons/actions/StringFromFile.java
deleted file mode 100644
index 6ead981..0000000
--- a/javasource/communitycommons/actions/StringFromFile.java
+++ /dev/null
@@ -1,65 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import communitycommons.StringUtils;
-import java.nio.charset.Charset;
-import java.nio.charset.StandardCharsets;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Reads the contents form the provided file document, using the specified encoding, and returns it as string.
- */
-public class StringFromFile extends UserAction
-{
- /** @deprecated use source.getMendixObject() instead. */
- @java.lang.Deprecated(forRemoval = true)
- private final IMendixObject __source;
- private final system.proxies.FileDocument source;
- private final communitycommons.proxies.StandardEncodings encoding;
-
- public StringFromFile(
- IContext context,
- IMendixObject _source,
- java.lang.String _encoding
- )
- {
- super(context);
- this.__source = _source;
- this.source = _source == null ? null : system.proxies.FileDocument.initialize(getContext(), _source);
- this.encoding = _encoding == null ? null : communitycommons.proxies.StandardEncodings.valueOf(_encoding);
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- Charset charset = StandardCharsets.UTF_8;
- if (this.encoding != null)
- charset = Charset.forName(this.encoding.name().replace('_', '-'));
- return StringUtils.stringFromFile(getContext(), source, charset);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "StringFromFile";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/StringLeftPad.java b/javasource/communitycommons/actions/StringLeftPad.java
deleted file mode 100644
index e3cbb91..0000000
--- a/javasource/communitycommons/actions/StringLeftPad.java
+++ /dev/null
@@ -1,64 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Pads a string on the left to a certain length.
- * value : the original value
- * amount: the desired length of the resulting string.
- * fillCharacter: the character to pad with. (or space if empty)
- *
- * For example
- * StringLeftPad("hello", 8, "-") returns "---hello"
- * StringLeftPad("hello", 2, "-") returns "hello"
- */
-public class StringLeftPad extends UserAction
-{
- private final java.lang.String value;
- private final java.lang.Long amount;
- private final java.lang.String fillCharacter;
-
- public StringLeftPad(
- IContext context,
- java.lang.String _value,
- java.lang.Long _amount,
- java.lang.String _fillCharacter
- )
- {
- super(context);
- this.value = _value;
- this.amount = _amount;
- this.fillCharacter = _fillCharacter;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- return communitycommons.StringUtils.leftPad(value, amount, fillCharacter);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "StringLeftPad";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/StringRightPad.java b/javasource/communitycommons/actions/StringRightPad.java
deleted file mode 100644
index eeb00fb..0000000
--- a/javasource/communitycommons/actions/StringRightPad.java
+++ /dev/null
@@ -1,64 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Pads a string on the right to a certain length.
- * value : the original value
- * amount: the desired length of the resulting string.
- * fillCharacter: the character to pad with. (or space if empty)
- *
- * For example
- * StringRightPad("hello", 8, "-") returns "hello---"
- * StringLeftpad("hello", 2, "-") returns "hello"
- */
-public class StringRightPad extends UserAction
-{
- private final java.lang.String value;
- private final java.lang.Long amount;
- private final java.lang.String fillCharacter;
-
- public StringRightPad(
- IContext context,
- java.lang.String _value,
- java.lang.Long _amount,
- java.lang.String _fillCharacter
- )
- {
- super(context);
- this.value = _value;
- this.amount = _amount;
- this.fillCharacter = _fillCharacter;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- return communitycommons.StringUtils.rightPad(value, amount, fillCharacter);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "StringRightPad";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/StringSimplify.java b/javasource/communitycommons/actions/StringSimplify.java
deleted file mode 100644
index 1889ed8..0000000
--- a/javasource/communitycommons/actions/StringSimplify.java
+++ /dev/null
@@ -1,52 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import communitycommons.StringUtils;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Remove diacritics from a string.
- */
-public class StringSimplify extends UserAction
-{
- private final java.lang.String value;
-
- public StringSimplify(
- IContext context,
- java.lang.String _value
- )
- {
- super(context);
- this.value = _value;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- return StringUtils.stringSimplify(this.value);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "StringSimplify";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/StringSplit.java b/javasource/communitycommons/actions/StringSplit.java
deleted file mode 100644
index ac8604a..0000000
--- a/javasource/communitycommons/actions/StringSplit.java
+++ /dev/null
@@ -1,66 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import java.util.ArrayList;
-import java.util.List;
-import com.mendix.core.Core;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import communitycommons.proxies.SplitItem;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-public class StringSplit extends UserAction>
-{
- private final java.lang.String inputString;
- private final java.lang.String splitParameter;
-
- public StringSplit(
- IContext context,
- java.lang.String _inputString,
- java.lang.String _splitParameter
- )
- {
- super(context);
- this.inputString = _inputString;
- this.splitParameter = _splitParameter;
- }
-
- @java.lang.Override
- public java.util.List executeAction() throws Exception
- {
- // BEGIN USER CODE
- List returnList = new ArrayList();
- String[] parts = this.inputString.split(this.splitParameter);
- Integer index = 0;
- for (String part : parts) {
- IMendixObject splitPart = Core.instantiate(getContext(), SplitItem.getType());
- splitPart.setValue(getContext(), SplitItem.MemberNames.Value.toString(), part);
- splitPart.setValue(getContext(), SplitItem.MemberNames.Index.toString(), index);
- returnList.add(splitPart);
- index = index + 1;
- }
- return returnList;
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "StringSplit";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/StringToFile.java b/javasource/communitycommons/actions/StringToFile.java
deleted file mode 100644
index ec76e71..0000000
--- a/javasource/communitycommons/actions/StringToFile.java
+++ /dev/null
@@ -1,70 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import communitycommons.StringUtils;
-import java.nio.charset.Charset;
-import java.nio.charset.StandardCharsets;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Stores a string into the provided FileDocument, using the specified encoding.
- * Note that destination will be committed.
- */
-public class StringToFile extends UserAction
-{
- private final java.lang.String value;
- /** @deprecated use destination.getMendixObject() instead. */
- @java.lang.Deprecated(forRemoval = true)
- private final IMendixObject __destination;
- private final system.proxies.FileDocument destination;
- private final communitycommons.proxies.StandardEncodings encoding;
-
- public StringToFile(
- IContext context,
- java.lang.String _value,
- IMendixObject _destination,
- java.lang.String _encoding
- )
- {
- super(context);
- this.value = _value;
- this.__destination = _destination;
- this.destination = _destination == null ? null : system.proxies.FileDocument.initialize(getContext(), _destination);
- this.encoding = _encoding == null ? null : communitycommons.proxies.StandardEncodings.valueOf(_encoding);
- }
-
- @java.lang.Override
- public java.lang.Boolean executeAction() throws Exception
- {
- // BEGIN USER CODE
- Charset charset = StandardCharsets.UTF_8;
- if (this.encoding != null)
- charset = Charset.forName(this.encoding.name().replace('_', '-'));
- StringUtils.stringToFile(getContext(), value, destination, charset);
- return true;
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "StringToFile";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/StringTrim.java b/javasource/communitycommons/actions/StringTrim.java
deleted file mode 100644
index f16077b..0000000
--- a/javasource/communitycommons/actions/StringTrim.java
+++ /dev/null
@@ -1,54 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Left and right trims a string (that is; removes all surrounding whitespace characters such as tabs, spaces and returns).
- * Returns the empty string if value is the empty value. Returns the trimmed string otherwise.
- */
-public class StringTrim extends UserAction
-{
- private final java.lang.String value;
-
- public StringTrim(
- IContext context,
- java.lang.String _value
- )
- {
- super(context);
- this.value = _value;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- if (this.value == null)
- return "";
- return this.value.trim();
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "StringTrim";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/SubstituteTemplate.java b/javasource/communitycommons/actions/SubstituteTemplate.java
deleted file mode 100644
index a760716..0000000
--- a/javasource/communitycommons/actions/SubstituteTemplate.java
+++ /dev/null
@@ -1,74 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import communitycommons.StringUtils;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Given an object and a template, substitutes all fields in the template. Supports attributes, references, referencesets and constants.
- *
- * The general field syntax is '{fieldname}'.
- *
- * Fieldname can be a member of the example object, an attribute which need to be retrieved over an reference(set) or a project constant. All paths are relative from the provided substitute obect. An example template:
- * ------------------
- * Dear {EmailOrName},
- *
- * {System.changedBy/FullName} has invited you to join the project {Module.MemberShip_Project/Name}.
- * Sign up is free and can be done here:
- * {@Module.PublicURL}link/Signup
- * -------------------------
- *
- * useHTMLEncoding identifies whether HTMLEncode is applied to the values before substituting.
- *
- * datetimeformat identifies a format string which is applied to date/time based attributes. Can be left empty. Defaults to "EEE dd MMM yyyy, HH:mm"
- */
-public class SubstituteTemplate extends UserAction
-{
- private final java.lang.String template;
- private final IMendixObject substitute;
- private final java.lang.Boolean useHTMLEncoding;
-
- public SubstituteTemplate(
- IContext context,
- java.lang.String _template,
- IMendixObject _substitute,
- java.lang.Boolean _useHTMLEncoding
- )
- {
- super(context);
- this.template = _template;
- this.substitute = _substitute;
- this.useHTMLEncoding = _useHTMLEncoding;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- return StringUtils.substituteTemplate(this.getContext(), template, substitute, useHTMLEncoding, null);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "SubstituteTemplate";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/SubstituteTemplate2.java b/javasource/communitycommons/actions/SubstituteTemplate2.java
deleted file mode 100644
index 5dd4901..0000000
--- a/javasource/communitycommons/actions/SubstituteTemplate2.java
+++ /dev/null
@@ -1,64 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import communitycommons.StringUtils;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Identical to SubstituteTemplate, but adds an datetimeformat argument
- *
- * DateTimeFormat identifies a format string which is applied to date/time based attributes. Can be left empty. Defaults to "EEE dd MMM yyyy, HH:mm"
- */
-public class SubstituteTemplate2 extends UserAction
-{
- private final java.lang.String template;
- private final IMendixObject substitute;
- private final java.lang.Boolean useHTMLEncoding;
- private final java.lang.String datetimeformat;
-
- public SubstituteTemplate2(
- IContext context,
- java.lang.String _template,
- IMendixObject _substitute,
- java.lang.Boolean _useHTMLEncoding,
- java.lang.String _datetimeformat
- )
- {
- super(context);
- this.template = _template;
- this.substitute = _substitute;
- this.useHTMLEncoding = _useHTMLEncoding;
- this.datetimeformat = _datetimeformat;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- return StringUtils.substituteTemplate(this.getContext(), template, substitute, useHTMLEncoding, this.datetimeformat);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "SubstituteTemplate2";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/SubstringAfter.java b/javasource/communitycommons/actions/SubstringAfter.java
deleted file mode 100644
index 01e0766..0000000
--- a/javasource/communitycommons/actions/SubstringAfter.java
+++ /dev/null
@@ -1,55 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import communitycommons.StringUtils;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Gets the substring after the first occurrence of a separator.
- */
-public class SubstringAfter extends UserAction
-{
- private final java.lang.String str;
- private final java.lang.String separator;
-
- public SubstringAfter(
- IContext context,
- java.lang.String _str,
- java.lang.String _separator
- )
- {
- super(context);
- this.str = _str;
- this.separator = _separator;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- return StringUtils.substringAfter(str, separator);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "SubstringAfter";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/SubstringAfterLast.java b/javasource/communitycommons/actions/SubstringAfterLast.java
deleted file mode 100644
index 53fdf2e..0000000
--- a/javasource/communitycommons/actions/SubstringAfterLast.java
+++ /dev/null
@@ -1,55 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import communitycommons.StringUtils;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Gets the substring after the last occurrence of a separator.
- */
-public class SubstringAfterLast extends UserAction
-{
- private final java.lang.String str;
- private final java.lang.String separator;
-
- public SubstringAfterLast(
- IContext context,
- java.lang.String _str,
- java.lang.String _separator
- )
- {
- super(context);
- this.str = _str;
- this.separator = _separator;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- return StringUtils.substringAfterLast(str, separator);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "SubstringAfterLast";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/SubstringBefore.java b/javasource/communitycommons/actions/SubstringBefore.java
deleted file mode 100644
index 48b93cb..0000000
--- a/javasource/communitycommons/actions/SubstringBefore.java
+++ /dev/null
@@ -1,55 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import communitycommons.StringUtils;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Gets the substring before the first occurrence of a separator.
- */
-public class SubstringBefore extends UserAction
-{
- private final java.lang.String str;
- private final java.lang.String separator;
-
- public SubstringBefore(
- IContext context,
- java.lang.String _str,
- java.lang.String _separator
- )
- {
- super(context);
- this.str = _str;
- this.separator = _separator;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- return StringUtils.substringBefore(str, separator);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "SubstringBefore";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/SubstringBeforeLast.java b/javasource/communitycommons/actions/SubstringBeforeLast.java
deleted file mode 100644
index cb2f797..0000000
--- a/javasource/communitycommons/actions/SubstringBeforeLast.java
+++ /dev/null
@@ -1,55 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import communitycommons.StringUtils;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Gets the substring before the last occurrence of a separator.
- */
-public class SubstringBeforeLast extends UserAction
-{
- private final java.lang.String str;
- private final java.lang.String separator;
-
- public SubstringBeforeLast(
- IContext context,
- java.lang.String _str,
- java.lang.String _separator
- )
- {
- super(context);
- this.str = _str;
- this.separator = _separator;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- return StringUtils.substringBeforeLast(str, separator);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "SubstringBeforeLast";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/ThrowException.java b/javasource/communitycommons/actions/ThrowException.java
deleted file mode 100644
index 26a8276..0000000
--- a/javasource/communitycommons/actions/ThrowException.java
+++ /dev/null
@@ -1,57 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import communitycommons.Misc;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * This action always throws an exception (of type communityutils.UserThrownError), which is, in combination with custom error handling, quite useful to end a microflow prematurely or to bail out to the calling action/ microflow.
- *
- * The message of the last thrown error can be inspected by using the variable $lasterrormessage
- *
- * Example usuage: In general, if an Event (before commit especially) returns false, it should call this action and then return true instead. If an Before commit returns false, the object will not be committed, but there is no easy way for the calling Microflow/ action to detect this! An exception on the other hand, will be noticed.
- */
-public class ThrowException extends UserAction
-{
- private final java.lang.String message;
-
- public ThrowException(
- IContext context,
- java.lang.String _message
- )
- {
- super(context);
- this.message = _message;
- }
-
- @java.lang.Override
- public java.lang.Boolean executeAction() throws Exception
- {
- // BEGIN USER CODE
- Misc.throwException(message);
- return null;
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "ThrowException";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/ThrowWebserviceException.java b/javasource/communitycommons/actions/ThrowWebserviceException.java
deleted file mode 100644
index 720e7c7..0000000
--- a/javasource/communitycommons/actions/ThrowWebserviceException.java
+++ /dev/null
@@ -1,57 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import communitycommons.Misc;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * (Behavior has changed since version 3.2. The exception is now properly propagated to the cient).
- *
- * Throws an exception. This is very useful if the microflow is called by a webservice. If you throw this kind of exceptions, an fault message will be generated in the output, instead of an '501 Internal server' error.
- *
- * If debug level of community commons is set to 'debug' the errors will be locally visible as well, otherwise not. Throwing a webservice exception states that the webservice invocation was incorrect, not the webservice implementation.
- */
-public class ThrowWebserviceException extends UserAction
-{
- private final java.lang.String faultstring;
-
- public ThrowWebserviceException(
- IContext context,
- java.lang.String _faultstring
- )
- {
- super(context);
- this.faultstring = _faultstring;
- }
-
- @java.lang.Override
- public java.lang.Boolean executeAction() throws Exception
- {
- // BEGIN USER CODE
- Misc.throwWebserviceException(faultstring);
- return true;
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "ThrowWebserviceException";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/TimeMeasureEnd.java b/javasource/communitycommons/actions/TimeMeasureEnd.java
deleted file mode 100644
index 6a92954..0000000
--- a/javasource/communitycommons/actions/TimeMeasureEnd.java
+++ /dev/null
@@ -1,61 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import communitycommons.Logging;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * End timing something, and print the result to the log.
- * - TimerName. Should correspond to the TimerName used with TimeMeasureStart.
- * - LogLevel. The loglevel used to print the result.
- * - The message to be printed in the log.
- */
-public class TimeMeasureEnd extends UserAction
-{
- private final java.lang.String TimerName;
- private final communitycommons.proxies.LogLevel Loglevel;
- private final java.lang.String message;
-
- public TimeMeasureEnd(
- IContext context,
- java.lang.String _timerName,
- java.lang.String _loglevel,
- java.lang.String _message
- )
- {
- super(context);
- this.TimerName = _timerName;
- this.Loglevel = _loglevel == null ? null : communitycommons.proxies.LogLevel.valueOf(_loglevel);
- this.message = _message;
- }
-
- @java.lang.Override
- public java.lang.Long executeAction() throws Exception
- {
- // BEGIN USER CODE
- return Logging.measureEnd(TimerName, Loglevel, message);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "TimeMeasureEnd";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/TimeMeasureStart.java b/javasource/communitycommons/actions/TimeMeasureStart.java
deleted file mode 100644
index e485a79..0000000
--- a/javasource/communitycommons/actions/TimeMeasureStart.java
+++ /dev/null
@@ -1,56 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import communitycommons.Logging;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Start timing something, and print the result to the log.
- * - TimerName. Should correspond to the TimerName used in TimeMeasureEnd.
- *
- * Note that multiple timers can run at once. Existing timers can be restarted using this function as well.
- */
-public class TimeMeasureStart extends UserAction
-{
- private final java.lang.String TimerName;
-
- public TimeMeasureStart(
- IContext context,
- java.lang.String _timerName
- )
- {
- super(context);
- this.TimerName = _timerName;
- }
-
- @java.lang.Override
- public java.lang.Boolean executeAction() throws Exception
- {
- // BEGIN USER CODE
- Logging.measureStart(TimerName);
- return true;
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "TimeMeasureStart";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/XSSSanitize.java b/javasource/communitycommons/actions/XSSSanitize.java
deleted file mode 100644
index 3a147e6..0000000
--- a/javasource/communitycommons/actions/XSSSanitize.java
+++ /dev/null
@@ -1,104 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.MendixRuntimeException;
-import com.mendix.systemwideinterfaces.core.IContext;
-import communitycommons.proxies.SanitizerPolicy;
-import java.util.List;
-import java.util.Objects;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-import org.apache.commons.lang3.StringUtils;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Removes all potential dangerous HTML from a string so that it can be safely displayed in a browser.
- *
- * This function should be applied to all HTML which is displayed in the browser, and can be entered by (untrusted) users.
- *
- * - HTML: The html to sanitize
- * - policy1... policy6: one or more values of SanitizerPolicy. You may leave these policy parameters empty if you don't want to allow additional elements.
- *
- * BLOCKS: Allows common block elements including ,
, etc.
- * FORMATTING: Allows common formatting elements including , , etc.
- * IMAGES: Allows elements from HTTP, HTTPS, and relative sources.
- * LINKS: Allows HTTP, HTTPS, MAILTO and relative links
- * STYLES: Allows certain safe CSS properties in style="..." attributes.
- * TABLES: Allows commons table elements.
- *
- * For more information, visit:
- *
- * http://javadoc.io/doc/com.googlecode.owasp-java-html-sanitizer/owasp-java-html-sanitizer/20180219.1
- */
-public class XSSSanitize extends UserAction
-{
- private final java.lang.String html;
- private final communitycommons.proxies.SanitizerPolicy policy1;
- private final communitycommons.proxies.SanitizerPolicy policy2;
- private final communitycommons.proxies.SanitizerPolicy policy3;
- private final communitycommons.proxies.SanitizerPolicy policy4;
- private final communitycommons.proxies.SanitizerPolicy policy5;
- private final communitycommons.proxies.SanitizerPolicy policy6;
-
- public XSSSanitize(
- IContext context,
- java.lang.String _html,
- java.lang.String _policy1,
- java.lang.String _policy2,
- java.lang.String _policy3,
- java.lang.String _policy4,
- java.lang.String _policy5,
- java.lang.String _policy6
- )
- {
- super(context);
- this.html = _html;
- this.policy1 = _policy1 == null ? null : communitycommons.proxies.SanitizerPolicy.valueOf(_policy1);
- this.policy2 = _policy2 == null ? null : communitycommons.proxies.SanitizerPolicy.valueOf(_policy2);
- this.policy3 = _policy3 == null ? null : communitycommons.proxies.SanitizerPolicy.valueOf(_policy3);
- this.policy4 = _policy4 == null ? null : communitycommons.proxies.SanitizerPolicy.valueOf(_policy4);
- this.policy5 = _policy5 == null ? null : communitycommons.proxies.SanitizerPolicy.valueOf(_policy5);
- this.policy6 = _policy6 == null ? null : communitycommons.proxies.SanitizerPolicy.valueOf(_policy6);
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- if (StringUtils.isEmpty(html)) {
- return "";
- }
-
- List policyParams = Stream.of(policy1, policy2, policy3, policy4, policy5, policy6)
- .filter(Objects::nonNull)
- .collect(Collectors.toList());
-
- if (policyParams.isEmpty()) {
- throw new MendixRuntimeException("At least one policy is required");
- }
-
- return communitycommons.StringUtils.sanitizeHTML(html, policyParams);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "XSSSanitize";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/YearsBetween.java b/javasource/communitycommons/actions/YearsBetween.java
deleted file mode 100644
index cd1cd38..0000000
--- a/javasource/communitycommons/actions/YearsBetween.java
+++ /dev/null
@@ -1,67 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import communitycommons.DateTime;
-import communitycommons.Logging;
-import communitycommons.proxies.LogLevel;
-import communitycommons.proxies.LogNodes;
-import java.util.Date;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Calculates the number of years between two dates.
- * - dateTime : the original (oldest) dateTime
- * - compareDate: the second date. If EMPTY, the current datetime will be used. Effectively this means that the age of the dateTime is calculated.
- */
-public class YearsBetween extends UserAction
-{
- private final java.util.Date dateTime;
- private final java.util.Date compareDate;
-
- public YearsBetween(
- IContext context,
- java.util.Date _dateTime,
- java.util.Date _compareDate
- )
- {
- super(context);
- this.dateTime = _dateTime;
- this.compareDate = _compareDate;
- }
-
- @java.lang.Override
- public java.lang.Long executeAction() throws Exception
- {
- // BEGIN USER CODE
- try {
- return Long.valueOf(DateTime.periodBetween(this.dateTime, compareDate == null ? new Date() : compareDate)
- .getYears());
- } catch (Exception e) {
- Logging.log(LogNodes.CommunityCommons.name(), LogLevel.Warning, "DateTime calculation error, returning -1", e);
- return -1L;
- }
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "YearsBetween";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/commitInSeparateDatabaseTransaction.java b/javasource/communitycommons/actions/commitInSeparateDatabaseTransaction.java
deleted file mode 100644
index 3f9324e..0000000
--- a/javasource/communitycommons/actions/commitInSeparateDatabaseTransaction.java
+++ /dev/null
@@ -1,62 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.core.Core;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.ISession;
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * This function commits an object in a seperate context and transaction, making sure it gets persisted in the database (regarding which exception happens after invocation).
- *
- * Please note that this action is prone to deadlock. For example if you commit an object in one transaction and then use this action to commit the same object in a separate transaction. We do not recommend the use of this action.
- *
- *
- */
-public class commitInSeparateDatabaseTransaction extends UserAction
-{
- private final IMendixObject mxObject;
-
- public commitInSeparateDatabaseTransaction(
- IContext context,
- IMendixObject _mxObject
- )
- {
- super(context);
- this.mxObject = _mxObject;
- }
-
- @java.lang.Override
- public java.lang.Boolean executeAction() throws Exception
- {
- // BEGIN USER CODE
- ISession session = getContext().getSession();
- IContext newContext = session.createContext();
- Core.commit(newContext, mxObject);
- newContext.endTransaction();
- return true;
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "commitInSeparateDatabaseTransaction";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/commitWithoutEvents.java b/javasource/communitycommons/actions/commitWithoutEvents.java
deleted file mode 100644
index 8329dba..0000000
--- a/javasource/communitycommons/actions/commitWithoutEvents.java
+++ /dev/null
@@ -1,55 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import communitycommons.ORM;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Commits an object, but without events.
- *
- * N.B. This function is not very useful when called from the model, but it is useful when called from custom Java code.
- */
-public class commitWithoutEvents extends UserAction
-{
- private final IMendixObject subject;
-
- public commitWithoutEvents(
- IContext context,
- IMendixObject _subject
- )
- {
- super(context);
- this.subject = _subject;
- }
-
- @java.lang.Override
- public java.lang.Boolean executeAction() throws Exception
- {
- // BEGIN USER CODE
- return ORM.commitWithoutEvents(this.getContext(), subject);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "commitWithoutEvents";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/copyAttributes.java b/javasource/communitycommons/actions/copyAttributes.java
deleted file mode 100644
index 1469f25..0000000
--- a/javasource/communitycommons/actions/copyAttributes.java
+++ /dev/null
@@ -1,59 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import communitycommons.ORM;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Copies all common primitive attributes from source to target, which are not necessarily of the same type. This is useful to, for example, translate database object into view objects.
- *
- * Note that no automatic type conversion is done.
- */
-public class copyAttributes extends UserAction
-{
- private final IMendixObject source;
- private final IMendixObject target;
-
- public copyAttributes(
- IContext context,
- IMendixObject _source,
- IMendixObject _target
- )
- {
- super(context);
- this.source = _source;
- this.target = _target;
- }
-
- @java.lang.Override
- public java.lang.Boolean executeAction() throws Exception
- {
- // BEGIN USER CODE
- ORM.copyAttributes(getContext(), source, target);
- return true;
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "copyAttributes";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/deleteAll.java b/javasource/communitycommons/actions/deleteAll.java
deleted file mode 100644
index a1a3dfa..0000000
--- a/javasource/communitycommons/actions/deleteAll.java
+++ /dev/null
@@ -1,52 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import communitycommons.XPath;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Removes ALL instances of a certain domain object type using batches.
- */
-public class deleteAll extends UserAction
-{
- private final java.lang.String entityType;
-
- public deleteAll(
- IContext context,
- java.lang.String _entityType
- )
- {
- super(context);
- this.entityType = _entityType;
- }
-
- @java.lang.Override
- public java.lang.Boolean executeAction() throws Exception
- {
- // BEGIN USER CODE
- return XPath.create(this.getContext(), entityType).deleteAll();
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "deleteAll";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/executeMicroflowAsUser.java b/javasource/communitycommons/actions/executeMicroflowAsUser.java
deleted file mode 100644
index 18994f5..0000000
--- a/javasource/communitycommons/actions/executeMicroflowAsUser.java
+++ /dev/null
@@ -1,63 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import communitycommons.Misc;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Executes the given microflow as if the $currentuser is the provided user (delegation). Use sudoContext to determine if 'apply entity access' should be used
- *
- * - microflowName: the fully qualified microflow name, 'CommunityCommons.CreateUserIfNotExists'
- * - username: The user that should be used to execute the microflow
- * - sudoContext: whether entity access should be applied.
- */
-public class executeMicroflowAsUser extends UserAction
-{
- private final java.lang.String microflow;
- private final java.lang.String username;
- private final java.lang.Boolean sudoContext;
-
- public executeMicroflowAsUser(
- IContext context,
- java.lang.String _microflow,
- java.lang.String _username,
- java.lang.Boolean _sudoContext
- )
- {
- super(context);
- this.microflow = _microflow;
- this.username = _username;
- this.sudoContext = _sudoContext;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- Object res = Misc.executeMicroflowAsUser(getContext(), microflow, username, sudoContext);
- return res == null ? null : res.toString();
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "executeMicroflowAsUser";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/executeMicroflowAsUser_1.java b/javasource/communitycommons/actions/executeMicroflowAsUser_1.java
deleted file mode 100644
index dce9499..0000000
--- a/javasource/communitycommons/actions/executeMicroflowAsUser_1.java
+++ /dev/null
@@ -1,66 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import communitycommons.Misc;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Identical to executeMicroflowAsUser, but takes 1 argument
- */
-public class executeMicroflowAsUser_1 extends UserAction
-{
- private final java.lang.String microflow;
- private final java.lang.String username;
- private final java.lang.Boolean sudoContext;
- private final java.lang.String arg1name;
- private final IMendixObject arg1value;
-
- public executeMicroflowAsUser_1(
- IContext context,
- java.lang.String _microflow,
- java.lang.String _username,
- java.lang.Boolean _sudoContext,
- java.lang.String _arg1name,
- IMendixObject _arg1value
- )
- {
- super(context);
- this.microflow = _microflow;
- this.username = _username;
- this.sudoContext = _sudoContext;
- this.arg1name = _arg1name;
- this.arg1value = _arg1value;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- Object res = Misc.executeMicroflowAsUser(getContext(), microflow, username, sudoContext, arg1name, arg1value);
- return res == null ? null : res.toString();
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "executeMicroflowAsUser_1";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/executeMicroflowAsUser_2.java b/javasource/communitycommons/actions/executeMicroflowAsUser_2.java
deleted file mode 100644
index c046206..0000000
--- a/javasource/communitycommons/actions/executeMicroflowAsUser_2.java
+++ /dev/null
@@ -1,72 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import communitycommons.Misc;
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Identical to executeMicroflowAsUser, but takes 2 arguments
- */
-public class executeMicroflowAsUser_2 extends UserAction
-{
- private final java.lang.String microflow;
- private final java.lang.String username;
- private final java.lang.Boolean sudoContext;
- private final java.lang.String arg1name;
- private final IMendixObject arg1value;
- private final java.lang.String arg2name;
- private final IMendixObject arg2value;
-
- public executeMicroflowAsUser_2(
- IContext context,
- java.lang.String _microflow,
- java.lang.String _username,
- java.lang.Boolean _sudoContext,
- java.lang.String _arg1name,
- IMendixObject _arg1value,
- java.lang.String _arg2name,
- IMendixObject _arg2value
- )
- {
- super(context);
- this.microflow = _microflow;
- this.username = _username;
- this.sudoContext = _sudoContext;
- this.arg1name = _arg1name;
- this.arg1value = _arg1value;
- this.arg2name = _arg2name;
- this.arg2value = _arg2value;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- Object res = Misc.executeMicroflowAsUser(getContext(), microflow, username, sudoContext, arg1name, arg1value, arg2name, arg2value);
- return res == null ? null : res.toString();
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "executeMicroflowAsUser_2";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/executeMicroflowInBackground.java b/javasource/communitycommons/actions/executeMicroflowInBackground.java
deleted file mode 100644
index 733093d..0000000
--- a/javasource/communitycommons/actions/executeMicroflowInBackground.java
+++ /dev/null
@@ -1,68 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import communitycommons.Misc;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * This action allows an microflow to be executed independently from this microflow.
- * This function is identical to "RunMicroflowAsyncInQueue", except that it takes one argument which will be passed to the microflow being called.
- *
- * This might be useful to model for example your own batching system, or to run a microflow in its own (system) transaction. The microflow is delayed for at least 200ms and then run with low priority in a system context. Since the microflow run in its own transaction, it is not affected with rollbacks (due to exceptions) or commits in this microflow.
- *
- * Invocations to this method are guaranteed to be run in FIFO order, only one microflow is run at a time.
- *
- * Note that since the microflow is run as system transaction, $currentUser is not available and no security restrictions are applied.
- *
- * - The microflowname specifies the fully qualified name of the microflow (case sensitive) e.g.: 'MyFirstModule.MyFirstMicroflow'.
- * - The context object specifies an argument that should be passed to the microflow if applicable. Currently only zero or one argument are supported. Note that editing this object in both microflows might lead to unexpected behavior.
- *
- * Returns true if scheduled successfully.
- */
-public class executeMicroflowInBackground extends UserAction
-{
- private final java.lang.String microflow;
- private final IMendixObject contextObject;
-
- public executeMicroflowInBackground(
- IContext context,
- java.lang.String _microflow,
- IMendixObject _contextObject
- )
- {
- super(context);
- this.microflow = _microflow;
- this.contextObject = _contextObject;
- }
-
- @java.lang.Override
- public java.lang.Boolean executeAction() throws Exception
- {
- // BEGIN USER CODE
- return Misc.runMicroflowInBackground(getContext(), microflow, contextObject);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "executeMicroflowInBackground";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/executeMicroflowInBatches.java b/javasource/communitycommons/actions/executeMicroflowInBatches.java
deleted file mode 100644
index 164a610..0000000
--- a/javasource/communitycommons/actions/executeMicroflowInBatches.java
+++ /dev/null
@@ -1,79 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import communitycommons.Misc;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Invokes a microflow in batches. The microflow is invoked for each individual item returned by the xpath query.
- *
- * The objects will be processed in small batches (based on the batchsize), which makes this function very useful to process large amounts of objects without using much memory. All defaut behavior such as commit events are applied as defined in your microflow.
- *
- * Parameters:
- * - xpath: Fully qualified xpath query that indicates the set of objects the microflow should be invoked on. For example:
- * '//System.User[Active = true()]'
- * - microflow: The microflow that should be invoked. Should accept one argument of the same type as the xpath. For example:
- * 'MyFirstModule.UpdateBirthday'
- * - batchsize: The amount of objects that should be processed in a single transaction. When in doubt, 1 is fine, but larger batches (for example; 100) will be faster due to less overhead.
- * - waitUntilFinished: Whether this call should block (wait) until all objects are
- * processed.
- *
- * Returns true if the batch has successfully started, or, if waitUntilFinished is true, returns true if the batch succeeded completely.
- *
- * Note, if new objects are added to the dataset while the batch is still running, those objects will be processed as well.
- */
-public class executeMicroflowInBatches extends UserAction
-{
- private final java.lang.String xpath;
- private final java.lang.String microflow;
- private final java.lang.Long batchsize;
- private final java.lang.Boolean waitUntilFinished;
- private final java.lang.Boolean ascending;
-
- public executeMicroflowInBatches(
- IContext context,
- java.lang.String _xpath,
- java.lang.String _microflow,
- java.lang.Long _batchsize,
- java.lang.Boolean _waitUntilFinished,
- java.lang.Boolean _ascending
- )
- {
- super(context);
- this.xpath = _xpath;
- this.microflow = _microflow;
- this.batchsize = _batchsize;
- this.waitUntilFinished = _waitUntilFinished;
- this.ascending = _ascending;
- }
-
- @java.lang.Override
- public java.lang.Boolean executeAction() throws Exception
- {
- // BEGIN USER CODE
- return Misc.executeMicroflowInBatches(xpath, microflow, batchsize.intValue(), waitUntilFinished.booleanValue(), ascending);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "executeMicroflowInBatches";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/executeUnverifiedMicroflowAsUser.java b/javasource/communitycommons/actions/executeUnverifiedMicroflowAsUser.java
deleted file mode 100644
index a2f783d..0000000
--- a/javasource/communitycommons/actions/executeUnverifiedMicroflowAsUser.java
+++ /dev/null
@@ -1,63 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import communitycommons.Misc;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Executes the given microflow as if the $currentuser is the provided user (delegation). Use sudoContext to determine if 'apply entity access' should be used
- *
- * - microflowName: the fully qualified microflow name, 'CommunityCommons.CreateUserIfNotExists'
- * - username: The user that should be used to execute the microflow
- * - sudoContext: whether entity access should be applied.
- */
-public class executeUnverifiedMicroflowAsUser extends UserAction
-{
- private final java.lang.String microflowName;
- private final java.lang.String username;
- private final java.lang.Boolean sudoContext;
-
- public executeUnverifiedMicroflowAsUser(
- IContext context,
- java.lang.String _microflowName,
- java.lang.String _username,
- java.lang.Boolean _sudoContext
- )
- {
- super(context);
- this.microflowName = _microflowName;
- this.username = _username;
- this.sudoContext = _sudoContext;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- Object res = Misc.executeMicroflowAsUser(getContext(), microflowName, username, sudoContext);
- return res == null ? null : res.toString();
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "executeUnverifiedMicroflowAsUser";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/executeUnverifiedMicroflowAsUser_1.java b/javasource/communitycommons/actions/executeUnverifiedMicroflowAsUser_1.java
deleted file mode 100644
index ff23314..0000000
--- a/javasource/communitycommons/actions/executeUnverifiedMicroflowAsUser_1.java
+++ /dev/null
@@ -1,66 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import communitycommons.Misc;
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Identical to executeMicroflowAsUser, but takes 1 argument
- */
-public class executeUnverifiedMicroflowAsUser_1 extends UserAction
-{
- private final java.lang.String microflowName;
- private final java.lang.String username;
- private final java.lang.Boolean sudoContext;
- private final java.lang.String arg1name;
- private final IMendixObject arg1value;
-
- public executeUnverifiedMicroflowAsUser_1(
- IContext context,
- java.lang.String _microflowName,
- java.lang.String _username,
- java.lang.Boolean _sudoContext,
- java.lang.String _arg1name,
- IMendixObject _arg1value
- )
- {
- super(context);
- this.microflowName = _microflowName;
- this.username = _username;
- this.sudoContext = _sudoContext;
- this.arg1name = _arg1name;
- this.arg1value = _arg1value;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- Object res = Misc.executeMicroflowAsUser(getContext(), microflowName, username, sudoContext, arg1name, arg1value);
- return res == null ? null : res.toString();
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "executeUnverifiedMicroflowAsUser_1";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/executeUnverifiedMicroflowAsUser_2.java b/javasource/communitycommons/actions/executeUnverifiedMicroflowAsUser_2.java
deleted file mode 100644
index a788646..0000000
--- a/javasource/communitycommons/actions/executeUnverifiedMicroflowAsUser_2.java
+++ /dev/null
@@ -1,72 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import communitycommons.Misc;
-import com.mendix.systemwideinterfaces.core.IContext;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Identical to executeMicroflowAsUser, but takes 2 arguments
- */
-public class executeUnverifiedMicroflowAsUser_2 extends UserAction
-{
- private final java.lang.String microflowName;
- private final java.lang.String username;
- private final java.lang.Boolean sudoContext;
- private final java.lang.String arg1name;
- private final IMendixObject arg1value;
- private final java.lang.String arg2name;
- private final IMendixObject arg2value;
-
- public executeUnverifiedMicroflowAsUser_2(
- IContext context,
- java.lang.String _microflowName,
- java.lang.String _username,
- java.lang.Boolean _sudoContext,
- java.lang.String _arg1name,
- IMendixObject _arg1value,
- java.lang.String _arg2name,
- IMendixObject _arg2value
- )
- {
- super(context);
- this.microflowName = _microflowName;
- this.username = _username;
- this.sudoContext = _sudoContext;
- this.arg1name = _arg1name;
- this.arg1value = _arg1value;
- this.arg2name = _arg2name;
- this.arg2value = _arg2value;
- }
-
- @java.lang.Override
- public java.lang.String executeAction() throws Exception
- {
- // BEGIN USER CODE
- Object res = Misc.executeMicroflowAsUser(getContext(), microflowName, username, sudoContext, arg1name, arg1value, arg2name, arg2value);
- return res == null ? null : res.toString();
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "executeUnverifiedMicroflowAsUser_2";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/executeUnverifiedMicroflowInBackground.java b/javasource/communitycommons/actions/executeUnverifiedMicroflowInBackground.java
deleted file mode 100644
index 8309214..0000000
--- a/javasource/communitycommons/actions/executeUnverifiedMicroflowInBackground.java
+++ /dev/null
@@ -1,68 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import communitycommons.Misc;
-import com.mendix.systemwideinterfaces.core.IMendixObject;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * This action allows an microflow to be executed independently from this microflow.
- * This function is identical to "RunMicroflowAsyncInQueue", except that it takes one argument which will be passed to the microflow being called.
- *
- * This might be useful to model for example your own batching system, or to run a microflow in its own (system) transaction. The microflow is delayed for at least 200ms and then run with low priority in a system context. Since the microflow run in its own transaction, it is not affected with rollbacks (due to exceptions) or commits in this microflow.
- *
- * Invocations to this method are guaranteed to be run in FIFO order, only one microflow is run at a time.
- *
- * Note that since the microflow is run as system transaction, $currentUser is not available and no security restrictions are applied.
- *
- * - The microflowname specifies the fully qualified name of the microflow (case sensitive) e.g.: 'MyFirstModule.MyFirstMicroflow'.
- * - The context object specifies an argument that should be passed to the microflow if applicable. Currently only zero or one argument are supported. Note that editing this object in both microflows might lead to unexpected behavior.
- *
- * Returns true if scheduled successfully.
- */
-public class executeUnverifiedMicroflowInBackground extends UserAction
-{
- private final java.lang.String microflowName;
- private final IMendixObject contextObject;
-
- public executeUnverifiedMicroflowInBackground(
- IContext context,
- java.lang.String _microflowName,
- IMendixObject _contextObject
- )
- {
- super(context);
- this.microflowName = _microflowName;
- this.contextObject = _contextObject;
- }
-
- @java.lang.Override
- public java.lang.Boolean executeAction() throws Exception
- {
- // BEGIN USER CODE
- return Misc.runMicroflowInBackground(getContext(), microflowName, contextObject);
- // END USER CODE
- }
-
- /**
- * Returns a string representation of this action
- * @return a string representation of this action
- */
- @java.lang.Override
- public java.lang.String toString()
- {
- return "executeUnverifiedMicroflowInBackground";
- }
-
- // BEGIN EXTRA CODE
- // END EXTRA CODE
-}
diff --git a/javasource/communitycommons/actions/executeUnverifiedMicroflowInBatches.java b/javasource/communitycommons/actions/executeUnverifiedMicroflowInBatches.java
deleted file mode 100644
index 3ed89f6..0000000
--- a/javasource/communitycommons/actions/executeUnverifiedMicroflowInBatches.java
+++ /dev/null
@@ -1,79 +0,0 @@
-// This file was generated by Mendix Studio Pro.
-//
-// 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 communitycommons.actions;
-
-import com.mendix.systemwideinterfaces.core.IContext;
-import communitycommons.Misc;
-import com.mendix.systemwideinterfaces.core.UserAction;
-
-/**
- * Invokes a microflow in batches. The microflow is invoked for each individual item returned by the xpath query.
- *
- * The objects will be processed in small batches (based on the batchsize), which makes this function very useful to process large amounts of objects without using much memory. All defaut behavior such as commit events are applied as defined in your microflow.
- *
- * Parameters:
- * - xpath: Fully qualified xpath query that indicates the set of objects the microflow should be invoked on. For example:
- * '//System.User[Active = true()]'
- * - microflow: The microflow that should be invoked. Should accept one argument of the same type as the xpath. For example:
- * 'MyFirstModule.UpdateBirthday'
- * - batchsize: The amount of objects that should be processed in a single transaction. When in doubt, 1 is fine, but larger batches (for example; 100) will be faster due to less overhead.
- * - waitUntilFinished: Whether this call should block (wait) until all objects are
- * processed.
- *
- * Returns true if the batch has successfully started, or, if waitUntilFinished is true, returns true if the batch succeeded completely.
- *
- * Note, if new objects are added to the dataset while the batch is still running, those objects will be processed as well.
- */
-public class executeUnverifiedMicroflowInBatches extends UserAction