text:
/* Generated by camel build tools - do NOT edit this file! */
package org.apache.camel.component.debezium;

import java.util.Map;

import org.apache.camel.CamelContext;
import org.apache.camel.spi.ExtendedPropertyConfigurerGetter;
import org.apache.camel.spi.PropertyConfigurerGetter;
import org.apache.camel.spi.ConfigurerStrategy;
import org.apache.camel.spi.GeneratedPropertyConfigurer;
import org.apache.camel.util.CaseInsensitiveMap;
import org.apache.camel.support.component.PropertyConfigurerSupport;

/**
 * Generated by camel build tools - do NOT edit this file!
 */
@SuppressWarnings("unchecked")
public class DebeziumSqlserverComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer, PropertyConfigurerGetter {

    private org.apache.camel.component.debezium.configuration.SqlServerConnectorEmbeddedDebeziumConfiguration getOrCreateConfiguration(DebeziumSqlserverComponent target) {
        if (target.getConfiguration() == null) {
            target.setConfiguration(new org.apache.camel.component.debezium.configuration.SqlServerConnectorEmbeddedDebeziumConfiguration());
        }
        return target.getConfiguration();
    }

    @Override
    public boolean configure(CamelContext camelContext, Object obj, String name, Object value, boolean ignoreCase) {
        DebeziumSqlserverComponent target = (DebeziumSqlserverComponent) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "additionalproperties":
        case "additionalProperties": getOrCreateConfiguration(target).setAdditionalProperties(property(camelContext, java.util.Map.class, value)); return true;
        case "autowiredenabled":
        case "autowiredEnabled": target.setAutowiredEnabled(property(camelContext, boolean.class, value)); return true;
        case "binaryhandlingmode":
        case "binaryHandlingMode": getOrCreateConfiguration(target).setBinaryHandlingMode(property(camelContext, java.lang.String.class, value)); return true;
        case "bridgeerrorhandler":
        case "bridgeErrorHandler": target.setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true;
        case "columnblacklist":
        case "columnBlacklist": getOrCreateConfiguration(target).setColumnBlacklist(property(camelContext, java.lang.String.class, value)); return true;
        case "columnexcludelist":
        case "columnExcludeList": getOrCreateConfiguration(target).setColumnExcludeList(property(camelContext, java.lang.String.class, value)); return true;
        case "columnincludelist":
        case "columnIncludeList": getOrCreateConfiguration(target).setColumnIncludeList(property(camelContext, java.lang.String.class, value)); return true;
        case "columnpropagatesourcetype":
        case "columnPropagateSourceType": getOrCreateConfiguration(target).setColumnPropagateSourceType(property(camelContext, java.lang.String.class, value)); return true;
        case "columnwhitelist":
        case "columnWhitelist": getOrCreateConfiguration(target).setColumnWhitelist(property(camelContext, java.lang.String.class, value)); return true;
        case "configuration": target.setConfiguration(property(camelContext, org.apache.camel.component.debezium.configuration.SqlServerConnectorEmbeddedDebeziumConfiguration.class, value)); return true;
        case "converters": getOrCreateConfiguration(target).setConverters(property(camelContext, java.lang.String.class, value)); return true;
        case "databasedbname":
        case "databaseDbname": getOrCreateConfiguration(target).setDatabaseDbname(property(camelContext, java.lang.String.class, value)); return true;
        case "databasehistory":
        case "databaseHistory": getOrCreateConfiguration(target).setDatabaseHistory(property(camelContext, java.lang.String.class, value)); return true;
        case "databasehistoryfilefilename":
        case "databaseHistoryFileFilename": getOrCreateConfiguration(target).setDatabaseHistoryFileFilename(property(camelContext, java.lang.String.class, value)); return true;
        case "databasehistorykafkabootstrapservers":
        case "databaseHistoryKafkaBootstrapServers": getOrCreateConfiguration(target).setDatabaseHistoryKafkaBootstrapServers(property(camelContext, java.lang.String.class, value)); return true;
        case "databasehistorykafkarecoveryattempts":
        case "databaseHistoryKafkaRecoveryAttempts": getOrCreateConfiguration(target).setDatabaseHistoryKafkaRecoveryAttempts(property(camelContext, int.class, value)); return true;
        case "databasehistorykafkarecoverypollintervalms":
        case "databaseHistoryKafkaRecoveryPollIntervalMs": getOrCreateConfiguration(target).setDatabaseHistoryKafkaRecoveryPollIntervalMs(property(camelContext, int.class, value)); return true;
        case "databasehistorykafkatopic":
        case "databaseHistoryKafkaTopic": getOrCreateConfiguration(target).setDatabaseHistoryKafkaTopic(property(camelContext, java.lang.String.class, value)); return true;
        case "databasehistoryskipunparseableddl":
        case "databaseHistorySkipUnparseableDdl": getOrCreateConfiguration(target).setDatabaseHistorySkipUnparseableDdl(property(camelContext, boolean.class, value)); return true;
        case "databasehistorystoreonlycapturedtablesddl":
        case "databaseHistoryStoreOnlyCapturedTablesDdl": getOrCreateConfiguration(target).setDatabaseHistoryStoreOnlyCapturedTablesDdl(property(camelContext, boolean.class, value)); return true;
        case "databasehistorystoreonlymonitoredtablesddl":
        case "databaseHistoryStoreOnlyMonitoredTablesDdl": getOrCreateConfiguration(target).setDatabaseHistoryStoreOnlyMonitoredTablesDdl(property(camelContext, boolean.class, value)); return true;
        case "databasehostname":
        case "databaseHostname": getOrCreateConfiguration(target).setDatabaseHostname(property(camelContext, java.lang.String.class, value)); return true;
        case "databaseinstance":
        case "databaseInstance": getOrCreateConfiguration(target).setDatabaseInstance(property(camelContext, java.lang.String.class, value)); return true;
        case "databasenames":
        case "databaseNames": getOrCreateConfiguration(target).setDatabaseNames(property(camelContext, java.lang.String.class, value)); return true;
        case "databasepassword":
        case "databasePassword": getOrCreateConfiguration(target).setDatabasePassword(property(camelContext, java.lang.String.class, value)); return true;
        case "databaseport":
        case "databasePort": getOrCreateConfiguration(target).setDatabasePort(property(camelContext, int.class, value)); return true;
        case "databaseservername":
        case "databaseServerName": getOrCreateConfiguration(target).setDatabaseServerName(property(camelContext, java.lang.String.class, value)); return true;
        case "databaseuser":
        case "databaseUser": getOrCreateConfiguration(target).setDatabaseUser(property(camelContext, java.lang.String.class, value)); return true;
        case "datatypepropagatesourcetype":
        case "datatypePropagateSourceType": getOrCreateConfiguration(target).setDatatypePropagateSourceType(property(camelContext, java.lang.String.class, value)); return true;
        case "decimalhandlingmode":
        case "decimalHandlingMode": getOrCreateConfiguration(target).setDecimalHandlingMode(property(camelContext, java.lang.String.class, value)); return true;
        case "eventprocessingfailurehandlingmode":
        case "eventProcessingFailureHandlingMode": getOrCreateConfiguration(target).setEventProcessingFailureHandlingMode(property(camelContext, java.lang.String.class, value)); return true;
        case "heartbeatintervalms":
        case "heartbeatIntervalMs": getOrCreateConfiguration(target).setHeartbeatIntervalMs(property(camelContext, int.class, value)); return true;
        case "heartbeattopicsprefix":
        case "heartbeatTopicsPrefix": getOrCreateConfiguration(target).setHeartbeatTopicsPrefix(property(camelContext, java.lang.String.class, value)); return true;
        case "includeschemachanges":
        case "includeSchemaChanges": getOrCreateConfiguration(target).setIncludeSchemaChanges(property(camelContext, boolean.class, value)); return true;
        case "internalkeyconverter":
        case "internalKeyConverter": getOrCreateConfiguration(target).setInternalKeyConverter(property(camelContext, java.lang.String.class, value)); return true;
        case "internalvalueconverter":
        case "internalValueConverter": getOrCreateConfiguration(target).setInternalValueConverter(property(camelContext, java.lang.String.class, value)); return true;
        case "maxbatchsize":
        case "maxBatchSize": getOrCreateConfiguration(target).setMaxBatchSize(property(camelContext, int.class, value)); return true;
        case "maxiterationtransactions":
        case "maxIterationTransactions": getOrCreateConfiguration(target).setMaxIterationTransactions(property(camelContext, int.class, value)); return true;
        case "maxqueuesize":
        case "maxQueueSize": getOrCreateConfiguration(target).setMaxQueueSize(property(camelContext, int.class, value)); return true;
        case "maxqueuesizeinbytes":
        case "maxQueueSizeInBytes": getOrCreateConfiguration(target).setMaxQueueSizeInBytes(property(camelContext, long.class, value)); return true;
        case "messagekeycolumns":
        case "messageKeyColumns": getOrCreateConfiguration(target).setMessageKeyColumns(property(camelContext, java.lang.String.class, value)); return true;
        case "offsetcommitpolicy":
        case "offsetCommitPolicy": getOrCreateConfiguration(target).setOffsetCommitPolicy(property(camelContext, java.lang.String.class, value)); return true;
        case "offsetcommittimeoutms":
        case "offsetCommitTimeoutMs": getOrCreateConfiguration(target).setOffsetCommitTimeoutMs(property(camelContext, java.time.Duration.class, value).toMillis()); return true;
        case "offsetflushintervalms":
        case "offsetFlushIntervalMs": getOrCreateConfiguration(target).setOffsetFlushIntervalMs(property(camelContext, java.time.Duration.class, value).toMillis()); return true;
        case "offsetstorage":
        case "offsetStorage": getOrCreateConfiguration(target).setOffsetStorage(property(camelContext, java.lang.String.class, value)); return true;
        case "offsetstoragefilename":
        case "offsetStorageFileName": getOrCreateConfiguration(target).setOffsetStorageFileName(property(camelContext, java.lang.String.class, value)); return true;
        case "offsetstoragepartitions":
        case "offsetStoragePartitions": getOrCreateConfiguration(target).setOffsetStoragePartitions(property(camelContext, int.class, value)); return true;
        case "offsetstoragereplicationfactor":
        case "offsetStorageReplicationFactor": getOrCreateConfiguration(target).setOffsetStorageReplicationFactor(property(camelContext, int.class, value)); return true;
        case "offsetstoragetopic":
        case "offsetStorageTopic": getOrCreateConfiguration(target).setOffsetStorageTopic(property(camelContext, java.lang.String.class, value)); return true;
        case "pollintervalms":
        case "pollIntervalMs": getOrCreateConfiguration(target).setPollIntervalMs(property(camelContext, java.time.Duration.class, value).toMillis()); return true;
        case "providetransactionmetadata":
        case "provideTransactionMetadata": getOrCreateConfiguration(target).setProvideTransactionMetadata(property(camelContext, boolean.class, value)); return true;
        case "queryfetchsize":
        case "queryFetchSize": getOrCreateConfiguration(target).setQueryFetchSize(property(camelContext, int.class, value)); return true;
        case "retriablerestartconnectorwaitms":
        case "retriableRestartConnectorWaitMs": getOrCreateConfiguration(target).setRetriableRestartConnectorWaitMs(property(camelContext, java.time.Duration.class, value).toMillis()); return true;
        case "sanitizefieldnames":
        case "sanitizeFieldNames": getOrCreateConfiguration(target).setSanitizeFieldNames(property(camelContext, boolean.class, value)); return true;
        case "signaldatacollection":
        case "signalDataCollection": getOrCreateConfiguration(target).setSignalDataCollection(property(camelContext, java.lang.String.class, value)); return true;
        case "skippedoperations":
        case "skippedOperations": getOrCreateConfiguration(target).setSkippedOperations(property(camelContext, java.lang.String.class, value)); return true;
        case "snapshotdelayms":
        case "snapshotDelayMs": getOrCreateConfiguration(target).setSnapshotDelayMs(property(camelContext, java.time.Duration.class, value).toMillis()); return true;
        case "snapshotfetchsize":
        case "snapshotFetchSize": getOrCreateConfiguration(target).setSnapshotFetchSize(property(camelContext, int.class, value)); return true;
        case "snapshotincludecollectionlist":
        case "snapshotIncludeCollectionList": getOrCreateConfiguration(target).setSnapshotIncludeCollectionList(property(camelContext, java.lang.String.class, value)); return true;
        case "snapshotisolationmode":
        case "snapshotIsolationMode": getOrCreateConfiguration(target).setSnapshotIsolationMode(property(camelContext, java.lang.String.class, value)); return true;
        case "snapshotlocktimeoutms":
        case "snapshotLockTimeoutMs": getOrCreateConfiguration(target).setSnapshotLockTimeoutMs(property(camelContext, java.time.Duration.class, value).toMillis()); return true;
        case "snapshotmaxthreads":
        case "snapshotMaxThreads": getOrCreateConfiguration(target).setSnapshotMaxThreads(property(camelContext, int.class, value)); return true;
        case "snapshotmode":
        case "snapshotMode": getOrCreateConfiguration(target).setSnapshotMode(property(camelContext, java.lang.String.class, value)); return true;
        case "snapshotselectstatementoverrides":
        case "snapshotSelectStatementOverrides": getOrCreateConfiguration(target).setSnapshotSelectStatementOverrides(property(camelContext, java.lang.String.class, value)); return true;
        case "sourcestructversion":
        case "sourceStructVersion": getOrCreateConfiguration(target).setSourceStructVersion(property(camelContext, java.lang.String.class, value)); return true;
        case "sourcetimestampmode":
        case "sourceTimestampMode": getOrCreateConfiguration(target).setSourceTimestampMode(property(camelContext, java.lang.String.class, value)); return true;
        case "tableblacklist":
        case "tableBlacklist": getOrCreateConfiguration(target).setTableBlacklist(property(camelContext, java.lang.String.class, value)); return true;
        case "tableexcludelist":
        case "tableExcludeList": getOrCreateConfiguration(target).setTableExcludeList(property(camelContext, java.lang.String.class, value)); return true;
        case "tableignorebuiltin":
        case "tableIgnoreBuiltin": getOrCreateConfiguration(target).setTableIgnoreBuiltin(property(camelContext, boolean.class, value)); return true;
        case "tableincludelist":
        case "tableIncludeList": getOrCreateConfiguration(target).setTableIncludeList(property(camelContext, java.lang.String.class, value)); return true;
        case "tablewhitelist":
        case "tableWhitelist": getOrCreateConfiguration(target).setTableWhitelist(property(camelContext, java.lang.String.class, value)); return true;
        case "timeprecisionmode":
        case "timePrecisionMode": getOrCreateConfiguration(target).setTimePrecisionMode(property(camelContext, java.lang.String.class, value)); return true;
        case "tombstonesondelete":
        case "tombstonesOnDelete": getOrCreateConfiguration(target).setTombstonesOnDelete(property(camelContext, boolean.class, value)); return true;
        default: return false;
        }
    }

    @Override
    public Class<?> getOptionType(String name, boolean ignoreCase) {
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "additionalproperties":
        case "additionalProperties": return java.util.Map.class;
        case "autowiredenabled":
        case "autowiredEnabled": return boolean.class;
        case "binaryhandlingmode":
        case "binaryHandlingMode": return java.lang.String.class;
        case "bridgeerrorhandler":
        case "bridgeErrorHandler": return boolean.class;
        case "columnblacklist":
        case "columnBlacklist": return java.lang.String.class;
        case "columnexcludelist":
        case "columnExcludeList": return java.lang.String.class;
        case "columnincludelist":
        case "columnIncludeList": return java.lang.String.class;
        case "columnpropagatesourcetype":
        case "columnPropagateSourceType": return java.lang.String.class;
        case "columnwhitelist":
        case "columnWhitelist": return java.lang.String.class;
        case "configuration": return org.apache.camel.component.debezium.configuration.SqlServerConnectorEmbeddedDebeziumConfiguration.class;
        case "converters": return java.lang.String.class;
        case "databasedbname":
        case "databaseDbname": return java.lang.String.class;
        case "databasehistory":
        case "databaseHistory": return java.lang.String.class;
        case "databasehistoryfilefilename":
        case "databaseHistoryFileFilename": return java.lang.String.class;
        case "databasehistorykafkabootstrapservers":
        case "databaseHistoryKafkaBootstrapServers": return java.lang.String.class;
        case "databasehistorykafkarecoveryattempts":
        case "databaseHistoryKafkaRecoveryAttempts": return int.class;
        case "databasehistorykafkarecoverypollintervalms":
        case "databaseHistoryKafkaRecoveryPollIntervalMs": return int.class;
        case "databasehistorykafkatopic":
        case "databaseHistoryKafkaTopic": return java.lang.String.class;
        case "databasehistoryskipunparseableddl":
        case "databaseHistorySkipUnparseableDdl": return boolean.class;
        case "databasehistorystoreonlycapturedtablesddl":
        case "databaseHistoryStoreOnlyCapturedTablesDdl": return boolean.class;
        case "databasehistorystoreonlymonitoredtablesddl":
        case "databaseHistoryStoreOnlyMonitoredTablesDdl": return boolean.class;
        case "databasehostname":
        case "databaseHostname": return java.lang.String.class;
        case "databaseinstance":
        case "databaseInstance": return java.lang.String.class;
        case "databasenames":
        case "databaseNames": return java.lang.String.class;
        case "databasepassword":
        case "databasePassword": return java.lang.String.class;
        case "databaseport":
        case "databasePort": return int.class;
        case "databaseservername":
        case "databaseServerName": return java.lang.String.class;
        case "databaseuser":
        case "databaseUser": return java.lang.String.class;
        case "datatypepropagatesourcetype":
        case "datatypePropagateSourceType": return java.lang.String.class;
        case "decimalhandlingmode":
        case "decimalHandlingMode": return java.lang.String.class;
        case "eventprocessingfailurehandlingmode":
        case "eventProcessingFailureHandlingMode": return java.lang.String.class;
        case "heartbeatintervalms":
        case "heartbeatIntervalMs": return int.class;
        case "heartbeattopicsprefix":
        case "heartbeatTopicsPrefix": return java.lang.String.class;
        case "includeschemachanges":
        case "includeSchemaChanges": return boolean.class;
        case "internalkeyconverter":
        case "internalKeyConverter": return java.lang.String.class;
        case "internalvalueconverter":
        case "internalValueConverter": return java.lang.String.class;
        case "maxbatchsize":
        case "maxBatchSize": return int.class;
        case "maxiterationtransactions":
        case "maxIterationTransactions": return int.class;
        case "maxqueuesize":
        case "maxQueueSize": return int.class;
        case "maxqueuesizeinbytes":
        case "maxQueueSizeInBytes": return long.class;
        case "messagekeycolumns":
        case "messageKeyColumns": return java.lang.String.class;
        case "offsetcommitpolicy":
        case "offsetCommitPolicy": return java.lang.String.class;
        case "offsetcommittimeoutms":
        case "offsetCommitTimeoutMs": return long.class;
        case "offsetflushintervalms":
        case "offsetFlushIntervalMs": return long.class;
        case "offsetstorage":
        case "offsetStorage": return java.lang.String.class;
        case "offsetstoragefilename":
        case "offsetStorageFileName": return java.lang.String.class;
        case "offsetstoragepartitions":
        case "offsetStoragePartitions": return int.class;
        case "offsetstoragereplicationfactor":
        case "offsetStorageReplicationFactor": return int.class;
        case "offsetstoragetopic":
        case "offsetStorageTopic": return java.lang.String.class;
        case "pollintervalms":
        case "pollIntervalMs": return long.class;
        case "providetransactionmetadata":
        case "provideTransactionMetadata": return boolean.class;
        case "queryfetchsize":
        case "queryFetchSize": return int.class;
        case "retriablerestartconnectorwaitms":
        case "retriableRestartConnectorWaitMs": return long.class;
        case "sanitizefieldnames":
        case "sanitizeFieldNames": return boolean.class;
        case "signaldatacollection":
        case "signalDataCollection": return java.lang.String.class;
        case "skippedoperations":
        case "skippedOperations": return java.lang.String.class;
        case "snapshotdelayms":
        case "snapshotDelayMs": return long.class;
        case "snapshotfetchsize":
        case "snapshotFetchSize": return int.class;
        case "snapshotincludecollectionlist":
        case "snapshotIncludeCollectionList": return java.lang.String.class;
        case "snapshotisolationmode":
        case "snapshotIsolationMode": return java.lang.String.class;
        case "snapshotlocktimeoutms":
        case "snapshotLockTimeoutMs": return long.class;
        case "snapshotmaxthreads":
        case "snapshotMaxThreads": return int.class;
        case "snapshotmode":
        case "snapshotMode": return java.lang.String.class;
        case "snapshotselectstatementoverrides":
        case "snapshotSelectStatementOverrides": return java.lang.String.class;
        case "sourcestructversion":
        case "sourceStructVersion": return java.lang.String.class;
        case "sourcetimestampmode":
        case "sourceTimestampMode": return java.lang.String.class;
        case "tableblacklist":
        case "tableBlacklist": return java.lang.String.class;
        case "tableexcludelist":
        case "tableExcludeList": return java.lang.String.class;
        case "tableignorebuiltin":
        case "tableIgnoreBuiltin": return boolean.class;
        case "tableincludelist":
        case "tableIncludeList": return java.lang.String.class;
        case "tablewhitelist":
        case "tableWhitelist": return java.lang.String.class;
        case "timeprecisionmode":
        case "timePrecisionMode": return java.lang.String.class;
        case "tombstonesondelete":
        case "tombstonesOnDelete": return boolean.class;
        default: return null;
        }
    }

    @Override
    public Object getOptionValue(Object obj, String name, boolean ignoreCase) {
        DebeziumSqlserverComponent target = (DebeziumSqlserverComponent) obj;
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "additionalproperties":
        case "additionalProperties": return getOrCreateConfiguration(target).getAdditionalProperties();
        case "autowiredenabled":
        case "autowiredEnabled": return target.isAutowiredEnabled();
        case "binaryhandlingmode":
        case "binaryHandlingMode": return getOrCreateConfiguration(target).getBinaryHandlingMode();
        case "bridgeerrorhandler":
        case "bridgeErrorHandler": return target.isBridgeErrorHandler();
        case "columnblacklist":
        case "columnBlacklist": return getOrCreateConfiguration(target).getColumnBlacklist();
        case "columnexcludelist":
        case "columnExcludeList": return getOrCreateConfiguration(target).getColumnExcludeList();
        case "columnincludelist":
        case "columnIncludeList": return getOrCreateConfiguration(target).getColumnIncludeList();
        case "columnpropagatesourcetype":
        case "columnPropagateSourceType": return getOrCreateConfiguration(target).getColumnPropagateSourceType();
        case "columnwhitelist":
        case "columnWhitelist": return getOrCreateConfiguration(target).getColumnWhitelist();
        case "configuration": return target.getConfiguration();
        case "converters": return getOrCreateConfiguration(target).getConverters();
        case "databasedbname":
        case "databaseDbname": return getOrCreateConfiguration(target).getDatabaseDbname();
        case "databasehistory":
        case "databaseHistory": return getOrCreateConfiguration(target).getDatabaseHistory();
        case "databasehistoryfilefilename":
        case "databaseHistoryFileFilename": return getOrCreateConfiguration(target).getDatabaseHistoryFileFilename();
        case "databasehistorykafkabootstrapservers":
        case "databaseHistoryKafkaBootstrapServers": return getOrCreateConfiguration(target).getDatabaseHistoryKafkaBootstrapServers();
        case "databasehistorykafkarecoveryattempts":
        case "databaseHistoryKafkaRecoveryAttempts": return getOrCreateConfiguration(target).getDatabaseHistoryKafkaRecoveryAttempts();
        case "databasehistorykafkarecoverypollintervalms":
        case "databaseHistoryKafkaRecoveryPollIntervalMs": return getOrCreateConfiguration(target).getDatabaseHistoryKafkaRecoveryPollIntervalMs();
        case "databasehistorykafkatopic":
        case "databaseHistoryKafkaTopic": return getOrCreateConfiguration(target).getDatabaseHistoryKafkaTopic();
        case "databasehistoryskipunparseableddl":
        case "databaseHistorySkipUnparseableDdl": return getOrCreateConfiguration(target).isDatabaseHistorySkipUnparseableDdl();
        case "databasehistorystoreonlycapturedtablesddl":
        case "databaseHistoryStoreOnlyCapturedTablesDdl": return getOrCreateConfiguration(target).isDatabaseHistoryStoreOnlyCapturedTablesDdl();
        case "databasehistorystoreonlymonitoredtablesddl":
        case "databaseHistoryStoreOnlyMonitoredTablesDdl": return getOrCreateConfiguration(target).isDatabaseHistoryStoreOnlyMonitoredTablesDdl();
        case "databasehostname":
        case "databaseHostname": return getOrCreateConfiguration(target).getDatabaseHostname();
        case "databaseinstance":
        case "databaseInstance": return getOrCreateConfiguration(target).getDatabaseInstance();
        case "databasenames":
        case "databaseNames": return getOrCreateConfiguration(target).getDatabaseNames();
        case "databasepassword":
        case "databasePassword": return getOrCreateConfiguration(target).getDatabasePassword();
        case "databaseport":
        case "databasePort": return getOrCreateConfiguration(target).getDatabasePort();
        case "databaseservername":
        case "databaseServerName": return getOrCreateConfiguration(target).getDatabaseServerName();
        case "databaseuser":
        case "databaseUser": return getOrCreateConfiguration(target).getDatabaseUser();
        case "datatypepropagatesourcetype":
        case "datatypePropagateSourceType": return getOrCreateConfiguration(target).getDatatypePropagateSourceType();
        case "decimalhandlingmode":
        case "decimalHandlingMode": return getOrCreateConfiguration(target).getDecimalHandlingMode();
        case "eventprocessingfailurehandlingmode":
        case "eventProcessingFailureHandlingMode": return getOrCreateConfiguration(target).getEventProcessingFailureHandlingMode();
        case "heartbeatintervalms":
        case "heartbeatIntervalMs": return getOrCreateConfiguration(target).getHeartbeatIntervalMs();
        case "heartbeattopicsprefix":
        case "heartbeatTopicsPrefix": return getOrCreateConfiguration(target).getHeartbeatTopicsPrefix();
        case "includeschemachanges":
        case "includeSchemaChanges": return getOrCreateConfiguration(target).isIncludeSchemaChanges();
        case "internalkeyconverter":
        case "internalKeyConverter": return getOrCreateConfiguration(target).getInternalKeyConverter();
        case "internalvalueconverter":
        case "internalValueConverter": return getOrCreateConfiguration(target).getInternalValueConverter();
        case "maxbatchsize":
        case "maxBatchSize": return getOrCreateConfiguration(target).getMaxBatchSize();
        case "maxiterationtransactions":
        case "maxIterationTransactions": return getOrCreateConfiguration(target).getMaxIterationTransactions();
        case "maxqueuesize":
        case "maxQueueSize": return getOrCreateConfiguration(target).getMaxQueueSize();
        case "maxqueuesizeinbytes":
        case "maxQueueSizeInBytes": return getOrCreateConfiguration(target).getMaxQueueSizeInBytes();
        case "messagekeycolumns":
        case "messageKeyColumns": return getOrCreateConfiguration(target).getMessageKeyColumns();
        case "offsetcommitpolicy":
        case "offsetCommitPolicy": return getOrCreateConfiguration(target).getOffsetCommitPolicy();
        case "offsetcommittimeoutms":
        case "offsetCommitTimeoutMs": return getOrCreateConfiguration(target).getOffsetCommitTimeoutMs();
        case "offsetflushintervalms":
        case "offsetFlushIntervalMs": return getOrCreateConfiguration(target).getOffsetFlushIntervalMs();
        case "offsetstorage":
        case "offsetStorage": return getOrCreateConfiguration(target).getOffsetStorage();
        case "offsetstoragefilename":
        case "offsetStorageFileName": return getOrCreateConfiguration(target).getOffsetStorageFileName();
        case "offsetstoragepartitions":
        case "offsetStoragePartitions": return getOrCreateConfiguration(target).getOffsetStoragePartitions();
        case "offsetstoragereplicationfactor":
        case "offsetStorageReplicationFactor": return getOrCreateConfiguration(target).getOffsetStorageReplicationFactor();
        case "offsetstoragetopic":
        case "offsetStorageTopic": return getOrCreateConfiguration(target).getOffsetStorageTopic();
        case "pollintervalms":
        case "pollIntervalMs": return getOrCreateConfiguration(target).getPollIntervalMs();
        case "providetransactionmetadata":
        case "provideTransactionMetadata": return getOrCreateConfiguration(target).isProvideTransactionMetadata();
        case "queryfetchsize":
        case "queryFetchSize": return getOrCreateConfiguration(target).getQueryFetchSize();
        case "retriablerestartconnectorwaitms":
        case "retriableRestartConnectorWaitMs": return getOrCreateConfiguration(target).getRetriableRestartConnectorWaitMs();
        case "sanitizefieldnames":
        case "sanitizeFieldNames": return getOrCreateConfiguration(target).isSanitizeFieldNames();
        case "signaldatacollection":
        case "signalDataCollection": return getOrCreateConfiguration(target).getSignalDataCollection();
        case "skippedoperations":
        case "skippedOperations": return getOrCreateConfiguration(target).getSkippedOperations();
        case "snapshotdelayms":
        case "snapshotDelayMs": return getOrCreateConfiguration(target).getSnapshotDelayMs();
        case "snapshotfetchsize":
        case "snapshotFetchSize": return getOrCreateConfiguration(target).getSnapshotFetchSize();
        case "snapshotincludecollectionlist":
        case "snapshotIncludeCollectionList": return getOrCreateConfiguration(target).getSnapshotIncludeCollectionList();
        case "snapshotisolationmode":
        case "snapshotIsolationMode": return getOrCreateConfiguration(target).getSnapshotIsolationMode();
        case "snapshotlocktimeoutms":
        case "snapshotLockTimeoutMs": return getOrCreateConfiguration(target).getSnapshotLockTimeoutMs();
        case "snapshotmaxthreads":
        case "snapshotMaxThreads": return getOrCreateConfiguration(target).getSnapshotMaxThreads();
        case "snapshotmode":
        case "snapshotMode": return getOrCreateConfiguration(target).getSnapshotMode();
        case "snapshotselectstatementoverrides":
        case "snapshotSelectStatementOverrides": return getOrCreateConfiguration(target).getSnapshotSelectStatementOverrides();
        case "sourcestructversion":
        case "sourceStructVersion": return getOrCreateConfiguration(target).getSourceStructVersion();
        case "sourcetimestampmode":
        case "sourceTimestampMode": return getOrCreateConfiguration(target).getSourceTimestampMode();
        case "tableblacklist":
        case "tableBlacklist": return getOrCreateConfiguration(target).getTableBlacklist();
        case "tableexcludelist":
        case "tableExcludeList": return getOrCreateConfiguration(target).getTableExcludeList();
        case "tableignorebuiltin":
        case "tableIgnoreBuiltin": return getOrCreateConfiguration(target).isTableIgnoreBuiltin();
        case "tableincludelist":
        case "tableIncludeList": return getOrCreateConfiguration(target).getTableIncludeList();
        case "tablewhitelist":
        case "tableWhitelist": return getOrCreateConfiguration(target).getTableWhitelist();
        case "timeprecisionmode":
        case "timePrecisionMode": return getOrCreateConfiguration(target).getTimePrecisionMode();
        case "tombstonesondelete":
        case "tombstonesOnDelete": return getOrCreateConfiguration(target).isTombstonesOnDelete();
        default: return null;
        }
    }

    @Override
    public Object getCollectionValueType(Object target, String name, boolean ignoreCase) {
        switch (ignoreCase ? name.toLowerCase() : name) {
        case "additionalproperties":
        case "additionalProperties": return java.lang.Object.class;
        default: return null;
        }
    }
}


