text:
title: vc-button
type: components
order: 1
---

* [online demo](https://iwaimai-bi-fe.github.io/vc-button/examples/)
* [github](https://github.com/iwaimai-bi-fe/vc-button)
* [npm](https://www.npmjs.com/package/vc-button)
* [download](https://github.com/iwaimai-bi-fe/vc-button/archive/master.zip)

## Install

``` npm
npm install vc-button --save
```

``` js
// build version
import vcButton from 'vc-button'

// recommend for *.vue project for small bundle size
import vcButton from 'vc-button/src/Button.vue'
```

``` js
// commonjs
require('./dist/build.min.js')
```

``` html
// script tag
<script src='./dist/build.min.js'></script>
```

## Usage

## props

### type

type of button

* default: `确定`
* enum: `default | success | info | primary | warning | danger`
* type: `String`

### htmlType

valid [html type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type) attribute

* default: `button`
* type: `String`

### label

button label

* type: `String`

### shape

shape of button icon

* default: `circle`
* enum: `circle | other`
* type: `String`

### disabled

button disabled

* default: `false`
* type: `Boolean`

### readonly

button readonly

* default: `false`
* type: `Boolean`

### size

size of button

* default `middle`
* enum: `large | middle | small | mini`
* type: `String`

### loading

is loading state?

* default: `false`
* type: `Boolean`

### loadingText

loadingText

* default: `加载中...`
* type: `String`

### style

* type: `Object`

## example

``` js
import Vue from 'vue'
import vcButton from 'vc-button/src'

new Vue({
    el: '#app',
    data () {
        return {
            label: 'use label, no slot',
            type: "warning",
            htmlType: 'button',
            loading: false,
            loadingText: 'loading中',
            size: 'middle',
            icon: 'remove',
            shape: '',
            disabled: false,
            style: {}
        }
    },
    components: {
        vcbutton
    }
})
```

``` html
<vc-button
    :type="type"
    :loading="loading"
    :loading-text="loadingText"
    :size="size"
    :disabled="disabled"
    :icon="icon"
    :shape="shape"
    :style='{ "border-radius": "0px" }'
    @click="handleClick('btn1', '@click', 'is slot, costom style')"
>
    slot & costom style
</vc-button>
```


text:
package MySQLProtocol

type Packet_COM_PING struct {
	Packet
}

func (packet Packet_COM_PING) GetPacketSize(context Context) (size uint64) {
	size += 1
	return size
}

func (packet Packet_COM_PING) ToPacket(context Context) (data []byte) {
	size := packet.GetPacketSize(context)

	data = make([]byte, 0, size+4)
	data = append(data, BuildFixedLengthInteger3(uint32(size))...)
	data = append(data, BuildFixedLengthInteger1(packet.sequence_id)...)
	data = append(data, COM_PING)

	return data
}

func (packet *Packet_COM_PING) FromPacket(context Context, data Proto) {
	data.GetFixedLengthInteger3()
	packet.sequence_id = data.GetFixedLengthInteger1()
	data.GetFixedLengthInteger1()
}

redpajama_set_name: RedPajamaGithub


text:
<?php

##|+PRIV
##|*IDENT=page-status-trafficshaper-queues
##|*NAME=Status: Traffic shaper: Queues
##|*DESCR=Allow access to the 'Status: Traffic shaper: Queues' page.
##|*MATCH=status_queues.php*
##|-PRIV
/*
header("Last-Modified: " . gmdate("D, j M Y H:i:s") . " GMT");
header("Expires: " . gmdate("D, j M Y H:i:s", time()) . " GMT");
header("Cache-Control: no-cache, no-store, must-revalidate"); // HTTP/1.1
header("Pragma: no-cache"); // HTTP/1.0
*/

require_once("guiconfig.inc");
class QueueStats {
	public $queuename;
	public $queuelength;
	public $pps;
	public $bandwidth;
	public $borrows;
	public $suspends;
	public $drops;
}
if (!file_exists("{$g['varrun_path']}/qstats.pid") || !isvalidpid("{$g['varrun_path']}/qstats.pid")) {
	/* Start in the background so we don't hang up the GUI */
	mwexec_bg("/usr/local/sbin/qstats -p {$g['varrun_path']}/qstats.pid");
	/* Give it a moment to start up */
	sleep(1);
}
$fd = @fsockopen("unix://{$g['varrun_path']}/qstats");
if (!$fd) {
	$error = gettext("Something wrong happened during communication with stat gathering.");
} else {
	$stats = "";
	while (!feof($fd)) {
		$stats .= fread($fd, 4096);
	}
	fclose($fd);
	@file_put_contents("{$g['tmp_path']}/qstats", $stats);
	$altqstats = @parse_xml_config("{$g['tmp_path']}/qstats", array("altqstats"));
	if ($altqstats == -1) {
		$error = gettext("No queue statistics could be read.");
	}
}
if ($_REQUEST['getactivity']) {
	$statistics = array();
	$bigger_stat = 0;
	$stat_type = $_REQUEST['stats'];
	/* build the queue stats. */
	foreach ($altqstats['queue'] as $q) {
		statsQueues($q);
	}
	/* calculate the bigger amount of packets or bandwidth being moved through all queues. */
	if ($stat_type == "0") {
		foreach ($statistics as $q) {
			if ($bigger_stat < $q->pps) {
				$bigger_stat = $q->pps;
			}
		}
	} else {
		foreach ($statistics as $q) {
			if ($bigger_stat < $q->bandwidth) {
				$bigger_stat = $q->bandwidth;
			}
		}
	}
	$finscript = "";
	foreach ($statistics as $q) {
		if ($stat_type == "0" && $bigger_stat != "0") {
			$packet_s = round(100 * ($q->pps / $bigger_stat), 0);
		} else if ($bigger_stat != "0") {
			$packet_s = round(100 * ($q->bandwidth / $bigger_stat), 0);
		} else {
			$packet_s = 0;
		}
		$finscript .= "$('#queue{$q->queuename}width').css('width','{$packet_s}%');";
		$finscript .= "$('#queue{$q->queuename}pps').val('" . number_format($q->pps, 1) . "');";
		$finscript .= "$('#queue{$q->queuename}bps').val('" . format_bits($q->bandwidth) . "');";
		$finscript .= "$('#queue{$q->queuename}borrows').val('{$q->borrows}');";
		$finscript .= "$('#queue{$q->queuename}suspends').val('{$q->suspends}');";
		$finscript .= "$('#queue{$q->queuename}drops').val('{$q->drops}');";
		$finscript .= "$('#queue{$q->queuename}length').val('{$q->queuelength}');";
	}
	unset($statistics, $altqstats);
	header("Content-type: text/javascript");
	echo $finscript;
	exit;
}
$pgtitle = array(gettext("Status"), gettext("Queues"));
$shortcut_section = "trafficshaper";
include("head.inc");

if (!is_array($config['shaper']['queue']) || count($config['shaper']['queue']) < 1) {
	print_info_box(gettext("Traffic shaping is not configured."));
	include("foot.inc");
	exit;
}

if (!$error): ?>
<form action="status_queues.php" method="post">

<?php endif;

if ($error):
	print_info_box($error);
else: ?>

<?=gettext("Status Queues"); ?>

						<?=gettext("Queue"); ?>
						<?=gettext("Statistics"); ?>
							<select id="selStatistic" class="form-control">
								<option value="0"><?=gettext("PPS");?></option>
								<option value="1"><?=gettext("Bandwidth");?></option>
							</select>

						<?=gettext("PPS"); ?>
						<?=gettext("Bandwidth"); ?>
						<?=gettext("Borrows"); ?>
						<?=gettext("Suspends"); ?>
						<?=gettext("Drops"); ?>
						<?=gettext("Length"); ?>

<?php
	$if_queue_list = get_configured_interface_list_by_realif(false, true);
	processQueues($altqstats, 0, "");
?>
<?php endif; ?>

<?php
	print_info_box(gettext("Queue graphs take 5 seconds to sample data."), 'info', false);
?>

</form>
<?php

include("foot.inc");

function processQueues($altqstats, $level, $parent_name) {
	global $g;
	global $if_queue_list;

	$parent_name = $parent_name . " queuerow" . $altqstats['name'] . $altqstats['interface'];
	$prev_if = $altqstats['interface'];
	foreach ($altqstats['queue'] as $q) {
		$if_name = "";
		foreach ($if_queue_list as $oif => $real_name) {
			if ($oif == $q['interface']) {
				$if_name = $real_name;
				break;
			}
		}
		if ($prev_if != $q['interface']) {
			echo "
Interface " . htmlspecialchars(convert_real_interface_to_friendly_descr($q['interface'])) . "
\n";
			$prev_if = $q['interface'];
		}
?>
		<tr class="<?=$parent_name;?>">
			<td class="<?=$row_class?>" style="padding-left:<?=$level * 20?>px;">
				<?php
				if (is_array($q['queue'])) {
					echo "+/-";
				}
				if (strstr($q['name'], "root_")) {
					echo "Root queue";
				} else {
					echo "" . htmlspecialchars($q['name']) . "";
				}
				?>

<?php
		$cpuUsage = 0;
		print('');
		print('
');
		print('

');
		print('
');
		print('	');
		print('<input readonly style="border:0;width:70px;text-align:right;" name="queue' . $q['name'] . $q['interface'] . 'pps"      id="queue' . $q['name'] . $q['interface'] . 'pps"      value="(' . gettext("Loading") . ')" />	');
		print('<input readonly style="border:0;width:80px;text-align:right;" name="queue' . $q['name'] . $q['interface'] . 'bps"      id="queue' . $q['name'] . $q['interface'] . 'bps"      value="" />	');
		print('<input readonly style="border:0;width:70px;text-align:right;" name="queue' . $q['name'] . $q['interface'] . 'borrows"  id="queue' . $q['name'] . $q['interface'] . 'borrows"  value="" />	');
		print('<input readonly style="border:0;width:70px;text-align:right;" name="queue' . $q['name'] . $q['interface'] . 'suspends" id="queue' . $q['name'] . $q['interface'] . 'suspends" value="" />	');
		print('<input readonly style="border:0;width:70px;text-align:right;" name="queue' . $q['name'] . $q['interface'] . 'drops"    id="queue' . $q['name'] . $q['interface'] . 'drops"    value="" />	');
		print('<input readonly style="border:0;width:70px;text-align:right;" name="queue' . $q['name'] . $q['interface'] . 'length"   id="queue' . $q['name'] . $q['interface'] . 'length"   value="" />	');
?>

<?php
		if (is_array($q['queue'])) {
			processQueues($q, $level + 1, $parent_name);
		}
	};
}

function statsQueues($xml) {
	global $statistics;

	$current = new QueueStats();
	$child = new QueueStats();
	$current->queuename = $xml['name'] . $xml['interface'];
	$current->queuelength = $xml['qlength'];
	$current->pps = $xml['measured'];
	$current->bandwidth = $xml['measuredspeedint'];
	$current->borrows = intval($xml['borrows']);
	$current->suspends = intval($xml['suspends']);
	$current->drops = intval($xml['droppedpkts']);
	if (is_array($xml['queue'])) {
		foreach ($xml['queue'] as $q) {
			$child = statsQueues($q);
			$current->pps += $child->pps;
			$current->bandwidth += $child->bandwidth;
			$current->borrows += $child->borrows;
			$current->suspends += $child->suspends;
			$current->drops += $child->drops;
		}
	}
	unset($child);
	$statistics[] = $current;
	return $current;
}
function format_bits($bits) {
	if ($bits >= 1000000000) {
		return sprintf("%.2f Gbps", $bits/1000000000);
	} else if ($bits >= 1000000) {
		return sprintf("%.2f Mbps", $bits/1000000);
	} else if ($bits >= 1000) {
		return sprintf("%.2f Kbps", $bits/1000);
	} else {
		return sprintf("%d bps", $bits);
	}
}
?>


text:
''' Provides the ``ServerSession`` class.

'''
from __future__ import absolute_import

class ServerConnection(object):
    ''' Wraps a websocket connection to a client.
    '''

    def __init__(self, protocol, socket, application_context, session):
        self._protocol = protocol
        self._socket = socket
        self._application_context = application_context
        self._session = session
        self._session.subscribe(self)

    @property
    def session(self):
        return self._session

    @property
    def application_context(self):
        return self._application_context

    def detach_session(self):
        """Allow the session to be discarded and don't get change notifications from it anymore"""
        if self._session is not None:
            self._session.unsubscribe(self)
            self._session = None

    def ok(self, message):
        return self.protocol.create('OK', message.header['msgid'])

    def error(self, message, text):
        return self.protocol.create('ERROR', message.header['msgid'], text)

    def send_patch_document(self, event):
        msg = self.protocol.create('PATCH-DOC', [event])
        self._socket.send_message(msg)

    @property
    def protocol(self):
        return self._protocol


text:
<!DOCTYPE html>

    <title>Sugoi Admin</title>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link rel="stylesheet" href="css/admin.css">

Sugoi Admin

			<form role="form">

			    <input type="user" class="form-control input-glass"
			    	id="email" placeholder="Username">

			    <input type="password" class="form-control input-glass"
			    	id="pass" placeholder="Password">

			  <button type="submit" class="btn btn-primary btn-block btn-lg">Sign in</button>
			</form>
			Don't have an account yet?


text:
<!DOCTYPE html>

    <title>Studiowangfei | Project</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name=viewport content="width=device-width, initial-scale=1">
    <link type="text/css" rel="stylesheet" href="../css/core.css" />
    <link type="text/css" rel="stylesheet" href="../css/project_page.css" />
    <link rel="icon" href="../img/icon.png" />

W@RK


text:
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
  <component name="ChangeListManager">
    <list default="true" id="f9e7aee4-76e2-4c05-8f96-64f9faeedb2c" name="Default" comment="">
      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/encodings.xml" />
      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/gobabbe.iml" />
      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/misc.xml" />
      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/modules.xml" />
      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/scopes/scope_settings.xml" />
      <change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/.idea/vcs.xml" />
      <change type="MOVED" beforePath="$PROJECT_DIR$/app/controllers/HomeController.php" afterPath="$PROJECT_DIR$/app/controllers/PagesController.php" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/models/User.php" afterPath="$PROJECT_DIR$/app/models/User.php" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/config/app.php" afterPath="$PROJECT_DIR$/app/config/app.php" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/composer.json" afterPath="$PROJECT_DIR$/composer.json" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/config/database.php" afterPath="$PROJECT_DIR$/app/config/database.php" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/config/local/database.php" afterPath="$PROJECT_DIR$/app/config/local/database.php" />
      <change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/routes.php" afterPath="$PROJECT_DIR$/app/routes.php" />
    </list>
    <ignored path="gobabbe.iws" />
    <ignored path=".idea/workspace.xml" />
    <ignored path=".idea/dataSources.local.xml" />
    <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
    <option name="TRACKING_ENABLED" value="true" />
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
    <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
    <option name="LAST_RESOLUTION" value="IGNORE" />
  </component>
  <component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
  <component name="CreatePatchCommitExecutor">
    <option name="PATCH_PATH" value="" />
  </component>
  <component name="DaemonCodeAnalyzer">
    <disable_hints />
  </component>
  <component name="FavoritesManager">
    <favorites_list name="gobabbe" />
  </component>
  <component name="FileEditorManager">
    <leaf>
      <file leaf-file-name="_navbar.blade.php" pinned="false" current-in-tab="true">
        <entry file="file://$PROJECT_DIR$/app/views/layouts/_partials/_navbar.blade.php">
          <provider selected="true" editor-type-id="text-editor">
            <state vertical-scroll-proportion="0.5217391" vertical-offset="324" max-vertical-offset="1692">
              <caret line="19" column="104" selection-start-line="19" selection-start-column="104" selection-end-line="19" selection-end-column="104" />
              <folding>
                <element signature="n#style#0;n#form#0;n#div#1;n#div#0;n#nav#0;n#!!top" expanded="true" />
                <element signature="n#style#0;n#input#0;n#div#0;n#form#0;n#div#1;n#div#0;n#nav#0;n#!!top" expanded="true" />
              </folding>
            </state>
          </provider>
        </entry>
      </file>
    </leaf>
  </component>
  <component name="FindManager">
    <FindUsagesManager>
      <setting name="OPEN_NEW_TAB" value="true" />
    </FindUsagesManager>
  </component>
  <component name="Git.Settings">
    <option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
  </component>
  <component name="IdeDocumentHistory">
    <option name="changedFiles">
      <list>
        <option value="$PROJECT_DIR$/composer.json" />
        <option value="$PROJECT_DIR$/app/config/app.php" />
        <option value="$PROJECT_DIR$/app/views/layouts/_partials/footer.blade.php" />
        <option value="$PROJECT_DIR$/app/views/pages/home.php" />
        <option value="$PROJECT_DIR$/app/controllers/PagesController.php" />
        <option value="$PROJECT_DIR$/app/views/pages/home.blade.php" />
        <option value="$PROJECT_DIR$/app/models/User.php" />
        <option value="$PROJECT_DIR$/app/views/pages/register.blade.php" />
        <option value="$PROJECT_DIR$/app/config/local/database.php" />
        <option value="$PROJECT_DIR$/app/config/database.php" />
        <option value="$PROJECT_DIR$/app/database/migrations/2014_12_10_164729_add_remember_token_users_table.php" />
        <option value="$PROJECT_DIR$/app/views/layouts/default.blade.php" />
        <option value="$PROJECT_DIR$/app/routes.php" />
        <option value="$PROJECT_DIR$/app/views/pages/login.blade.php" />
        <option value="$PROJECT_DIR$/app/controllers/SessionController.php" />
        <option value="$PROJECT_DIR$/app/views/layouts/_partials/_navbar.blade.php" />
      </list>
    </option>
  </component>
  <component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
  <component name="ProjectFrameBounds">
    <option name="y" value="23" />
    <option name="width" value="1280" />
    <option name="height" value="712" />
  </component>
  <component name="ProjectLevelVcsManager" settingsEditedManually="false">
    <OptionsSetting value="true" id="Add" />
    <OptionsSetting value="true" id="Remove" />
    <OptionsSetting value="true" id="Checkout" />
    <OptionsSetting value="true" id="Update" />
    <OptionsSetting value="true" id="Status" />
    <OptionsSetting value="true" id="Edit" />
    <ConfirmationsSetting value="1" id="Add" />
    <ConfirmationsSetting value="0" id="Remove" />
  </component>
  <component name="ProjectReloadState">
    <option name="STATE" value="0" />
  </component>
  <component name="ProjectView">
    <navigator currentView="ProjectPane" proportions="" version="1">
      <flattenPackages />
      <showMembers />
      <showModules />
      <showLibraryContents />
      <hideEmptyPackages />
      <abbreviatePackageNames />
      <autoscrollToSource />
      <autoscrollFromSource />
      <sortByType />
    </navigator>
    <panes>
      <pane id="Scope" />
      <pane id="ProjectPane">
        <subPane>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="gobabbe" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="gobabbe" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="gobabbe" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="gobabbe" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="gobabbe" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="app" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="gobabbe" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="gobabbe" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="app" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="views" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="gobabbe" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="gobabbe" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="app" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="views" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="pages" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="gobabbe" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="gobabbe" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="app" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="views" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="layouts" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="gobabbe" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="gobabbe" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="app" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="views" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="layouts" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="_partials" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="gobabbe" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="gobabbe" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="app" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="models" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="gobabbe" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="gobabbe" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="app" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="database" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
          <PATH>
            <PATH_ELEMENT>
              <option name="myItemId" value="gobabbe" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.ProjectViewProjectNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="gobabbe" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="app" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="database" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
            <PATH_ELEMENT>
              <option name="myItemId" value="migrations" />
              <option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
            </PATH_ELEMENT>
          </PATH>
        </subPane>
      </pane>
    </panes>
  </component>
  <component name="PropertiesComponent">
    <property name="options.lastSelected" value="reference.settingsdialog.IDE.editor.colors" />
    <property name="options.splitter.main.proportions" value="0.3" />
    <property name="options.splitter.details.proportions" value="0.2" />
    <property name="WebServerToolWindowFactoryState" value="false" />
    <property name="FullScreen" value="false" />
  </component>
  <component name="RunManager">
    <configuration default="true" type="PHPUnitRunConfigurationType" factoryName="PHPUnit">
      <TestRunner />
      <method />
    </configuration>
    <configuration default="true" type="PhpLocalRunConfigurationType" factoryName="PHP Console">
      <method />
    </configuration>
    <configuration default="true" type="JavascriptDebugType" factoryName="JavaScript Debug">
      <method />
    </configuration>
    <configuration default="true" type="PhpBehatConfigurationType" factoryName="Behat">
      <BehatRunner />
      <method />
    </configuration>
    <configuration default="true" type="PhpUnitRemoteRunConfigurationType" factoryName="PHPUnit on Server">
      <method />
    </configuration>
    <configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
      <method />
    </configuration>
    <list size="0" />
  </component>
  <component name="ShelveChangesManager" show_recycled="false" />
  <component name="TaskManager">
    <task active="true" id="Default" summary="Default task">
      <changelist id="f9e7aee4-76e2-4c05-8f96-64f9faeedb2c" name="Default" comment="" />
      <created>1418221238563</created>
      <option name="number" value="Default" />
      <updated>1418221238563</updated>
    </task>
    <servers />
  </component>
  <component name="ToolWindowManager">
    <frame x="0" y="23" width="1280" height="712" extended-state="6" />
    <editor active="true" />
    <layout>
      <window_info id="Changes" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
      <window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
      <window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
      <window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
      <window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Application Servers" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
      <window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
      <window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
      <window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
      <window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
      <window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
      <window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
      <window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
      <window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
      <window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
      <window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
      <window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
    </layout>
  </component>
  <component name="Vcs.Log.UiProperties">
    <option name="RECENTLY_FILTERED_USER_GROUPS">
      <collection />
    </option>
    <option name="RECENTLY_FILTERED_BRANCH_GROUPS">
      <collection />
    </option>
  </component>
  <component name="VcsContentAnnotationSettings">
    <option name="myLimit" value="2678400000" />
  </component>
  <component name="VcsManagerConfiguration">
    <option name="myTodoPanelSettings">
      <TodoPanelSettings />
    </option>
  </component>
  <component name="XDebuggerManager">
    <breakpoint-manager />
    <watches-manager />
  </component>
  <component name="editorHistoryManager">
    <entry file="file://$PROJECT_DIR$/app/start/global.php">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="2808">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/bootstrap/start.php">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.20869565" vertical-offset="540" max-vertical-offset="2520">
          <caret line="28" column="33" selection-start-line="19" selection-start-column="33" selection-end-line="19" selection-end-column="33" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/app/config/local/app.php">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.0" vertical-offset="0" max-vertical-offset="864">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/composer.json">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.4173913" vertical-offset="0" max-vertical-offset="1584">
          <caret line="8" column="31" selection-start-line="8" selection-start-column="31" selection-end-line="8" selection-end-column="31" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/app/config/app.php">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.5304348" vertical-offset="4062" max-vertical-offset="7236">
          <caret line="123" column="49" selection-start-line="123" selection-start-column="49" selection-end-line="123" selection-end-column="49" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/app/views/layouts/_partials/_footer.blade.php">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.15652174" vertical-offset="0" max-vertical-offset="690">
          <caret line="3" column="46" selection-start-line="3" selection-start-column="46" selection-end-line="3" selection-end-column="46" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/app/controllers/PagesController.php">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.47826087" vertical-offset="354" max-vertical-offset="1044">
          <caret line="19" column="37" selection-start-line="19" selection-start-column="37" selection-end-line="19" selection-end-column="37" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/app/database/migrations/2014_12_10_155726_create_users_table.php">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="-0.62608695" vertical-offset="432" max-vertical-offset="1512">
          <caret line="0" column="0" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/app/models/User.php">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.5217391" vertical-offset="180" max-vertical-offset="1368">
          <caret line="18" column="18" selection-start-line="15" selection-start-column="18" selection-end-line="15" selection-end-column="18" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/app/config/local/database.php">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.31304348" vertical-offset="684" max-vertical-offset="1908">
          <caret line="25" column="32" selection-start-line="25" selection-start-column="32" selection-end-line="25" selection-end-column="32" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/app/config/database.php">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.4173913" vertical-offset="1836" max-vertical-offset="4716">
          <caret line="59" column="73" selection-start-line="59" selection-start-column="73" selection-end-line="59" selection-end-column="73" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/app/database/migrations/2014_12_10_164729_add_remember_token_users_table.php">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="1.3130435" vertical-offset="138" max-vertical-offset="1440">
          <caret line="30" column="49" selection-start-line="29" selection-start-column="49" selection-end-line="29" selection-end-column="49" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/_IDE_helper.php">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.33333334" vertical-offset="3046" max-vertical-offset="367812">
          <caret line="91" column="31" selection-start-line="91" selection-start-column="31" selection-end-line="91" selection-end-column="31" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/app/views/pages/register.blade.php">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.4173913" vertical-offset="576" max-vertical-offset="1692">
          <caret line="24" column="101" selection-start-line="24" selection-start-column="25" selection-end-line="24" selection-end-column="101" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/app/views/pages/home.blade.php">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.62608695" vertical-offset="0" max-vertical-offset="690">
          <caret line="12" column="5" selection-start-line="12" selection-start-column="5" selection-end-line="12" selection-end-column="5" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/app/views/layouts/default.blade.php">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.62608695" vertical-offset="288" max-vertical-offset="1260">
          <caret line="20" column="4" selection-start-line="20" selection-start-column="4" selection-end-line="20" selection-end-column="4" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/app/routes.php">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.052173913" vertical-offset="0" max-vertical-offset="828">
          <caret line="1" column="0" selection-start-line="1" selection-start-column="0" selection-end-line="1" selection-end-column="0" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/app/views/pages/login.blade.php">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.5217391" vertical-offset="252" max-vertical-offset="1332">
          <caret line="17" column="23" selection-start-line="17" selection-start-column="23" selection-end-line="17" selection-end-column="23" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/app/controllers/SessionController.php">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.31304348" vertical-offset="0" max-vertical-offset="3852">
          <caret line="6" column="34" selection-start-line="6" selection-start-column="34" selection-end-line="6" selection-end-column="34" />
          <folding />
        </state>
      </provider>
    </entry>
    <entry file="file://$PROJECT_DIR$/app/views/layouts/_partials/_navbar.blade.php">
      <provider selected="true" editor-type-id="text-editor">
        <state vertical-scroll-proportion="0.5217391" vertical-offset="324" max-vertical-offset="1692">
          <caret line="19" column="104" selection-start-line="19" selection-start-column="104" selection-end-line="19" selection-end-column="104" />
          <folding>
            <element signature="n#style#0;n#form#0;n#div#1;n#div#0;n#nav#0;n#!!top" expanded="true" />
            <element signature="n#style#0;n#input#0;n#div#0;n#form#0;n#div#1;n#div#0;n#nav#0;n#!!top" expanded="true" />
          </folding>
        </state>
      </provider>
    </entry>
  </component>
</project>


text:
package io.locative.app.view;

import android.Manifest;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.content.DialogInterface;
import android.content.pm.PackageManager;
import android.database.Cursor;
import android.graphics.Color;
import android.location.Address;
import android.location.Geocoder;
import android.location.Location;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Build;
import android.os.Bundle;
import android.os.Message;
import android.support.annotation.NonNull;
import android.support.v4.widget.NestedScrollView;
import android.util.Log;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.SeekBar;
import android.widget.Switch;
import android.widget.TextView;

import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.model.LatLng;
import com.schuetz.mapareas.MapAreaManager;
import com.schuetz.mapareas.MapAreaManager.CircleManagerListener;
import com.schuetz.mapareas.MapAreaMeasure;
import com.schuetz.mapareas.MapAreaWrapper;

import java.io.IOException;
import java.util.List;
import java.util.Locale;
import java.util.Random;
import java.util.UUID;

import butterknife.BindView;
import butterknife.OnClick;
import io.locative.app.LocativeApplication;
import io.locative.app.R;
import io.locative.app.geo.LocativeGeocoder;
import io.locative.app.geo.LocativeLocationManager;
import io.locative.app.map.WorkaroundMapFragment;
import io.locative.app.persistent.GeofenceProvider;
import io.locative.app.utils.Constants;
import io.locative.app.utils.GeocodeHandler;
import io.locative.app.utils.UrlValidator;

public class AddEditGeofenceActivity extends BaseActivity implements OnMapReadyCallback {

    public static final String TYPE = "type";

    public static final int DEFAULT_RADIUS_METERS = 50;
    public static final int MAX_RADIUS_METERS = 500;

    @BindView(R.id.address_button)
    Button mLocationButton;

    @BindView(R.id.customLocationId)
    EditText mCustomId;

    @BindView(R.id.trigger_enter)
    Switch mTriggerEnter;

    @BindView(R.id.trigger_exit)
    Switch mTriggerExit;

    @BindView(R.id.enter_method_button)
    Button mEnterMethodButton;

    @BindView(R.id.enter_url_text)
    EditText mEnterUrl;

    @BindView(R.id.exit_method_button)
    Button mExitMethodButton;

    @BindView(R.id.exit_url_text)
    EditText mExitUrl;

    @BindView(R.id.radius_slider)
    SeekBar mRadiusSlider;

    @BindView(R.id.radius_label)
    TextView mRadiusLabel;

    @BindView(R.id.basic_auth_switch)
    Switch mBasicAuthSwitch;

    @BindView(R.id.basic_auth_username)
    EditText mBasicAuthUsername;

    @BindView(R.id.basic_auth_password)
    EditText mBasicAuthPassword;

    @BindView(R.id.scrollView)
    NestedScrollView mScrollView;

    public String mEditGeofenceId;
    private boolean mIsEditingGeofence = false;

    private LocativeLocationManager mLocativeLocationManager = null;
    private MapAreaManager mCircleManager = null;
    private MapAreaWrapper mCircle = null;
    public ProgressDialog mProgressDialog = null;

    private GeocodeHandler mGeocoderHandler = null;
    private boolean mAddressIsDirty = true;
    //private boolean mGeocoderIsActive = false;
    private boolean mGeocodeAndSave = false;
    private boolean mSaved = false;
    private Constants.HttpMethod mEnterMethod = Constants.HttpMethod.POST;
    private Constants.HttpMethod mExitMethod = Constants.HttpMethod.POST;
    private GoogleMap mMap = null;

    LocativeLocationManager.LocationResult locationResult = new LocativeLocationManager.LocationResult() {
        @Override
        public void gotLocation(Location location) {
            //LatLng latLng = new LatLng(location.getLatitude(), location.getLongitude());
            if (mMap != null) {
                zoomToLocation(location);
            }
            setCircleToLocation(location);
            doReverseGeocoding(location);
        }
    };

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ((LocativeApplication) getApplication()).getComponent().inject(this);

        // Already existing (editing) Geofence?
        mEditGeofenceId = getIntent().getStringExtra("geofenceId");
        Log.d(Constants.LOG, "mEditGeofenceId: " + mEditGeofenceId);
        if (mEditGeofenceId != null) {
            mIsEditingGeofence = true;
        }

        mRadiusSlider.setMax(MAX_RADIUS_METERS);
        mRadiusSlider.setProgress(DEFAULT_RADIUS_METERS);
        mRadiusSlider.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() {
            @Override
            public void onProgressChanged(SeekBar seekBar, int radiusMeters, boolean fromUser) {
                if (mCircle != null) {
                    updateRadius();
                }
            }

            @Override
            public void onStartTrackingTouch(SeekBar seekBar) {

            }

            @Override
            public void onStopTrackingTouch(SeekBar seekBar) {

            }
        });

        WorkaroundMapFragment mapFragment = (WorkaroundMapFragment) getSupportFragmentManager()
                .findFragmentById(R.id.map);
        mapFragment.getMapAsync(this);
        mapFragment.setListener(new WorkaroundMapFragment.OnTouchListener() {
            @Override
            public void onTouch() {
                mScrollView.requestDisallowInterceptTouchEvent(true);
            }
        });

        mGeocoderHandler = new GeocodeHandler(this);
        updateRadius();
    }

    @SuppressWarnings("unsed")
    @OnClick({R.id.address_button, R.id.enter_method_button, R.id.exit_method_button})
    public void onButtonClick(View view) {
        int id = view.getId();
        switch (id) {
            case R.id.address_button:
                final EditText addressTextField = new EditText(view.getContext());
                new AlertDialog.Builder(view.getContext())
                        .setMessage("Enter Address manually:")
                        .setView(addressTextField)
                        .setPositiveButton("OK", new DialogInterface.OnClickListener() {
                            @Override
                            public void onClick(DialogInterface dialog, int which) {
                                doGeocodingAndPositionCircle(addressTextField.getText().toString());
                                dialog.dismiss();
                            }
                        })
                        .setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
                            @Override
                            public void onClick(DialogInterface dialog, int which) {
                                dialog.cancel();
                            }
                        })
                        .show();
                break;
            case R.id.enter_method_button:
                selectMethodForTriggerType(Constants.TriggerType.ARRIVAL);
                break;
            case R.id.exit_method_button:
                selectMethodForTriggerType(Constants.TriggerType.DEPARTURE);
                break;
        }

    }

    /**
     * Manipulates the map once available.
     * This callback is triggered when the map is ready to be used.
     * This is where we can add markers or lines, add listeners or move the camera. In this case,
     * we just add a marker near Sydney, Australia.
     * If Google Play services is not installed on the device, the user will be prompted to install
     * it inside the SupportMapFragment. This method will only be triggered once the user has
     * installed Google Play services and returned to the app.
     */
    @Override
    public void onMapReady(GoogleMap googleMap) {
        mMap = googleMap;
        mMap.getUiSettings().setZoomControlsEnabled(false);
        mMap.getUiSettings().setAllGesturesEnabled(true);
        mMap.getUiSettings().setMyLocationButtonEnabled(true);

        mMap.setMapType(GoogleMap.MAP_TYPE_NORMAL);

        // TODO request permission if not given
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
            if (checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED ||
                    checkSelfPermission(Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
                mMap.setMyLocationEnabled(true);
            }
        } else {
            // we have permission since requested on app install
            mMap.setMyLocationEnabled(true);
        }
        mMap.getUiSettings().setZoomControlsEnabled(false);

        Cursor cursor = null;
        if (mIsEditingGeofence) {
            ContentResolver resolver = this.getContentResolver();
            cursor = resolver.query(Uri.parse("content://" + getString(R.string.authority) + "/geofences"), null, "custom_id = ?", new String[]{String.valueOf(mEditGeofenceId)}, null);
            if (cursor != null && cursor.getCount() > 0) {
                cursor.moveToFirst();
                mLocationButton.setText(cursor.getString(cursor.getColumnIndex(GeofenceProvider.Geofence.KEY_NAME)));
                mRadiusSlider.setProgress(cursor.getInt(cursor.getColumnIndex(GeofenceProvider.Geofence.KEY_RADIUS)));
                mCustomId.setText(cursor.getString(cursor.getColumnIndex(GeofenceProvider.Geofence.KEY_CUSTOMID)));

                // Triggers
                int triggers = cursor.getInt(cursor.getColumnIndex(GeofenceProvider.Geofence.KEY_TRIGGER));
                mTriggerEnter.setChecked(((triggers & GeofenceProvider.TRIGGER_ON_ENTER) == GeofenceProvider.TRIGGER_ON_ENTER));
                mTriggerExit.setChecked(((triggers & GeofenceProvider.TRIGGER_ON_EXIT) == GeofenceProvider.TRIGGER_ON_EXIT));

                int enterMethod = cursor.getInt(cursor.getColumnIndex(GeofenceProvider.Geofence.KEY_ENTER_METHOD));
                mEnterMethodButton.setText(enterMethod == 0 ? "POST" : "GET");
                mEnterMethod = (Constants.HttpMethod.POST.ordinal() == enterMethod) ? Constants.HttpMethod.POST : Constants.HttpMethod.GET;
                mEnterUrl.setText(cursor.getString(cursor.getColumnIndex(GeofenceProvider.Geofence.KEY_ENTER_URL)));

                int exitMethod = cursor.getInt(cursor.getColumnIndex(GeofenceProvider.Geofence.KEY_EXIT_METHOD));
                mExitMethodButton.setText(exitMethod == 0 ? "POST" : "GET");
                mExitMethod = (Constants.HttpMethod.POST.ordinal() == enterMethod) ? Constants.HttpMethod.POST : Constants.HttpMethod.GET;
                mExitUrl.setText(cursor.getString(cursor.getColumnIndex(GeofenceProvider.Geofence.KEY_EXIT_URL)));

                mBasicAuthSwitch.setChecked(cursor.getInt(cursor.getColumnIndex(GeofenceProvider.Geofence.KEY_HTTP_AUTH)) != 0);
                mBasicAuthUsername.setText(cursor.getString(cursor.getColumnIndex(GeofenceProvider.Geofence.KEY_HTTP_USERNAME)));
                mBasicAuthPassword.setText(cursor.getString(cursor.getColumnIndex(GeofenceProvider.Geofence.KEY_HTTP_PASSWORD)));
            }
        }

        mLocativeLocationManager = new LocativeLocationManager();
        if (!mIsEditingGeofence) {
            mLocativeLocationManager.getLocation(this, locationResult);
        }
        Location location;
        if (mMap.isMyLocationEnabled() && mMap.getMyLocation() != null && !mIsEditingGeofence) {
            location = mMap.getMyLocation();
            mMap.getMyLocation();
        } else if (cursor != null) {
            location = new Location("location");
            location.setLatitude(cursor.getDouble(cursor.getColumnIndex(GeofenceProvider.Geofence.KEY_LATITUDE)));
            location.setLongitude(cursor.getDouble(cursor.getColumnIndex(GeofenceProvider.Geofence.KEY_LONGITUDE)));
        } else {
            // New York
            location = new Location("custom");
            location.setLatitude(40.7127);
            location.setLongitude(74.0059);
        }

        mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(new LatLng(location.getLatitude(), location.getLongitude()), 16));

        setupCircleManager();
        if (mIsEditingGeofence) {
            setCircleToLocation(location);
            int radiusMeters = cursor.getInt(cursor.getColumnIndex(GeofenceProvider.Geofence.KEY_RADIUS));
            mRadiusSlider.setProgress(radiusMeters);
        }

        updateRadius();
    }

    @Override
    public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
        switch (requestCode) {
            case LocativeLocationManager.MY_PERMISSIONS_REQUEST:
                mLocativeLocationManager.onRequestPermissionsResult(requestCode, permissions, grantResults);
                break;
        }
    }

    @Override
    protected int getLayoutResourceId() {
        return R.layout.activity_add_edit_geofence;
    }

    @Override
    protected String getToolbarTitle() {
        // need to replace by add or edit
        return "Add Geofence";
    }

    @Override
    protected int getMenuResourceId() {
        return R.menu.add_edit_geofence;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();
        if (id == R.id.action_save) {

            // Bail out ealy if webhook urls are borked
            if (!validateUrls()) {
                return false;
            }

            // Save Geofence / Add new one
            if (!mAddressIsDirty) {
                this.save(true);
                return true;
            }

            if (mCircle == null) {
                return false;
            }

            mProgressDialog = new ProgressDialog(this);
            mProgressDialog.setTitle(R.string.loading);
            mProgressDialog.setMessage(getResources().getString(R.string.geocoding_progress_message));
            mProgressDialog.setIndeterminate(true);
            mProgressDialog.show();

            mGeocodeAndSave = true;
            doReverseGeocodingOfCircleLocation();

            return true;
        }
        return super.onOptionsItemSelected(item);
    }

    private boolean validateUrls() {
        // Check for valid 'Enter' URL, or bail out.
        if (mEnterUrl.getText().length() > 0 &&
                !new UrlValidator(mEnterUrl.getText().toString()).validate()) {
            new AlertDialog.Builder(this)
                    .setTitle(R.string.save_error_title)
                    .setMessage(R.string.save_error_invalid_enter_url)
                    .setNeutralButton(R.string.ok, null)
                    .show();
            return false;
        }

        // Check for valid 'Exit' URL, or bail out.
        if (mExitUrl.getText().length() > 0 &&
                !new UrlValidator(mExitUrl.getText().toString()).validate()) {
            new AlertDialog.Builder(this)
                    .setTitle(R.string.save_error_title)
                    .setMessage(R.string.save_error_invalid_exit_url)
                    .setNeutralButton(R.string.ok, null)
                    .show();
            return false;
        }
        return true;
    }

    public void save(boolean finish) {

        if (!validateUrls()) {
            return;
        }

        Log.i(Constants.LOG, "Saved #1: " + mSaved);

        if (mSaved) {
            return;
        }

        mSaved = true;
        ContentResolver resolver = this.getContentResolver();
        ContentValues values = new ContentValues();

        String custom_id = mCustomId.getText().toString();
        if (mIsEditingGeofence) {
            Cursor existingCursor = resolver.query(Uri.parse("content://" + getString(R.string.authority) + "/geofences"), null, "custom_id = ?", new String[]{String.valueOf(mEditGeofenceId)}, null);
            if (existingCursor != null && existingCursor.getCount() > 0) {
                existingCursor.moveToFirst();
                if (custom_id.length() == 0) {
                    custom_id = existingCursor.getString(existingCursor.getColumnIndex(GeofenceProvider.Geofence.KEY_CUSTOMID));
                }
            }
        }

        if (custom_id.length() == 0 && !mIsEditingGeofence) {
            custom_id = new UUID(new Random().nextLong(), new Random().nextLong()).toString();
        }

        int triggers = 0;
        if (mTriggerEnter.isChecked()) {
            triggers |= GeofenceProvider.TRIGGER_ON_ENTER;
        }
        if (mTriggerExit.isChecked()) {
            triggers |= GeofenceProvider.TRIGGER_ON_EXIT;
        }

        Log.d(Constants.LOG, "Triggers: " + triggers);

        values.put(GeofenceProvider.Geofence.KEY_NAME, mLocationButton.getText().toString());
        values.put(GeofenceProvider.Geofence.KEY_RADIUS, mCircle.getRadius()); // in meters
        values.put(GeofenceProvider.Geofence.KEY_CUSTOMID, custom_id);
        values.put(GeofenceProvider.Geofence.KEY_ENTER_METHOD, this.methodForTriggerType(Constants.TriggerType.ARRIVAL).ordinal());
        values.put(GeofenceProvider.Geofence.KEY_ENTER_URL, mEnterUrl.getText().toString());
        values.put(GeofenceProvider.Geofence.KEY_TRIGGER, triggers);
        values.put(GeofenceProvider.Geofence.KEY_EXIT_METHOD, this.methodForTriggerType(Constants.TriggerType.DEPARTURE).ordinal());
        values.put(GeofenceProvider.Geofence.KEY_EXIT_URL, mExitUrl.getText().toString());
        values.put(GeofenceProvider.Geofence.KEY_HTTP_AUTH, mBasicAuthSwitch.isChecked() ? 1 : 0);
        values.put(GeofenceProvider.Geofence.KEY_HTTP_USERNAME, mBasicAuthUsername.getText().toString());
        values.put(GeofenceProvider.Geofence.KEY_HTTP_PASSWORD, mBasicAuthPassword.getText().toString());
        values.put(GeofenceProvider.Geofence.KEY_LATITUDE, mCircle.getCenter().latitude);
        values.put(GeofenceProvider.Geofence.KEY_LONGITUDE, mCircle.getCenter().longitude);

        if (mIsEditingGeofence) {
            resolver.update(Uri.parse("content://" + getString(R.string.authority) + "/geofences"), values, "custom_id = ?", new String[]{String.valueOf(mEditGeofenceId)});
        } else {
            resolver.insert(Uri.parse("content://" + getString(R.string.authority) + "/geofences"), values);
        }

        if (finish) {
            this.finish();
            Log.i(Constants.LOG, "Finished!");
        }

        mSaved = false;
        Log.i(Constants.LOG, "Saved #2: " + (mSaved ? "true" : "false"));

    }

    // Zoom to Location
    private void zoomToLocation(Location location) {
        LatLng currentPosition = new LatLng(location.getLatitude(), location.getLongitude());
        mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(currentPosition, 16));
    }

    // Setup Circle
    private void setCircleToLocation(Location location) {
        // Set Circle
        if (mMap != null && mCircleManager != null && mCircle == null) {
            LatLng position = new LatLng(location.getLatitude(), location.getLongitude());
            mCircle = new MapAreaWrapper(mMap, position, 100, 5.0f, 0xffff0000, 0x33ff0000, 1, 1000);
            mCircleManager.add(mCircle);
            mRadiusSlider.setProgress(DEFAULT_RADIUS_METERS);
        }
    }

    // Radius Circle
    private void setupCircleManager() {
        mCircleManager = new MapAreaManager(mMap,

                4, Color.RED, Color.HSVToColor(70, new float[]{1, 1, 200}), //styling

                -1,//custom drawables for move and resize icons

                0.5f, 0.5f, //sets anchor point of move / resize drawable in the middle

                new MapAreaMeasure(100, MapAreaMeasure.Unit.pixels), //circles will start with 100 pixels (independent of zoom level)

                new CircleManagerListener() { //listener for all circle events

                    @Override
                    public void onCreateCircle(MapAreaWrapper draggableCircle) {

                    }

                    @Override
                    public void onMoveCircleEnd(MapAreaWrapper draggableCircle) {
                        Log.d(Constants.LOG, "onMoveCircleEnd");
                        doReverseGeocodingOfCircleLocation();
                    }

                    @Override
                    public void onMoveCircleStart(MapAreaWrapper draggableCircle) {
                        mAddressIsDirty = true;
                    }

                });
    }

    // Reverse Geocoder
    private void doReverseGeocodingOfCircleLocation() {
        if (mCircle != null) {
            Location location = new Location("Geofence");
            location.setLongitude(mCircle.getCenter().longitude);
            location.setLatitude(mCircle.getCenter().latitude);
            doReverseGeocoding(location);
        }
    }

    private void doGeocodingAndPositionCircle(String addr) {
        if (mCircle != null) {
            Address address = new LocativeGeocoder().getLatLongFromAddress(addr, this);
            if (address != null) {
                LatLng latLng = new LatLng(address.getLatitude(), address.getLongitude());
                updateAddressField(address);

                mCircle.setCenter(latLng);
                mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, 16));
            } else {
                new AlertDialog.Builder(this)
                        .setMessage("No location found. Please refine your query.")
                        .setPositiveButton("OK", new DialogInterface.OnClickListener() {
                            @Override
                            public void onClick(DialogInterface dialogInterface, int i) {
                                dialogInterface.dismiss();
                            }
                        })
                        .show();
            }
        }
    }

    private void updateAddressField(Address address) {
        // Format the first line of address (if available), city, and country name.
        String addressText = String.format("%s, %s, %s",
                address.getMaxAddressLineIndex() > 0 ? address.getAddressLine(0) : "",
                address.getLocality(),
                address.getCountryName());
        // Update address field on UI.
        Message.obtain(mGeocoderHandler, GeocodeHandler.UPDATE_ADDRESS, addressText).sendToTarget();
    }

    private void doReverseGeocoding(Location location) {
        // Since the geocoding API is synchronous and may take a while.  You don't want to lock
        // up the UI thread.  Invoking reverse geocoding in an AsyncTask.
        //mGeocoderIsActive = true;
        Log.d(Constants.LOG, "doReverseGeocoding for location: " + location);
        (new ReverseGeocodingTask(this)).execute(location);
    }

    private class ReverseGeocodingTask extends AsyncTask<Location, Void, Void> {
        Context mContext;

        public ReverseGeocodingTask(Context context) {
            super();
            mContext = context;
        }

        @Override
        protected Void doInBackground(Location... params) {
            Geocoder geocoder = new Geocoder(mContext, Locale.getDefault());

            Location loc = params[0];
            List<Address> addresses = null;
            try {
                addresses = geocoder.getFromLocation(loc.getLatitude(), loc.getLongitude(), 1);
            } catch (IOException e) {
                e.printStackTrace();
                // Update address field with the exception.
//                Message.obtain(mGeocoderHandler, UPDATE_ADDRESS, e.toString()).sendToTarget();
                Log.e(Constants.LOG, "Error when Reverse-Geocoding: " + e.toString());
            }
            if (addresses != null && addresses.size() > 0) {
                updateAddressField(addresses.get(0));
            }
            mAddressIsDirty = false;
            //mGeocoderIsActive = false;

            if (mGeocodeAndSave) {
                mGeocodeAndSave = false;
                Message.obtain(mGeocoderHandler, GeocodeHandler.SAVE_AND_FINISH, null).sendToTarget();
            }

            return null;
        }
    }

    private void selectMethodForTriggerType(final Constants.TriggerType t) {

        new AlertDialog.Builder(this)
                .setMessage("Choose HTTP Method")
                .setPositiveButton("POST", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        if (t == Constants.TriggerType.ARRIVAL) {
                            mEnterMethodButton.setText("POST");
                            mEnterMethod = Constants.HttpMethod.POST;
                        } else {
                            mExitMethodButton.setText("POST");
                            mExitMethod = Constants.HttpMethod.POST;
                        }
                        dialog.dismiss();
                    }
                })
                .setNeutralButton("GET", new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog, int which) {
                        if (t == Constants.TriggerType.ARRIVAL) {
                            mEnterMethodButton.setText("GET");
                            mEnterMethod = Constants.HttpMethod.GET;
                        } else {
                            mExitMethodButton.setText("GET");
                            mExitMethod = Constants.HttpMethod.GET;
                        }
                        dialog.dismiss();
                    }
                })
                .show();
    }

    private Constants.HttpMethod methodForTriggerType(Constants.TriggerType t) {
        if (t == Constants.TriggerType.ARRIVAL) {
            return mEnterMethod;
        }
        return mExitMethod;
    }

    private void updateRadius() {
        int radiusMeters = mRadiusSlider.getProgress();
        mRadiusLabel.setText(String.format(getResources().getConfiguration().locale, "%d m", radiusMeters));
        if (mCircle != null) {
            mCircle.setRadius(radiusMeters);
        }
    }

}


