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/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..c7c00d9 100644 --- a/environment.gradle +++ b/environment.gradle @@ -11,4 +11,3 @@ 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.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 -{ - private final java.lang.String xpath; - private final java.lang.String microflowName; - private final java.lang.Long batchsize; - private final java.lang.Boolean waitUntilFinished; - private final java.lang.Boolean ascending; - - public executeUnverifiedMicroflowInBatches( - IContext context, - java.lang.String _xpath, - java.lang.String _microflowName, - java.lang.Long _batchsize, - java.lang.Boolean _waitUntilFinished, - java.lang.Boolean _ascending - ) - { - super(context); - this.xpath = _xpath; - this.microflowName = _microflowName; - 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, microflowName, 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 "executeUnverifiedMicroflowInBatches"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} diff --git a/javasource/communitycommons/actions/getCreatedByUser.java b/javasource/communitycommons/actions/getCreatedByUser.java deleted file mode 100644 index bac0f00..0000000 --- a/javasource/communitycommons/actions/getCreatedByUser.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; - -/** - * Returns the user that created an object - * - * (or empty if not applicable). - */ -public class getCreatedByUser extends UserAction -{ - private final IMendixObject thing; - - public getCreatedByUser( - IContext context, - IMendixObject _thing - ) - { - super(context); - this.thing = _thing; - } - - @java.lang.Override - public IMendixObject executeAction() throws Exception - { - // BEGIN USER CODE - return ORM.getCreatedByUser(getContext(), thing); - // 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 "getCreatedByUser"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} diff --git a/javasource/communitycommons/actions/getFileSize.java b/javasource/communitycommons/actions/getFileSize.java deleted file mode 100644 index 408b51b..0000000 --- a/javasource/communitycommons/actions/getFileSize.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.systemwideinterfaces.core.IMendixObject; -import communitycommons.Misc; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.systemwideinterfaces.core.UserAction; - -/** - * Returns the filesize of a file document in bytes. - * - * From version 2.3 on, this function can be used in cloud environments as well. - * - * NOTE: - * before 2.1, this functioned returned the size in kilobytes, although this documentation mentioned bytes - */ -public class getFileSize extends UserAction -{ - /** @deprecated use document.getMendixObject() instead. */ - @java.lang.Deprecated(forRemoval = true) - private final IMendixObject __document; - private final system.proxies.FileDocument document; - - public getFileSize( - IContext context, - IMendixObject _document - ) - { - super(context); - this.__document = _document; - this.document = _document == null ? null : system.proxies.FileDocument.initialize(getContext(), _document); - } - - @java.lang.Override - public java.lang.Long executeAction() throws Exception - { - // BEGIN USER CODE - return Misc.getFileSize(this.getContext(), document.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 "getFileSize"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} diff --git a/javasource/communitycommons/actions/getGUID.java b/javasource/communitycommons/actions/getGUID.java deleted file mode 100644 index ce5c1c2..0000000 --- a/javasource/communitycommons/actions/getGUID.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.IMendixObject; -import communitycommons.ORM; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.systemwideinterfaces.core.UserAction; - -/** - * returns the Global Unique Identifier (GUID, or id) of an object. - */ -public class getGUID extends UserAction -{ - private final IMendixObject item; - - public getGUID( - IContext context, - IMendixObject _item - ) - { - super(context); - this.item = _item; - } - - @java.lang.Override - public java.lang.Long executeAction() throws Exception - { - // BEGIN USER CODE - return ORM.getGUID(item); - // 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 "getGUID"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} diff --git a/javasource/communitycommons/actions/getLastChangedByUser.java b/javasource/communitycommons/actions/getLastChangedByUser.java deleted file mode 100644 index 1d88839..0000000 --- a/javasource/communitycommons/actions/getLastChangedByUser.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; - -/** - * Returns the user that last changed this object as System.User - * - * (or empty if not applicable). - */ -public class getLastChangedByUser extends UserAction -{ - private final IMendixObject thing; - - public getLastChangedByUser( - IContext context, - IMendixObject _thing - ) - { - super(context); - this.thing = _thing; - } - - @java.lang.Override - public IMendixObject executeAction() throws Exception - { - // BEGIN USER CODE - return ORM.getLastChangedByUser(getContext(), thing); - // 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 "getLastChangedByUser"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} diff --git a/javasource/communitycommons/actions/getOriginalValueAsString.java b/javasource/communitycommons/actions/getOriginalValueAsString.java deleted file mode 100644 index e35fccd..0000000 --- a/javasource/communitycommons/actions/getOriginalValueAsString.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.systemwideinterfaces.core.IMendixObject; -import communitycommons.ORM; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.systemwideinterfaces.core.UserAction; - -/** - * Returns the original value of an object member, that is, the last committed value. - * - * This is useful if you want to compare the actual value with the last stored value. - * - item : the object of which you want to inspect a member - * - member: the member to retrieve the previous value from. Note that for references, the module name needs to be included. - * - * The function is applicable for non-String members as well, but always returns a String representation of the previous value. - */ -public class getOriginalValueAsString extends UserAction -{ - private final IMendixObject item; - private final java.lang.String member; - - public getOriginalValueAsString( - IContext context, - IMendixObject _item, - java.lang.String _member - ) - { - super(context); - this.item = _item; - this.member = _member; - } - - @java.lang.Override - public java.lang.String executeAction() throws Exception - { - // BEGIN USER CODE - return ORM.getOriginalValueAsString(this.getContext(), item, member); - // 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 "getOriginalValueAsString"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} diff --git a/javasource/communitycommons/actions/getTypeAsString.java b/javasource/communitycommons/actions/getTypeAsString.java deleted file mode 100644 index 52497e4..0000000 --- a/javasource/communitycommons/actions/getTypeAsString.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.IMendixObject; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.systemwideinterfaces.core.UserAction; - -/** - * Returns the actual type of an Entity. Useful as alternative way to split upon inheritance, or as input of other functions in this module. - */ -public class getTypeAsString extends UserAction -{ - private final IMendixObject instance; - - public getTypeAsString( - IContext context, - IMendixObject _instance - ) - { - super(context); - this.instance = _instance; - } - - @java.lang.Override - public java.lang.String executeAction() throws Exception - { - // BEGIN USER CODE - if (instance == null) - return ""; - return instance.getType(); - // 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 "getTypeAsString"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} diff --git a/javasource/communitycommons/actions/memberHasChanged.java b/javasource/communitycommons/actions/memberHasChanged.java deleted file mode 100644 index 88735ec..0000000 --- a/javasource/communitycommons/actions/memberHasChanged.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 com.mendix.systemwideinterfaces.core.IMendixObject; -import communitycommons.ORM; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.systemwideinterfaces.core.UserAction; - -/** - * Checks whether a member has changed since the last commit. Useful in combination with getOriginalValueAsString. - * - * - item : the object to inspect - * - member: the name of the member to inspect. Note that for references, the module name needs to be included. - * - * Returns true if changed. - */ -public class memberHasChanged extends UserAction -{ - private final IMendixObject item; - private final java.lang.String member; - - public memberHasChanged( - IContext context, - IMendixObject _item, - java.lang.String _member - ) - { - super(context); - this.item = _item; - this.member = _member; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - // BEGIN USER CODE - return ORM.memberHasChanged(this.getContext(), item, member); - // 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 "memberHasChanged"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} diff --git a/javasource/communitycommons/actions/memberHasChangedValue.java b/javasource/communitycommons/actions/memberHasChangedValue.java deleted file mode 100644 index 2d6159a..0000000 --- a/javasource/communitycommons/actions/memberHasChangedValue.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.IMendixObject; -import communitycommons.ORM; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.systemwideinterfaces.core.UserAction; - -/** - * Check if the value of the member was changed to something other than its original value. - */ -public class memberHasChangedValue extends UserAction -{ - private final IMendixObject item; - private final java.lang.String member; - - public memberHasChangedValue( - IContext context, - IMendixObject _item, - java.lang.String _member - ) - { - super(context); - this.item = _item; - this.member = _member; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - // BEGIN USER CODE - return ORM.memberHasChangedValue(getContext(), item, member); - // 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 "memberHasChangedValue"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} diff --git a/javasource/communitycommons/actions/objectHasChanged.java b/javasource/communitycommons/actions/objectHasChanged.java deleted file mode 100644 index dfa9988..0000000 --- a/javasource/communitycommons/actions/objectHasChanged.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; - -/** - * Returns true if at least one member (including owned associations) of this object has changed. - * - * For Mendix < 9.5 this action keeps track of changes to the object except when 'changing to the same value'. For Mendix >= 9.5 this action keeps track of all changes. This is a result of a change of the underlying Mendix runtime-server behaviour. - */ -public class objectHasChanged extends UserAction -{ - private final IMendixObject item; - - public objectHasChanged( - IContext context, - IMendixObject _item - ) - { - super(context); - this.item = _item; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - // BEGIN USER CODE - return ORM.objectHasChanged(item); - // 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 "objectHasChanged"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} diff --git a/javasource/communitycommons/actions/objectHasChangedMemberValue.java b/javasource/communitycommons/actions/objectHasChangedMemberValue.java deleted file mode 100644 index 6ca7135..0000000 --- a/javasource/communitycommons/actions/objectHasChangedMemberValue.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.IMendixObject; -import communitycommons.ORM; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.systemwideinterfaces.core.UserAction; - -/** - * Returns true if any member has a value other than its original value. - */ -public class objectHasChangedMemberValue extends UserAction -{ - private final IMendixObject item; - - public objectHasChangedMemberValue( - IContext context, - IMendixObject _item - ) - { - super(context); - this.item = _item; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - // BEGIN USER CODE - return ORM.objectHasChangedMemberValue(getContext(), item); - // 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 "objectHasChangedMemberValue"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} diff --git a/javasource/communitycommons/actions/objectIsNew.java b/javasource/communitycommons/actions/objectIsNew.java deleted file mode 100644 index a1c8fdc..0000000 --- a/javasource/communitycommons/actions/objectIsNew.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 com.mendix.systemwideinterfaces.core.IMendixObject; -import com.mendix.systemwideinterfaces.core.UserAction; - -/** - * Returns true if this object is new (not committed in the database). - */ -public class objectIsNew extends UserAction -{ - private final IMendixObject mxObject; - - public objectIsNew( - IContext context, - IMendixObject _mxObject - ) - { - super(context); - this.mxObject = _mxObject; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - // BEGIN USER CODE - return this.mxObject.isNew(); - // 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 "objectIsNew"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} diff --git a/javasource/communitycommons/actions/recommitInBatches.java b/javasource/communitycommons/actions/recommitInBatches.java deleted file mode 100644 index 38ae402..0000000 --- a/javasource/communitycommons/actions/recommitInBatches.java +++ /dev/null @@ -1,58 +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; - -public class recommitInBatches extends UserAction -{ - private final java.lang.String xpath; - private final java.lang.Long batchsize; - private final java.lang.Boolean waitUntilFinished; - private final java.lang.Boolean ascending; - - public recommitInBatches( - IContext context, - java.lang.String _xpath, - java.lang.Long _batchsize, - java.lang.Boolean _waitUntilFinished, - java.lang.Boolean _ascending - ) - { - super(context); - this.xpath = _xpath; - this.batchsize = _batchsize; - this.waitUntilFinished = _waitUntilFinished; - this.ascending = _ascending; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - // BEGIN USER CODE - return Misc.recommitInBatches(xpath, 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 "recommitInBatches"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} diff --git a/javasource/communitycommons/actions/refreshClass.java b/javasource/communitycommons/actions/refreshClass.java deleted file mode 100644 index 483d731..0000000 --- a/javasource/communitycommons/actions/refreshClass.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.webui.FeedbackHelper; -import com.mendix.systemwideinterfaces.core.UserAction; - -/** - * Refreshes a certain domain object type in the client. Useful to enforce a datagrid to refresh for example. - * - * -objectType : Type of the domain objects to refresh, such as System.User or MyModule.MyFirstEntity. - * (you can use getTypeAsString to determine this dynamically, so that the invoke of this action is not be sensitive to domain model changes). - */ -public class refreshClass extends UserAction -{ - private final java.lang.String objectType; - - public refreshClass( - IContext context, - java.lang.String _objectType - ) - { - super(context); - this.objectType = _objectType; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - // BEGIN USER CODE - FeedbackHelper.addRefreshClass(this.getContext(), objectType); - 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 "refreshClass"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} diff --git a/javasource/communitycommons/actions/refreshClassByObject.java b/javasource/communitycommons/actions/refreshClassByObject.java deleted file mode 100644 index 9bc34ab..0000000 --- a/javasource/communitycommons/actions/refreshClassByObject.java +++ /dev/null @@ -1,58 +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 com.mendix.webui.FeedbackHelper; -import com.mendix.systemwideinterfaces.core.UserAction; - -/** - * Refreshes a certain domain object type in the client. Useful to enforce a datagrid to refresh for example. - * - * - instance : This object is used to identify the type of objects that need to be refreshed. For example passing $currentUser will refresh all System.Account's. - */ -public class refreshClassByObject extends UserAction -{ - private final IMendixObject instance; - - public refreshClassByObject( - IContext context, - IMendixObject _instance - ) - { - super(context); - this.instance = _instance; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - // BEGIN USER CODE - if (instance != null) { - FeedbackHelper.addRefreshClass(this.getContext(), instance.getType()); - } - 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 "refreshClassByObject"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} diff --git a/javasource/communitycommons/actions/retrieveURL.java b/javasource/communitycommons/actions/retrieveURL.java deleted file mode 100644 index 6b70186..0000000 --- a/javasource/communitycommons/actions/retrieveURL.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 communitycommons.Misc; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.systemwideinterfaces.core.UserAction; - -/** - * Retrieves data (such as an HTML page) from an URL using the HTTP protocol, and returns it as string. - * - * - url : The URL to retrieve. - * - post : Data to be sent in the request body. If set, a POST request will be send, otherwise a GET request is used. - * - * Example urls: - * 'https://mxforum.mendix.com/search/' - * 'http://www.google.nl/#hl=nl&q=download+mendix' - * - * Example post data: - * 'ipSearchTag=url&x=0&y=0' - */ -public class retrieveURL extends UserAction -{ - private final java.lang.String url; - private final java.lang.String postdata; - - public retrieveURL( - IContext context, - java.lang.String _url, - java.lang.String _postdata - ) - { - super(context); - this.url = _url; - this.postdata = _postdata; - } - - @java.lang.Override - public java.lang.String executeAction() throws Exception - { - // BEGIN USER CODE - return Misc.retrieveURL(url, postdata); - // 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 "retrieveURL"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} diff --git a/javasource/communitycommons/actions/storeURLToFileDocument.java b/javasource/communitycommons/actions/storeURLToFileDocument.java deleted file mode 100644 index ce3e1f6..0000000 --- a/javasource/communitycommons/actions/storeURLToFileDocument.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.Misc; -import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.systemwideinterfaces.core.UserAction; - -/** - * Retrieve a document from an URL using a HTTP GET request. - * - url : the URL to retrieve - * - document: the document to store the data into - * - filename: the filename to store it under. Only for internal use, so it can be an arbitrary filename. - * - * Example URL: 'http://www.mendix.com/wordpress/wp-content/themes/mendix_new/images/mendix.png' - * - * NOTE: For images, no thumbnail will be generated. - */ -public class storeURLToFileDocument extends UserAction -{ - private final java.lang.String url; - /** @deprecated use document.getMendixObject() instead. */ - @java.lang.Deprecated(forRemoval = true) - private final IMendixObject __document; - private final system.proxies.FileDocument document; - private final java.lang.String filename; - - public storeURLToFileDocument( - IContext context, - java.lang.String _url, - IMendixObject _document, - java.lang.String _filename - ) - { - super(context); - this.url = _url; - this.__document = _document; - this.document = _document == null ? null : system.proxies.FileDocument.initialize(getContext(), _document); - this.filename = _filename; - } - - @java.lang.Override - public java.lang.Boolean executeAction() throws Exception - { - // BEGIN USER CODE - return Misc.storeURLToFileDocument(this.getContext(), url, document.getMendixObject(), filename); - // 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 "storeURLToFileDocument"; - } - - // BEGIN EXTRA CODE - // END EXTRA CODE -} diff --git a/javasource/oql/actions/ExportOQLToCSV.java b/javasource/oql/actions/ExportOQLToCSV.java index 0910072..7cf7537 100644 --- a/javasource/oql/actions/ExportOQLToCSV.java +++ b/javasource/oql/actions/ExportOQLToCSV.java @@ -12,13 +12,11 @@ import com.mendix.core.Core; import com.mendix.logging.ILogNode; import com.mendix.systemwideinterfaces.connectionbus.data.IDataColumnSchema; -import com.mendix.systemwideinterfaces.connectionbus.data.IDataRow; import com.mendix.systemwideinterfaces.connectionbus.data.IDataTable; import com.mendix.systemwideinterfaces.connectionbus.requests.IParameterMap; import com.mendix.systemwideinterfaces.connectionbus.requests.IRetrievalSchema; import com.mendix.systemwideinterfaces.connectionbus.requests.types.IOQLTextGetRequest; import com.mendix.systemwideinterfaces.core.IContext; -import com.mendix.systemwideinterfaces.core.IMendixIdentifier; import com.mendix.systemwideinterfaces.core.IMendixObject; import com.mendix.systemwideinterfaces.core.UserAction; import oql.implementation.MxCSVWriter; @@ -26,12 +24,10 @@ import system.proxies.FileDocument; import java.io.*; import java.util.ArrayList; -import java.util.Date; import java.util.List; import java.util.Map.Entry; import java.util.Optional; import java.util.stream.Collectors; -import java.util.stream.IntStream; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; @@ -100,7 +96,8 @@ public IMendixObject executeAction() throws Exception MxCSVWriter writer = new MxCSVWriter(new OutputStreamWriter(os), this.separatorChar.charAt(0), this.quoteChar != null ? Optional.of(this.quoteChar.charAt(0)) : Optional.empty(), - this.escapeChar != null ? Optional.of(this.escapeChar.charAt(0)) : Optional.empty()); + this.escapeChar != null ? Optional.of(this.escapeChar.charAt(0)) : Optional.empty(), + this.removeNewLinesFromValues); IMendixObject result = Core.instantiate(getContext(), this.returnEntity); @@ -124,7 +121,7 @@ public IMendixObject executeAction() throws Exception writer.writeRow(headers); } - writeResults(results, writer); + writer.writeDataTable(results, getContext()); if (results.getRowCount() != PAGE_SIZE) { break; @@ -171,30 +168,5 @@ private IOQLTextGetRequest buildRequest(String statement, int offset, int pagesi request.setParameters(parameterMap); return request; } - - private void writeResults(IDataTable results, MxCSVWriter writer) throws IOException { - for (IDataRow row : results.getRows()) { - List values = IntStream - .range(0, results.getSchema().getColumnCount()) - .mapToObj(index -> row.getValue(getContext(), index)) - .map(value -> { - if (value == null) return ""; - else { - if (value instanceof Date) { - return Long.toString(((Date) value).getTime()); // use timestamp to export for more precision than just seconds. - } else if (value instanceof IMendixIdentifier) { - return Long.toString(((IMendixIdentifier) value).toLong()); - } else { - return value.toString(); - } - } - }) - .map(value -> this.removeNewLinesFromValues ? value.replaceAll("(\r\n|\n|\r)", " ") : value) - .collect(Collectors.toCollection(ArrayList::new)); - writer.writeRow(values); - } - } - - // END EXTRA CODE } diff --git a/javasource/oql/actions/ExportOQLToMarkdown.java b/javasource/oql/actions/ExportOQLToMarkdown.java new file mode 100644 index 0000000..177f027 --- /dev/null +++ b/javasource/oql/actions/ExportOQLToMarkdown.java @@ -0,0 +1,112 @@ +// 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 oql.actions; + +import com.mendix.core.Core; +import com.mendix.systemwideinterfaces.connectionbus.data.IDataColumnSchema; +import com.mendix.systemwideinterfaces.connectionbus.data.IDataTable; +import com.mendix.systemwideinterfaces.connectionbus.requests.IParameterMap; +import com.mendix.systemwideinterfaces.connectionbus.requests.IRetrievalSchema; +import com.mendix.systemwideinterfaces.connectionbus.requests.types.IOQLTextGetRequest; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.systemwideinterfaces.core.UserAction; +import oql.implementation.MxCSVWriter; +import oql.implementation.OQL; +import java.io.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map.Entry; +import java.util.Optional; +import java.util.stream.Collectors; + +/** + * Java action that executes an OQL query and returns the result as a formatted markdown table. + */ +public class ExportOQLToMarkdown extends UserAction +{ + private final java.lang.String query; + + public ExportOQLToMarkdown( + IContext context, + java.lang.String _query + ) + { + super(context); + this.query = _query; + } + + @java.lang.Override + public java.lang.String executeAction() throws Exception + { + // BEGIN USER CODE + final int PAGE_SIZE = 10000; + + try (StringWriter stringWriter = new StringWriter(); + MxCSVWriter writer = new MxCSVWriter(stringWriter, '|', Optional.empty(), Optional.of('\\'), Optional.of('|'), Optional.of('|'), true)) { + + int offset = 0; + while (true) { + + IContext context = getContext().createSudoClone(); + IDataTable results = Core.retrieveOQLDataTable(context, buildRequest(query, offset, PAGE_SIZE)); + + if (offset == 0) { + List headers = results.getSchema() + .getColumnSchemas() + .stream() + .map(IDataColumnSchema::getName) + .collect(Collectors.toCollection(ArrayList::new)); + writer.writeRow(headers); + writer.writeRow(Collections.nCopies(headers.size(), "-")); + } + + writer.writeDataTable(results, getContext()); + + if (results.getRowCount() != PAGE_SIZE) { + break; + } + offset += PAGE_SIZE; + } + OQL.resetParameters(); + + return stringWriter.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 "ExportOQLToMarkdown"; + } + + // BEGIN EXTRA CODE + private IOQLTextGetRequest buildRequest(String statement, int offset, int pagesize) { + IOQLTextGetRequest request = Core.createOQLTextGetRequest(); + request.setQuery(statement); + + IParameterMap parameterMap = request.createParameterMap(); + IRetrievalSchema schema = Core.createRetrievalSchema(); + schema.setAmount(pagesize); + schema.setOffset(offset); + request.setRetrievalSchema(schema); + for (Entry entry : OQL.getNextParameters().entrySet()) { + parameterMap.put(entry.getKey(), entry.getValue()); + } + request.setParameters(parameterMap); + return request; + } + // END EXTRA CODE +} diff --git a/javasource/oql/implementation/MxCSVWriter.java b/javasource/oql/implementation/MxCSVWriter.java index 9db632b..35b27a9 100644 --- a/javasource/oql/implementation/MxCSVWriter.java +++ b/javasource/oql/implementation/MxCSVWriter.java @@ -5,31 +5,75 @@ import java.io.Closeable; import java.io.IOException; import java.io.Writer; +import java.util.ArrayList; +import java.util.Date; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; +import java.util.stream.IntStream; import java.util.stream.Stream; +import com.mendix.systemwideinterfaces.connectionbus.data.IDataRow; +import com.mendix.systemwideinterfaces.connectionbus.data.IDataTable; +import com.mendix.systemwideinterfaces.core.IContext; +import com.mendix.systemwideinterfaces.core.IMendixIdentifier; + public class MxCSVWriter implements Closeable { - protected Writer writer; - protected List specialCharactersToEscape; - protected char separatorChar; - protected Optional quoteChar; - protected Optional escapeChar; - protected String lineEnd = "\r\n"; + private Writer writer; + private List specialCharactersToEscape; + private char separatorChar; + private boolean removeNewLinesFromValues; + private Optional quoteChar; + private Optional escapeChar; + private Optional initialChar; + private Optional endChar; + private String lineEnd = "\r\n"; - public MxCSVWriter(Writer writer, char separatorChar, Optional quoteChar, Optional escapeChar) { + public MxCSVWriter(Writer writer, char separatorChar, Optional quoteChar, Optional escapeChar, + Optional initialChar, Optional endChar, boolean removeNewLinesFromValues) { this.writer = writer; this.separatorChar = separatorChar; this.quoteChar = quoteChar; this.escapeChar = escapeChar; + this.initialChar = initialChar; + this.endChar = endChar; + this.removeNewLinesFromValues = removeNewLinesFromValues; specialCharactersToEscape = defineSpecialCharactersToEscape(); } + public MxCSVWriter(Writer writer, char separatorChar, Optional quoteChar, Optional escapeChar, boolean removeNewLinesFromValues) { + this(writer, separatorChar, quoteChar, escapeChar, Optional.empty(), Optional.empty(), removeNewLinesFromValues); + } + + public void writeDataTable(IDataTable results, IContext context) throws IOException { + for (IDataRow row : results.getRows()) { + List values = IntStream + .range(0, results.getSchema().getColumnCount()) + .mapToObj(index -> row.getValue(context, index)) + .map(value -> { + if (value == null) return ""; + else { + if (value instanceof Date) { + return Long.toString(((Date) value).getTime()); // use timestamp to export for more precision than just seconds. + } else if (value instanceof IMendixIdentifier) { + return Long.toString(((IMendixIdentifier) value).toLong()); + } else { + return value.toString(); + } + } + }) + .map(value -> removeNewLinesFromValues ? value.replaceAll("(\r\n|\n|\r)", " ") : value) + .collect(Collectors.toCollection(ArrayList::new)); + writeRow(values); + } + } + public void writeRow(List columns) throws IOException { StringBuilder rowBuilder = new StringBuilder(1024); + initialChar.ifPresent(rowBuilder::append); + for (int columnIndex = 0; columnIndex < columns.size(); columnIndex++) { if (columnIndex != 0) { @@ -42,6 +86,8 @@ public void writeRow(List columns) throws IOException { writeValue(rowBuilder, nextValue); quoteChar.ifPresent(rowBuilder::append); } + + endChar.ifPresent(rowBuilder::append); rowBuilder.append(lineEnd); writer.write(rowBuilder.toString()); diff --git a/marketplace/release-notes/5.1.0.txt b/marketplace/release-notes/5.1.0.txt new file mode 100644 index 0000000..fba2041 --- /dev/null +++ b/marketplace/release-notes/5.1.0.txt @@ -0,0 +1,3 @@ +- We removed the CsvAsTable widget and replaced it with the Markdown viewer, which is a platform supported widget and can be downloaded from the marketplace. +- We added an ExportOQLToMarkdown java action that generates a Markdown formatted table from the result of executing an OQL query. +- We removed the dependency on the Community Commons module. \ No newline at end of file diff --git a/mprcontents/01/3c/013c411b-c6ba-4fe9-b842-583c4853753f.mxunit b/mprcontents/01/3c/013c411b-c6ba-4fe9-b842-583c4853753f.mxunit deleted file mode 100644 index d10e7e4..0000000 Binary files a/mprcontents/01/3c/013c411b-c6ba-4fe9-b842-583c4853753f.mxunit and /dev/null differ diff --git a/mprcontents/06/c4/06c46b42-722e-4bb7-abba-3a0a49bb2ac9.mxunit b/mprcontents/06/c4/06c46b42-722e-4bb7-abba-3a0a49bb2ac9.mxunit deleted file mode 100644 index f239549..0000000 Binary files a/mprcontents/06/c4/06c46b42-722e-4bb7-abba-3a0a49bb2ac9.mxunit and /dev/null differ diff --git a/mprcontents/0b/ac/0bac7797-fd37-4834-badf-454a6334f7b9.mxunit b/mprcontents/0b/ac/0bac7797-fd37-4834-badf-454a6334f7b9.mxunit deleted file mode 100644 index 565ffa0..0000000 Binary files a/mprcontents/0b/ac/0bac7797-fd37-4834-badf-454a6334f7b9.mxunit and /dev/null differ diff --git a/mprcontents/0c/85/0c856a2d-2236-40fb-8155-0f4b6bbff4ef.mxunit b/mprcontents/0c/85/0c856a2d-2236-40fb-8155-0f4b6bbff4ef.mxunit deleted file mode 100644 index 702814e..0000000 Binary files a/mprcontents/0c/85/0c856a2d-2236-40fb-8155-0f4b6bbff4ef.mxunit and /dev/null differ diff --git a/mprcontents/0e/2a/0e2a0433-04d8-4c74-9275-335bd68ff360.mxunit b/mprcontents/0e/2a/0e2a0433-04d8-4c74-9275-335bd68ff360.mxunit deleted file mode 100644 index d52008a..0000000 Binary files a/mprcontents/0e/2a/0e2a0433-04d8-4c74-9275-335bd68ff360.mxunit and /dev/null differ diff --git a/mprcontents/0f/a2/0fa22ce8-d674-4098-99aa-d522cd2a362c.mxunit b/mprcontents/0f/a2/0fa22ce8-d674-4098-99aa-d522cd2a362c.mxunit deleted file mode 100644 index ecd9661..0000000 Binary files a/mprcontents/0f/a2/0fa22ce8-d674-4098-99aa-d522cd2a362c.mxunit and /dev/null differ diff --git a/mprcontents/11/73/11730161-c9a1-4e76-85c8-b777affb9e12.mxunit b/mprcontents/11/73/11730161-c9a1-4e76-85c8-b777affb9e12.mxunit deleted file mode 100644 index f66b2a0..0000000 Binary files a/mprcontents/11/73/11730161-c9a1-4e76-85c8-b777affb9e12.mxunit and /dev/null differ diff --git a/mprcontents/12/57/125797ad-7f8d-4def-a68f-d88bb08bad16.mxunit b/mprcontents/12/57/125797ad-7f8d-4def-a68f-d88bb08bad16.mxunit deleted file mode 100644 index 334ff7b..0000000 Binary files a/mprcontents/12/57/125797ad-7f8d-4def-a68f-d88bb08bad16.mxunit and /dev/null differ diff --git a/mprcontents/14/d5/14d5ba43-5f28-4e2b-bfce-76d4ab2cfc0d.mxunit b/mprcontents/14/d5/14d5ba43-5f28-4e2b-bfce-76d4ab2cfc0d.mxunit deleted file mode 100644 index d4f36de..0000000 Binary files a/mprcontents/14/d5/14d5ba43-5f28-4e2b-bfce-76d4ab2cfc0d.mxunit and /dev/null differ diff --git a/mprcontents/19/3a/193addff-f779-4e47-a8ea-69fc6922c4f6.mxunit b/mprcontents/19/3a/193addff-f779-4e47-a8ea-69fc6922c4f6.mxunit deleted file mode 100644 index eb030b8..0000000 Binary files a/mprcontents/19/3a/193addff-f779-4e47-a8ea-69fc6922c4f6.mxunit and /dev/null differ diff --git a/mprcontents/1f/2c/1f2c4703-788f-4bb5-8b58-94088896316a.mxunit b/mprcontents/1f/2c/1f2c4703-788f-4bb5-8b58-94088896316a.mxunit deleted file mode 100644 index 89bed62..0000000 Binary files a/mprcontents/1f/2c/1f2c4703-788f-4bb5-8b58-94088896316a.mxunit and /dev/null differ diff --git a/mprcontents/20/9b/209b3fb0-1b92-4e02-a318-21099fb30c07.mxunit b/mprcontents/20/9b/209b3fb0-1b92-4e02-a318-21099fb30c07.mxunit deleted file mode 100644 index 9c7df9b..0000000 Binary files a/mprcontents/20/9b/209b3fb0-1b92-4e02-a318-21099fb30c07.mxunit and /dev/null differ diff --git a/mprcontents/21/79/21795fc5-fccd-4f3f-850d-a895791a9695.mxunit b/mprcontents/21/79/21795fc5-fccd-4f3f-850d-a895791a9695.mxunit index 05dd440..2cd107b 100644 Binary files a/mprcontents/21/79/21795fc5-fccd-4f3f-850d-a895791a9695.mxunit and b/mprcontents/21/79/21795fc5-fccd-4f3f-850d-a895791a9695.mxunit differ diff --git a/mprcontents/23/39/23390396-86a1-431e-ace2-1019f84ae93a.mxunit b/mprcontents/23/39/23390396-86a1-431e-ace2-1019f84ae93a.mxunit deleted file mode 100644 index c4ac724..0000000 Binary files a/mprcontents/23/39/23390396-86a1-431e-ace2-1019f84ae93a.mxunit and /dev/null differ diff --git a/mprcontents/25/26/252623ce-00e2-46ef-9863-fa54edcc933c.mxunit b/mprcontents/25/26/252623ce-00e2-46ef-9863-fa54edcc933c.mxunit deleted file mode 100644 index 194de3e..0000000 Binary files a/mprcontents/25/26/252623ce-00e2-46ef-9863-fa54edcc933c.mxunit and /dev/null differ diff --git a/mprcontents/25/90/25905f62-d767-4053-9a17-c4e7b59ba931.mxunit b/mprcontents/25/90/25905f62-d767-4053-9a17-c4e7b59ba931.mxunit deleted file mode 100644 index 3df5af8..0000000 Binary files a/mprcontents/25/90/25905f62-d767-4053-9a17-c4e7b59ba931.mxunit and /dev/null differ diff --git a/mprcontents/26/df/26df65a0-31fc-4ad2-8379-dd6ff55e6d84.mxunit b/mprcontents/26/df/26df65a0-31fc-4ad2-8379-dd6ff55e6d84.mxunit deleted file mode 100644 index a4922a6..0000000 Binary files a/mprcontents/26/df/26df65a0-31fc-4ad2-8379-dd6ff55e6d84.mxunit and /dev/null differ diff --git a/mprcontents/27/58/2758d413-8bc4-4570-8522-8c85a22ea96b.mxunit b/mprcontents/27/58/2758d413-8bc4-4570-8522-8c85a22ea96b.mxunit deleted file mode 100644 index 9aed3f4..0000000 Binary files a/mprcontents/27/58/2758d413-8bc4-4570-8522-8c85a22ea96b.mxunit and /dev/null differ diff --git a/mprcontents/27/5e/275e8860-72a1-4f65-86a6-6dbd79be6bbb.mxunit b/mprcontents/27/5e/275e8860-72a1-4f65-86a6-6dbd79be6bbb.mxunit deleted file mode 100644 index 5873abd..0000000 Binary files a/mprcontents/27/5e/275e8860-72a1-4f65-86a6-6dbd79be6bbb.mxunit and /dev/null differ diff --git a/mprcontents/28/aa/28aabeb5-d781-4389-ba73-fb483078a131.mxunit b/mprcontents/28/aa/28aabeb5-d781-4389-ba73-fb483078a131.mxunit deleted file mode 100644 index ebf76c8..0000000 Binary files a/mprcontents/28/aa/28aabeb5-d781-4389-ba73-fb483078a131.mxunit and /dev/null differ diff --git a/mprcontents/2a/63/2a639441-051e-4576-88ce-de5ce43cc281.mxunit b/mprcontents/2a/63/2a639441-051e-4576-88ce-de5ce43cc281.mxunit deleted file mode 100644 index 08f6450..0000000 Binary files a/mprcontents/2a/63/2a639441-051e-4576-88ce-de5ce43cc281.mxunit and /dev/null differ diff --git a/mprcontents/2c/5c/2c5c8be1-3894-4a38-b3b3-5bc84b32647a.mxunit b/mprcontents/2c/5c/2c5c8be1-3894-4a38-b3b3-5bc84b32647a.mxunit deleted file mode 100644 index da15081..0000000 Binary files a/mprcontents/2c/5c/2c5c8be1-3894-4a38-b3b3-5bc84b32647a.mxunit and /dev/null differ diff --git a/mprcontents/2e/7a/2e7a6433-d40b-44c1-8bce-7eb8d3245959.mxunit b/mprcontents/2e/7a/2e7a6433-d40b-44c1-8bce-7eb8d3245959.mxunit deleted file mode 100644 index fd85d0e..0000000 Binary files a/mprcontents/2e/7a/2e7a6433-d40b-44c1-8bce-7eb8d3245959.mxunit and /dev/null differ diff --git a/mprcontents/2f/e5/2fe59de0-076a-4c5e-8891-0fa390406aee.mxunit b/mprcontents/2f/e5/2fe59de0-076a-4c5e-8891-0fa390406aee.mxunit deleted file mode 100644 index 00e3686..0000000 Binary files a/mprcontents/2f/e5/2fe59de0-076a-4c5e-8891-0fa390406aee.mxunit and /dev/null differ diff --git a/mprcontents/32/92/3292aafb-cb40-488d-84b8-2b06f79d3298.mxunit b/mprcontents/32/92/3292aafb-cb40-488d-84b8-2b06f79d3298.mxunit deleted file mode 100644 index 889fcfd..0000000 Binary files a/mprcontents/32/92/3292aafb-cb40-488d-84b8-2b06f79d3298.mxunit and /dev/null differ diff --git a/mprcontents/32/e1/32e1b2e4-2c2f-4da4-9a44-1f93080e702c.mxunit b/mprcontents/32/e1/32e1b2e4-2c2f-4da4-9a44-1f93080e702c.mxunit deleted file mode 100644 index ea75928..0000000 Binary files a/mprcontents/32/e1/32e1b2e4-2c2f-4da4-9a44-1f93080e702c.mxunit and /dev/null differ diff --git a/mprcontents/33/5d/335d12eb-da1e-4191-b771-a3cffad2d7dc.mxunit b/mprcontents/33/5d/335d12eb-da1e-4191-b771-a3cffad2d7dc.mxunit deleted file mode 100644 index 0a18f7b..0000000 Binary files a/mprcontents/33/5d/335d12eb-da1e-4191-b771-a3cffad2d7dc.mxunit and /dev/null differ diff --git a/mprcontents/34/61/34618046-ffb8-4b19-bae1-cf00400d7285.mxunit b/mprcontents/34/61/34618046-ffb8-4b19-bae1-cf00400d7285.mxunit deleted file mode 100644 index a3050d4..0000000 Binary files a/mprcontents/34/61/34618046-ffb8-4b19-bae1-cf00400d7285.mxunit and /dev/null differ diff --git a/mprcontents/36/af/36af3c25-6b85-4e29-a7ee-0d1f6b7af119.mxunit b/mprcontents/36/af/36af3c25-6b85-4e29-a7ee-0d1f6b7af119.mxunit deleted file mode 100644 index 67bf050..0000000 Binary files a/mprcontents/36/af/36af3c25-6b85-4e29-a7ee-0d1f6b7af119.mxunit and /dev/null differ diff --git a/mprcontents/37/11/3711fb9b-49b3-4edc-89bb-242980d9e013.mxunit b/mprcontents/37/11/3711fb9b-49b3-4edc-89bb-242980d9e013.mxunit deleted file mode 100644 index 3ede5e5..0000000 Binary files a/mprcontents/37/11/3711fb9b-49b3-4edc-89bb-242980d9e013.mxunit and /dev/null differ diff --git a/mprcontents/37/92/3792e394-7ee1-4bd2-bd66-29b95537c7b6.mxunit b/mprcontents/37/92/3792e394-7ee1-4bd2-bd66-29b95537c7b6.mxunit deleted file mode 100644 index 1423454..0000000 Binary files a/mprcontents/37/92/3792e394-7ee1-4bd2-bd66-29b95537c7b6.mxunit and /dev/null differ diff --git a/mprcontents/38/0d/380d3f03-fe78-42f4-be74-8b773246f993.mxunit b/mprcontents/38/0d/380d3f03-fe78-42f4-be74-8b773246f993.mxunit deleted file mode 100644 index bd20238..0000000 Binary files a/mprcontents/38/0d/380d3f03-fe78-42f4-be74-8b773246f993.mxunit and /dev/null differ diff --git a/mprcontents/3b/c7/3bc7a565-94ff-46c7-805c-5654e9454e1a.mxunit b/mprcontents/3b/c7/3bc7a565-94ff-46c7-805c-5654e9454e1a.mxunit deleted file mode 100644 index cac30a1..0000000 Binary files a/mprcontents/3b/c7/3bc7a565-94ff-46c7-805c-5654e9454e1a.mxunit and /dev/null differ diff --git a/mprcontents/3d/27/3d276089-410d-437c-8677-c226e99de37d.mxunit b/mprcontents/3d/27/3d276089-410d-437c-8677-c226e99de37d.mxunit deleted file mode 100644 index 71c2398..0000000 Binary files a/mprcontents/3d/27/3d276089-410d-437c-8677-c226e99de37d.mxunit and /dev/null differ diff --git a/mprcontents/41/19/41199396-2edd-4812-957c-0d3a4df302fa.mxunit b/mprcontents/41/19/41199396-2edd-4812-957c-0d3a4df302fa.mxunit deleted file mode 100644 index 0d5e375..0000000 Binary files a/mprcontents/41/19/41199396-2edd-4812-957c-0d3a4df302fa.mxunit and /dev/null differ diff --git a/mprcontents/41/1b/411be654-7889-49b2-9659-ae4165865b1c.mxunit b/mprcontents/41/1b/411be654-7889-49b2-9659-ae4165865b1c.mxunit deleted file mode 100644 index 53b89cb..0000000 Binary files a/mprcontents/41/1b/411be654-7889-49b2-9659-ae4165865b1c.mxunit and /dev/null differ diff --git a/mprcontents/41/3d/413d63ba-1d48-40ab-b2b9-ba920002647f.mxunit b/mprcontents/41/3d/413d63ba-1d48-40ab-b2b9-ba920002647f.mxunit deleted file mode 100644 index 1c3272b..0000000 Binary files a/mprcontents/41/3d/413d63ba-1d48-40ab-b2b9-ba920002647f.mxunit and /dev/null differ diff --git a/mprcontents/42/69/4269b76e-7532-4ec5-8f87-3104c3ac35f4.mxunit b/mprcontents/42/69/4269b76e-7532-4ec5-8f87-3104c3ac35f4.mxunit deleted file mode 100644 index 25f8ee0..0000000 Binary files a/mprcontents/42/69/4269b76e-7532-4ec5-8f87-3104c3ac35f4.mxunit and /dev/null differ diff --git a/mprcontents/42/91/4291ccae-6b0e-4da4-a7da-412e22be58a0.mxunit b/mprcontents/42/91/4291ccae-6b0e-4da4-a7da-412e22be58a0.mxunit deleted file mode 100644 index 8e21537..0000000 Binary files a/mprcontents/42/91/4291ccae-6b0e-4da4-a7da-412e22be58a0.mxunit and /dev/null differ diff --git a/mprcontents/45/54/4554a69d-94ff-469d-baf1-76e4f5e521c3.mxunit b/mprcontents/45/54/4554a69d-94ff-469d-baf1-76e4f5e521c3.mxunit deleted file mode 100644 index 9a61046..0000000 Binary files a/mprcontents/45/54/4554a69d-94ff-469d-baf1-76e4f5e521c3.mxunit and /dev/null differ diff --git a/mprcontents/45/66/45664afd-3868-49b5-8854-f17716ccb49e.mxunit b/mprcontents/45/66/45664afd-3868-49b5-8854-f17716ccb49e.mxunit deleted file mode 100644 index a4943c0..0000000 Binary files a/mprcontents/45/66/45664afd-3868-49b5-8854-f17716ccb49e.mxunit and /dev/null differ diff --git a/mprcontents/46/4d/464ddf7e-dd1b-4d8e-b7ae-972ca0ba4678.mxunit b/mprcontents/46/4d/464ddf7e-dd1b-4d8e-b7ae-972ca0ba4678.mxunit deleted file mode 100644 index 01b7d4c..0000000 Binary files a/mprcontents/46/4d/464ddf7e-dd1b-4d8e-b7ae-972ca0ba4678.mxunit and /dev/null differ diff --git a/mprcontents/48/b4/48b4121a-6dca-47d8-b9e1-12cc7b615b37.mxunit b/mprcontents/48/b4/48b4121a-6dca-47d8-b9e1-12cc7b615b37.mxunit deleted file mode 100644 index c18e5a2..0000000 Binary files a/mprcontents/48/b4/48b4121a-6dca-47d8-b9e1-12cc7b615b37.mxunit and /dev/null differ diff --git a/mprcontents/4b/ad/4bad8d25-e5aa-44f3-914c-945649a1dad6.mxunit b/mprcontents/4b/ad/4bad8d25-e5aa-44f3-914c-945649a1dad6.mxunit deleted file mode 100644 index e671021..0000000 Binary files a/mprcontents/4b/ad/4bad8d25-e5aa-44f3-914c-945649a1dad6.mxunit and /dev/null differ diff --git a/mprcontents/4e/6f/4e6fbfd9-cb0d-4dc7-abb9-2f7c61a48839.mxunit b/mprcontents/4e/6f/4e6fbfd9-cb0d-4dc7-abb9-2f7c61a48839.mxunit deleted file mode 100644 index bcf4001..0000000 Binary files a/mprcontents/4e/6f/4e6fbfd9-cb0d-4dc7-abb9-2f7c61a48839.mxunit and /dev/null differ diff --git a/mprcontents/4f/6e/4f6e48bf-b665-4910-83a4-ef1370342887.mxunit b/mprcontents/4f/6e/4f6e48bf-b665-4910-83a4-ef1370342887.mxunit deleted file mode 100644 index cb4b7fd..0000000 Binary files a/mprcontents/4f/6e/4f6e48bf-b665-4910-83a4-ef1370342887.mxunit and /dev/null differ diff --git a/mprcontents/50/1e/501e57e5-98d2-4a47-a0e9-85f75d41d80d.mxunit b/mprcontents/50/1e/501e57e5-98d2-4a47-a0e9-85f75d41d80d.mxunit deleted file mode 100644 index 8c6e601..0000000 Binary files a/mprcontents/50/1e/501e57e5-98d2-4a47-a0e9-85f75d41d80d.mxunit and /dev/null differ diff --git a/mprcontents/55/19/55194696-b0e5-46c2-bbe7-dd5a5d95e787.mxunit b/mprcontents/55/19/55194696-b0e5-46c2-bbe7-dd5a5d95e787.mxunit deleted file mode 100644 index ee2a88a..0000000 Binary files a/mprcontents/55/19/55194696-b0e5-46c2-bbe7-dd5a5d95e787.mxunit and /dev/null differ diff --git a/mprcontents/5b/78/5b78ee28-e066-4098-a180-1a3efda60f8a.mxunit b/mprcontents/5b/78/5b78ee28-e066-4098-a180-1a3efda60f8a.mxunit index b4b12b5..13aba98 100644 Binary files a/mprcontents/5b/78/5b78ee28-e066-4098-a180-1a3efda60f8a.mxunit and b/mprcontents/5b/78/5b78ee28-e066-4098-a180-1a3efda60f8a.mxunit differ diff --git a/mprcontents/5b/c5/5bc5ed62-9161-4f75-a6b7-8e989a4ea6ee.mxunit b/mprcontents/5b/c5/5bc5ed62-9161-4f75-a6b7-8e989a4ea6ee.mxunit deleted file mode 100644 index e1092b2..0000000 Binary files a/mprcontents/5b/c5/5bc5ed62-9161-4f75-a6b7-8e989a4ea6ee.mxunit and /dev/null differ diff --git a/mprcontents/5c/f0/5cf090fc-d880-4617-b738-ebc8747fa3f8.mxunit b/mprcontents/5c/f0/5cf090fc-d880-4617-b738-ebc8747fa3f8.mxunit deleted file mode 100644 index cf82825..0000000 Binary files a/mprcontents/5c/f0/5cf090fc-d880-4617-b738-ebc8747fa3f8.mxunit and /dev/null differ diff --git a/mprcontents/5d/96/5d96a675-8b26-4e41-a8b4-3e9e9d21c822.mxunit b/mprcontents/5d/96/5d96a675-8b26-4e41-a8b4-3e9e9d21c822.mxunit deleted file mode 100644 index 872c6eb..0000000 Binary files a/mprcontents/5d/96/5d96a675-8b26-4e41-a8b4-3e9e9d21c822.mxunit and /dev/null differ diff --git a/mprcontents/5f/33/5f33ef3d-ff24-4710-a336-0868cedf0c65.mxunit b/mprcontents/5f/33/5f33ef3d-ff24-4710-a336-0868cedf0c65.mxunit deleted file mode 100644 index 7fc3d24..0000000 Binary files a/mprcontents/5f/33/5f33ef3d-ff24-4710-a336-0868cedf0c65.mxunit and /dev/null differ diff --git a/mprcontents/62/b8/62b889da-ec36-4bcc-b7e8-82ad756aa341.mxunit b/mprcontents/62/b8/62b889da-ec36-4bcc-b7e8-82ad756aa341.mxunit deleted file mode 100644 index 644a285..0000000 Binary files a/mprcontents/62/b8/62b889da-ec36-4bcc-b7e8-82ad756aa341.mxunit and /dev/null differ diff --git a/mprcontents/63/57/6357efb6-66a6-4fbe-a08b-b6a7c2d34f49.mxunit b/mprcontents/63/57/6357efb6-66a6-4fbe-a08b-b6a7c2d34f49.mxunit deleted file mode 100644 index 650be3d..0000000 Binary files a/mprcontents/63/57/6357efb6-66a6-4fbe-a08b-b6a7c2d34f49.mxunit and /dev/null differ diff --git a/mprcontents/64/d6/64d66178-e97d-44d0-8b8d-0b02fa8f4ad7.mxunit b/mprcontents/64/d6/64d66178-e97d-44d0-8b8d-0b02fa8f4ad7.mxunit deleted file mode 100644 index 7d584ab..0000000 Binary files a/mprcontents/64/d6/64d66178-e97d-44d0-8b8d-0b02fa8f4ad7.mxunit and /dev/null differ diff --git a/mprcontents/67/ac/67acd8e9-474c-4eff-b8c2-13bdce431524.mxunit b/mprcontents/67/ac/67acd8e9-474c-4eff-b8c2-13bdce431524.mxunit deleted file mode 100644 index 340eecd..0000000 Binary files a/mprcontents/67/ac/67acd8e9-474c-4eff-b8c2-13bdce431524.mxunit and /dev/null differ diff --git a/mprcontents/69/48/69489ab2-1f36-49a4-98cf-b518e0552dbe.mxunit b/mprcontents/69/48/69489ab2-1f36-49a4-98cf-b518e0552dbe.mxunit deleted file mode 100644 index f350b13..0000000 Binary files a/mprcontents/69/48/69489ab2-1f36-49a4-98cf-b518e0552dbe.mxunit and /dev/null differ diff --git a/mprcontents/6d/ce/6dcea552-d688-4c4f-bf86-d3ebe5a7b4f4.mxunit b/mprcontents/6d/ce/6dcea552-d688-4c4f-bf86-d3ebe5a7b4f4.mxunit deleted file mode 100644 index fd06372..0000000 Binary files a/mprcontents/6d/ce/6dcea552-d688-4c4f-bf86-d3ebe5a7b4f4.mxunit and /dev/null differ diff --git a/mprcontents/70/2c/702c6958-2b3f-4997-a978-65a051b7e7b0.mxunit b/mprcontents/70/2c/702c6958-2b3f-4997-a978-65a051b7e7b0.mxunit deleted file mode 100644 index 3c9bb52..0000000 Binary files a/mprcontents/70/2c/702c6958-2b3f-4997-a978-65a051b7e7b0.mxunit and /dev/null differ diff --git a/mprcontents/72/48/72484a2b-ac9a-4e21-9f39-1655e243bba8.mxunit b/mprcontents/72/48/72484a2b-ac9a-4e21-9f39-1655e243bba8.mxunit deleted file mode 100644 index 420a6d2..0000000 Binary files a/mprcontents/72/48/72484a2b-ac9a-4e21-9f39-1655e243bba8.mxunit and /dev/null differ diff --git a/mprcontents/73/20/7320a1b2-f9ef-4cef-9940-5cf1dcbee25b.mxunit b/mprcontents/73/20/7320a1b2-f9ef-4cef-9940-5cf1dcbee25b.mxunit deleted file mode 100644 index b31564c..0000000 Binary files a/mprcontents/73/20/7320a1b2-f9ef-4cef-9940-5cf1dcbee25b.mxunit and /dev/null differ diff --git a/mprcontents/74/26/7426abea-6dca-4a78-b80f-a81a6faabffb.mxunit b/mprcontents/74/26/7426abea-6dca-4a78-b80f-a81a6faabffb.mxunit deleted file mode 100644 index 4549772..0000000 Binary files a/mprcontents/74/26/7426abea-6dca-4a78-b80f-a81a6faabffb.mxunit and /dev/null differ diff --git a/mprcontents/74/34/7434faab-9b88-4ea2-8310-1901e04e94c0.mxunit b/mprcontents/74/34/7434faab-9b88-4ea2-8310-1901e04e94c0.mxunit deleted file mode 100644 index 58f4553..0000000 Binary files a/mprcontents/74/34/7434faab-9b88-4ea2-8310-1901e04e94c0.mxunit and /dev/null differ diff --git a/mprcontents/74/a6/74a6557f-b52f-4e6e-b6f2-220549b1a029.mxunit b/mprcontents/74/a6/74a6557f-b52f-4e6e-b6f2-220549b1a029.mxunit deleted file mode 100644 index 0ee644a..0000000 Binary files a/mprcontents/74/a6/74a6557f-b52f-4e6e-b6f2-220549b1a029.mxunit and /dev/null differ diff --git a/mprcontents/76/fb/76fbd7b9-db26-4c16-b674-494ab38938a6.mxunit b/mprcontents/76/fb/76fbd7b9-db26-4c16-b674-494ab38938a6.mxunit deleted file mode 100644 index 51d82e8..0000000 Binary files a/mprcontents/76/fb/76fbd7b9-db26-4c16-b674-494ab38938a6.mxunit and /dev/null differ diff --git a/mprcontents/7a/90/7a90a204-9d71-46a2-a681-525a4a73a7fa.mxunit b/mprcontents/7a/90/7a90a204-9d71-46a2-a681-525a4a73a7fa.mxunit deleted file mode 100644 index 65f6d3e..0000000 Binary files a/mprcontents/7a/90/7a90a204-9d71-46a2-a681-525a4a73a7fa.mxunit and /dev/null differ diff --git a/mprcontents/7b/82/7b82f74b-ca76-4b6c-8193-c07b7c859f53.mxunit b/mprcontents/7b/82/7b82f74b-ca76-4b6c-8193-c07b7c859f53.mxunit deleted file mode 100644 index 6b078e8..0000000 Binary files a/mprcontents/7b/82/7b82f74b-ca76-4b6c-8193-c07b7c859f53.mxunit and /dev/null differ diff --git a/mprcontents/7d/cf/7dcfbab9-f1b0-425c-bd68-e8f26d0536f2.mxunit b/mprcontents/7d/cf/7dcfbab9-f1b0-425c-bd68-e8f26d0536f2.mxunit deleted file mode 100644 index 2b710fe..0000000 Binary files a/mprcontents/7d/cf/7dcfbab9-f1b0-425c-bd68-e8f26d0536f2.mxunit and /dev/null differ diff --git a/mprcontents/80/72/8072a112-065f-4090-8437-59ec3aeb3039.mxunit b/mprcontents/80/72/8072a112-065f-4090-8437-59ec3aeb3039.mxunit deleted file mode 100644 index 619c5d7..0000000 Binary files a/mprcontents/80/72/8072a112-065f-4090-8437-59ec3aeb3039.mxunit and /dev/null differ diff --git a/mprcontents/80/de/80de880e-544f-4a2c-9f03-54c477f7b6bc.mxunit b/mprcontents/80/de/80de880e-544f-4a2c-9f03-54c477f7b6bc.mxunit deleted file mode 100644 index 3735b0a..0000000 Binary files a/mprcontents/80/de/80de880e-544f-4a2c-9f03-54c477f7b6bc.mxunit and /dev/null differ diff --git a/mprcontents/81/59/815964be-bcb1-4ae4-946d-1a78fab2a049.mxunit b/mprcontents/81/59/815964be-bcb1-4ae4-946d-1a78fab2a049.mxunit deleted file mode 100644 index 6de80ca..0000000 Binary files a/mprcontents/81/59/815964be-bcb1-4ae4-946d-1a78fab2a049.mxunit and /dev/null differ diff --git a/mprcontents/82/e9/82e92749-f8b2-44fc-bff0-d5cb54c1a5be.mxunit b/mprcontents/82/e9/82e92749-f8b2-44fc-bff0-d5cb54c1a5be.mxunit deleted file mode 100644 index 466af30..0000000 Binary files a/mprcontents/82/e9/82e92749-f8b2-44fc-bff0-d5cb54c1a5be.mxunit and /dev/null differ diff --git a/mprcontents/83/f8/83f86cae-04cf-4177-93a1-cbdb75896b6d.mxunit b/mprcontents/83/f8/83f86cae-04cf-4177-93a1-cbdb75896b6d.mxunit deleted file mode 100644 index a370265..0000000 Binary files a/mprcontents/83/f8/83f86cae-04cf-4177-93a1-cbdb75896b6d.mxunit and /dev/null differ diff --git a/mprcontents/87/07/870735ab-b61c-43a5-8a12-f9f94a19352f.mxunit b/mprcontents/87/07/870735ab-b61c-43a5-8a12-f9f94a19352f.mxunit deleted file mode 100644 index 9c0eba2..0000000 Binary files a/mprcontents/87/07/870735ab-b61c-43a5-8a12-f9f94a19352f.mxunit and /dev/null differ diff --git a/mprcontents/8a/36/8a36d97c-8bd8-4fdc-a74c-c5146c170159.mxunit b/mprcontents/8a/36/8a36d97c-8bd8-4fdc-a74c-c5146c170159.mxunit deleted file mode 100644 index 5c910d3..0000000 Binary files a/mprcontents/8a/36/8a36d97c-8bd8-4fdc-a74c-c5146c170159.mxunit and /dev/null differ diff --git a/mprcontents/8b/28/8b285504-0ea9-4457-81f1-5672867385c6.mxunit b/mprcontents/8b/28/8b285504-0ea9-4457-81f1-5672867385c6.mxunit deleted file mode 100644 index 3462a38..0000000 Binary files a/mprcontents/8b/28/8b285504-0ea9-4457-81f1-5672867385c6.mxunit and /dev/null differ diff --git a/mprcontents/8c/e2/8ce23aaf-4652-42c0-8fd9-5ccf841f2470.mxunit b/mprcontents/8c/e2/8ce23aaf-4652-42c0-8fd9-5ccf841f2470.mxunit deleted file mode 100644 index f931bdc..0000000 Binary files a/mprcontents/8c/e2/8ce23aaf-4652-42c0-8fd9-5ccf841f2470.mxunit and /dev/null differ diff --git a/mprcontents/8d/64/8d64fb90-624d-4517-90fb-5f1006330527.mxunit b/mprcontents/8d/64/8d64fb90-624d-4517-90fb-5f1006330527.mxunit deleted file mode 100644 index 9b1d21d..0000000 Binary files a/mprcontents/8d/64/8d64fb90-624d-4517-90fb-5f1006330527.mxunit and /dev/null differ diff --git a/mprcontents/90/a6/90a6952e-7573-4453-8c35-e852178f6048.mxunit b/mprcontents/90/a6/90a6952e-7573-4453-8c35-e852178f6048.mxunit deleted file mode 100644 index 0c19ee1..0000000 Binary files a/mprcontents/90/a6/90a6952e-7573-4453-8c35-e852178f6048.mxunit and /dev/null differ diff --git a/mprcontents/92/12/9212c43e-4e29-4284-abeb-69b313105a8d.mxunit b/mprcontents/92/12/9212c43e-4e29-4284-abeb-69b313105a8d.mxunit deleted file mode 100644 index c48ae81..0000000 Binary files a/mprcontents/92/12/9212c43e-4e29-4284-abeb-69b313105a8d.mxunit and /dev/null differ diff --git a/mprcontents/92/a1/92a16b06-4320-4bef-b613-4d5e75eaafca.mxunit b/mprcontents/92/a1/92a16b06-4320-4bef-b613-4d5e75eaafca.mxunit deleted file mode 100644 index 0cc23d4..0000000 Binary files a/mprcontents/92/a1/92a16b06-4320-4bef-b613-4d5e75eaafca.mxunit and /dev/null differ diff --git a/mprcontents/93/80/93807c97-df06-4376-b94b-2893da1820a7.mxunit b/mprcontents/93/80/93807c97-df06-4376-b94b-2893da1820a7.mxunit deleted file mode 100644 index 738329c..0000000 Binary files a/mprcontents/93/80/93807c97-df06-4376-b94b-2893da1820a7.mxunit and /dev/null differ diff --git a/mprcontents/98/d0/98d0f7e5-3c77-48bd-848c-f97e78f61ef1.mxunit b/mprcontents/98/d0/98d0f7e5-3c77-48bd-848c-f97e78f61ef1.mxunit deleted file mode 100644 index 282173f..0000000 Binary files a/mprcontents/98/d0/98d0f7e5-3c77-48bd-848c-f97e78f61ef1.mxunit and /dev/null differ diff --git a/mprcontents/99/d2/99d2ef87-63ba-4468-85e6-aea66bb94f41.mxunit b/mprcontents/99/d2/99d2ef87-63ba-4468-85e6-aea66bb94f41.mxunit deleted file mode 100644 index 33bd47a..0000000 Binary files a/mprcontents/99/d2/99d2ef87-63ba-4468-85e6-aea66bb94f41.mxunit and /dev/null differ diff --git a/mprcontents/9b/d2/9bd23e92-f195-433e-b6b4-ae5f16991a5f.mxunit b/mprcontents/9b/d2/9bd23e92-f195-433e-b6b4-ae5f16991a5f.mxunit deleted file mode 100644 index b77080b..0000000 Binary files a/mprcontents/9b/d2/9bd23e92-f195-433e-b6b4-ae5f16991a5f.mxunit and /dev/null differ diff --git a/mprcontents/9c/de/9cde8514-afb6-4c49-8dae-6e930c9e52a1.mxunit b/mprcontents/9c/de/9cde8514-afb6-4c49-8dae-6e930c9e52a1.mxunit index 332b340..851c826 100644 Binary files a/mprcontents/9c/de/9cde8514-afb6-4c49-8dae-6e930c9e52a1.mxunit and b/mprcontents/9c/de/9cde8514-afb6-4c49-8dae-6e930c9e52a1.mxunit differ diff --git a/mprcontents/9e/b2/9eb2ec1c-1169-4520-b73a-1229b2c06893.mxunit b/mprcontents/9e/b2/9eb2ec1c-1169-4520-b73a-1229b2c06893.mxunit deleted file mode 100644 index e9ee9d8..0000000 Binary files a/mprcontents/9e/b2/9eb2ec1c-1169-4520-b73a-1229b2c06893.mxunit and /dev/null differ diff --git a/mprcontents/9f/9c/9f9c9b78-c67c-4283-8d6f-62dcf933276a.mxunit b/mprcontents/9f/9c/9f9c9b78-c67c-4283-8d6f-62dcf933276a.mxunit index c361c06..45db123 100644 Binary files a/mprcontents/9f/9c/9f9c9b78-c67c-4283-8d6f-62dcf933276a.mxunit and b/mprcontents/9f/9c/9f9c9b78-c67c-4283-8d6f-62dcf933276a.mxunit differ diff --git a/mprcontents/9f/c0/9fc0c7d0-2733-40fe-b6ce-b8e0a26061fb.mxunit b/mprcontents/9f/c0/9fc0c7d0-2733-40fe-b6ce-b8e0a26061fb.mxunit deleted file mode 100644 index 444ec80..0000000 Binary files a/mprcontents/9f/c0/9fc0c7d0-2733-40fe-b6ce-b8e0a26061fb.mxunit and /dev/null differ diff --git a/mprcontents/a0/85/a0851786-be34-44ab-9850-e330885a0459.mxunit b/mprcontents/a0/85/a0851786-be34-44ab-9850-e330885a0459.mxunit deleted file mode 100644 index 7f713d7..0000000 Binary files a/mprcontents/a0/85/a0851786-be34-44ab-9850-e330885a0459.mxunit and /dev/null differ diff --git a/mprcontents/a3/30/a330388c-fa3b-4513-ab2a-c2e811833b7f.mxunit b/mprcontents/a3/30/a330388c-fa3b-4513-ab2a-c2e811833b7f.mxunit deleted file mode 100644 index 25cd078..0000000 Binary files a/mprcontents/a3/30/a330388c-fa3b-4513-ab2a-c2e811833b7f.mxunit and /dev/null differ diff --git a/mprcontents/a3/c6/a3c6f007-8a21-452b-9170-ab11fd5e27b8.mxunit b/mprcontents/a3/c6/a3c6f007-8a21-452b-9170-ab11fd5e27b8.mxunit deleted file mode 100644 index 0b42659..0000000 Binary files a/mprcontents/a3/c6/a3c6f007-8a21-452b-9170-ab11fd5e27b8.mxunit and /dev/null differ diff --git a/mprcontents/a4/e3/a4e3f1ec-8f10-43ed-b33c-9fe2a30a490f.mxunit b/mprcontents/a4/e3/a4e3f1ec-8f10-43ed-b33c-9fe2a30a490f.mxunit deleted file mode 100644 index de1a6be..0000000 Binary files a/mprcontents/a4/e3/a4e3f1ec-8f10-43ed-b33c-9fe2a30a490f.mxunit and /dev/null differ diff --git a/mprcontents/aa/3c/aa3cc804-dc1c-4fa0-ad46-e726c21fe3da.mxunit b/mprcontents/aa/3c/aa3cc804-dc1c-4fa0-ad46-e726c21fe3da.mxunit deleted file mode 100644 index b480102..0000000 Binary files a/mprcontents/aa/3c/aa3cc804-dc1c-4fa0-ad46-e726c21fe3da.mxunit and /dev/null differ diff --git a/mprcontents/ab/d2/abd2bd2b-d3c2-45a0-a71a-22be0c92e811.mxunit b/mprcontents/ab/d2/abd2bd2b-d3c2-45a0-a71a-22be0c92e811.mxunit deleted file mode 100644 index dbde4b3..0000000 Binary files a/mprcontents/ab/d2/abd2bd2b-d3c2-45a0-a71a-22be0c92e811.mxunit and /dev/null differ diff --git a/mprcontents/ac/75/ac754e40-2cda-4bdd-95a4-1def12d18dfd.mxunit b/mprcontents/ac/75/ac754e40-2cda-4bdd-95a4-1def12d18dfd.mxunit deleted file mode 100644 index 3e1114c..0000000 Binary files a/mprcontents/ac/75/ac754e40-2cda-4bdd-95a4-1def12d18dfd.mxunit and /dev/null differ diff --git a/mprcontents/b0/20/b02094ef-defa-402f-ac93-59effd58ae2b.mxunit b/mprcontents/b0/20/b02094ef-defa-402f-ac93-59effd58ae2b.mxunit deleted file mode 100644 index c95db47..0000000 Binary files a/mprcontents/b0/20/b02094ef-defa-402f-ac93-59effd58ae2b.mxunit and /dev/null differ diff --git a/mprcontents/b1/ae/b1ae64e0-91f8-4ab2-bf04-cffe11596808.mxunit b/mprcontents/b1/ae/b1ae64e0-91f8-4ab2-bf04-cffe11596808.mxunit deleted file mode 100644 index 8f74d1d..0000000 Binary files a/mprcontents/b1/ae/b1ae64e0-91f8-4ab2-bf04-cffe11596808.mxunit and /dev/null differ diff --git a/mprcontents/b3/fb/b3fbd897-33ae-4056-b2ff-4493b3f7c31d.mxunit b/mprcontents/b3/fb/b3fbd897-33ae-4056-b2ff-4493b3f7c31d.mxunit deleted file mode 100644 index 6657f44..0000000 Binary files a/mprcontents/b3/fb/b3fbd897-33ae-4056-b2ff-4493b3f7c31d.mxunit and /dev/null differ diff --git a/mprcontents/b4/bc/b4bcdd4c-2e90-4adf-a6b3-68e3bcf097f9.mxunit b/mprcontents/b4/bc/b4bcdd4c-2e90-4adf-a6b3-68e3bcf097f9.mxunit deleted file mode 100644 index 45e9b9e..0000000 Binary files a/mprcontents/b4/bc/b4bcdd4c-2e90-4adf-a6b3-68e3bcf097f9.mxunit and /dev/null differ diff --git a/mprcontents/b7/de/b7dec694-362f-48ae-8fa5-c64e0fc507d8.mxunit b/mprcontents/b7/de/b7dec694-362f-48ae-8fa5-c64e0fc507d8.mxunit deleted file mode 100644 index 3124b29..0000000 Binary files a/mprcontents/b7/de/b7dec694-362f-48ae-8fa5-c64e0fc507d8.mxunit and /dev/null differ diff --git a/mprcontents/b9/02/b90235b9-1e35-492e-8f46-07c792c3a6ce.mxunit b/mprcontents/b9/02/b90235b9-1e35-492e-8f46-07c792c3a6ce.mxunit deleted file mode 100644 index c033e3d..0000000 Binary files a/mprcontents/b9/02/b90235b9-1e35-492e-8f46-07c792c3a6ce.mxunit and /dev/null differ diff --git a/mprcontents/ba/b6/bab64d45-15b1-4fc7-b40b-861297a9b856.mxunit b/mprcontents/ba/b6/bab64d45-15b1-4fc7-b40b-861297a9b856.mxunit deleted file mode 100644 index c120071..0000000 Binary files a/mprcontents/ba/b6/bab64d45-15b1-4fc7-b40b-861297a9b856.mxunit and /dev/null differ diff --git a/mprcontents/bc/c7/bcc73544-a623-4ef4-b11e-a8356ee45b7a.mxunit b/mprcontents/bc/c7/bcc73544-a623-4ef4-b11e-a8356ee45b7a.mxunit deleted file mode 100644 index 84bd1d7..0000000 Binary files a/mprcontents/bc/c7/bcc73544-a623-4ef4-b11e-a8356ee45b7a.mxunit and /dev/null differ diff --git a/mprcontents/c3/2e/c32ee613-9245-4a1c-823c-04deaab7eca0.mxunit b/mprcontents/c3/2e/c32ee613-9245-4a1c-823c-04deaab7eca0.mxunit deleted file mode 100644 index e2edaa2..0000000 Binary files a/mprcontents/c3/2e/c32ee613-9245-4a1c-823c-04deaab7eca0.mxunit and /dev/null differ diff --git a/mprcontents/c4/2f/c42f512f-fc1f-461c-94df-fb58a2c39e83.mxunit b/mprcontents/c4/2f/c42f512f-fc1f-461c-94df-fb58a2c39e83.mxunit deleted file mode 100644 index 86ee522..0000000 Binary files a/mprcontents/c4/2f/c42f512f-fc1f-461c-94df-fb58a2c39e83.mxunit and /dev/null differ diff --git a/mprcontents/c5/a1/c5a1acc8-f0c3-4492-8748-615dfc5f1089.mxunit b/mprcontents/c5/a1/c5a1acc8-f0c3-4492-8748-615dfc5f1089.mxunit deleted file mode 100644 index 9b60fa7..0000000 Binary files a/mprcontents/c5/a1/c5a1acc8-f0c3-4492-8748-615dfc5f1089.mxunit and /dev/null differ diff --git a/mprcontents/ce/24/ce24ce2d-531f-4cc6-89f3-b8788a6308d0.mxunit b/mprcontents/ce/24/ce24ce2d-531f-4cc6-89f3-b8788a6308d0.mxunit deleted file mode 100644 index 63da737..0000000 Binary files a/mprcontents/ce/24/ce24ce2d-531f-4cc6-89f3-b8788a6308d0.mxunit and /dev/null differ diff --git a/mprcontents/ce/49/ce4916a7-4aa0-4a65-b5d4-cbb83d0ca02c.mxunit b/mprcontents/ce/49/ce4916a7-4aa0-4a65-b5d4-cbb83d0ca02c.mxunit deleted file mode 100644 index 0cd764f..0000000 Binary files a/mprcontents/ce/49/ce4916a7-4aa0-4a65-b5d4-cbb83d0ca02c.mxunit and /dev/null differ diff --git a/mprcontents/d0/de/d0de4dd0-4e0a-404c-a4d0-6728e4b7da59.mxunit b/mprcontents/d0/de/d0de4dd0-4e0a-404c-a4d0-6728e4b7da59.mxunit deleted file mode 100644 index 94afa7f..0000000 Binary files a/mprcontents/d0/de/d0de4dd0-4e0a-404c-a4d0-6728e4b7da59.mxunit and /dev/null differ diff --git a/mprcontents/d3/05/d3055cec-d54d-4d26-8fa0-236c6653e775.mxunit b/mprcontents/d3/05/d3055cec-d54d-4d26-8fa0-236c6653e775.mxunit deleted file mode 100644 index 591679d..0000000 Binary files a/mprcontents/d3/05/d3055cec-d54d-4d26-8fa0-236c6653e775.mxunit and /dev/null differ diff --git a/mprcontents/d5/17/d51747fb-2f79-427b-9111-4f9146a8c321.mxunit b/mprcontents/d5/17/d51747fb-2f79-427b-9111-4f9146a8c321.mxunit deleted file mode 100644 index bf5e3af..0000000 Binary files a/mprcontents/d5/17/d51747fb-2f79-427b-9111-4f9146a8c321.mxunit and /dev/null differ diff --git a/mprcontents/d6/80/d6806243-190a-476f-8016-89303a425800.mxunit b/mprcontents/d6/80/d6806243-190a-476f-8016-89303a425800.mxunit deleted file mode 100644 index d49e00c..0000000 Binary files a/mprcontents/d6/80/d6806243-190a-476f-8016-89303a425800.mxunit and /dev/null differ diff --git a/mprcontents/d8/3d/d83dcc11-b9f3-4ea3-932a-82bb6c9e6ca3.mxunit b/mprcontents/d8/3d/d83dcc11-b9f3-4ea3-932a-82bb6c9e6ca3.mxunit deleted file mode 100644 index 156d1f7..0000000 Binary files a/mprcontents/d8/3d/d83dcc11-b9f3-4ea3-932a-82bb6c9e6ca3.mxunit and /dev/null differ diff --git a/mprcontents/d9/ae/d9ae85dd-d8ec-419f-9848-185c6a0b5397.mxunit b/mprcontents/d9/ae/d9ae85dd-d8ec-419f-9848-185c6a0b5397.mxunit deleted file mode 100644 index 0d132ce..0000000 Binary files a/mprcontents/d9/ae/d9ae85dd-d8ec-419f-9848-185c6a0b5397.mxunit and /dev/null differ diff --git a/mprcontents/de/50/de50da93-2589-4cad-9130-261931c71c1c.mxunit b/mprcontents/de/50/de50da93-2589-4cad-9130-261931c71c1c.mxunit deleted file mode 100644 index 23d607f..0000000 Binary files a/mprcontents/de/50/de50da93-2589-4cad-9130-261931c71c1c.mxunit and /dev/null differ diff --git a/mprcontents/e4/20/e420ec5a-aabc-464b-8adf-3fc2c2c9e323.mxunit b/mprcontents/e4/20/e420ec5a-aabc-464b-8adf-3fc2c2c9e323.mxunit deleted file mode 100644 index a795c1b..0000000 Binary files a/mprcontents/e4/20/e420ec5a-aabc-464b-8adf-3fc2c2c9e323.mxunit and /dev/null differ diff --git a/mprcontents/e5/55/e555196b-c0ca-497e-b581-bf190d744b58.mxunit b/mprcontents/e5/55/e555196b-c0ca-497e-b581-bf190d744b58.mxunit deleted file mode 100644 index 477bb91..0000000 Binary files a/mprcontents/e5/55/e555196b-c0ca-497e-b581-bf190d744b58.mxunit and /dev/null differ diff --git a/mprcontents/ea/11/ea11f719-67e4-4944-873f-174f182338c4.mxunit b/mprcontents/ea/11/ea11f719-67e4-4944-873f-174f182338c4.mxunit new file mode 100644 index 0000000..2d822a8 Binary files /dev/null and b/mprcontents/ea/11/ea11f719-67e4-4944-873f-174f182338c4.mxunit differ diff --git a/mprcontents/ea/14/ea145d49-84cb-4328-a50b-b8d8b35317ab.mxunit b/mprcontents/ea/14/ea145d49-84cb-4328-a50b-b8d8b35317ab.mxunit deleted file mode 100644 index 534fe28..0000000 Binary files a/mprcontents/ea/14/ea145d49-84cb-4328-a50b-b8d8b35317ab.mxunit and /dev/null differ diff --git a/mprcontents/eb/0c/eb0c3cf5-4c0b-4cd9-9642-0106c40e6cb1.mxunit b/mprcontents/eb/0c/eb0c3cf5-4c0b-4cd9-9642-0106c40e6cb1.mxunit deleted file mode 100644 index a24667f..0000000 Binary files a/mprcontents/eb/0c/eb0c3cf5-4c0b-4cd9-9642-0106c40e6cb1.mxunit and /dev/null differ diff --git a/mprcontents/ec/25/ec255d6f-b9a8-4bb2-a312-c9d1d07dbd07.mxunit b/mprcontents/ec/25/ec255d6f-b9a8-4bb2-a312-c9d1d07dbd07.mxunit deleted file mode 100644 index d7fe503..0000000 Binary files a/mprcontents/ec/25/ec255d6f-b9a8-4bb2-a312-c9d1d07dbd07.mxunit and /dev/null differ diff --git a/mprcontents/ed/97/ed97f4c1-6f14-4e8c-b9a5-84410d40aa31.mxunit b/mprcontents/ed/97/ed97f4c1-6f14-4e8c-b9a5-84410d40aa31.mxunit deleted file mode 100644 index 4afbe85..0000000 Binary files a/mprcontents/ed/97/ed97f4c1-6f14-4e8c-b9a5-84410d40aa31.mxunit and /dev/null differ diff --git a/mprcontents/ed/c0/edc0beb2-d305-40a5-80db-696738eaf052.mxunit b/mprcontents/ed/c0/edc0beb2-d305-40a5-80db-696738eaf052.mxunit deleted file mode 100644 index fca82b5..0000000 Binary files a/mprcontents/ed/c0/edc0beb2-d305-40a5-80db-696738eaf052.mxunit and /dev/null differ diff --git a/mprcontents/ee/3d/ee3dc1fc-fa9d-469f-ab56-1c763276eba2.mxunit b/mprcontents/ee/3d/ee3dc1fc-fa9d-469f-ab56-1c763276eba2.mxunit deleted file mode 100644 index 96ce747..0000000 Binary files a/mprcontents/ee/3d/ee3dc1fc-fa9d-469f-ab56-1c763276eba2.mxunit and /dev/null differ diff --git a/mprcontents/ef/28/ef288b8a-0371-48c4-9db4-8ac2f0ae39d4.mxunit b/mprcontents/ef/28/ef288b8a-0371-48c4-9db4-8ac2f0ae39d4.mxunit deleted file mode 100644 index 6a3991c..0000000 Binary files a/mprcontents/ef/28/ef288b8a-0371-48c4-9db4-8ac2f0ae39d4.mxunit and /dev/null differ diff --git a/mprcontents/ef/4a/ef4ae36f-1485-4ea1-9f7e-26ec5835b911.mxunit b/mprcontents/ef/4a/ef4ae36f-1485-4ea1-9f7e-26ec5835b911.mxunit deleted file mode 100644 index a956640..0000000 Binary files a/mprcontents/ef/4a/ef4ae36f-1485-4ea1-9f7e-26ec5835b911.mxunit and /dev/null differ diff --git a/mprcontents/f4/84/f4841ac1-f038-4d61-be48-28b4c9b859fd.mxunit b/mprcontents/f4/84/f4841ac1-f038-4d61-be48-28b4c9b859fd.mxunit deleted file mode 100644 index 8c06215..0000000 Binary files a/mprcontents/f4/84/f4841ac1-f038-4d61-be48-28b4c9b859fd.mxunit and /dev/null differ diff --git a/mprcontents/f6/16/f6164553-18d9-4c6f-bb39-4cecb3f26c80.mxunit b/mprcontents/f6/16/f6164553-18d9-4c6f-bb39-4cecb3f26c80.mxunit deleted file mode 100644 index 5a31661..0000000 Binary files a/mprcontents/f6/16/f6164553-18d9-4c6f-bb39-4cecb3f26c80.mxunit and /dev/null differ diff --git a/mprcontents/f8/5a/f85abab2-8261-4e09-b8f2-1cd4d9c697c6.mxunit b/mprcontents/f8/5a/f85abab2-8261-4e09-b8f2-1cd4d9c697c6.mxunit deleted file mode 100644 index d50c6ac..0000000 Binary files a/mprcontents/f8/5a/f85abab2-8261-4e09-b8f2-1cd4d9c697c6.mxunit and /dev/null differ diff --git a/mprcontents/fa/39/fa398d01-80e6-47c8-8ad3-8d2f0576793a.mxunit b/mprcontents/fa/39/fa398d01-80e6-47c8-8ad3-8d2f0576793a.mxunit deleted file mode 100644 index f4244d3..0000000 Binary files a/mprcontents/fa/39/fa398d01-80e6-47c8-8ad3-8d2f0576793a.mxunit and /dev/null differ diff --git a/mprcontents/fd/d6/fdd60a1a-e6b2-4053-9be1-f1d43eade39e.mxunit b/mprcontents/fd/d6/fdd60a1a-e6b2-4053-9be1-f1d43eade39e.mxunit deleted file mode 100644 index 2a2f04c..0000000 Binary files a/mprcontents/fd/d6/fdd60a1a-e6b2-4053-9be1-f1d43eade39e.mxunit and /dev/null differ diff --git a/src/test/java/com/mendix/oqlmodule/test/MxCSVWriterTest.java b/src/test/java/com/mendix/oqlmodule/test/MxCSVWriterTest.java index 24dce7f..2bb4ba9 100644 --- a/src/test/java/com/mendix/oqlmodule/test/MxCSVWriterTest.java +++ b/src/test/java/com/mendix/oqlmodule/test/MxCSVWriterTest.java @@ -25,7 +25,8 @@ public void setup() { defaultWriter = new MxCSVWriter(new OutputStreamWriter(output), ',', Optional.of('"'), - Optional.of('\\')); + Optional.of('\\'), + true); } String writeAndGetResult(MxCSVWriter writer, List> columns) throws IOException { @@ -66,7 +67,8 @@ public void testEscapedSpecialCharacters() throws IOException { MxCSVWriter writerWithoutQuote = new MxCSVWriter(new OutputStreamWriter(output), ',', Optional.empty(), - Optional.of('\\')); + Optional.of('\\'), + true); List> toWrite = List.of(List.of(",", "\r\n"), List.of("\\", "\"")); diff --git a/themesource/communitycommons/native/design-properties.json b/themesource/communitycommons/native/design-properties.json deleted file mode 100644 index 49d1a20..0000000 --- a/themesource/communitycommons/native/design-properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - -} diff --git a/themesource/communitycommons/native/main.js b/themesource/communitycommons/native/main.js deleted file mode 100644 index b611ae1..0000000 --- a/themesource/communitycommons/native/main.js +++ /dev/null @@ -1,2 +0,0 @@ -import * as variables from "../../../theme/native/custom-variables"; - diff --git a/themesource/communitycommons/settings.json b/themesource/communitycommons/settings.json deleted file mode 100644 index 49d1a20..0000000 --- a/themesource/communitycommons/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - -} diff --git a/themesource/communitycommons/web/design-properties.json b/themesource/communitycommons/web/design-properties.json deleted file mode 100644 index 49d1a20..0000000 --- a/themesource/communitycommons/web/design-properties.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - -} diff --git a/themesource/communitycommons/web/main.scss b/themesource/communitycommons/web/main.scss deleted file mode 100644 index 122370f..0000000 --- a/themesource/communitycommons/web/main.scss +++ /dev/null @@ -1,2 +0,0 @@ -@import '../../../theme/web/custom-variables'; - diff --git a/widgets/com.mendix.widget.web.Markdown.mpk b/widgets/com.mendix.widget.web.Markdown.mpk new file mode 100644 index 0000000..2a80ff6 Binary files /dev/null and b/widgets/com.mendix.widget.web.Markdown.mpk differ diff --git a/widgets/mendix.CsvAsTable.mpk b/widgets/mendix.CsvAsTable.mpk deleted file mode 100644 index b7b1178..0000000 Binary files a/widgets/mendix.CsvAsTable.mpk and /dev/null differ