text:
section {
    display: flex;
}
.main {
    padding: 0 1.75rem 0 0;
    width: 75.555%;
}
.row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}
aside {
    font-size: 16px;
    min-width: 280px;
    width: 25.555%;
    padding: 2rem;
    border: 1px solid rgba(29, 30, 31, 0.24);
    border-radius: 3px;
    background-color: rgba(252, 255, 255, 0.85);
}
aside h2 {
    color: #f3a614;
    font-size: 1.5rem;
    border-bottom: 1px solid rgba(142, 193, 210, 0.32);
    padding-bottom: 0.5rem;
    margin-top: 0;
}
.remove,
.remove a {
    color: #d45e04;
    font-weight: bold;
    text-decoration: none;
}
.remove a:hover {
    text-decoration: underline;
}

.product-grid-row {
    margin: 0;
    padding: 0;

    display: flex;
    flex-wrap: wrap;
    margin-left: -.75rem;
    margin-right: -.75rem;
}
.product-tile-wrap {
    padding-right: .75rem;
    padding-left: .75rem;
    flex-basis: 33.33333%;
    max-width: 33.33333%;
    margin-bottom: 3.92rem;
}
.product-tile {
    position: relative;
    margin: 0;
    padding: 1rem;
    border: 2px solid #efefef;
    background-color: #fff;
}
.product-tile:hover img {
    opacity: .75;
}
.product-tile .product-description p {
    margin: 0;
    font-size: .8rem;
    padding-bottom: .5rem;
}
.product-tile a {
    text-decoration: none;
    color: #444;
}
.product-image-wrap {
    margin-bottom: .75rem;
    position: relative;
    display: block;
}
.product-image-wrap:before {
    display: block;
    content: "";
    width: 100%;
    padding-top: 134.89583%;
}
.product-image-wrap .product-image-position-wrap {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}
.product-image {
    width: 100%;
    height: auto;
}
.product-tile img {
    vertical-align: middle;
}