text:
package gov.nih.nci.cabig.caaers.web.ae;

import static gov.nih.nci.cabig.caaers.CaaersUseCase.CREATE_EXPEDITED_REPORT;
import gov.nih.nci.cabig.caaers.CaaersUseCases;

/**
 * @author Krikor Krumlian
 */
@CaaersUseCases({CREATE_EXPEDITED_REPORT})
public class AdditionalInformationTabTest extends AeTabTestCase {
    @Override
    protected AdditionalInformationTab createTab() {
        return new AdditionalInformationTab();
    }

    public void testFields() throws Exception {
        assertFieldProperties("desc", "aeReport.additionalInformation.autopsyReport",
                "aeReport.additionalInformation.consults",
                "aeReport.additionalInformation.dischargeSummary",
                "aeReport.additionalInformation.flowCharts",
                "aeReport.additionalInformation.labReports",
                "aeReport.additionalInformation.obaForm",
                "aeReport.additionalInformation.pathologyReport",
                "aeReport.additionalInformation.progressNotes",
                "aeReport.additionalInformation.radiologyReports",
                "aeReport.additionalInformation.referralLetters",
                "aeReport.additionalInformation.irbReport",
                "aeReport.additionalInformation.other",
                "aeReport.additionalInformation.otherInformation"

        );
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<!--
  ~ Copyright (c) 2010-2015 Evolveum
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<resource oid="8bc3ff5a-ef5d-11e4-8bba-001e8c717e5b"
          xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
          xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
          xmlns:t="http://prism.evolveum.com/xml/ns/public/types-3"
          xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance/ef2bc95b-76e0-59e2-86d6-3d4f02d3ffff"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:icfc="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/connector-schema-3"
          xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"
          xmlns:mr="http://prism.evolveum.com/xml/ns/public/matching-rule-3"
          xmlns:cap="http://midpoint.evolveum.com/xml/ns/public/resource/capabilities-3">

	<name>Embedded Test OpenDJ with bad credentials</name>
	<!-- NOTE: The connector OID will get dynamically replaced in the integration tests -->
	<connectorRef oid="ef2bc95b-76e0-59e2-86d6-3d4f02d3eedd" type="c:ConnectorType"/>
	<connectorConfiguration xmlns:icfcldap="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/bundle/com.evolveum.polygon.connector-ldap/com.evolveum.polygon.connector.ldap.LdapConnector">

		<icfc:configurationProperties>
			<icfcldap:port>10389</icfcldap:port>
			<icfcldap:host>localhost</icfcldap:host>
			<icfcldap:baseContext>dc=example,dc=com</icfcldap:baseContext>
			<icfcldap:bindDn>cn=directory manager</icfcldap:bindDn>
			<icfcldap:bindPassword><t:clearValue>wrongPASSWORD</t:clearValue></icfcldap:bindPassword>
			<icfcldap:pagingStrategy>auto</icfcldap:pagingStrategy>
			<icfcldap:vlvSortAttribute>entryUUID</icfcldap:vlvSortAttribute>
 			<icfcldap:operationalAttributes>ds-pwp-account-disabled</icfcldap:operationalAttributes>
 			<icfcldap:operationalAttributes>isMemberOf</icfcldap:operationalAttributes>
		</icfc:configurationProperties>

		<icfc:connectorPoolConfiguration>
			<icfc:minEvictableIdleTimeMillis>120000</icfc:minEvictableIdleTimeMillis>
			<icfc:minIdle>1</icfc:minIdle>
			<icfc:maxIdle>10</icfc:maxIdle>
			<icfc:maxObjects>10</icfc:maxObjects>
			<icfc:maxWait>150000</icfc:maxWait>
		</icfc:connectorPoolConfiguration>

		<icfc:producerBufferSize>100</icfc:producerBufferSize>

		<icfc:timeouts>
				<icfc:create>-1</icfc:create>
				<icfc:get>-1</icfc:get>
				<icfc:update>-1</icfc:update>
				<icfc:delete>-1</icfc:delete>
				<icfc:test>-1</icfc:test>
				<icfc:scriptOnConnector>-1</icfc:scriptOnConnector>
				<icfc:scriptOnResource>-1</icfc:scriptOnResource>
				<icfc:authentication>-1</icfc:authentication>
				<icfc:search>-1</icfc:search>
				<icfc:validate>-1</icfc:validate>
				<icfc:sync>-1</icfc:sync>
				<icfc:schema>-1</icfc:schema>
			</icfc:timeouts>

			<icfc:resultsHandlerConfiguration>
				<icfc:enableNormalizingResultsHandler>false</icfc:enableNormalizingResultsHandler>
				<icfc:enableFilteredResultsHandler>false</icfc:enableFilteredResultsHandler>
				<icfc:enableAttributesToGetSearchResultsHandler>false</icfc:enableAttributesToGetSearchResultsHandler>
			</icfc:resultsHandlerConfiguration>

	</connectorConfiguration>

	<namespace>http://midpoint.evolveum.com/xml/ns/public/resource/instance/ef2bc95b-76e0-59e2-86d6-3d4f02d3ffff</namespace>

	<!-- Schema is not present. Schema should be generated by provisioning on the first use of this resource. -->

	<schemaHandling>

    	<objectType>
    		<kind>account</kind>
            <intent>default</intent>
            <displayName>Default Account</displayName>
            <default>true</default>
            <objectClass>ri:inetOrgPerson</objectClass>
            <attribute>
				<ref>icfs:name</ref>
				<matchingRule>mr:stringIgnoreCase</matchingRule>
			</attribute>
			<attribute>
				<ref>ri:isMemberOf</ref>
				<matchingRule>mr:stringIgnoreCase</matchingRule>
				<fetchStrategy>explicit</fetchStrategy>
			</attribute>
            <association>
            	<ref>ri:group</ref>
            	<displayName>LDAP Group Membership</displayName>
            	<kind>entitlement</kind>
            	<intent>ldapGroup</intent>
            	<direction>objectToSubject</direction>
            	<associationAttribute>ri:uniqueMember</associationAttribute>
            	<valueAttribute>icfs:name</valueAttribute>
            	<shortcutAssociationAttribute>ri:isMemberOf</shortcutAssociationAttribute>
            	<shortcutValueAttribute>icfs:name</shortcutValueAttribute>
            	<explicitReferentialIntegrity>true</explicitReferentialIntegrity>
            </association>
       		<protected>
       			<!-- WilDCapiTaLIzaTioN makes sure that this is matched case-insensitive -->
				<icfs:name>uid=cAlyPSo,ou=PeoPle,DC=example,dc=COM</icfs:name>
			</protected>
			<configuredCapabilities>
				<cap:pagedSearch>
					<cap:defaultSortField>ri:uid</cap:defaultSortField>
				</cap:pagedSearch>
				<cap:countObjects>
					<cap:simulate>sequentialSearch</cap:simulate>
				</cap:countObjects>
			</configuredCapabilities>
        </objectType>

        <objectType>
        	<kind>entitlement</kind>
            <intent>ldapGroup</intent>
            <displayName>LDAP Group</displayName>
            <objectClass>ri:groupOfUniqueNames</objectClass>
			<attribute>
				<ref>ri:uniqueMember</ref>
				<matchingRule>mr:stringIgnoreCase</matchingRule>
			</attribute>
        </objectType>

	</schemaHandling>

	<capabilities>
		<configured>
			<cap:activation>
				<cap:status>
					<cap:attribute>ri:ds-pwp-account-disabled</cap:attribute>
					<cap:enableValue/>
					<cap:disableValue>true</cap:disableValue>
				</cap:status>
				<cap:lockoutStatus>
					<!-- This is fake. But OpenDJ lockout attribute is not modifiable using normal LDAP operations. -->
					<cap:attribute>ri:pager</cap:attribute>
					<cap:normalValue/>
					<cap:lockedValue>1</cap:lockedValue>
				</cap:lockoutStatus>
			</cap:activation>
			<!--
			<cap:credentials>
				<cap:password/>
			</cap:credentials>
			<cap:liveSync/>
			<cap:testConnection/>
			-->
			<cap:create/>
	        <cap:read/>
	        <cap:update/>
	        <cap:delete/>
		</configured>
	</capabilities>

</resource>


text:
//---------------------------------------------------------------------
// <copyright file="ODataJsonLightErrorDeserializer.cs" company="Microsoft">
//      Copyright (C) Microsoft Corporation. All rights reserved. See License.txt in the project root for license information.
// </copyright>
//---------------------------------------------------------------------

namespace Microsoft.OData.Core.JsonLight
{
    #region Namespaces
    using System;
    using System.Diagnostics;
#if ODATALIB_ASYNC
    using System.Threading.Tasks;
#endif
    using Microsoft.OData.Core.Json;
    #endregion Namespaces

    /// <summary>
    /// OData JsonLight deserializer for errors.
    /// </summary>
    internal sealed class ODataJsonLightErrorDeserializer : ODataJsonLightDeserializer
    {
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="jsonLightInputContext">The JsonLight input context to read from.</param>
        internal ODataJsonLightErrorDeserializer(ODataJsonLightInputContext jsonLightInputContext)
            : base(jsonLightInputContext)
        {
        }

        /// <summary>
        /// Read a top-level error.
        /// </summary>
        /// <returns>An <see cref="ODataError"/> representing the read error.</returns>
        /// <remarks>
        /// Pre-Condition:  JsonNodeType.None       - The reader must not have been used yet.
        /// Post-Condition: JsonNodeType.EndOfInput
        /// </remarks>
        internal ODataError ReadTopLevelError()
        {
            Debug.Assert(this.JsonReader.NodeType == JsonNodeType.None, "Pre-Condition: expected JsonNodeType.None, the reader must not have been used yet.");
            Debug.Assert(!this.JsonReader.DisableInStreamErrorDetection, "!JsonReader.DisableInStreamErrorDetection");
            this.JsonReader.AssertNotBuffering();

            // prevent the buffering JSON reader from detecting in-stream errors - we read the error ourselves
            // to throw proper exceptions
            this.JsonReader.DisableInStreamErrorDetection = true;

            // We use this to store annotations and check for duplicate annotation names, but we don't really store properties in it.
            DuplicatePropertyNamesChecker duplicatePropertyNamesChecker = this.CreateDuplicatePropertyNamesChecker();

            try
            {
                // Position the reader on the first node
                this.ReadPayloadStart(
                    ODataPayloadKind.Error,
                    duplicatePropertyNamesChecker,
                    /*isReadingNestedPayload*/false,
                    /*allowEmptyPayload*/false);

                ODataError result = this.ReadTopLevelErrorImplementation();

                Debug.Assert(this.JsonReader.NodeType == JsonNodeType.EndOfInput, "Post-Condition: JsonNodeType.EndOfInput");
                this.JsonReader.AssertNotBuffering();

                return result;
            }
            finally
            {
                this.JsonReader.DisableInStreamErrorDetection = false;
            }
        }

#if ODATALIB_ASYNC

        /// <summary>
        /// Read a top-level error.
        /// </summary>
        /// <returns>A task which returns an <see cref="ODataError"/> representing the read error.</returns>
        /// <remarks>
        /// Pre-Condition:  JsonNodeType.None       - The reader must not have been used yet.
        /// Post-Condition: JsonNodeType.EndOfInput
        /// </remarks>
        internal Task<ODataError> ReadTopLevelErrorAsync()
        {
            Debug.Assert(this.JsonReader.NodeType == JsonNodeType.None, "Pre-Condition: expected JsonNodeType.None, the reader must not have been used yet.");
            Debug.Assert(!this.JsonReader.DisableInStreamErrorDetection, "!JsonReader.DisableInStreamErrorDetection");
            this.JsonReader.AssertNotBuffering();

            // prevent the buffering JSON reader from detecting in-stream errors - we read the error ourselves
            // to throw proper exceptions
            this.JsonReader.DisableInStreamErrorDetection = true;

            // We use this to store annotations and check for duplicate annotation names, but we don't really store properties in it.
            DuplicatePropertyNamesChecker duplicatePropertyNamesChecker = this.CreateDuplicatePropertyNamesChecker();

            // Position the reader on the first node
            return this.ReadPayloadStartAsync(
                ODataPayloadKind.Error,
                duplicatePropertyNamesChecker,
                /*isReadingNestedPayload*/false,
                /*allowEmptyPayload*/false)

                .FollowOnSuccessWith(t =>
                {
                    ODataError result = this.ReadTopLevelErrorImplementation();

                    Debug.Assert(this.JsonReader.NodeType == JsonNodeType.EndOfInput, "Post-Condition: JsonNodeType.EndOfInput");
                    this.JsonReader.AssertNotBuffering();

                    return result;
                })

                .FollowAlwaysWith(t =>
                {
                    this.JsonReader.DisableInStreamErrorDetection = false;
                });
        }
#endif

        /// <summary>
        /// Read a top-level error.
        /// </summary>
        /// <returns>An <see cref="ODataError"/> representing the read error.</returns>
        /// <remarks>
        /// Pre-Condition:  JsonNodeType.Property       - The first property of the top level object.
        ///                 JsonNodeType.EndObject      - If there are no properties in the top level object.
        ///                 any                         - Will throw if anything else.
        /// Post-Condition: JsonNodeType.EndOfInput
        /// </remarks>
        private ODataError ReadTopLevelErrorImplementation()
        {
            ODataError error = null;

            while (this.JsonReader.NodeType == JsonNodeType.Property)
            {
                string propertyName = this.JsonReader.ReadPropertyName();
                if (string.CompareOrdinal(JsonLightConstants.ODataErrorPropertyName, propertyName) != 0)
                {
                    // we only allow a single 'error' property for a top-level error object
                    throw new ODataException(Strings.ODataJsonErrorDeserializer_TopLevelErrorWithInvalidProperty(propertyName));
                }

                if (error != null)
                {
                    throw new ODataException(OData.Core.Strings.ODataJsonReaderUtils_MultipleErrorPropertiesWithSameName(JsonLightConstants.ODataErrorPropertyName));
                }

                error = new ODataError();

                this.ReadODataErrorObject(error);
            }

            // Read the end of the error object
            this.JsonReader.ReadEndObject();

            // Read the end of the response.
            this.ReadPayloadEnd(false /*isReadingNestedPayload*/);

            Debug.Assert(this.JsonReader.NodeType == JsonNodeType.EndOfInput, "Post-Condition: JsonNodeType.EndOfInput");

            return error;
        }

        /// <summary>
        /// Reads all the properties in a single JSON object scope, calling <paramref name="readPropertyWithValue"/> for each non-annotation property encountered.
        /// </summary>
        /// <param name="readPropertyWithValue">
        /// An action which takes the name of the current property and processes the property value as necessary.
        /// At the start of this action, the reader is positioned at the property value node.
        /// The action should leave the reader positioned on the node after the property value.
        /// </param>
        /// <remarks>
        ///
        /// This method should only be used for scopes where we allow (and ignore) annotations in a custom namespace, i.e. scopes which directly correspond to a class in the OM.
        ///
        /// Pre-Condition:  JsonNodeType.StartObject    - The start of the JSON object being processed.
        ///                 any                         - Will throw if not StartObject.
        /// Post-Condition: any                         - The node after the EndObject node for the JSON object being processed.
        /// </remarks>
        private void ReadJsonObjectInErrorPayload(Action<string, DuplicatePropertyNamesChecker> readPropertyWithValue)
        {
            DuplicatePropertyNamesChecker duplicatePropertyNamesChecker = this.CreateDuplicatePropertyNamesChecker();

            this.JsonReader.ReadStartObject();

            while (this.JsonReader.NodeType == JsonNodeType.Property)
            {
                this.ProcessProperty(
                    duplicatePropertyNamesChecker,
                    this.ReadErrorPropertyAnnotationValue,
                    (propertyParsingResult, propertyName) =>
                    {
                        switch (propertyParsingResult)
                        {
                            case PropertyParsingResult.ODataInstanceAnnotation:
                                throw new ODataException(Strings.ODataJsonLightErrorDeserializer_InstanceAnnotationNotAllowedInErrorPayload(propertyName));
                            case PropertyParsingResult.CustomInstanceAnnotation:
                                readPropertyWithValue(propertyName, duplicatePropertyNamesChecker);
                                break;
                            case PropertyParsingResult.PropertyWithoutValue:
                                throw new ODataException(Strings.ODataJsonLightErrorDeserializer_PropertyAnnotationWithoutPropertyForError(propertyName));
                            case PropertyParsingResult.PropertyWithValue:
                                readPropertyWithValue(propertyName, duplicatePropertyNamesChecker);
                                break;
                            case PropertyParsingResult.EndOfObject:
                                break;

                            case PropertyParsingResult.MetadataReferenceProperty:
                                throw new ODataException(Strings.ODataJsonLightPropertyAndValueDeserializer_UnexpectedMetadataReferenceProperty(propertyName));
                        }
                    });
            }

            this.JsonReader.ReadEndObject();
        }

        /// <summary>
        /// Reads a value of property annotation on an error payload.
        /// </summary>
        /// <param name="propertyAnnotationName">The name of the property annotation to read.</param>
        /// <returns>The value of the property annotation.</returns>
        /// <remarks>
        /// This method should read the property annotation value and return a representation of the value which will be later
        /// consumed by the entry reading code, or throw if ther is something unexpected.
        ///
        /// Pre-Condition:  JsonNodeType.PrimitiveValue         The value of the property annotation property
        ///                 JsonNodeType.StartObject
        ///                 JsonNodeType.StartArray
        /// Post-Condition: JsonNodeType.EndObject              The end of the error object
        ///                 JsonNodeType.Property               The next property after the property annotation
        /// </remarks>
        private object ReadErrorPropertyAnnotationValue(string propertyAnnotationName)
        {
            Debug.Assert(!string.IsNullOrEmpty(propertyAnnotationName), "!string.IsNullOrEmpty(propertyAnnotationName)");
            Debug.Assert(
                propertyAnnotationName.StartsWith(JsonLightConstants.ODataAnnotationNamespacePrefix, StringComparison.Ordinal),
                "The method should only be called with OData. annotations");
            this.AssertJsonCondition(JsonNodeType.PrimitiveValue, JsonNodeType.StartObject, JsonNodeType.StartArray);

            if (string.CompareOrdinal(propertyAnnotationName, ODataAnnotationNames.ODataType) == 0)
            {
                string typeName = ReaderUtils.AddEdmPrefixOfTypeName(ReaderUtils.RemovePrefixOfTypeName(this.JsonReader.ReadStringValue()));
                if (typeName == null)
                {
                    throw new ODataException(Strings.ODataJsonLightPropertyAndValueDeserializer_InvalidTypeName(propertyAnnotationName));
                }

                this.AssertJsonCondition(JsonNodeType.Property, JsonNodeType.EndObject);
                return typeName;
            }

            throw new ODataException(Strings.ODataJsonLightErrorDeserializer_PropertyAnnotationNotAllowedInErrorPayload(propertyAnnotationName));
        }

        /// <summary>
        /// Reads the JSON object which is the value of the "error" property.
        /// </summary>
        /// <param name="error">The <see cref="ODataError"/> object to update with data from the payload.</param>
        /// <remarks>
        /// Pre-Condition:  JsonNodeType.StartObject    - The start of the "error" object.
        ///                 any                         - Will throw if not StartObject.
        /// Post-Condition: any                         - The node after the "error" object's EndNode.
        /// </remarks>
        private void ReadODataErrorObject(ODataError error)
        {
            this.ReadJsonObjectInErrorPayload((propertyName, duplicationPropertyNameChecker) => this.ReadPropertyValueInODataErrorObject(error, propertyName, duplicationPropertyNameChecker));
        }

        /// <summary>
        /// Reads an inner error payload.
        /// </summary>
        /// <param name="recursionDepth">The number of times this method has been called recursively.</param>
        /// <returns>An <see cref="ODataInnerError"/> representing the read inner error.</returns>
        /// <remarks>
        /// Pre-Condition:  JsonNodeType.StartObject    - The start of the "innererror" object.
        ///                 any                         - will throw if not StartObject.
        /// Post-Condition: any                         - The node after the "innererror" object's EndNode.
        /// </remarks>
        private ODataInnerError ReadInnerError(int recursionDepth)
        {
            Debug.Assert(this.JsonReader.DisableInStreamErrorDetection, "JsonReader.DisableInStreamErrorDetection");
            this.JsonReader.AssertNotBuffering();

            ValidationUtils.IncreaseAndValidateRecursionDepth(ref recursionDepth, this.MessageReaderSettings.MessageQuotas.MaxNestingDepth);

            ODataInnerError innerError = new ODataInnerError();

            this.ReadJsonObjectInErrorPayload((propertyName, duplicatePropertyNamesChecker) => this.ReadPropertyValueInInnerError(recursionDepth, innerError, propertyName));

            this.JsonReader.AssertNotBuffering();
            return innerError;
        }

        /// <summary>
        /// Reads a property value which occurs in the "innererror" object scope.
        /// </summary>
        /// <param name="recursionDepth">The number of parent inner errors for this inner error.</param>
        /// <param name="innerError">The <see cref="ODataError"/> object to update with the data from this property value.</param>
        /// <param name="propertyName">The name of the property whose value is to be read.</param>
        /// <remarks>
        /// Pre-Condition:  any                         - The value of the property being read.
        /// Post-Condition: JsonNodeType.Property       - The property after the one being read.
        ///                 JsonNodeType.EndObject      - The end of the "innererror" object.
        ///                 any                         - Anything else after the property value is an invalid payload (but won't fail in this method).
        /// </remarks>
        private void ReadPropertyValueInInnerError(int recursionDepth, ODataInnerError innerError, string propertyName)
        {
            switch (propertyName)
            {
                case JsonConstants.ODataErrorInnerErrorMessageName:
                    innerError.Message = this.JsonReader.ReadStringValue(JsonConstants.ODataErrorInnerErrorMessageName);
                    break;

                case JsonConstants.ODataErrorInnerErrorTypeNameName:
                    innerError.TypeName = this.JsonReader.ReadStringValue(JsonConstants.ODataErrorInnerErrorTypeNameName);
                    break;

                case JsonConstants.ODataErrorInnerErrorStackTraceName:
                    innerError.StackTrace = this.JsonReader.ReadStringValue(JsonConstants.ODataErrorInnerErrorStackTraceName);
                    break;

                case JsonConstants.ODataErrorInnerErrorInnerErrorName:
                    innerError.InnerError = this.ReadInnerError(recursionDepth);
                    break;

                default:
                    // skip any unsupported properties in the inner error
                    this.JsonReader.SkipValue();
                    break;
            }
        }

        /// <summary>
        /// Reads a property value which occurs in the "error" object scope.
        /// </summary>
        /// <param name="error">The <see cref="ODataError"/> object to update with the data from this property value.</param>
        /// <param name="propertyName">The name of the property whose value is to be read.</param>
        /// <param name="duplicationPropertyNameChecker">DuplicatePropertyNamesChecker to use for extracting property annotations
        /// targetting any custom instance annotations on the error.</param>
        /// <remarks>
        /// Pre-Condition:  any                         - The value of the property being read.
        /// Post-Condition: JsonNodeType.Property       - The property after the one being read.
        ///                 JsonNodeType.EndObject      - The end of the "error" object.
        ///                 any                         - Anything else after the property value is an invalid payload (but won't fail in this method).
        /// </remarks>
        private void ReadPropertyValueInODataErrorObject(ODataError error, string propertyName, DuplicatePropertyNamesChecker duplicationPropertyNameChecker)
        {
            switch (propertyName)
            {
                case JsonConstants.ODataErrorCodeName:
                    error.ErrorCode = this.JsonReader.ReadStringValue(JsonConstants.ODataErrorCodeName);
                    break;

                case JsonConstants.ODataErrorMessageName:
                    error.Message = this.JsonReader.ReadStringValue(JsonConstants.ODataErrorMessageName);
                    break;

                case JsonConstants.ODataErrorInnerErrorName:
                    error.InnerError = this.ReadInnerError(0 /* recursionDepth */);
                    break;

                default:
                    // See if it's an instance annotation
                    if (ODataJsonLightReaderUtils.IsAnnotationProperty(propertyName))
                    {
                        ODataJsonLightPropertyAndValueDeserializer valueDeserializer = new ODataJsonLightPropertyAndValueDeserializer(this.JsonLightInputContext);
                        object typeName = null;

                        var odataAnnotations = duplicationPropertyNameChecker.GetODataPropertyAnnotations(propertyName);
                        if (odataAnnotations != null)
                        {
                            odataAnnotations.TryGetValue(ODataAnnotationNames.ODataType, out typeName);
                        }

                        var value = valueDeserializer.ReadNonEntityValue(
                            typeName as string,
                            null /*expectedValueTypeReference*/,
                            null /*duplicatePropertiesNamesChecker*/,
                            null /*collectionValidator*/,
                            false /*validateNullValue*/,
                            false /*isTopLevelPropertyValue*/,
                            false /*insideComplexValue*/,
                            propertyName);

                        error.GetInstanceAnnotations().Add(new ODataInstanceAnnotation(propertyName, value.ToODataValue()));
                    }
                    else
                    {
                        // we only allow a 'code', 'message' and 'innererror' properties in the value of the 'error' property or custom instance annotations
                        throw new ODataException(Strings.ODataJsonLightErrorDeserializer_TopLevelErrorValueWithInvalidProperty(propertyName));
                    }

                    break;
            }
        }
    }
}