.product-name {
    font-size: 1.1rem;
    margin: 0;
    color: #444;
}
.product-price {
    padding-bottom: 1rem;
    text-align: right;
    color: #8c420a;
}
.sale.standard-price {
    text-decoration: line-through;
}
.sale-price {
    color: #d45e04;
}
.product-tile .button {
    max-width: 100%;
}
.product-tile button i.fa-shopping-cart {
    padding-right: 0.5rem;
}
.cart-item {
    padding-bottom: 0.5rem;
    padding-top: 0.5rem;
    border-bottom: 1px solid #dedede;
}
.cart-item:first-child {
    padding-top: 0;
}
.cart-item .product-name,
.cart-item .product-price,
.remove, .qty {
    font-size: 0.8rem;
    padding-bottom: 0;
}
.cart-item .remove {
    text-align: right;
}
.checkout-total {
    padding: 1rem 0;
}
.checkout {
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.process-checkout {
    margin-bottom: 0.8rem;
}
.continue-shopping {
    padding-top: 0.4rem;
}
.continue-shopping .fa-arrow-left:before {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-transition-duration: 0.1s;
    transition-duration: 0.1s;
    -webkit-transition-property: transform;
    transition-property: transform;
    -webkit-transition-timing-function: ease-out;
    transition-timing-function: ease-out;
}
.continue-shopping:hover {
    cursor: pointer;
}
.continue-shopping:hover .fa-arrow-left:before,
.continue-shopping:focus .fa-arrow-left:before,
.continue-shopping:active .fa-arrow-left:before {
    -webkit-transform: translateX(-4px);
    transform: translateX(-4px);
}
.cart-items h2 .cart-label {
    font-size: 2.6rem;
}
.cart-items h2 {
    position: relative;
    border-bottom: 4px solid #eee;
}
.cart-total {
    position: absolute;
    color: #fff;
    top: 13px;
    left: 22px;
    font-size: 1rem;
    font-family: sans-serif;
    font-weight: 100;
}

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace DetailTest\FileConversion;

use PHPUnit_Framework_TestCase as TestCase;

use Zend\Loader\StandardAutoloader;

use Detail\FileConversion\Module;

class ModuleTest extends TestCase
{
    /**
     * @var Module
     */
    protected $module;

    protected function setUp()
    {
        $this->module = new Module();
    }

    public function testModuleProvidesAutoloaderConfig()
    {
        $config = $this->module->getAutoloaderConfig();

        $this->assertTrue(is_array($config));

        $this->assertArrayHasKey(StandardAutoloader::CLASS, $config);
        $this->assertArrayHasKey('namespaces', $config[StandardAutoloader::CLASS]);
        $this->assertArrayHasKey('Detail\FileConversion', $config[StandardAutoloader::CLASS]['namespaces']);
    }

    public function testModuleProvidesConfig()
    {
        $config = $this->module->getConfig();

        $this->assertTrue(is_array($config));
        $this->assertArrayHasKey('detail_fileconversion', $config);
    }

    public function testModuleProvidesControllerConfig()
    {
        $config = $this->module->getControllerConfig();

        $this->assertTrue(is_array($config));
    }

    public function testModuleProvidesServiceConfig()
    {
        $config = $this->module->getServiceConfig();

        $this->assertTrue(is_array($config));
    }
}


text:
layout: post
title: Finding One Thing You Like about Anyone
author: Manal Ghosain
categories:
tags:
---

![Stars at night](/images/bright-stars.jpg)

Another year has flown by and here we are. We're in the midst of the festive season and all the socializing that comes with it.

Spending time with family and loved ones can be the best or the worst thing, depending on the nature of our relationships.

Strained relationships can be the source of more pain around the holidays. We don't want to let our family down, but we don't want to suffer either. And we struggle.

What if we did a simple thing this holiday season that might alleviate the pain, and reduce our resistance to highly charged emotional situations?

As a self-proclaimed expert in finding fault with myself, and others, I decided to try something different in my interactions this season (and probably after).

Instead of automatically dreading having to deal with a person, because of all the built-up negativity over the years, I'm going to look for _one_ thing I like about them.

We always find what we're looking for. So I'm not going to look for things that trigger the same judgment and negative emotions (a way to validate my pain and prove that I'm right). I'm going into the interaction with the intention of finding just one thing I like about the person.

## Why look for one thing to like

By nature, or conditioning, we tend to focus on the negative. We store the pain of the past into the deep emotional vaults of our minds.

The mere thought of a person, or the slightest provocation, can trigger intense reactions.

Pain is meant to serve a purpose in our lives. When it's there for no reason other than our story about it, it's time to try something different.

Looking for one thing we like can be a way for us to stop focusing on the pain that doesn't serve any purpose. It's a way for us to remain open and willing to connect with someone in this moment without all the baggage and judgment of the past.

We can find something to like about anyone we deal with. It doesn't have to be a grand redeeming trait that wipes the slate clean. It's just one simple thing—any one thing.

Why one and not two or three? It's all we need. We don't want to turn a social experience into a complex mission. There is no need for lists of good qualities about each family member, or friend.

## What's the one good thing to uncover?

Some of the things we find might sound childish. And that's okay. The subconscious likes silly and childish stuff.

We can look for things like:

- My mother really knows how to fold napkins like a pro.
- My father thinks the wireless router is possessed by a demon. LOL!
- My partner laughed at my joke.
- Ha! My friend licked her plate.
- Who knew! My boss likes cat videos.
- My sister is a dish washing ninja.

Other things might be more serious but as effective.

- Jane showed up to every family gathering without fail. She's really committed.
- My cousin talks to my mother all the time. She truly cares.
- John's laughter is infectious.

When we find this one thing and think about it, we break the conditioned obsession with the negative.

Look for funny and silly things and you'll find them. Look for small acts of kindness, someone giving you attention, or people simply showing up.

## What might happen when you find one thing you like?

Aside from not dwelling in pain and feeling a little better, you'll probably relax and maybe, just maybe, enjoy yourself.

You validate others without trying too hard. You're with them and having a good time, or at least a decent time, without much drama.

And that can have a ripple effect on others relaxing around you, not feeling they need to defend, or explain, themselves. You will transform the experience for yourself and others, without much effort.

**People are flawed. Am I in denial?**

No. We're not making stuff up, or excusing bad behavior.

We're looking for what's already there that we chose to ignore in the past. We're focusing on the new instead of the old.

When we look beyond all the festive decorations, gifts, feasts, and past and present noise, we will see what the holidays are truly about: taking time to express our love and appreciation for the people who matter most to us.

Yes there maybe grievances about the past and the people we're close to. After all no one is perfect. But no one is without something we can like—something we can appreciate and celebrate.


text:
#ifndef SkPixelXorXfermode_DEFINED
#define SkPixelXorXfermode_DEFINED

#include "SkXfermode.h"

/** SkPixelXorXfermode implements a simple pixel xor (op ^ src ^ dst).
    This transformation does not follow premultiplied conventions, therefore
    this proc *always* returns an opaque color (alpha == 255). Thus it is
    not really usefull for operating on blended colors.
*/
class SkPixelXorXfermode : public SkXfermode {
public:
    SkPixelXorXfermode(SkColor opColor) : fOpColor(opColor) {}

    SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(SkPixelXorXfermode)

protected:
    SkPixelXorXfermode(SkFlattenableReadBuffer& rb);
    virtual void flatten(SkFlattenableWriteBuffer&) const SK_OVERRIDE;

    // override from SkXfermode
    virtual SkPMColor xferColor(SkPMColor src, SkPMColor dst);

private:
    SkColor fOpColor;

    typedef SkXfermode INHERITED;
};

#endif


text:
/**
 * Created by m.charyton on 21.09.2016.
 */
"use strict";
let bodyParser = require('body-parser');
let conn = require('../controllers/connectionCtrl.js');
let userRouter = require('express').Router();

userRouter.use(function (req, res, next) {
    console.log(req.method, req.url);
    next();
});

/**
 * You first need to create a formatting function to pad numbers to two digits…
 **/
function twoDigits(d) {
    if (0 <= d && d < 10) return "0" + d.toString();
    if (-10 < d && d < 0) return "-0" + (-1 * d).toString();
    return d.toString();
}

/**
 * …and then create the method to output the date string as desired.
 * Some people hate using prototypes this way, but if you are going
 * to apply this to more than one Date object, having it as a prototype
 * makes sense.
 **/
Date.prototype.toMysqlFormat = function () {
    return this.getUTCFullYear() + "-" + twoDigits(1 + this.getUTCMonth()) + "-" + twoDigits(this.getUTCDate()) + " " + twoDigits(this.getUTCHours()) + ":" + twoDigits(this.getUTCMinutes()) + ":" + twoDigits(this.getUTCSeconds());
};

let showDetailedOrder = function (req, res) {
    "use strict";
    // Show inventory
    let sql = "SELECT\
    Order_Detail.Quantity,\
        Order_Detail.`Comment`,\
        Order_Detail.Status_Id,\
        Order_Detail.Status_Change_Date,\
        Order_Detail.Order_Date,\
        Order_Detail.Realization_Date,\
        Order_Detail.Price,\
        Order_Detail.Approved,\
        Order_Detail.Approved_Date,\
        Order_Detail.Order_Id,\
        `User`.`Name`,\
        `User`.Surname,\
        Inventory_Type.Type_Name,\
        Inventory_Category.Category_Name\
    FROM\
    Order_Detail\
    INNER JOIN `User` ON Order_Detail.User_Id = `User`.User_Id\
    INNER JOIN Inventory_Type ON Order_Detail.Type_Id = Inventory_Type.Type_Id\
    INNER JOIN Inventory_Category ON Inventory_Type.Category_Id = Inventory_Category.Category_Id\
    ";

    querySql(req, res, sql);
};

let addOrder = function (req, res) {
    "use strict";
    let order = {
        /*  label: function () {
         let value;
         if (req.body.hasOwnProperty('label')) {
         value = req.body.label;
         value = value.replace(/'/g, "\\'");
         } else {
         console.log('No label');
         return;
         }
         return value;
         },*/
        category: function () {
            let value;
            if (req.body.hasOwnProperty('selectedCategory')) {
                value = req.body.selectedCategory;
                value = value.replace(/'/g, "\\'");
            } else {
                console.log('No category');
                return;
            }
            return value;
        },
        typeId: function () {
            let value;
            if (req.body.hasOwnProperty('selectedType')) {
                value = req.body.selectedType;
                value = value.replace(/'/g, "\\'");
            } else {
                console.log('No typeId');
                return;
            }
            return value;
        },
        order_quantity: function () {
            let value;
            if (req.body.hasOwnProperty('quantity')) {
                value = req.body.quantity;
            } else {
                console.log('No quantity');
                return;
            }
            return value;
        },
        delivery_date: function () {
            let value;
            if (req.body.hasOwnProperty('deliveryDate')) {
                value = req.body.deliveryDate;
                value = new Date(value).toMysqlFormat();
            } else {
                console.log('No delivery date');
                return;
            }
            return value;
        },
        comment: function () {
            let value;
            if (req.body.hasOwnProperty('comment')) {
                value = req.body.comment;
                value = value.replace(/'/g, "\\'");
            } else {
                console.log('No comment');
                return;
            }
            return value;
        }
    };

    conn.pool.getConnection(function (err, connection) {
        if (err) {
            res.json({"code": 200, "status": "Error in connection to database: " + err});
            return;
        }

        console.log("connected as: " + connection.threadId);

        connection.beginTransaction(function (err) {
            if (err) {
                throw err;
            }

            let sql = "INSERT INTO `Order` (User_Id, Status_Id, Status_Change_Date, Order_Date, Delivery_Date) VALUES (1, 1, NOW(), NOW(), '" + order.delivery_date() + "' )";
            // console.log(sql);
            connection.query(sql, function (err, rows) {
                connection.release();
                if (err) {
                    console.log(err);
                    return connection.rollback(function () {
                        throw err;
                    });
                }
                let orderId = rows.insertId;
                let sql2 = "INSERT INTO Order_Detail (Order_Id, Type_Id, User_Id, Quantity, Comment, Status_Id, Status_Change_Date, Order_Date, Realization_Date) VALUES (" + orderId + ", " + order.typeId() + ", 1," + order.order_quantity() + ", '" + order.comment() + "', 1, NOW(), NOW(), '" + order.delivery_date() + "' )";
                // console.log(sql2);
                connection.query(sql2, function (err, rows) {
                    if (err) {
                        console.log(err);
                        return connection.rollback(function () {
                            throw err;
                        });
                    }

                    connection.commit(function (err) {
                        if (err) {
                            return connection.rollback(function () {
                                throw err;
                            });
                        }
                        console.log("Success!:");
                        console.log(rows);
                        res.send("Order added successfully!");
                        return rows;
                    });
                });
            });
        });
    });
};

let changeStatus = function (req, res) {
    "use strict";
    if (req.body.hasOwnProperty("status_id")) {
        let status_id = req.body.status_id;
    }
    if (req.body.hasOwnProperty("inventory_id")) {
        let inventory_id = req.body.inventory_id;
    }

    let sql = "UPDATE Inventory SET Status_Id = " + status_id + " WHERE Inventory.Inventory_Id =" + inventory_id;
    querySql(req, res, sql);
};

function querySql(req, res, sql) {
    "use strict";
    conn.pool.getConnection(function (err, connection) {
        if (err) {
            res.json({"code": 200, "status": "Error in connection to database: " + err});
            return;
        }

        console.log("connected as: " + connection.threadId);

        connection.query(sql, function (err, rows) {
            connection.release();
            if (!err) {
                console.log(rows);
                res.json(rows);
            } else {
                console.log(err);
            }
        });

        connection.on('error', function (err) {
            res.json({"code": 100, "status": "error in query: " + err});

        });
    });
}
// #######################################
// ################ ROUTES ###############
// ######## ROOT URI: /api/inventory #####
// #######################################

// create application/json parser
var jsonParser = bodyParser.json();

// Show specific inventory
// userRouter.get('/orders/', showOrder);
userRouter.get('/', showDetailedOrder);
userRouter.get('/:id', showDetailedOrder);
userRouter.post('/', addOrder);

// #######################################
// ############ ROUTER EXPORT ############
// #######################################

module.exports = userRouter;


text:
/**
 * Test different API for DOM utility
 * @class test.aria.dom.basic.DomTestCase
 */
Aria.classDefinition({
    $classpath : 'test.aria.dom.basic.DomTestCase',
    $extends : 'aria.jsunit.TemplateTestCase',
    $dependencies : ['aria.utils.Dom', 'aria.templates.Layout'],
    $constructor : function () {
        this.$TemplateTestCase.constructor.call(this);

        this.setTestEnv({
            template : "test.aria.dom.basic.BigPage",
            css : "font-family:Tahoma,Verdana,sans-serif"
        });
    },
    $prototype : {

        runTemplateTest : function () {

            // get the page size
            var size = aria.utils.Dom.getFullPageSize();
            var viewport = aria.utils.Dom._getViewportSize();

            // Should be bigger than the viewport
            this.assertTrue(size.width >= viewport.width, "Page width should be bigger than viewport width.");
            this.assertTrue(size.height >= viewport.height, "Page height should be bigger than viewport height.");

            // Test another page
            this._replaceTestTemplate({
                template : "test.aria.dom.basic.LongPage"
            }, {
                fn : this.myTestLongPage,
                scope : this
            });
        },

        myTestLongPage : function () {
            // get the page size
            var size = aria.utils.Dom.getFullPageSize();
            var viewport = aria.utils.Dom._getViewportSize();

            // Should be bigger only longer the viewport
            // Commented out as this breaks the automated test suite run daily on aria server:
            // this.assertTrue(size.width === viewport.width, "Your browser should be maximized for this test to pass");
            this.assertTrue(size.height >= viewport.height, "Page height should be bigger than viewport height for long pages.");

            // Test another page
            this._replaceTestTemplate({
                template : "test.aria.dom.basic.SmallPage"
            }, {
                fn : this.myTestSmallPage,
                scope : this
            });
        },

        myTestSmallPage : function (args) {
            // get the page size
            var size = aria.utils.Dom.getFullPageSize();
            var viewport = aria.utils.Dom._getViewportSize();

            // Should be bigger equal to the viewport
            this.assertEquals(size.width, viewport.width, "Page width should be viewport width.");
            // This assertion cannot be proved, the tester adds something in the page that makes it long
            // this.assertTrue(size.height === viewport.height);

            // Test the geometry utility
            this._replaceTestTemplate({
                template : "test.aria.dom.basic.Geometry"
            }, {
                fn : this.myTestGeometry,
                scope : this
            });
        },

        myTestGeometry : function () {
            // Geometry of the first div
            var uDom = aria.utils.Dom, div, geo, span;
            var scrollbarsWidth = aria.templates.Layout.getScrollbarsWidth();

            div = this.getElementById("d1");
            geo = uDom.getGeometry(div);

            this.assertTrue(geo.x < 30, "d1: Expected x < 30, got " + geo.x);
            this.assertTrue(geo.y < 30, "d1: Expected y < 30, got " + geo.y);
            this.assertEquals(geo.width, 100, "d1: Expected width equal to 100, got " + geo.width);
            this.assertEquals(geo.height, 100, "d1: Expected height equal to 100, got " + geo.height);

            // Geometry of the second div
            div = this.getElementById("d2");
            geo = uDom.getGeometry(div);

            this.assertTrue(geo.x < 30, "d2: Expected x < 30, got " + geo.x);
            this.assertTrue(geo.y >= 100, "d2: Expected y >= 100, got " + geo.y);
            this.assertEquals(geo.width, 100, "d2: Expected width equal to 100, got " + geo.width);
            this.assertEquals(geo.height, 100, "d2: Expected height equal to 100, got " + geo.height);

            // Geometry of the span
            span = this.getElementById("s1");
            geo = uDom.getGeometry(span);

            // getGeometry returns the visible part of s1, which is limited by its parent element
            this.assertTrue(geo.x < 30, "s1: Expected x < 30, got " + geo.x);
            this.assertTrue(geo.y >= 100, "s1: Expected y >= 100, got " + geo.y);

            // On mac, webkit scrollbars are not visualized without scrolling
            if (aria.core.Browser.isMac && aria.core.Browser.isWebkit) {
                this.assertEquals(geo.width, 100, "s1: Expected width == 100, got %1");
                this.assertEquals(geo.height, 100, "s1: Expected height == 100, got %1");
            } else {
                this.assertEquals(geo.width, (100 - scrollbarsWidth), "s1: Expected width == %2, got %1");
                this.assertEquals(geo.height, (100 - scrollbarsWidth), "s1: Expected height == %2, got %1");
            }

            // End of test
            this.notifyTemplateTestEnd();
        }
    }
});


text:
// Set breakpoint on function below here
function A() { }
// Above breakpoint should bind on above line

// Set breakpoint on function below here
function B() {
}
// Above breakpoint should bind on above line

// Set breakpoint on function below here
function C() {
    // Above breakpoint should bind on next line
}

// Set breakpoint on function below here
function D(x, y) { return x + y; }
// Above breakpoint should bind on above line

// Set breakpoint on function below here
function E(x, y, z) {
    // Above breakpoint should bind on next line
    return x + y - z;
}

A();
B();
C();
D(1, 2);
E(1, 2, 3);


text:
define("ghost/components/gh-blur-input",
  ["exports"],
  function(__exports__) {
    "use strict";
    var BlurInput = Ember.TextField.extend({
        selectOnClick: false,
        click: function (event) {
            if (this.get('selectOnClick')) {
                event.currentTarget.select();
            }
        },
        focusOut: function () {
            this.sendAction('action', this.get('value'));
        }
    });

    __exports__["default"] = BlurInput;
  });


text:
<?php

namespace CodeIgniter\Debug\Toolbar\Collectors;

use CodeIgniter\Database\Query;
use CodeIgniter\Test\CIUnitTestCase;
use PHPUnit\Framework\MockObject\MockObject;

/**
 * @internal
 */
final class DatabaseTest extends CIUnitTestCase
{
    public function testDisplay(): void
    {
        /** @var MockObject&Query $query */
        $query = $this->getMockBuilder(Query::class)
            ->disableOriginalConstructor()
            ->getMock();

        // set mock returns
        $query->method('getQuery')->willReturn('SHOW TABLES;');
        $query->method('debugToolbarDisplay')->willReturn('SHOW TABLES;');
        $query->method('getDuration')->with(5)->willReturn('1.23456');

        Database::collect($query); // <== $query will be called here
        $collector = new Database();

        $queries = $collector->display()['queries'];

        $this->assertSame('1234.56 ms', $queries[0]['duration']);
        $this->assertSame('SHOW TABLES;', $queries[0]['sql']);
        $this->assertSame(clean_path(__FILE__) . ':35', $queries[0]['trace-file']);

        foreach ($queries[0]['trace'] as $i => $trace) {
            // since we added the index numbering
            $this->assertArrayHasKey('index', $trace);
            $this->assertSame(
                sprintf('%s', $i + 1),
                preg_replace(sprintf('/%s/', chr(0xC2) . chr(0xA0)), '', $trace['index'])
            );

            // since we merged file & line together
            $this->assertArrayNotHasKey('line', $trace);
            $this->assertArrayHasKey('file', $trace);

            // since we dropped object & args in the backtrace for performance
            // but args MAY STILL BE present in internal calls
            $this->assertArrayNotHasKey('object', $trace);
        }
    }
}


text:
$:.unshift File.dirname(__FILE__)
$:.unshift File.join(File.dirname(__FILE__),'..', 'lib')

require 'ebay'
require 'config'

# Get the actively listed items from My eBay and sort them by TimeLeft
ebay = Ebay::Api.new

begin
  response = ebay.get_my_ebay_selling(
    :detail_level => 'ReturnAll',
    :active_list => Ebay::Types::ItemListCustomization.new(:sort => 'TimeLeft')
  )

  puts "You have #{response.active_list.items.size} active listings:"
  response.active_list.items.each do |item|
    puts "#{item.item_id}: #{item.title}"
  end
rescue Ebay::RequestError => e
  e.errors.each do |error|
    puts error.long_message
  end
end


text:
{% load menu_tags %}

{% for item in menu_items %}

        {{ item.text }}{% if item.has_children_in_menu %} {% endif %}
        {% if item.has_children_in_menu %}
        	{% sub_menu item %}
        {% endif %}

{% endfor %}


text:
package org.cucina.engine;

import org.cucina.engine.definition.ProcessDefinition;
import org.cucina.engine.definition.config.ProcessDefinitionRegistry;
import org.cucina.engine.testadapters.MockProcessDefinitionBuilder;
import org.cucina.engine.testadapters.StandardOutputWorkflowListener;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;

import java.util.Collections;

import static org.junit.Assert.assertNotNull;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

/**
 * @author robh
 * @author vlevine
 */
public class DefaultProcessSessionFactoryTest {
	@Mock
	private ProcessDriverFactory executorFactory;
	@Mock
	private TokenFactory tokenFactory;
	@Mock
	private ProcessDriver executor;

	/**
	 * JAVADOC Method Level Comments
	 */
	@Before
	public void setup() {
		MockitoAnnotations.initMocks(this);
		when(executorFactory.getExecutor()).thenReturn(executor);
	}

	/**
	 * JAVADOC
	 */
	@Test
	public void testOpenSessionWithDefinitionName() {
		ProcessDefinitionRegistry definitionRegistry = mock(ProcessDefinitionRegistry.class);

		DefaultProcessSessionFactory sessionFactory = new DefaultProcessSessionFactory(definitionRegistry,
				Collections.singletonList((WorkflowListener) new StandardOutputWorkflowListener()),
				executorFactory);

		ProcessDefinition workflowDefinition = MockProcessDefinitionBuilder.buildChooseADrinkDefinition();
		ProcessSession session = sessionFactory.openSession(workflowDefinition);

		assertNotNull(session);
	}

	/**
	 * JAVADOC
	 */
	@Test
	public void testOpenSessionWithSuppliedDefinition() {
		ProcessDefinitionRegistry definitionRegistry = mock(ProcessDefinitionRegistry.class);
		ProcessDefinition workflowDefinition = MockProcessDefinitionBuilder.buildChooseADrinkDefinition();

		when(definitionRegistry.findWorkflowDefinition(workflowDefinition.getId()))
				.thenReturn(workflowDefinition);

		DefaultProcessSessionFactory sessionFactory = new DefaultProcessSessionFactory(definitionRegistry,
				Collections.singletonList((WorkflowListener) new StandardOutputWorkflowListener()),
				executorFactory);

		ProcessSession session = sessionFactory.openSession(workflowDefinition.getId());

		assertNotNull(session);
	}
}


text:
# Configure Rails Envinronment
ENV["RAILS_ENV"] = "test"

require 'rubygems'
require 'bundler/setup'

require 'rails'
require "rails/test_help"
require 'sass/rails'
require 'sfl'
require 'mocha'

Rails.backtrace_cleaner.remove_silencers!

# If developing against local dependencies, this code will ensure they get picked up
# in the project fixtures that have their own bundle environment
$gem_options = {}
possible_dev_dependencies = %w(sass-rails sass rails actionpack railties sprockets)
Bundler.load.specs.each do |s|
  if possible_dev_dependencies.include?(s.name)
     gem_path = s.full_gem_path
     gem_options = {:version => s.version}
     gem_options[:path] = gem_path if File.exists?("#{gem_path}/#{s.name}.gemspec")
     $gem_options[s.name] = gem_options
  end
end

# Load support files
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;

namespace PIR.Config
{
    using Config;
    using System.Collections;
    using System.Xml;

    public class ComponentConfig
    {
        public string _ReturnStr = "";

        public string GetAppConfig(string config)
        {
            _ReturnStr = System.Web.Configuration.WebConfigurationManager.AppSettings[config].ToString();
            return _ReturnStr;
        }

        public Dictionary<string, string> getAllAppSetting()
        {
            Dictionary<string, string> _Dictionary = new Dictionary<string, string>();

            XmlDocument document = new XmlDocument();
            document.Load(AppDomain.CurrentDomain.BaseDirectory+"Web.config");
            XmlNodeList appsetting = document.SelectNodes("configuration/appSettings/add");

            foreach (XmlNode node in appsetting)
            {
                _Dictionary.Add(node.Attributes["key"].Value, node.Attributes["value"].Value);
            }

            return _Dictionary;
        }

    }
}


text:
package de.evoila.cf.broker.service.impl;

import de.evoila.cf.broker.bean.BackupConfiguration;
import de.evoila.cf.broker.bean.ConditionOnBackupService;
import de.evoila.cf.broker.controller.utils.RestPageImpl;
import de.evoila.cf.broker.exception.ServiceInstanceDoesNotExistException;
import de.evoila.cf.broker.service.BackupCustomService;
import de.evoila.cf.broker.service.BackupService;
import de.evoila.cf.config.security.AcceptSelfSignedClientHttpRequestFactory;
import de.evoila.cf.model.*;
import de.evoila.cf.model.enums.DestinationType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.context.annotation.Conditional;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.http.*;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.util.UriComponentsBuilder;

import javax.annotation.PostConstruct;
import java.util.*;

@Service
@Conditional(ConditionOnBackupService.class)
public class BackupServiceImpl implements BackupService {

    private static final Logger logger = LoggerFactory.getLogger(BackupServiceImpl.class);

    private final RestTemplate restTemplate;

    private HttpHeaders headers;

    private BackupConfiguration backupConfiguration;

    private RabbitTemplate rabbitTemplate;

    private BackupCustomService backupCustomService;

    public BackupServiceImpl(BackupConfiguration backupConfiguration, BackupCustomService backupCustomService,
                             RabbitTemplate rabbitTemplate) {
        Assert.notNull(backupConfiguration, "BackupConfiguration can not be null");
        Assert.notNull(rabbitTemplate, "RabbitTemplate can not be null");

        this.backupConfiguration = backupConfiguration;
        this.backupCustomService = backupCustomService;
        this.restTemplate = new RestTemplate();
        this.rabbitTemplate = rabbitTemplate;
        this.rabbitTemplate.setMessageConverter(new Jackson2JsonMessageConverter());
    }

    @ConditionalOnBean(AcceptSelfSignedClientHttpRequestFactory.class)
    @Autowired(required = false)
    private void selfSignedRestTemplate(AcceptSelfSignedClientHttpRequestFactory requestFactory) {
        restTemplate.setRequestFactory(requestFactory);
    }

    @PostConstruct
    private void backupEndpointHeaders() {
        this.headers = new HttpHeaders();
        headers.add("Content-Type", "application/json");
        headers.add("Accept", "application/json");
        headers.add("Authorization", encodeCredentials());
    }

    private String encodeCredentials () {
        String str = backupConfiguration.getUser() + ":" + backupConfiguration.getPassword();
        return "Basic " + Base64.getEncoder().encodeToString(str.getBytes());
    }

    private UriComponentsBuilder buildUri(String path, Pageable pageable) {
        UriComponentsBuilder builder = UriComponentsBuilder
                .fromUriString(backupConfiguration.getUri() + path);

        builder.queryParam("page", pageable.getPageNumber());
        builder.queryParam("page_size", pageable.getPageSize());
        if (pageable.getSort() != null) {
            Iterator<Sort.Order> sortIterator = pageable.getSort().iterator();
            while (sortIterator.hasNext()) {
                Sort.Order order = sortIterator.next();
                builder.queryParam("sort", order.getProperty() + "," + order.getDirection().toString());
            }
        }

        return builder;
    }

    @Override
    public ResponseEntity<List<BackupItem>> getItems(String serviceInstanceId) {
        List<BackupItem> backupItems = new ArrayList<>();
        try {
            for (Map.Entry<String, String> item : this.backupCustomService.getItems(serviceInstanceId).entrySet())
                backupItems.add(new BackupItem(item.getKey(), item.getValue()));

        } catch(Exception ex) {
            return new ResponseEntity("Could not load entitled items", HttpStatus.INTERNAL_SERVER_ERROR);
        }

        return new ResponseEntity(backupItems, HttpStatus.OK);
    }

    @Override
    public ResponseEntity<Object> backupNow(String planId, BackupRequest backupRequest) {
        BackupPlan plan = this.getPlan(planId).getBody();
        backupRequest.setDestinationId(plan.getDestinationId());
        backupRequest.setPlan(plan);

        BackupConfiguration.Queue queue = this.backupConfiguration.getQueue();
        if (queue != null){
            rabbitTemplate.convertAndSend(queue.getExchange(), queue.getRoutingKey(), backupRequest);
        } else {
            String msg = "Backup RabbitMQ backupConfiguration is null. Please check configuration";
            logger.error(msg);
            return new ResponseEntity<>(msg,HttpStatus.INTERNAL_SERVER_ERROR);
        }

        return new ResponseEntity<>(new HashMap(),HttpStatus.CREATED);
    }

    @Override
    public ResponseEntity<HashMap> restoreNow(String planId, RestoreRequest restoreRequest) {
        BackupPlan plan = this.getPlan(planId).getBody();
        restoreRequest.setPlan(plan);

        rabbitTemplate.convertAndSend(this.backupConfiguration.getQueue().getExchange(),
                                this.backupConfiguration.getQueue().getRoutingKey(), restoreRequest);

        return new ResponseEntity<>(new HashMap(), HttpStatus.CREATED);
    }

    @Override
    public ResponseEntity<RestPageImpl<BackupJob>> getJobs(String serviceInstanceId, Pageable pageable) {
        Map<String, String> uriParams = new HashMap<>();
        uriParams.put("serviceInstanceId", serviceInstanceId);

        HttpEntity entity = new HttpEntity(headers);
        ResponseEntity<RestPageImpl<BackupJob>> response = restTemplate
                .exchange(buildUri("/jobs/byInstance/{serviceInstanceId}", pageable).buildAndExpand(uriParams).toUri(),
                    HttpMethod.GET, entity, new ParameterizedTypeReference<RestPageImpl<BackupJob>>() {});

        return response;
    }

    @Override
    public ResponseEntity<RestPageImpl<BackupPlan>> getPlans(String serviceInstanceId, Pageable pageable) {
        Map<String, String> uriParams = new HashMap<>();
        uriParams.put("serviceInstanceId", serviceInstanceId);

        HttpEntity entity = new HttpEntity(headers);
        ResponseEntity<RestPageImpl<BackupPlan>> response = restTemplate
                .exchange(buildUri("/plans/byInstance/{serviceInstanceId}", pageable).buildAndExpand(uriParams).toUri(),
                        HttpMethod.GET, entity, new ParameterizedTypeReference<RestPageImpl<BackupPlan>>() {});

        return response;
    }

    @Override
    public ResponseEntity<BackupJob> deleteJob(String jobId) {
        HttpEntity entity = new HttpEntity(headers);
        ResponseEntity response = restTemplate.exchange(backupConfiguration.getUri() + "/jobs/" + jobId,
                                                HttpMethod.DELETE, entity, BackupJob.class
        );
        return response;
    }

    @Override
    public ResponseEntity<BackupPlan> postPlan(String serviceInstanceId, BackupPlan plan) throws ServiceInstanceDoesNotExistException {
        EndpointCredential credentials = backupCustomService.getCredentials(serviceInstanceId);
        plan.setSource(credentials);
        plan.setServiceInstanceId(serviceInstanceId);
        HttpEntity entity = new HttpEntity(plan, headers);
        ResponseEntity response = restTemplate.exchange(backupConfiguration.getUri() + "/plans",
                                                HttpMethod.POST, entity, BackupPlan.class
        );
        return response;
    }

    @Override
    public ResponseEntity<BackupPlan> deletePlan(String planId) {
        HttpEntity entity = new HttpEntity(headers);
        ResponseEntity response = restTemplate.exchange(backupConfiguration.getUri() + "/plans/" + planId,
                                                HttpMethod.DELETE, entity, BackupPlan.class
        );
        return response;
    }

    @Override
    public ResponseEntity<BackupPlan> updatePlan(String serviceInstanceId, String planId, BackupPlan plan) throws ServiceInstanceDoesNotExistException {
        EndpointCredential credentials = backupCustomService.getCredentials(serviceInstanceId);
        plan.setSource(credentials);
        HttpEntity entity = new HttpEntity(plan, headers);
        ResponseEntity response = restTemplate.exchange(backupConfiguration.getUri() + "/plans/" + planId,
                                                HttpMethod.PUT, entity, BackupPlan.class
        );
        return response;
    }

    @Override
    public ResponseEntity<BackupJob> getJob(String jobId) {
        HttpEntity entity = new HttpEntity(headers);
        return restTemplate.exchange(backupConfiguration.getUri()+ "/jobs/" + jobId, HttpMethod.GET, entity, BackupJob.class);
    }

    @Override
    public ResponseEntity<BackupPlan> getPlan(String planId) {
        HttpEntity entity = new HttpEntity(headers);
        return restTemplate.exchange(backupConfiguration.getUri()+ "/plans/" + planId, HttpMethod.GET, entity, BackupPlan.class);
    }

    @Override
    public ResponseEntity<RestPageImpl<FileDestination>> getDestinations(String serviceInstanceId, Pageable pageable) {
        Map<String, String> uriParams = new HashMap<>();
        uriParams.put("serviceInstanceId", serviceInstanceId);

        HttpEntity entity = new HttpEntity(headers);
        ResponseEntity<RestPageImpl<FileDestination>> response = restTemplate
                                 .exchange(buildUri("/destinations/byInstance/{serviceInstanceId}", pageable)
                                 .buildAndExpand(uriParams).toUri(),
                                       HttpMethod.GET, entity, new ParameterizedTypeReference<RestPageImpl<FileDestination>>() {});
        return response;
    }

    @Override
    public ResponseEntity<FileDestination> getDestination(String destinationId) {
        HttpEntity entity = new HttpEntity(headers);
        return restTemplate.exchange(backupConfiguration.getUri()+ "/destinations/" + destinationId, HttpMethod.GET,
                entity, FileDestination.class);
    }

    @Override
    public ResponseEntity<FileDestination> postDestination(String serviceInstanceId, FileDestination fileDestination) {
        HttpEntity entity = new HttpEntity(fileDestination, headers);
        fileDestination.setInstanceId(serviceInstanceId);
        fileDestination.setType(DestinationType.SWIFT);
        ResponseEntity response = restTemplate.exchange(backupConfiguration.getUri() + "/destinations",
                                                HttpMethod.POST, entity, FileDestination.class
        );
        return response;
    }

    @Override
    public ResponseEntity<FileDestination> updateDestination(String serviceInstanceId, String destinationId, FileDestination fileDestination)  {
        HttpEntity entity = new HttpEntity(fileDestination, headers);
        fileDestination.setInstanceId(serviceInstanceId);
        fileDestination.setType(DestinationType.SWIFT);
        ResponseEntity response = restTemplate.exchange(backupConfiguration.getUri() + "/destinations/" + destinationId,
                                                HttpMethod.PUT, entity, FileDestination.class
        );
        return response;
    }

    @Override
    public ResponseEntity<FileDestination> deleteDestination(String destinationId) {
        HttpEntity entity = new HttpEntity(headers);
        ResponseEntity response = restTemplate.exchange(backupConfiguration.getUri() + "/destinations/" + destinationId,
                                                HttpMethod.DELETE, entity, FileDestination.class
        );
        return response;
    }

    @Override
    public ResponseEntity<FileDestination> validateDestination(String serviceInstanceId, FileDestination fileDestination) {
        HttpEntity entity = new HttpEntity(fileDestination, headers);
        fileDestination.setInstanceId(serviceInstanceId);
        ResponseEntity response = restTemplate.exchange(backupConfiguration.getUri() + "/destinations/validate",
                                                HttpMethod.POST, entity, FileDestination.class
        );
        return response;
    }

}


text:
<!doctype html>

        <meta charset="utf-8">
        <meta http-equiv="x-ua-compatible" content="ie=edge">
        <title>@voxtecnologia/angular-forms documentation</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">

        <link rel="icon" type="image/x-icon" href="../images/favicon.ico">
	    <link rel="stylesheet" href="../styles/style.css">

            @voxtecnologia/angular-forms documentation
            <button type="button" class="btn btn-default btn-menu fa fa-bars" id="btn-menu"></button>

                <input type="text" placeholder="Type to search">

                        @voxtecnologia/angular-forms documentation

                        Getting started

                                        Overview

                                  README

                                        CHANGELOG

                                        LICENSE

                                Modules

                                    AngularFormsModule

                                    DataTableModule

                                    DemoModule

                                    ValidationMessageModule

                            Components

                                    AngularFormsComponent

                                    DataTableComponent

                                    DemoComponent

                                    ValidationMessageComponent

                            Classes

                                    AngularForms

                                    AngularFormsTranslateLoader

                                    Checkbox

                                    Choice

                                    DataTable

                                    DataTableBuilder

                                    Dependency

                                    DependencyService

                                    Email

                                    EmailValidator

                                    Fieldset

                                    FieldsetBuilder

                                    Group

                                    GroupBuilder

                                    Max

                                    MaxLength

                                    MaxLengthValidator

                                    MaxValidator

                                    Min

                                    MinLength

                                    MinLengthValidator

                                    MinValidator

                                    Pattern

                                    PatternValidator

                                    Question

                                    QuestionFactory

                                    Radio

                                    ReactiveFormsFactory

                                    Required

                                    RequiredValidator

                                    Select

                                    SelectService

                                    StringUtils

                                    Text

                                    TextArea

                                    Validation

                                    ValidationFactory

                                    ValidationTypeNotFoundError

                                    ValidatorFactory

                                    ValidatorFactoryHandler

                            Injectables

                                    DemoService

                            Interfaces

                                    Option

                            Miscellaneous

                                  Enums

                                  Variables

                            Documentation generated using

                               @voxtecnologia/angular-forms documentation

                                   <input type="text" placeholder="Type to search">

                               Getting started

                                               Overview

                                         README

                                               CHANGELOG

                                               LICENSE

                                       Modules

                                           AngularFormsModule

                                           DataTableModule

                                           DemoModule

                                           ValidationMessageModule

                                   Components

                                           AngularFormsComponent

                                           DataTableComponent

                                           DemoComponent

                                           ValidationMessageComponent

                                   Classes

                                           AngularForms

                                           AngularFormsTranslateLoader

                                           Checkbox

                                           Choice

                                           DataTable

                                           DataTableBuilder

                                           Dependency

                                           DependencyService

                                           Email

                                           EmailValidator

                                           Fieldset

                                           FieldsetBuilder

                                           Group

                                           GroupBuilder

                                           Max

                                           MaxLength

                                           MaxLengthValidator

                                           MaxValidator

                                           Min

                                           MinLength

                                           MinLengthValidator

                                           MinValidator

                                           Pattern

                                           PatternValidator

                                           Question

                                           QuestionFactory

                                           Radio

                                           ReactiveFormsFactory

                                           Required

                                           RequiredValidator

                                           Select

                                           SelectService

                                           StringUtils

                                           Text

                                           TextArea

                                           Validation

                                           ValidationFactory

                                           ValidationTypeNotFoundError

                                           ValidatorFactory

                                           ValidatorFactoryHandler

                                   Injectables

                                           DemoService

                                   Interfaces

                                           Option

                                   Miscellaneous

                                         Enums

                                         Variables

                                   Documentation generated using

Classes

ReactiveFormsFactory

        Info

        Source

File

            src/factory/reactive-forms-factory.ts

Index

Methods

                                        Public createFormArrayFromQuestions

                                        Public createFormGroupFromGroups

                                        Public createFormGroupFromQuestions

                                        Public createValidators

                        Methods

                                    Public createFormArrayFromQuestions

                                    createFormArrayFromQuestions(questions: [][])

Defined in src/factory/reactive-forms-factory.ts:67

                                                Parameters :

                                                            Name
                                                            Type
                                                            Optional
                                                            Description

                                                              questions

                                                                      [][]

                                            Returns :     Promise<>

                                    Public createFormGroupFromGroups

                                    createFormGroupFromGroups(groups: Group[])

Defined in src/factory/reactive-forms-factory.ts:14

                                                Parameters :

                                                            Name
                                                            Type
                                                            Optional
                                                            Description

                                                              groups

                                                                      Group[]

                                            Returns :     Promise<>

                                    Public createFormGroupFromQuestions

                                    createFormGroupFromQuestions(questions: Question[], checkDisabledQuestions: boolean)

Defined in src/factory/reactive-forms-factory.ts:42

                                                Parameters :

                                                            Name
                                                            Type
                                                            Optional
                                                            Description

                                                              questions

                                                                      Question[]

                                                              checkDisabledQuestions

                                                                      boolean

                                            Returns :     Promise<>

                                    Public createValidators

                                    createValidators(validations: Validation[])

Defined in src/factory/reactive-forms-factory.ts:89

                                                Parameters :

                                                            Name
                                                            Type
                                                            Optional
                                                            Description

                                                              validations

                                                                      Validation[]

                                            Returns :     Promise<[]>

import { FormGroup, FormArray, FormControl, ValidatorFn, Validators } from '@angular/forms';

import { Group, GroupType, Fieldset, DataTable } from '../group';
import { Choice, Question } from '../question';
import { Validation, MinLength, MaxLength, Pattern, Required, Min, Max } from '../validation';
import {
  ValidatorFactoryHandler, RequiredValidator, EmailValidator, MaxValidator, MinValidator,
  MaxLengthValidator, MinLengthValidator, PatternValidator
} from '../chain-of-responsibility/validator-factory';
import { ValidationTypeNotFoundError } from '../chain-of-responsibility/validator-factory/error';

export class ReactiveFormsFactory {

  public static async createFormGroupFromGroups(groups: Group<any>[]): Promise<FormGroup> {
    return new Promise<FormGroup>(async (resolve: (formGroup: FormGroup) => void, reject: (error: string) => void) => {
      try {
        const formGroup: FormGroup = new FormGroup({});

        for await (const group of groups) {
          let control: FormGroup | FormArray;

          if (GroupType.FIELDSET === group.type) {
            control = await ReactiveFormsFactory.createFormGroupFromQuestions((<Fieldset>group).questions);
          } else {
            control = await ReactiveFormsFactory.createFormArrayFromQuestions((<DataTable>group).questions.slice(1));

            if ((<DataTable>group).validations && 0 < (<DataTable>group).validations.length) {
              control.setValidators(await ReactiveFormsFactory.createValidators((<DataTable>group).validations));
            }
          }

          formGroup.addControl(group.code, control);
        }

        resolve(formGroup);
      } catch (error) {
        reject(error);
      }
    });
  }

  public static async createFormGroupFromQuestions(questions: Question<any>[], checkDisabledQuestions: boolean = true): Promise<FormGroup> {
    return new Promise<FormGroup>(async (resolve: (formGroup: FormGroup) => void, reject: (error: Error) => void) => {
      try {
        const formGroup: FormGroup = new FormGroup({});

        for await (const question of questions) {
          const validators: ValidatorFn[] = await ReactiveFormsFactory.createValidators(question.validations);
          const answer: any = !question.answer && (<Choice>question).defaultOption ? (<Choice>question).defaultOption : question.answer;
          const formState: any = { value: answer, disabled: checkDisabledQuestions && question.disabled };
          const control: FormControl = new FormControl(formState, validators);

          if (question.validations && 0 < question.validations.length) {
            control.setValidators(await ReactiveFormsFactory.createValidators(question.validations));
          }

          formGroup.addControl(question.name, control);
        }

        resolve(formGroup);
      } catch (error) {
        reject(error);
      }
    });
  }

  public static async createFormArrayFromQuestions(questions: Question<any>[][]): Promise<FormArray> {
    return new Promise<FormArray>(async (resolve: (formArray: FormArray) => void, reject: (error: Error) => void) => {
      try {
        const formArray: FormArray = new FormArray([]);

        for await (const question of questions) {
          const group: FormGroup = new FormGroup({});

          for (const column of question) {
            group.addControl(column.name, new FormControl(column.answer));
          }

          formArray.push(group);
        }

        resolve(formArray);
      } catch (error) {
        reject(error);
      }
    });
  }

  public static async createValidators(validations: Validation[]): Promise<ValidatorFn[]> {
    return new Promise<ValidatorFn[]>(async (resolve: (validators: ValidatorFn[]) => void, reject: (error: Error) => void) => {
      try {
        const validators: ValidatorFn[] = [];

        for await (const validation of validations) {
          const validatorFactoryHandler: ValidatorFactoryHandler = (new RequiredValidator())
            .append(new EmailValidator())
            .append(new MaxValidator())
            .append(new MinValidator())
            .append(new MaxLengthValidator())
            .append(new MinLengthValidator())
            .append(new PatternValidator());

          const validatorFn: ValidatorFn = validatorFactoryHandler.handle(validation);
          validators.push(validatorFn);
        }

        resolve(validators);
      } catch (error) {
        reject(error);
      }
    });
  }
}

 results matching ""

No results matching ""


text:
package mime

import (
	"testing"
)

func TestExtraExtensions(t *testing.T) {
	if !IsKnownExtension("jpg") {
		t.Fatalf("jpg should be a known extension")
	}
	if !IsKnownExtension("jpeg") {
		t.Fatalf("jpeg should be a known extension")
	}

	if "jpg" != TypeJPEG.DefaultExtension() {
		t.Fatalf("jpg should be the default extension")
	}
}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Poria europa P. Karst.

### Remarks
null