text:
gouv-geo-api
======

[![NPM](https://nodei.co/npm/gouv-geo-api.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/gouv-geo-api/)

[![npm version](https://badge.fury.io/js/gouv-geo-api.svg)](https://badge.fury.io/js/gouv-geo-api)

A Node wrapper for the [geo api](http://travaux.data.rennesmetropole.fr/).
---

### Installation
```javascript
$ npm install gouv-geo-api
```
or
```javascript
$ npm install git://github.com/Raesta/gouv-geo-api.git
```

### Example
```javascript
var GeoAPI = require('gouv-geo-api');

var Geo = new GeoAPI();

// get all towns with parameters
Geo.getTowns({codePostal: 94000}, function(error, result) {
  console.log(error, result);
});

// fetch all departments
Geo.getDepartments(null, function(error, result) {
  console.log(error, result);
});
```


text:
// Copyright 2020 Google LLC
// 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.

/*! THIS FILE IS AUTO-GENERATED */

import {AuthPlus, getAPI, GoogleConfigurable} from 'googleapis-common';
import {lifesciences_v2beta} from './v2beta';

export const VERSIONS = {
  v2beta: lifesciences_v2beta.Lifesciences,
};

export function lifesciences(
  version: 'v2beta'
): lifesciences_v2beta.Lifesciences;
export function lifesciences(
  options: lifesciences_v2beta.Options
): lifesciences_v2beta.Lifesciences;
export function lifesciences<T = lifesciences_v2beta.Lifesciences>(
  this: GoogleConfigurable,
  versionOrOptions: 'v2beta' | lifesciences_v2beta.Options
) {
  return getAPI<T>('lifesciences', versionOrOptions, VERSIONS, this);
}

const auth = new AuthPlus();
export {auth};
export {lifesciences_v2beta};
export {
  AuthPlus,
  GlobalOptions,
  APIRequestContext,
  GoogleConfigurable,
  StreamMethodOptions,
  GaxiosPromise,
  MethodOptions,
  BodyResponseCallback,
} from 'googleapis-common';

redpajama_set_name: RedPajamaGithub


text:
package br.com.wcorrea.transport.api.modulos.financeiro.recebimentoParcelaStatus;

import br.com.wcorrea.transport.api.modulos.financeiro.recebimentoParcelaStatus.RecebimentoParcelaStatus;
import br.com.wcorrea.transport.api.modulos.financeiro.recebimentoParcelaStatus.RecebimentoParcelaStatusRepositoryQuery;
import org.springframework.data.jpa.repository.JpaRepository;

public interface RecebimentoParcelaStatusRepository extends JpaRepository<RecebimentoParcelaStatus, Long>, RecebimentoParcelaStatusRepositoryQuery {

}


text:
extensions = ['rst2pdf.pdfbuilder']
master_doc = 'index'

# -- Options for PDF output ----------------------------------------------------
# Grouping the document tree into PDF files (source start file, target file name, title, author).
pdf_documents = [('index', 'BreakLevel_2', 'Break Level Test', 'Rob Allen')]

pdf_stylesheets = ['sphinx']
pdf_use_toc = True
pdf_use_index = False
pdf_use_modindex = False
pdf_use_coverpage = False
pdf_invariant = True
pdf_breakside = 'any'

pdf_toc_depth=3


text:
<?php

namespace Sylius\Bundle\AttributeBundle\Form\Type;

use Sylius\Bundle\AttributeBundle\Form\EventListener\BuildAttributeValueFormListener;
use Sylius\Bundle\ResourceBundle\Form\Type\AbstractResourceType;
use Sylius\Component\Product\Model\AttributeInterface;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;

/**
 * Attribute value form type.
 *
 * @author Paweł Jędrzejewski <pawel@sylius.org>
 */
class AttributeValueType extends AbstractResourceType
{
    /**
     * Attributes subject name.
     *
     * @var string
     */
    protected $subjectName;

    /**
     * Constructor.
     *
     * @param string $dataClass
     * @param array  $validationGroups
     * @param string $subjectName
     */
    public function __construct($dataClass, array $validationGroups, $subjectName)
    {
        parent::__construct($dataClass, $validationGroups);

        $this->subjectName = $subjectName;
    }

    /**
     * {@inheritdoc}
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('attribute', sprintf('sylius_%s_attribute_choice', $this->subjectName), array(
                'label' => sprintf('sylius.form.attribute.%s_attribute_value.attribute', $this->subjectName)
            ))
            ->addEventSubscriber(new BuildAttributeValueFormListener($builder->getFormFactory(), $this->subjectName))
        ;

        $this->buildAttributeValuePrototypes($builder);
    }

    /**
     * {@inheritdoc}
     */
    public function buildView(FormView $view, FormInterface $form, array $options)
    {
        $view->vars['prototypes'] = array();

        foreach ($form->getConfig()->getAttribute('prototypes', array()) as $name => $prototype) {
            $view->vars['prototypes'][$name] = $prototype->createView($view);
        }
    }

    /**
     * {@inheritdoc}
     */
    public function getName()
    {
        return sprintf('sylius_%s_attribute_value', $this->subjectName);
    }

    /**
     * Build attribute values' prototypes
     *
     * @param FormBuilderInterface $builder
     */
    protected function buildAttributeValuePrototypes($builder)
    {
        $attributes = $builder->get('attribute')->getOption('choice_list')->getChoices();

        $prototypes = array();
        foreach ($attributes as $attribute) {
            $config = array_merge(array(
                'label' => sprintf('sylius.form.attribute.%s_attribute_value.value', $this->subjectName)
            ), $attribute->getConfiguration());
            $prototypes[] = $builder->create('value', $attribute->getType(), $config)->getForm();
        }

        $builder->setAttribute('prototypes', $prototypes);
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>

<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
         version="2.4">

    <servlet>
        <servlet-name>HelloWorld</servlet-name>
        <servlet-class>org.jboss.wise.test.integration.basic.HelloWorldBean</servlet-class>
    </servlet>

    <servlet-mapping>
        <servlet-name>HelloWorld</servlet-name>
        <url-pattern>/HelloWorld</url-pattern>
    </servlet-mapping>

</web-app>


text:
<?xml version="1.0"?>

<project name="libxml2-java" default="compile">
  <property name="src.main" value="src/main/java" />
  <property name="src.test" value="src/test/java" />
  <property name="build.main" value="build/classes/main" />
  <property name="build.test" value="build/classes/test" />
  <property environment="env" />

  <path id="home.classpath">
    <fileset dir="${env.HOME}/sdks/jars" includes="*.jar" />
    <pathelement location="${build.main}" />
    <pathelement location="${build.test}" />
  </path>

  <target name="compile">
    <mkdir dir="${build.main}" />
    <javac srcdir="${src.main}"
      destdir="${build.main}"
      includeantruntime="no"
      debug="yes">
    </javac>

    <mkdir dir="${build.test}" />
    <javac srcdir="${src.test}"
      destdir="${build.test}"
      includeantruntime="no"
      debug="yes">
      <classpath refid="home.classpath">
      </classpath>
    </javac>
  </target>

  <target name="jar" depends="compile">
    <java classname="org.xmlsoft.util.BuildResources"
      classpathref="home.classpath" />
    <copy todir="${build.main}">
      <fileset dir="resources" includes="*" />
    </copy>
    <jar jarfile="build/libs/libxml2-java.jar"
      basedir="${build.main}" />

  </target>

  <target name="javadoc" depends="compile">
    <mkdir dir="javadoc" />
    <javadoc sourcePath="${src.main}"
      destdir="javadoc"
      packagenames="org.xmlsoft"
      author="yes"
      link="http://docs.oracle.com/javase/7/docs/api/"
      encoding="UTF-8">
    </javadoc>
  </target>

  <target name="test" depends="compile">
    <java classname="org.junit.runner.JUnitCore"
      classpathref="home.classpath">
      <arg value="org.xmlsoft.test.ContextStart" />
      <arg value="org.xmlsoft.test.BasicTest" />
      <arg value="org.xmlsoft.test.JaxpTest" />
      <arg value="org.xmlsoft.test.SaxTest" />
      <arg value="org.xmlsoft.test.XPathTest" />
      <arg value="org.xmlsoft.test.DomManipulationTest" />
      <arg value="org.xmlsoft.test.ContextEnd" />
    </java>
  </target>

  <target name="performance" depends="compile">
    <java classname="org.junit.runner.JUnitCore"
      classpathref="home.classpath">
      <arg value="org.xmlsoft.test.RssTest" />
    </java>
  </target>

  <target name="clean">
    <delete dir="${build.main}" />
    <delete dir="${build.test}" />
  </target>

</project>


text:
@interface YapDatabaseSearchQueueControl : NSObject

- (id)initWithRollback:(BOOL)rollback;

@property (nonatomic, readonly) BOOL abort;
@property (nonatomic, readonly) BOOL rollback;

@end

@implementation YapDatabaseSearchQueueControl

@synthesize rollback = rollback;

- (id)initWithRollback:(BOOL)inRollback
{
	if ((self = [super init]))
	{
		rollback = inRollback;
	}
	return self;
}

- (BOOL)abort {
	return YES;
}

@end

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma mark -
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

@implementation YapDatabaseSearchQueue
{
	NSMutableArray *queue;
	OSSpinLock lock;

	BOOL queueHasAbort;
	BOOL queueHasRollback;
}

- (id)init
{
	if ((self = [super init]))
	{
		queue = [[NSMutableArray alloc] init];
		lock = OS_SPINLOCK_INIT;
	}
	return self;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma mark Public API
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

- (void)enqueueQuery:(NSString *)query
{
	if (query == nil) return;

	OSSpinLockLock(&lock);
	{
		[queue addObject:[query copy]];
	}
	OSSpinLockUnlock(&lock);
}

- (void)abortSearchInProgressAndRollback:(BOOL)shouldRollback
{
	OSSpinLockLock(&lock);
	{
		YapDatabaseSearchQueueControl *control =
		  [[YapDatabaseSearchQueueControl alloc] initWithRollback:shouldRollback];

		[queue addObject:control];

		queueHasAbort = YES;
		queueHasRollback = queueHasRollback || shouldRollback;
	}
	OSSpinLockUnlock(&lock);
}

- (NSArray *)enqueuedQueries
{
	NSMutableArray *queries = nil;

	OSSpinLockLock(&lock);
	{
		queries = [NSMutableArray arrayWithCapacity:[queue count]];

		for (id obj in queue)
		{
			if ([obj isKindOfClass:[NSString class]])
			{
				[queries addObject:obj];
			}
		}
	}
	OSSpinLockUnlock(&lock);

	return queries;
}

- (NSUInteger)enqueuedQueryCount
{
	NSUInteger count = 0;

	OSSpinLockLock(&lock);
	{
		for (id obj in queue)
		{
			if ([obj isKindOfClass:[NSString class]])
			{
				count++;
			}
		}
	}
	OSSpinLockUnlock(&lock);

	return count;
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma mark Private API
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

- (NSString *)flushQueue
{
	NSString *lastQuery = nil;

	OSSpinLockLock(&lock);
	{
		id lastObject = [queue lastObject];
		[queue removeAllObjects];

		queueHasAbort = NO;
		queueHasRollback = NO;

		if ([lastObject isKindOfClass:[NSString class]])
		{
			lastQuery = (NSString *)lastObject;
		}
	}
	OSSpinLockUnlock(&lock);

	return lastQuery;
}

- (BOOL)shouldAbortSearchInProgressAndRollback:(BOOL *)shouldRollbackPtr
{
	BOOL shouldAbort = NO;
	BOOL shouldRollback = NO;

	OSSpinLockLock(&lock);
	{
		shouldAbort = queueHasAbort;
		shouldRollback = queueHasRollback;
	}
	OSSpinLockUnlock(&lock);

	if (shouldRollbackPtr) *shouldRollbackPtr = shouldRollback;
	return shouldAbort;
}

@end


text:
package org.wso2.carbon.kernel.internal.startupresolver.beans;

import org.osgi.framework.Bundle;
import org.wso2.carbon.kernel.internal.startupresolver.StartupServiceCache;
import org.wso2.carbon.kernel.startupresolver.RequiredCapabilityListener;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.function.Function;
import java.util.stream.Collectors;

/**
 * {@code StartupComponent} Represents an entity which needs to hold its initialization until all the required
 * capabilities are available.
 *

 * A {@code StartupComponent} should register an OSGi service with the interface {@code RequiredCapabilityListener}.
 * This service will be invoked when all the required capabilities are available.
 *

 * e.g.
 * Carbon-Component: startup.listener;componentName="transport-mgt";
 * requiredService="org.wso2.carbon.kernel.transports.CarbonTransport"
 *
 * @since 5.1.0
 */
public class StartupComponent {

    /**
     * Name of the startup listener component extracted from the componentName manifest attribute.
     */
    private String name;

    /**
     * List of required service class names extracted from the requiredService manifest attribute.
     */
    private List<String> requiredServiceList = new ArrayList<>();

    /**
     * List of expected capabilities.
     */
    private final List<Capability> expectedCapabilityList = Collections.synchronizedList(new ArrayList<>());

    /**
     * RequiredCapabilityListener service instance.
     */
    private RequiredCapabilityListener listener;

    /**
     * List of pending expected or available CapabilityProvider OSGi services.
     */
    private List<CapabilityProviderCapability> pendingCapabilityProviderList = new ArrayList<>();

    /**
     * OSGi bundle to which this component resides.
     */
    private Bundle bundle;

    /**
     * Indicates whether this startup listener component is already satisfied or not.
     */
    private boolean satisfied = false;

    /**
     * Constructor to create a {@code StartupComponent} instance.
     *
     * @param componentName name of the startup listener component.
     * @param bundle        bundle in which this startup listener component resides.
     */
    public StartupComponent(String componentName, Bundle bundle) {
        this.name = componentName;
        this.bundle = bundle;
    }

    /**
     * Name of the startup listener component.
     *
     * @return the name.
     */
    public String getName() {
        return name;
    }

    /**
     * Returns the required OSGi services lists of this component.
     *
     * @return a list which contains the all the required OSGi services of this component.
     */
    public List<String> getRequiredServices() {
        return requiredServiceList;
    }

    public void addRequiredServices(List<String> requiredServiceList) {
        this.requiredServiceList.addAll(requiredServiceList);
    }

    public void addRequiredService(String requiredService) {
        requiredServiceList.add(requiredService);
    }

    public boolean isServiceRequired(String service) {
        return requiredServiceList.contains(service);
    }

    /**
     * Register {@code Capability} instances with this startup listener component.
     *

     * Adds the given {@code Capability} to the {@code expectedCapabilityList}
     *
     * @param capability {@code Capability} object to be registered with this startup listener component.
     */
    public void addExpectedCapability(Capability capability) {
        synchronized (expectedCapabilityList) {
            Capability expectedCapability = expectedCapabilityList.stream()
                    .filter(expCapability -> expCapability.getName().equals(capability.getName()))
                    .filter(expCapability -> !expCapability.isSecondCheck()
                            && expCapability.getState() == Capability.CapabilityState.AVAILABLE)
                    .findFirst().orElse(null);

            if (expectedCapability != null) {
                expectedCapability.setSecondCheck(true);
                expectedCapability.setDirectDependency(capability.isDirectDependency());
            } else {
                expectedCapabilityList.add(capability);
            }
        }
    }

    /**
     * This method updates the capability in the expected capability list.
     *
     * If a corresponding capability is found in the expectedCapabilityList, then the existing capability is updated,
     * or the new capability is added to the expectedCapabilityList otherwise.
     *
     * @param capability the capability to be updated
     */
    public void updateCapability(Capability capability) {
        synchronized (expectedCapabilityList) {
            if (capability.getState() == Capability.CapabilityState.EXPECTED) {
                Optional<Capability> optCapability = expectedCapabilityList.stream()
                        .filter(expCapability -> expCapability.getName().equals(capability.getName()))
                        .filter(expCapability -> expCapability.getState() == Capability.CapabilityState.AVAILABLE)
                        .filter(expCapability -> !expCapability.isSecondCheck())
                        .findFirst();

                if (optCapability.isPresent()) {
                    optCapability.get().setSecondCheck(true);
                } else {
                    expectedCapabilityList.add(capability);
                }
            } else {
                // if Capability.CapabilityState.AVAILABLE
                Optional<Capability> optCapability = expectedCapabilityList.stream()
                        .filter(expCapability -> expCapability.getName().equals(capability.getName()))
                        .filter(expCapability -> expCapability.getState() == Capability.CapabilityState.EXPECTED)
                        .findFirst();

                if (optCapability.isPresent()) {
                    optCapability.get().setState(Capability.CapabilityState.AVAILABLE);
                    optCapability.get().setSecondCheck(true);
                } else {
                    expectedCapabilityList.add(capability);
                }
            }
        }
    }

    /**
     * Returns all the pending capabilities of this startup listener component. There could capabilities
     * in both AVAILABLE and EXPECTED state.
     *

     * If the {@code Capability} is in the EXPECTED state which means that the corresponding AVAILABLE
     * {@code Capability} is not yet registered with this component.
     *

     * IF the {@code Capability} is in the AVAILABLE state which means that the corresponding EXPECTED
     * {@code Capability} is not yet registered with this component.
     *
     * When Generating the pending capability list it considers;
     * 1. all the direct dependencies
     * 2. all the indirect dependencies at EXPECTED state.
     *
     * @return the list of pending capabilities.
     */
    public List<Capability> getPendingCapabilities() {
        Map<String, Long> availableServiceCounts = StartupServiceCache.getInstance().getAvailableService(name);

        synchronized (expectedCapabilityList) {
            Map<String, Long> expectedServiceCounts = expectedCapabilityList.stream()
                    .filter(expCapability -> expCapability.isDirectDependency()
                            || (!expCapability.isDirectDependency()
                            && expCapability.getState() == Capability.CapabilityState.EXPECTED))
                    .map(expCapability -> expCapability.getName())
                    .collect(Collectors.groupingBy(Function.identity(), Collectors.counting()));

            availableServiceCounts.forEach((s, aLong) -> {
                Long eCount = expectedServiceCounts.get(s);
                if (eCount != null && aLong >= eCount) {
                    expectedServiceCounts.remove(s);
                }
            });

            if (expectedServiceCounts.isEmpty()) {
                return Collections.emptyList();
            } else {
                return expectedCapabilityList.stream()
                        .filter(expCapability -> expectedServiceCounts.keySet().contains(expCapability.getName()))
                        .collect(Collectors.toList());
            }
        }
    }

    public RequiredCapabilityListener getListener() {
        return listener;
    }

    public void setListener(RequiredCapabilityListener listener) {
        this.listener = listener;
    }

    public void addExpectedOrAvailableCapabilityProvider(CapabilityProviderCapability capabilityProvider) {
        if (pendingCapabilityProviderList.contains(capabilityProvider)) {
            pendingCapabilityProviderList.remove(capabilityProvider);
        } else {
            pendingCapabilityProviderList.add(capabilityProvider);
        }
    }

    public List<CapabilityProviderCapability> getPendingCapabilityProviders() {
        return Collections.unmodifiableList(pendingCapabilityProviderList);
    }

    public Bundle getBundle() {
        return bundle;
    }

    public boolean isSatisfied() {
        return satisfied;
    }

    public void setSatisfied(boolean satisfied) {
        this.satisfied = satisfied;
    }

    /**
     * Returns 'true' if this component can be satisfied.
     *

     * A {@code StartupComponent} can be satisfied if all the following conditions are valid.
     * 1) If there no pending capability registrations.
     * 2) If the {@code RequiredCapabilityListener} OSGi service is available.
     * 3) If there are no pending {@code CapabilityProvider} OSGi service registrations.
     *
     * @return 'true' if this component can be satisfied, or else 'false'.
     */
    public boolean isSatisfiable() {
        return !satisfied &&
                getPendingCapabilities().size() == 0 &&
                listener != null &&
                pendingCapabilityProviderList.size() == 0;
    }

    /**
     * Returns 'true' if this component in in the pending state.
     *

     * A {@code StartupComponents} becomes pending if either of the following conditions met.
     * 1) If there are pending capability registrations,
     * 2) If there are pending {@code CapabilityProvider} service registrations,
     * 3) If the {@code RequiredCapabilityListener} is not yet registered.
     *
     * @return 'true' if the component is in the pending state.
     */
    public boolean isPending() {
        return !satisfied;
    }

    /**
     * Checks whether the given components is equal to this component.
     *

     * Two components are equal if their names and the bundles are equal.
     *
     * @param obj Startup component to checked.
     * @return 'true' if the given component is equal to this component.
     */
    public boolean equals(Object obj) {
        if (!(obj instanceof StartupComponent)) {
            return false;
        }

        StartupComponent other = (StartupComponent) obj;
        return this.getName().equals(other.getName()) && (this.bundle.equals(other.bundle));
    }

    public int hashCode() {
        assert false;
        return 10;
    }
}


text:
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = exports.makeSelectable = exports.ListItem = exports.List = undefined;

var _List2 = require('./List');

var _List3 = _interopRequireDefault(_List2);

var _ListItem2 = require('./ListItem');

var _ListItem3 = _interopRequireDefault(_ListItem2);

var _makeSelectable2 = require('./makeSelectable');

var _makeSelectable3 = _interopRequireDefault(_makeSelectable2);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

exports.List = _List3.default;
exports.ListItem = _ListItem3.default;
exports.makeSelectable = _makeSelectable3.default;
exports.default = _List3.default;


text:
<?php

/**
 * @group maniphest
 */
final class ManiphestTaskListController extends ManiphestController {

  const DEFAULT_PAGE_SIZE = 1000;

  private $view;

  public function willProcessRequest(array $data) {
    $this->view = idx($data, 'view');
  }

  private function getArrToStrList($key) {
    $arr = $this->getRequest()->getArr($key);
    $arr = implode(',', $arr);
    return nonempty($arr, null);
  }

  public function processRequest() {

    $request = $this->getRequest();
    $user = $request->getUser();

    if ($request->isFormPost()) {
      // Redirect to GET so URIs can be copy/pasted.

      $task_ids   = $request->getStr('set_tasks');
      $task_ids   = nonempty($task_ids, null);

      $search_text = $request->getStr('set_search');

      $min_priority = $request->getInt('set_lpriority');

      $max_priority = $request->getInt('set_hpriority');

      $min_severity = $request->getInt('set_lseverity');

      $max_severity = $request->getInt('set_hseverity');

      $version = $request->getStr('set_version');

      $functionality = $request->getStr('set_functionality');

      $uri = $request->getRequestURI()
        ->alter('users',         $this->getArrToStrList('set_users'))
        ->alter('projects',      $this->getArrToStrList('set_projects'))
        ->alter('aprojects',     $this->getArrToStrList('set_aprojects'))
        ->alter('useraprojects', $this->getArrToStrList('set_useraprojects'))
        ->alter('xprojects',     $this->getArrToStrList('set_xprojects'))
        ->alter('owners',        $this->getArrToStrList('set_owners'))
        ->alter('authors',       $this->getArrToStrList('set_authors'))
        ->alter('lpriority',     $min_priority)
        ->alter('hpriority',     $max_priority)
        ->alter('lseverity',     $min_severity)
        ->alter('hseverity',     $max_severity)
        ->alter('tasks',         $task_ids)
        ->alter('search',        $search_text)
        ->alter('version',       $version)
        ->alter('functionality', $functionality);

      return id(new AphrontRedirectResponse())->setURI($uri);
    }

    $nav = $this->buildBaseSideNav();

    $has_filter = array(
      'action' => true,
      'created' => true,
      'subscribed' => true,
      'triage' => true,
      'projecttriage' => true,
      'projectall' => true,
    );

    $query = null;
    $key = $request->getStr('key');
    if (!$key && !$this->view) {
      if ($this->getDefaultQuery()) {
        $key = $this->$query()->getQueryKey();
      }
    }

    if ($key) {
      $query = id(new PhabricatorSearchQuery())->loadOneWhere(
        'queryKey = %s',
        $key);
    }

    // If the user is running a saved query, load query parameters from that
    // query. Otherwise, build a new query object from the HTTP request.

    if ($query) {
      $nav->selectFilter('Q:'.$query->getQueryKey(), 'custom');
      $this->view = 'custom';
    } else {
      $this->view = $nav->selectFilter($this->view, 'action');
      $query = $this->buildQueryFromRequest();
    }

    // Execute the query.

    list($tasks, $handles, $total_count) = self::loadTasks(
      $query,
      $user);

    // Extract information we need to render the filters from the query.

    $search_text    = $query->getParameter('fullTextSearch');

    $user_phids     = $query->getParameter('userPHIDs', array());
    $task_ids       = $query->getParameter('taskIDs', array());
    $owner_phids    = $query->getParameter('ownerPHIDs', array());
    $author_phids   = $query->getParameter('authorPHIDs', array());
    $project_phids  = $query->getParameter('projectPHIDs', array());
    $any_project_phids = $query->getParameter(
      'anyProjectPHIDs',
      array());
    $any_user_project_phids = $query->getParameter(
      'anyUserProjectPHIDs',
      array());
    $exclude_project_phids = $query->getParameter(
      'excludeProjectPHIDs',
      array());
    $low_priority   = $query->getParameter('lowPriority');
    $high_priority  = $query->getParameter('highPriority');
    $low_severity   = $query->getParameter('lowSeverity');
    $high_severity  = $query->getParameter('highSeverity');
    $version  = $query->getParameter('version');
    $functionality  = $query->getParameter('functionality');

    $page_size = $query->getParameter('limit');
    $page = $query->getParameter('offset');

    $q_taskType = $query->getParameter('type');
    $q_status = $query->getParameter('status');
    $q_group  = $query->getParameter('group');
    $q_order  = $query->getParameter('order');

    $form = id(new AphrontFormView())
      ->setUser($user)
      ->setNoShading(true)
      ->setAction(
          $request->getRequestURI()
            ->alter('key', null)
            ->alter(
              $this->getTaskTypeRequestKey(),
              $this->getTaskTypeRequestValue($q_taskType))
            ->alter(
              $this->getStatusRequestKey(),
              $this->getStatusRequestValue($q_status))
            ->alter(
              $this->getOrderRequestKey(),
              $this->getOrderRequestValue($q_order))
            ->alter(
              $this->getGroupRequestKey(),
              $this->getGroupRequestValue($q_group)));

    if (isset($has_filter[$this->view])) {
      $tokens = array();
      foreach ($user_phids as $phid) {
        $tokens[$phid] = $handles[$phid]->getFullName();
      }
      $form->appendChild(
        id(new AphrontFormTokenizerControl())
          ->setDatasource('/typeahead/common/searchowner/')
          ->setName('set_users')
          ->setLabel(pht('Users'))
          ->setValue($tokens));
    }

    if ($this->view == 'custom') {
      $form->appendChild(
        id(new AphrontFormTextControl())
          ->setName('set_search')
          ->setLabel(pht('Search'))
          ->setValue($search_text));
      $form->appendChild(
        id(new AphrontFormTextControl())
          ->setName('set_tasks')
          ->setLabel(pht('Task IDs'))
          ->setValue(join(',', $task_ids)));

      $tokens = array();
      foreach ($owner_phids as $phid) {
        $tokens[$phid] = $handles[$phid]->getFullName();
      }
      $form->appendChild(
        id(new AphrontFormTokenizerControl())
          ->setDatasource('/typeahead/common/searchowner/')
          ->setName('set_owners')
          ->setLabel(pht('Owners'))
          ->setValue($tokens));

      $tokens = array();
      foreach ($author_phids as $phid) {
        $tokens[$phid] = $handles[$phid]->getFullName();
      }
      $form->appendChild(
        id(new AphrontFormTokenizerControl())
          ->setDatasource('/typeahead/common/authors/')
          ->setName('set_authors')
          ->setLabel(pht('Authors'))
          ->setValue($tokens));
    }

    $tokens = array();
    foreach ($project_phids as $phid) {
      $tokens[$phid] = $handles[$phid]->getFullName();
    }
    if ($this->view != 'projectall' && $this->view != 'projecttriage') {

      $caption = null;
      if ($this->view == 'custom') {
        $caption = pht('Find tasks in ALL of these projects ("AND" query).');
      }

      $form->appendChild(
        id(new AphrontFormTokenizerControl())
          ->setDatasource('/typeahead/common/searchproject/')
          ->setName('set_projects')
          ->setLabel(pht('Projects'))
          ->setCaption($caption)
          ->setValue($tokens));
    }

    if ($this->view == 'custom') {
      $atokens = array();
      foreach ($any_project_phids as $phid) {
        $atokens[$phid] = $handles[$phid]->getFullName();
      }
      $form->appendChild(
        id(new AphrontFormTokenizerControl())
          ->setDatasource('/typeahead/common/projects/')
          ->setName('set_aprojects')
          ->setLabel(pht('Any Projects'))
          ->setCaption(pht('Find tasks in ANY of these projects ("OR" query).'))
          ->setValue($atokens));

      $tokens = array();
      foreach ($any_user_project_phids as $phid) {
        $tokens[$phid] = $handles[$phid]->getFullName();
      }
      $form->appendChild(
        id(new AphrontFormTokenizerControl())
        ->setDatasource('/typeahead/common/users/')
        ->setName('set_useraprojects')
        ->setLabel(pht('Any User Projects'))
        ->setCaption(
          pht('Find tasks in ANY of these users\' projects ("OR" query).'))
        ->setValue($tokens));

      $tokens = array();
      foreach ($exclude_project_phids as $phid) {
        $tokens[$phid] = $handles[$phid]->getFullName();
      }
      $form->appendChild(
        id(new AphrontFormTokenizerControl())
          ->setDatasource('/typeahead/common/projects/')
          ->setName('set_xprojects')
          ->setLabel(pht('Exclude Projects'))
          ->setCaption(pht('Find tasks NOT in any of these projects.'))
          ->setValue($tokens));

      $priority = ManiphestTaskPriority::getLowestPriority();
      if ($low_priority !== null) {
        $priority = $low_priority;
      }

      $form->appendChild(
          id(new AphrontFormSelectControl())
            ->setLabel(pht('Min Priority'))
            ->setName('set_lpriority')
            ->setValue($priority)
            ->setOptions(array_reverse(
                ManiphestTaskPriority::getTaskPriorityMap(), true)));

      $priority = ManiphestTaskPriority::getHighestPriority();
      if ($high_priority !== null) {
        $priority = $high_priority;
      }

      $form->appendChild(
          id(new AphrontFormSelectControl())
            ->setLabel(pht('Max Priority'))
            ->setName('set_hpriority')
            ->setValue($priority)
            ->setOptions(ManiphestTaskPriority::getTaskPriorityMap()));

      $severity = ManiphestTaskSeverity::getLowestSeverity();
      if ($low_severity !== null) {
        $severity = $low_severity;
      }

      $form->appendChild(
          id(new AphrontFormSelectControl())
            ->setLabel(pht('Min Severity'))
            ->setName('set_lseverity')
            ->setValue($severity)
            ->setOptions(array_reverse(
                ManiphestTaskSeverity::getTaskSeverityMap(), true)));

      $severity = ManiphestTaskSeverity::getHighestSeverity();
      if ($high_severity !== null) {
        $severity = $high_severity;
      }

      $form->appendChild(
          id(new AphrontFormSelectControl())
            ->setLabel(pht('Max Severity'))
            ->setName('set_hseverity')
            ->setValue($severity)
            ->setOptions(ManiphestTaskSeverity::getTaskSeverityMap()));

      $form->appendChild(
        id(new AphrontFormTextControl())
          ->setName('set_version')
          ->setLabel(pht('Version'))
          ->setValue($version));

      $form->appendChild(
        id(new AphrontFormTextControl())
          ->setName('set_functionality')
          ->setLabel(pht('Functionality'))
          ->setValue($functionality));

    }

    $form
      ->appendChild($this->renderTaskTypeControl($q_taskType))
      ->appendChild($this->renderStatusControl($q_status))
      ->appendChild($this->renderGroupControl($q_group))
      ->appendChild($this->renderOrderControl($q_order));

    $submit = id(new AphrontFormSubmitControl())
      ->setValue(pht('Filter Tasks'));

    // Only show "Save..." for novel queries which have some kind of query
    // parameters set.
    if ($this->view === 'custom'
        && empty($key)
        && $request->getRequestURI()->getQueryParams()) {
      $submit->addCancelButton(
        '/maniphest/custom/edit/?key='.$query->getQueryKey(),
        pht('Save Custom Query...'));
    }

    $form->appendChild($submit);

    $create_uri = new PhutilURI('/maniphest/task/create/');
    if ($project_phids) {
      // If we have project filters selected, use them as defaults for task
      // creation.
      $create_uri->setQueryParam('projects', implode(';', $project_phids));
    }

    $filter = new AphrontListFilterView();
    if (empty($key)) {
      $filter->appendChild($form);
    }

    $have_tasks = false;
    foreach ($tasks as $group => $list) {
      if (count($list)) {
        $have_tasks = true;
        break;
      }
    }

    require_celerity_resource('maniphest-task-summary-css');

    $list_container = new AphrontNullView();
    $list_container->appendChild(hsprintf(
      '
'));

    if (!$have_tasks) {
      $no_tasks = pht('No matching tasks.');
      $list_container->appendChild(hsprintf(
        '
'.
          '%s'.
        '
',
        $no_tasks));
      $result_count = null;
    } else {
      $pager = new AphrontPagerView();
      $pager->setURI($request->getRequestURI(), 'offset');
      $pager->setPageSize($page_size);
      $pager->setOffset($page);
      $pager->setCount($total_count);

      $cur = ($pager->getOffset() + 1);
      $max = min($pager->getOffset() + $page_size, $total_count);
      $tot = $total_count;

      $results = pht('Displaying tasks %s - %s of %s.',
        number_format($cur),
        number_format($max),
        number_format($tot));
      $result_count = phutil_tag(
        'div',
        array(
          'class' => 'maniphest-total-result-count'
        ),
        $results);

      $selector = new AphrontNullView();

      $group = $query->getParameter('group');
      $order = $query->getParameter('order');
      $is_draggable =
        ($order == 'priority') &&
        ($group == 'none' || $group == 'priority');

      $lists = array();
      foreach ($tasks as $group => $list) {
        $task_list = new ManiphestTaskListView();
        $task_list->setShowBatchControls(true);
        if ($is_draggable) {
          $task_list->setShowSubpriorityControls(true);
        }
        $task_list->setUser($user);
        $task_list->setTasks($list);
        $task_list->setHandles($handles);

        $count = number_format(count($list));

        $header =
          javelin_tag(
            'h1',
            array(
              'class' => 'maniphest-task-group-header',
              'sigil' => 'task-group',
              'meta'  => array(
                'priority' => head($list)->getPriority(),
              ),
            ),
            $group.' ('.$count.')');

        $lists[] =
          phutil_tag(
            'div',
            array(
              'class' => 'maniphest-task-group'
            ),
            array(
              $header,
              $task_list,
            ));
      }

      $selector->appendChild($lists);
      $selector->appendChild($this->renderBatchEditor($query));

      $list_container->appendChild($selector);
      $list_container->appendChild($pager);

      Javelin::initBehavior(
        'maniphest-subpriority-editor',
        array(
          'uri'   =>  '/maniphest/subpriority/',
        ));
    }

    $nav->appendChild($filter);
    $nav->appendChild($result_count);
    $nav->appendChild($list_container);

    $title = pht('Task List');

    $crumbs = $this->buildApplicationCrumbs()
      ->addCrumb(
        id(new PhabricatorCrumbView())
          ->setName($title))
      ->addAction(
        id(new PHUIListItemView())
          ->setHref($this->getApplicationURI('/task/create/'))
          ->setName(pht('Create Task'))
          ->setIcon('create'));

    $nav->setCrumbs($crumbs);

    return $this->buildApplicationPage(
      $nav,
      array(
        'title' => $title,
        'device' => true,
        'dust' => true,
      ));
  }

  public static function loadTasks(
    PhabricatorSearchQuery $search_query,
    PhabricatorUser $viewer) {

    $any_project = false;
    $search_text = $search_query->getParameter('fullTextSearch');
    $user_phids = $search_query->getParameter('userPHIDs', array());
    $task_ids = $search_query->getParameter('taskIDs', array());
    $project_phids = $search_query->getParameter('projectPHIDs', array());
    $any_project_phids = $search_query->getParameter(
      'anyProjectPHIDs',
      array());
    $any_user_project_phids = $search_query->getParameter(
      'anyUserProjectPHIDs',
      array());
    $xproject_phids = $search_query->getParameter(
      'excludeProjectPHIDs',
      array());
    $owner_phids = $search_query->getParameter('ownerPHIDs', array());
    $author_phids = $search_query->getParameter('authorPHIDs', array());

    $low_priority = $search_query->getParameter('lowPriority');
    $low_priority = coalesce($low_priority,
        ManiphestTaskPriority::getLowestPriority());
    $high_priority = $search_query->getParameter('highPriority');
    $high_priority = coalesce($high_priority,
      ManiphestTaskPriority::getHighestPriority());

    $low_severity = $search_query->getParameter('lowSeverity');
    $low_severity = coalesce($low_severity,
        ManiphestTaskSeverity::getLowestSeverity());
    $high_severity = $search_query->getParameter('highSeverity');
    $high_severity = coalesce($high_severity,
      ManiphestTaskSeverity::getHighestSeverity());

    $version = $search_query->getParameter('version');
    $functionality = $search_query->getParameter('functionality');

    $query = new ManiphestTaskQuery();
    $query->withTaskIDs($task_ids);

    if ($project_phids) {
      $query->withAllProjects($project_phids);
    }

    if ($xproject_phids) {
      $query->withoutProjects($xproject_phids);
    }

    if ($any_project_phids) {
      $query->withAnyProjects($any_project_phids);
    }

    if ($owner_phids) {
      $query->withOwners($owner_phids);
    }

    if ($author_phids) {
      $query->withAuthors($author_phids);
    }

    if ($any_user_project_phids) {
      $query->setViewer($viewer);
      $query->withAnyUserProjects($any_user_project_phids);
    }

	$taskType = $search_query->getParameter('type', 'all');
    if (!empty($taskType['task']) && !empty($taskType['bug'])) {
      $query->withTaskType(ManiphestTaskQuery::TYPE_ANY);
    } else if (!empty($taskType['task'])) {
      $query->withTaskType(ManiphestTaskQuery::TYPE_TASK);
    } else {
      $query->withTaskType(ManiphestTaskQuery::TYPE_BUG);
    }

    $status = $search_query->getParameter('status', 'all');
    if (is_array($status)) {
      if (!empty($status['open']) && !empty($status['closed'])) {
        $query->withStatus(ManiphestTaskQuery::STATUS_ANY);
      } else if (!empty($status['open'])) {
        $query->withStatus(ManiphestTaskQuery::STATUS_OPEN);
      } else {
        $query->withStatus(ManiphestTaskQuery::STATUS_CLOSED);
      }
	}
	else {
      $query->withStatus($status);
	}

    switch ($search_query->getParameter('view')) {
      case 'action':
        $query->withOwners($user_phids);
        break;
      case 'created':
        $query->withAuthors($user_phids);
        break;
      case 'subscribed':
        $query->withSubscribers($user_phids);
        break;
      case 'triage':
        $query->withOwners($user_phids);
        $query->withPriority(ManiphestTaskPriority::PRIORITY_TRIAGE);
        break;
      case 'alltriage':
        $query->withPriority(ManiphestTaskPriority::PRIORITY_TRIAGE);
        break;
      case 'all':
        break;
      case 'projecttriage':
        $query->withPriority(ManiphestTaskPriority::PRIORITY_TRIAGE);
        break;
      case 'projectall':
        break;
      case 'custom':
        $query->withPrioritiesBetween($low_priority, $high_priority);
        $query->withSeveritiesBetween($low_severity, $high_severity);
        break;
    }

    $query->withVersion($version);
    $query->withFunctionality($functionality);
    $query->withFullTextSearch($search_text);

    $order_map = array(
      'priority'  => ManiphestTaskQuery::ORDER_PRIORITY,
      'severity'  => ManiphestTaskQuery::ORDER_SEVERITY,
      'created'   => ManiphestTaskQuery::ORDER_CREATED,
      'title'     => ManiphestTaskQuery::ORDER_TITLE,
    );
    $query->setOrderBy(
      idx(
        $order_map,
        $search_query->getParameter('order'),
        ManiphestTaskQuery::ORDER_MODIFIED));

    $group_map = array(
      'priority'  => ManiphestTaskQuery::GROUP_PRIORITY,
      'severity'  => ManiphestTaskQuery::GROUP_SEVERITY,
      'owner'     => ManiphestTaskQuery::GROUP_OWNER,
      'status'    => ManiphestTaskQuery::GROUP_STATUS,
      'project'   => ManiphestTaskQuery::GROUP_PROJECT,
    );
    $query->setGroupBy(
      idx(
        $group_map,
        $search_query->getParameter('group'),
        ManiphestTaskQuery::GROUP_NONE));

    $query->setCalculateRows(true);
    $query->setLimit($search_query->getParameter('limit'));
    $query->setOffset($search_query->getParameter('offset'));

    $data = $query->execute();
    $total_row_count = $query->getRowCount();

    $project_group_phids = array();
    if ($search_query->getParameter('group') == 'project') {
      foreach ($data as $task) {
        foreach ($task->getProjectPHIDs() as $phid) {
          $project_group_phids[] = $phid;
        }
      }
    }

    $handle_phids = mpull($data, 'getOwnerPHID');
    $handle_phids = array_merge(
      $handle_phids,
      $project_phids,
      $user_phids,
      $xproject_phids,
      $owner_phids,
      $author_phids,
      $project_group_phids,
      $any_project_phids,
      $any_user_project_phids,
      array_mergev(mpull($data, 'getProjectPHIDs')));
    $handles = id(new PhabricatorObjectHandleData($handle_phids))
      ->setViewer($viewer)
      ->loadHandles();

    switch ($search_query->getParameter('group')) {
      case 'priority':
        $data = mgroup($data, 'getPriority');

        // If we have invalid priorities, they'll all map to "???". Merge
        // arrays to prevent them from overwriting each other.

        $out = array();
        foreach ($data as $pri => $tasks) {
          $out[ManiphestTaskPriority::getTaskPriorityName($pri)][] = $tasks;
        }
        foreach ($out as $pri => $tasks) {
          $out[$pri] = array_mergev($tasks);
        }
        $data = $out;

        break;
      case 'severity':
        $data = mgroup($data, 'getSeverity');

        // If we have invalid severities, they'll all map to "???". Merge
        // arrays to prevent them from overwriting each other.

        $out = array();
        foreach ($data as $sev => $tasks) {
          $out[ManiphestTaskSeverity::getTaskSeverityName($sev)][] = $tasks;
        }
        foreach ($out as $sev => $tasks) {
          $out[$sev] = array_mergev($tasks);
        }
        $data = $out;

        break;
      case 'status':
        $data = mgroup($data, 'getStatus');

        $out = array();
        foreach ($data as $status => $tasks) {
          $out[ManiphestTaskStatus::getTaskStatusFullName($status)] = $tasks;
        }

        $data = $out;
        break;
      case 'owner':
        $data = mgroup($data, 'getOwnerPHID');

        $out = array();
        foreach ($data as $phid => $tasks) {
          if ($phid) {
            $out[$handles[$phid]->getFullName()] = $tasks;
          } else {
            $out['Unassigned'] = $tasks;
          }
        }

        $data = $out;
        ksort($data);

        // Move "Unassigned" to the top of the list.
        if (isset($data['Unassigned'])) {
          $data = array('Unassigned' => $out['Unassigned']) + $out;
        }
        break;
      case 'project':
        $grouped = array();
        foreach ($query->getGroupByProjectResults() as $project => $tasks) {
          foreach ($tasks as $task) {
            $group = $project ? $handles[$project]->getName() : 'No Project';
            $grouped[$group][$task->getID()] = $task;
          }
        }
        $data = $grouped;
        ksort($data);

        // Move "No Project" to the end of the list.
        if (isset($data['No Project'])) {
          $noproject = $data['No Project'];
          unset($data['No Project']);
          $data += array('No Project' => $noproject);
        }
        break;
      default:
        $data = array(
          'Tasks' => $data,
        );
        break;
    }

    return array($data, $handles, $total_row_count);
  }

  private function renderBatchEditor(PhabricatorSearchQuery $search_query) {
    $user = $this->getRequest()->getUser();

    Javelin::initBehavior(
      'maniphest-batch-selector',
      array(
        'selectAll'   => 'batch-select-all',
        'selectNone'  => 'batch-select-none',
        'submit'      => 'batch-select-submit',
        'status'      => 'batch-select-status-cell',
        'idContainer' => 'batch-select-id-container',
        'formID'      => 'batch-select-form',
      ));

    $select_all = javelin_tag(
      'a',
      array(
        'href'        => '#',
        'mustcapture' => true,
        'class'       => 'grey button',
        'id'          => 'batch-select-all',
      ),
      pht('Select All'));

    $select_none = javelin_tag(
      'a',
      array(
        'href'        => '#',
        'mustcapture' => true,
        'class'       => 'grey button',
        'id'          => 'batch-select-none',
      ),
      pht('Clear Selection'));

    $submit = phutil_tag(
      'button',
      array(
        'id'          => 'batch-select-submit',
        'disabled'    => 'disabled',
        'class'       => 'disabled',
      ),
      pht("Batch Edit Selected \xC2\xBB"));

    $export = javelin_tag(
      'a',
      array(
        'href' => '/maniphest/export/'.$search_query->getQueryKey().'/',
        'class' => 'grey button',
      ),
      pht('Export to Excel'));

    $hidden = phutil_tag(
      'div',
      array(
        'id' => 'batch-select-id-container',
      ),
      '');

    $editor = hsprintf(
      '
'.
        '
%s
'.
        '
'.
          '
'.
            '%s%s	'.
            '%s	'.
            '%s	'.
            '%s%s	'.
          '
'.
        '
'.
      '
',
      pht('Batch Task Editor'),
      $select_all,
      $select_none,
      $export,
      '',
      $submit,
      $hidden);

    $editor = phabricator_form(
      $user,
      array(
        'method' => 'POST',
        'action' => '/maniphest/batch/',
        'id'     => 'batch-select-form',
      ),
      $editor);

    return $editor;
  }

  private function buildQueryFromRequest() {
    $request  = $this->getRequest();
    $user     = $request->getUser();

    $taskType = $this->getTaskTypeValueFromRequest();
	$status   = $this->getStatusValueFromRequest();
    $group    = $this->getGroupValueFromRequest();
    $order    = $this->getOrderValueFromRequest();

    $user_phids = $request->getStrList(
      'users',
      array($user->getPHID()));

    if ($this->view == 'projecttriage' || $this->view == 'projectall') {
      $projects = id(new PhabricatorProjectQuery())
        ->setViewer($user)
        ->withMemberPHIDs($user_phids)
        ->execute();
      $any_project_phids = mpull($projects, 'getPHID');
      $any_user_project_phids = array();
    } else {
      $any_project_phids = $request->getStrList('aprojects');
      $any_user_project_phids = $request->getStrList('useraprojects');
    }

    $project_phids = $request->getStrList('projects');
    $exclude_project_phids = $request->getStrList('xprojects');
    $task_ids = $request->getStrList('tasks');

    if ($task_ids) {
      // We only need the integer portion of each task ID, so get rid of any
      // non-numeric elements
      $numeric_task_ids = array();

      foreach ($task_ids as $task_id) {
        $task_id = preg_replace('/\D+/', '', $task_id);
        if (!empty($task_id)) {
          $numeric_task_ids[] = $task_id;
        }
      }

      if (empty($numeric_task_ids)) {
        $numeric_task_ids = array(null);
      }

      $task_ids = $numeric_task_ids;
    }

    $owner_phids    = $request->getStrList('owners');
    $author_phids   = $request->getStrList('authors');

    $search_string  = $request->getStr('search');

    $low_priority   = $request->getInt('lpriority');
    $high_priority  = $request->getInt('hpriority');

    $low_severity   = $request->getInt('lseverity');
    $high_severity  = $request->getInt('hseverity');

    $version  = $request->getStr('version');
    $functionality  = $request->getStr('functionality');

    $page = $request->getInt('offset');
    $page_size = self::DEFAULT_PAGE_SIZE;

    $query = new PhabricatorSearchQuery();
    $query->setQuery('<<maniphest>>');
    $query->setParameters(
      array(
        'fullTextSearch'      => $search_string,
        'view'                => $this->view,
        'userPHIDs'           => $user_phids,
        'projectPHIDs'        => $project_phids,
        'anyProjectPHIDs'     => $any_project_phids,
        'anyUserProjectPHIDs' => $any_user_project_phids,
        'excludeProjectPHIDs' => $exclude_project_phids,
        'ownerPHIDs'          => $owner_phids,
        'authorPHIDs'         => $author_phids,
        'taskIDs'             => $task_ids,
        'lowPriority'         => $low_priority,
        'highPriority'        => $high_priority,
        'lowSeverity'         => $low_severity,
        'highSeverity'        => $high_severity,
        'group'               => $group,
        'order'               => $order,
        'offset'              => $page,
        'limit'               => $page_size,
        'status'              => $status,
        'type'                => $taskType,
        'version'             => $version,
        'functionality'       => $functionality,
      ));

    $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
    $query->save();
    unset($unguarded);

    return $query;
  }

/* -(  Toggle Button Controls  )---------------------------------------------

  These are a giant mess since we have several different values: the request
  key (GET param used in requests), the request value (short names used in
  requests to keep URIs readable), and the query value (complex value stored in
  the query).

*/

  private function getTaskTypeValueFromRequest() {
    $map = $this->getTaskTypeMap();
    $val = $this->getRequest()->getStr($this->getTaskTypeRequestKey());
    return idx($map, $val, $map['tb']);
  }

  private function getStatusValueFromRequest() {
    $map = $this->getStatusMap();
    $val = $this->getRequest()->getStr($this->getStatusRequestKey());
    return idx($map, $val, head($map));
  }

  private function getGroupValueFromRequest() {
    $map = $this->getGroupMap();
    $val = $this->getRequest()->getStr($this->getGroupRequestKey());
    return idx($map, $val, head($map));
  }

  private function getOrderValueFromRequest() {
    $map = $this->getOrderMap();
    $val = $this->getRequest()->getStr($this->getOrderRequestKey());
    return idx($map, $val, head($map));
  }

  private function getTaskTypeRequestKey() {
    return 't';
  }

  private function getStatusRequestKey() {
    return 's';
  }

  private function getGroupRequestKey() {
    return 'g';
  }

  private function getOrderRequestKey() {
    return 'o';
  }

  private function getTaskTypeRequestValue($value) {
    return array_search($value, $this->getTaskTypeMap());
  }

  private function getStatusRequestValue($value) {
    return array_search($value, $this->getStatusMap());
  }

  private function getGroupRequestValue($value) {
    return array_search($value, $this->getGroupMap());
  }

  private function getOrderRequestValue($value) {
    return array_search($value, $this->getOrderMap());
  }

  private function getTaskTypeMap() {
    return array(
      't'   => array(
        'task' => true,
      ),
      'b'   => array(
        'bug' => true,
      ),
      'tb'  => array(
        'task' => true,
        'bug' => true,
      ),
    );
  }

  private function getStatusMap() {
    return array(
      'o'   => array(
        'open' => true,
      ),
      'c'   => array(
        'closed' => true,
      ),
      'oc'  => array(
        'open' => true,
        'closed' => true,
      ),
	  's' . ManiphestTaskStatus::STATUS_OPEN => ManiphestTaskQuery::STATUS_OPEN_ONLY,
	  's' . ManiphestTaskStatus::STATUS_OPEN_IN_PROGRESS => ManiphestTaskQuery::STATUS_IN_PROGRESS,
	  's' . ManiphestTaskStatus::STATUS_OPEN_READY_FOR_TEST => ManiphestTaskQuery::STATUS_READY_FOR_TEST,
	  's' . ManiphestTaskStatus::STATUS_CLOSED_RESOLVED => ManiphestTaskQuery::STATUS_RESOLVED,
	  's' . ManiphestTaskStatus::STATUS_CLOSED_WONTFIX => ManiphestTaskQuery::STATUS_WONTFIX,
	  's' . ManiphestTaskStatus::STATUS_CLOSED_INVALID => ManiphestTaskQuery::STATUS_INVALID,
	  's' . ManiphestTaskStatus::STATUS_CLOSED_DUPLICATE => ManiphestTaskQuery::STATUS_DUPLICATE,
	  's' . ManiphestTaskStatus::STATUS_CLOSED_SPITE => ManiphestTaskQuery::STATUS_SPITE,
    );
  }

  private function getGroupMap() {
    return array(
      'p'  => 'priority',
      'sv' => 'severity',
      'o'  => 'owner',
      's'  => 'status',
      'j'  => 'project',
      'n'  => 'none',
    );
  }

  private function getOrderMap() {
    return array(
      'p' => 'priority',
      's' => 'severity',
      'u' => 'updated',
      'c' => 'created',
      't' => 'title',
    );
  }

  private function getTaskTypeButtonMap() {
    return array(
      't'   => pht('Task'),
      'b'   => pht('Bug'),
      'tb'  => pht('All'),
    );
  }

  private function getStatusButtonMap() {
    $result = array(
      'o'   => pht('Opened'),
      'c'   => pht('Closed'),
      'oc'  => pht('All'),
    );

	$statusMap = ManiphestTaskStatus::getTaskStatusMap();

	foreach ($statusMap as $key => $value) {
		$result['s' . $key] = pht($value);
	}

	return $result;
  }

  private function getGroupButtonMap() {
    return array(
      'p'  => pht('Priority'),
      'sv' => pht('Severity'),
      'o'  => pht('Owner'),
      's'  => pht('Status'),
      'j'  => pht('Project'),
      'n'  => pht('None'),
    );
  }

  private function getOrderButtonMap() {
    return array(
      'p' => pht('Priority'),
      's' => pht('Severity'),
      'u' => pht('Updated'),
      'c' => pht('Created'),
      't' => pht('Title'),
    );
  }

  public function renderTaskTypeControl($value) {
    $request = $this->getRequest();
    return id(new AphrontFormToggleButtonsControl())
      ->setLabel(pht('Type'))
      ->setValue($this->getTaskTypeRequestValue($value))
      ->setBaseURI($request->getRequestURI(), $this->getTaskTypeRequestKey())
      ->setButtons($this->getTaskTypeButtonMap());
  }

  public function renderStatusControl($value) {
    $request = $this->getRequest();
    return id(new AphrontFormToggleButtonsControl())
      ->setLabel(pht('Status'))
      ->setValue($this->getStatusRequestValue($value))
      ->setBaseURI($request->getRequestURI(), $this->getStatusRequestKey())
      ->setButtons($this->getStatusButtonMap());
  }

  public function renderOrderControl($value) {
    $request = $this->getRequest();
    return id(new AphrontFormToggleButtonsControl())
      ->setLabel(pht('Order'))
      ->setValue($this->getOrderRequestValue($value))
      ->setBaseURI($request->getRequestURI(), $this->getOrderRequestKey())
      ->setButtons($this->getOrderButtonMap());
  }

  public function renderGroupControl($value) {
    $request = $this->getRequest();
    return id(new AphrontFormToggleButtonsControl())
      ->setLabel(pht('Group'))
      ->setValue($this->getGroupRequestValue($value))
      ->setBaseURI($request->getRequestURI(), $this->getGroupRequestKey())
      ->setButtons($this->getGroupButtonMap());
  }

}


text:
var jQueryScriptUrl = "https://ajax.aspnetcdn.com/ajax/jQuery/jquery-2.0.2.min.js";

// Is MDS enabled?
if ("undefined" != typeof g_MinimalDownload && g_MinimalDownload && (window.location.pathname.toLowerCase()).endsWith("/_layouts/15/start.aspx") && "undefined" != typeof asyncDeltaManager) {
    // Register script for MDS if possible
    RegisterModuleInit("PnP-Partner-Pack-Overrides.js", JavaScript_Embed); //MDS registration
    JavaScript_Embed(); //non MDS run
} else {
    JavaScript_Embed();
}

function JavaScript_Embed() {

    loadScript(jQueryScriptUrl, function () {
        $(document).ready(function () {
            // SP.SOD.executeOrDelayUntilScriptLoaded(function () { ReplaceLinks(); }, 'sp.js');
            SP.SOD.executeFunc('sp.js', 'SP.ClientContext', replaceLinks);
        });
    });
}

function replaceLinks() {

    // Customize the newsbweb.aspx page, as soon as possible
    if (IsOnPage("newsbweb.aspx")) {
        // Clean the current page as soon as possible
        $("body").removeClass("ms-backgroundImage");
        $("body").empty();
    }

    var ctx = SP.ClientContext.get_current();
    var web = ctx.get_web();
    ctx.load(web, 'Url');

    ctx.executeQueryAsync(
        function () { // on success

            var currentScriptUrl = $('#PnPPartnerPackOverrides').attr('src');
            addInSiteUrl = "https://localhost:44339";
            var hostWebUrl = web.get_url();

            // Customize the newsbweb.aspx page, as soon as possible
            if (IsOnPage("newsbweb.aspx")) {
                // Redirect to the custom "New Sub Site" page URL
                location.replace(addInSiteUrl + "/pages/default.aspx?SPHostUrl=" + encodeURIComponent(hostWebUrl));
            }

            // Customize the viewlsts.aspx page
            if (IsOnPage("viewlsts.aspx")) {
                // Replace the "New Sub Site" link
                $("#createnewsite").attr("href", addInSiteUrl + "/pages/default.aspx?SPHostUrl=" + encodeURIComponent(hostWebUrl));
            }
        },
        function (s, e) { // on failure
            console.error(e.get_message());
        }
    );
}

function IsOnPage(pageName) {
    if (window.location.href.toLowerCase().indexOf(pageName.toLowerCase()) > -1) {
        return true;
    } else {
        return false;
    }
}

function loadScript(url, callback) {
    var head = document.getElementsByTagName("head")[0];
    var script = document.createElement("script");
    script.src = url;

    // Attach handlers for all browsers
    var done = false;
    script.onload = script.onreadystatechange = function () {
        if (!done && (!this.readyState
					|| this.readyState == "loaded"
					|| this.readyState == "complete")) {
            done = true;

            // Continue your code
            callback();

            // Handle memory leak in IE
            script.onload = script.onreadystatechange = null;
            head.removeChild(script);
        }
    };

    head.appendChild(script);
}


text:
'use strict';

var $mongoose = require('mongoose');

var AccessControlEntry = require('./accessControlEntry.js');

var UserAccessControlEntrySchema = AccessControlEntry.schema.extend({
	user: {
		ref: 'User',
		type: $mongoose.Schema.Types.ObjectId
	}
});

var UserAccessControlEntry = $mongoose.model('UserAccessControlEntry', UserAccessControlEntrySchema);

module.exports = UserAccessControlEntry;


text:
import { IValue } from "./IValue";

export class SplitStringToString implements IValue<String> {
  private readonly string: IValue<String>;
  private readonly splitBy: string | RegExp;
  private readonly elementPosition: Number;

  /**
    * Split a string into substrings using the specified separator.
    * @param string which is shall be split by separator.
    * @param separator used to split given string.
    * @param elementPosition number of element of the splitted string method value() will return; counting starts at 1
    */
  constructor(
    string: IValue<String>,
    separator: string | RegExp,
    element: Number,
  ) {
    this.string = string;
    this.splitBy = separator;
    this.elementPosition = element;
  }

  public value(): String {
    let elements = this.string.value().split(this.splitBy);
    let s: String;
    if (elements.length === 0) {
      s = this.string.value();
    } else {
      if (this.elementPosition > 0) {
        s = elements[this.elementPosition.valueOf() - 1];
      } else{
        throw new Error(`Number given for the element must be greater than 0, got: ${this.elementPosition}`);
      }
    }
    return s;
  }
}


text:
__author__ = 'Ammar Akhtar'

"""
simple logging for betfair.py

heavily inspired by
	https://docs.python.org/2/howto/logging-cookbook.html,
	http://pymotw.com/2/logging/

"""

import logging
import logging.handlers

LOG_FILENAME = 'logs/logs.out'
formatter = logging.Formatter('%(levelname)s [%(asctime)s] [%(name)s] [%(filename)s:%(lineno)s] %(message)s')

loghandler = logging.handlers.RotatingFileHandler(LOG_FILENAME, maxBytes=1000000, backupCount=15)
loghandler.setFormatter(formatter)
loghandler.setLevel(logging.DEBUG)

ch = logging.StreamHandler()
ch.setFormatter(formatter)
ch.setLevel(logging.DEBUG)

stream_logger = logging.getLogger('stream_logger')
stream_logger.addHandler(ch)

main_logger = logging.getLogger('betfair_logger')
main_logger.addHandler(loghandler)
main_logger.addHandler(ch)
main_logger.setLevel(logging.INFO)

# end set up logsai


text:
<?php

/*
 * controller and components
 */
App::uses('Controller', 'Controller');
App::uses('CakeRequest', 'Network');
App::uses('CakeResponse', 'Network');
App::uses('ComponentCollection', 'Controller');
App::uses('CloggyAclComponent', 'Cloggy.Controller/Component');

/*
 * models
 */
App::uses('CloggyAppModel', 'Cloggy.Model');
App::uses('CloggyUser', 'Cloggy.Model');

class TestCallbackController extends Controller {

    public $uses = array('Cloggy.CloggyUser');

    public function beforeFilter() {
        parent::beforeFilter();
    }

    public function test() {
        echo 'failed!';
    }

}

class CloggyAclComponentTest extends CakeTestCase {

    public $fixtures = array(
        'plugin.cloggy.cloggy_user',
        'plugin.cloggy.cloggy_user_role',
        'plugin.cloggy.cloggy_user_perm'
    );

    private $__CloggyAcl;
    private $__CloggyUser;
    private $__Controller;
    private $__TestController;

    public function setUp() {

        parent::setUp();

        // Setup our component and fake test controller
        $Collection = new ComponentCollection();
        $CakeRequest = new CakeRequest();
        $CakeResponse = new CakeResponse();

        $this->__CloggyUser = ClassRegistry::init('CloggyUser');
        $this->__CloggyAcl = new CloggyAclComponent($Collection);

        /*
         * main controller
         */
        $this->__Controller = new Controller($CakeRequest, $CakeResponse);
        $this->__Controller->constructClasses();

        /*
         * contstruct class for TestController
         */
        $this->__TestController = new TestCallbackController($CakeRequest,$CakeResponse);
        $this->__TestController->constructClasses();

    }

    public function testObjects() {
        $this->assertFalse(empty($this->__Controller));
        $this->assertFalse(empty($this->__CloggyAcl));
        $this->assertTrue(is_a($this->__CloggyUser, 'CloggyUser'));
        $this->assertTrue(is_a($this->__TestController->CloggyUser, 'CloggyUser'));
    }

    public function testUserData() {

        $user = $this->__getUser();

        $this->assertFalse(empty($user));
        $this->assertArrayHasKey('CloggyUserRole',$user);
        $this->assertArrayHasKey('CloggyUserPermAro',$user);
        $this->assertFalse(empty($user['CloggyUser']));
        $this->assertFalse(empty($user['CloggyUserRole']));
        $this->assertFalse(empty($user['CloggyUserPermAro']));

        $this->__CloggyAcl->setUserData($user);
        $this->__CloggyAcl->initialize($this->__Controller);

        $user = $this->__CloggyAcl->getUserData();
        $this->assertFalse(empty($user));

        $this->__CloggyAcl->clearUserData();
        $this->__CloggyAcl->initialize($this->__Controller);

        $user = $this->__CloggyAcl->getUserData();
        $this->assertTrue(empty($user));

    }

    public function testRulesBasic() {

        $user = $this->__getUser();

        $this->__CloggyAcl->setUserData($user);
        $this->__CloggyAcl->initialize($this->__Controller);

        $Rule = $this->__CloggyAcl->getRuleObject();
        $this->assertTrue(is_a($Rule,'CloggyRulesAcl'));

        $RuleController = $Rule->getController();
        $Controller = $this->__CloggyAcl->getControllerObject();

        $this->assertTrue(is_a($RuleController,'Controller'));
        $this->assertEqual($Controller, $RuleController);

        $Rule->init();

        $ruleControllerName = $Rule->getRequestedController();
        $ruleActionName = $Rule->getRequestedAction();
        $ruleUrl = $Rule->getRequestedUrl();

        $this->assertTrue(is_null($ruleControllerName));
        $this->assertTrue(is_null($ruleActionName));

    }

    public function testRulesRequest() {

        $this->__Controller->request->url = 'controller/action';
        $this->__Controller->request->params['plugin'] = 'cloggy';
        $this->__Controller->request->params['controller'] = 'cloggy_test_controller';
        $this->__Controller->request->params['action'] = 'action';
        $this->__Controller->request->query['url'] = 'controller/action';

        $this->assertEqual($this->__Controller->request->url,'controller/action');
        $this->assertEqual($this->__Controller->request->params['plugin'],'cloggy');
        $this->assertEqual($this->__Controller->request->params['controller'],'cloggy_test_controller');
        $this->assertEqual($this->__Controller->request->params['action'],'action');
        $this->assertEqual($this->__Controller->request->query['url'],'controller/action');

        $user = $this->__getUser();
        $this->__CloggyAcl->setUserData($user);
        $this->__CloggyAcl->initialize($this->__Controller);

        $Rule = $this->__CloggyAcl->getRuleObject();
        $Rule->init();

        $ruleControllerName = $Rule->getRequestedController();
        $ruleActionName = $Rule->getRequestedAction();
        $ruleUrl = $Rule->getRequestedUrl();

        $this->assertEqual($ruleControllerName,$this->__Controller->request->params['controller']);
        $this->assertEqual($ruleActionName,$this->__Controller->request->params['action']);
        $this->assertEqual($ruleUrl,$this->__Controller->request->query['url']);

        $Rule->reset();

        $ruleControllerName = $Rule->getRequestedController();
        $ruleActionName = $Rule->getRequestedAction();
        $ruleUrl = $Rule->getRequestedUrl();

        $this->assertTrue(is_null($ruleControllerName));
        $this->assertTrue(is_null($ruleActionName));
        $this->assertTrue(is_null($ruleUrl));

    }

    public function testRuleAdapter() {

        $user = $this->__getUser();

        $this->__Controller->request->url = 'url/controller/action';
        $this->__Controller->request->params['plugin'] = 'cloggy';
        $this->__Controller->request->params['controller'] = 'controller';
        $this->__Controller->request->params['action'] = 'action';
        $this->__Controller->request->query['url'] = 'url/controller/action';

        $this->__CloggyAcl->setUserData($user);
        $this->__CloggyAcl->initialize($this->__Controller);

        $Rule = $this->__CloggyAcl->getRuleObject();
        $Rule->init();
        $Rule->setUpAco('controller');

        $aco = $Rule->getAco();
        $this->assertEqual($aco,'controller/action');

        $Rule->setUpAco('url');
        $aco = $Rule->getAco();
        $this->assertEqual($aco,'url/controller/action');

    }

    public function testModel() {

        $user = $this->__getUser();

        $this->__CloggyAcl->setUserData($user);
        $this->__CloggyAcl->initialize($this->__Controller);

        $Rule = $this->__CloggyAcl->getRuleObject();
        $Rule->init();
        $Rule->setUpAco('controller');

        $Model = $Rule->getCloggyUserPermModel();
        $this->assertTrue(is_a($Model,'CloggyUserPerm'));

        $data = $Rule->getRulesByAcoAdapter('controller/action','controller');

        $this->assertFalse(empty($data));
        $this->assertCount(3,$data);

        $Rule->reset();

        $data = $Rule->getRulesByAcoAdapter('controller/action','controller');
        $this->assertFalse($data);
    }

    public function testAclAcoAdapter() {

        $user = $this->__getUser();

        $this->__Controller->request->url = 'url/controller/action';
        $this->__Controller->request->params['plugin'] = 'cloggy';
        $this->__Controller->request->params['controller'] = 'controller';
        $this->__Controller->request->params['action'] = 'action';
        $this->__Controller->request->query['url'] = 'url/controller/action';

        $this->__CloggyAcl->setUserData($user);
        $this->__CloggyAcl->initialize($this->__Controller);

        $aco = $this->__CloggyAcl->getAco('controller');
        $this->assertEqual($aco,'controller/action');

        $adapter = $this->__CloggyAcl->getAdapterObject('module');
        $this->assertTrue(is_a($adapter,'CloggyModuleAcl'));

        $wrongAdapter = $this->__CloggyAcl->getAdapterObject('test');
        $this->assertFalse($wrongAdapter);

    }

    public function testCallback() {

        $user = $this->__getUser();

        $this->__TestController->request->url = 'url/controller/action';
        $this->__TestController->request->params['plugin'] = 'cloggy';
        $this->__TestController->request->params['controller'] = 'controller';
        $this->__TestController->request->params['action'] = 'action';
        $this->__TestController->request->query['url'] = 'url/controller/action';

        $this->__CloggyAcl->setUserData($user);
        $this->__CloggyAcl->initialize($this->__TestController);
        $this->__CloggyAcl->setFailedCallBack('test');

        $this->__CloggyAcl->clearUserData();
        $this->expectOutputString('failed!');
        $this->__CloggyAcl->generateAro();

    }

    public function testAro() {

        $user = $this->__getUser();

        $this->__Controller->request->url = 'url/controller/action';
        $this->__Controller->request->params['plugin'] = 'cloggy';
        $this->__Controller->request->params['controller'] = 'controller';
        $this->__Controller->request->params['action'] = 'action';
        $this->__Controller->request->query['url'] = 'url/controller/action';

        $this->__CloggyAcl->setUserData($user);
        $this->__CloggyAcl->initialize($this->__Controller);
        $this->__CloggyAcl->generateAro();

        $aroId = $this->__CloggyAcl->getAroId();
        $aroType = $this->__CloggyAcl->getAroType();

        $this->assertEqual($aroId,1);
        $this->assertEqual($aroType,'roles');

        /*
         * delete role and perm
         * test manual get data from database
         */
        unset($user['CloggyUserRole']);
        unset($user['CloggyUserPermAro']);

        $this->__CloggyAcl->setUserData($user['CloggyUser']);
        $this->__CloggyAcl->generateAro();

        $aroId = $this->__CloggyAcl->getAroId();
        $aroType = $this->__CloggyAcl->getAroType();

        $this->assertEqual($aroId,1);
        $this->assertEqual($aroType,'roles');

        $this->__CloggyAcl->setUserData($user['CloggyUser']);
        $this->__CloggyAcl->generateAro('users');

        $aroId = $this->__CloggyAcl->getAroId();
        $aroType = $this->__CloggyAcl->getAroType();

        $this->assertEqual($aroId,1);
        $this->assertEqual($aroType,'users');
    }

    public function testStartup() {

        $user = $this->__getUser();

        $this->__TestController->request->url = 'url/controller/action';
        $this->__TestController->request->params['plugin'] = 'cloggy';
        $this->__TestController->request->params['controller'] = 'controller';
        $this->__TestController->request->params['action'] = 'action';
        $this->__TestController->request->params['isCloggyModule'] = 1;
        $this->__TestController->request->query['url'] = 'url/controller/action';

        $this->__CloggyAcl->setUserData($user);
        $this->__CloggyAcl->initialize($this->__TestController);
        $this->__CloggyAcl->setFailedCallBack('test');
        $this->__CloggyAcl->startup($this->__TestController);

        $isAllowed = $this->__CloggyAcl->isAroAllowed();
        $this->assertTrue($isAllowed);

        $user = $this->__getUser(2);
        $this->__CloggyAcl->clearUserData();
        $this->__CloggyAcl->setUserData($user);
        $this->__CloggyAcl->startup($this->__TestController);

        $isAllowed = $this->__CloggyAcl->isAroAllowed();
        $this->expectOutputString('failed!');
        $this->assertFalse($isAllowed);

    }

    public function testModuleIsAllowed() {

        $user = $this->__getUser();

        $this->__Controller->request->url = 'url/controller/action';
        $this->__Controller->request->params['plugin'] = 'cloggy';
        $this->__Controller->request->params['controller'] = 'controller';
        $this->__Controller->request->params['action'] = 'action';
        $this->__Controller->request->params['name'] = 'TestModule';
        $this->__Controller->request->query['url'] = 'url/controller/action';

        $this->__CloggyAcl->setUserData($user);
        $this->__CloggyAcl->initialize($this->__Controller);
        $this->__CloggyAcl->generateAro();

        $checkModule = $this->__CloggyAcl->isModuleAllowedByAro('TestModule');
        $this->assertFalse($checkModule);

        $checkModule = $this->__CloggyAcl->isModuleAllowedByAro('TestModule2');
        $this->assertTrue($checkModule);

    }

    private function __getUser($id=1) {
        return $this->__CloggyUser->find('first',array(
            'contain' => array(
                'CloggyUserRole',
                'CloggyUserPermAro'
            ),
            'conditions' => array('CloggyUser.id' => $id)
        ));
    }

}


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Sber. Akad. Wiss. Wien, Math. -naturw. Kl. , Abt. 1 116: 129 (1907)

#### Original name
Pseudosphaeriaceae Höhn.

### Remarks
null


text:
import { combineReducers } from 'redux';
import LoginReducer from './LoginReducer';
import JobsReducer from './JobsReducer';
import BuildsReducer from './BuildsReducer';
import BuildReducer from './BuildReducer';

// glue all the reducers together into 1 root reducer
export default combineReducers({
  login: LoginReducer,
  jobs: JobsReducer,
  builds: BuildsReducer,
  build: BuildReducer
});

// Put reducer keys that you do NOT want stored to persistence here
export const persistentStoreBlacklist = ['login', 'jobs', 'builds', 'build'];


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Uses of Class com.aleozlx.pacswitch.types.FutureTracker</title>
<meta name="date" content="2014-09-15">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Class
com.aleozlx.pacswitch.types.FutureTracker

Packages that use FutureTracker

Package
Description

com.aleozlx.pacswitch

Uses of FutureTracker in com.aleozlx.pacswitch

Subclasses of FutureTracker in com.aleozlx.pacswitch

Modifier and Type
Class and Description

protected static class
PacswitchMessager.Tracker<E>

FutureObject tracker with ID format specifications

Fields in com.aleozlx.pacswitch declared as FutureTracker

Modifier and Type
Field and Description

protected FutureTracker<java.lang.String>
PacswitchMessager.msgtracker

Request/response mapping

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes


text:
package com.box.androidsdk.content.requests;

import com.box.androidsdk.content.models.BoxSession;
import com.box.androidsdk.content.models.BoxBookmark;
import com.box.androidsdk.content.models.BoxComment;
import com.box.androidsdk.content.models.BoxFolder;
import com.box.androidsdk.content.models.BoxListComments;

import java.util.HashMap;

/**
 * Bookmark requests.
 */
public class BoxRequestsBookmark {

    /**
     * Request for retrieving information on a bookmark
     */
    public static class GetBookmarkInfo extends BoxRequestItem<BoxBookmark, GetBookmarkInfo> {

        /**
         * Creates a bookmark information request with the default parameters
         *
         * @param id            id of the bookmark to get information on
         * @param requestUrl    URL of the bookmark information endpoint
         * @param session       the authenticated session that will be used to make the request with
         */
        public GetBookmarkInfo(String id, String requestUrl, BoxSession session) {
            super(BoxBookmark.class, id, requestUrl, session);
            mRequestMethod = Methods.GET;
        }

        /**
         * Sets the if-none-match header for the request.
         * The bookmark will only be retrieved if the etag does not match the most current etag for the bookmark.
         *
         * @param etag  etag to set in the if-none-match header.
         * @return request with the updated if-none-match header.
         */
        @Override
        public GetBookmarkInfo setIfNoneMatchEtag(String etag) {
            return super.setIfNoneMatchEtag(etag);
        }

        /**
         * Returns the etag currently set in the if-none-match header.
         *
         * @return  etag set in the if-none-match header, or null if none set.
         */
        @Override
        public String getIfNoneMatchEtag() {
            return super.getIfNoneMatchEtag();
        }
    }

    /**
     * Request for creating a new bookmark
     */
    public static class CreateBookmark extends BoxRequestItem<BoxBookmark, CreateBookmark> {

        /**
         * Creates a create bookmark request with the default parameters
         *
         * @param parentId  id of the parent folder for the new bookmark
         * @param url   URL of the new bookmark
         * @param requestUrl    URL of the create bookmark endpoint
         * @param session       the authenticated session that will be used to make the request with
         */
        public CreateBookmark(String parentId, String url, String requestUrl, BoxSession session) {
            super(BoxBookmark.class, null, requestUrl, session);
            mRequestMethod = Methods.POST;
            setParentId(parentId);
            setUrl(url);
        }

        /**
         * Returns the parent id for the new bookmark currently set in the request.
         *
         * @return  id of the parent for the new bookmark
         */
        public String getParentId() {
            return mBodyMap.containsKey(BoxFolder.FIELD_PARENT) ? (String) mBodyMap.get(BoxFolder.FIELD_ID) : null;
        }

        /**
         * Sets the parent id to use in the create bookmark request.
         *
         * @param id    id of the parent folder for the new bookmark
         * @return  the request with the updated parent id
         */
        public CreateBookmark setParentId(String id) {
            HashMap<String, Object> map = new HashMap<String,Object>();
            map.put(BoxFolder.FIELD_ID, id);
            BoxFolder parentFolder = new BoxFolder(map);
            mBodyMap.put(BoxFolder.FIELD_PARENT, parentFolder);
            return this;
        }

        /**
         * Returns the URL currently set for the create bookmark request.
         *
         * @return  the URL for the new bookmark
         */
        public String getUrl() {
            return (String) mBodyMap.get(BoxBookmark.FIELD_URL);
        }

        /**
         * Sets the URL of the bookmark to be created in the request.
         *
         * @param url   URL of the new bookmark
         * @return  the request with the updated URL
         */
        public CreateBookmark setUrl(String url) {
            mBodyMap.put(BoxBookmark.FIELD_URL, url);
            return this;
        }

        /**
         * Returns the name of the new bookmark currently set in the request. Will return null if not set.
         *
         * @return name of the bookmark that will be created.
         */
        public String getName() {
            return (String) mBodyMap.get(BoxBookmark.FIELD_NAME);
        }

        /**
         * Sets the name of the bookmark to be created in the request.
         *
         * @param name  name of the bookmark to be created
         * @return  the request with the updated name
         */
        public CreateBookmark setName(String name) {
            mBodyMap.put(BoxBookmark.FIELD_NAME, name);
            return this;
        }

        /**
         * Returns the description of the new bookmark currently set in the request. Will return null if not set.
         *
         * @return  description of the bookmark that will be created
         */
        public String getDescription() {
            return (String) mBodyMap.get(BoxBookmark.FIELD_DESCRIPTION);
        }

        /**
         * Sets the description of the bookmark to be created in the request.
         *
         * @param description   new description for the bookmark to be created
         * @return  the request with the updated description
         */
        public CreateBookmark setDescription(String description) {
            mBodyMap.put(BoxBookmark.FIELD_DESCRIPTION, description);
            return this;
        }
    }

    /**
     * Request for updating information on a bookmark
     */
    public static class UpdateBookmark extends BoxRequestItemUpdate<BoxBookmark, UpdateBookmark> {

        /**
         * Creates an update file request with the default parameters
         *
         * @param id            id of the file to update information on
         * @param requestUrl    URL of the update file endpoint
         * @param session       the authenticated session that will be used to make the request with
         */
        public UpdateBookmark(String id, String requestUrl, BoxSession session) {
            super(BoxBookmark.class, id, requestUrl, session);
        }

        /**
         * Returns the URL for the bookmark currently set in the request.
         *
         * @return  URL for the bookmark.
         */
        public String getUrl() {
            return (String) mBodyMap.get(BoxBookmark.FIELD_URL);
        }

        /**
         * Sets the new URL for the bookmark in the request.
         *
         * @param url   new URL for the bookmark.
         * @return  request with the updated bookmark URL.
         */
        public UpdateBookmark setUrl(String url) {
            mBodyMap.put(BoxBookmark.FIELD_URL, url);
            return this;
        }

        @Override
        public UpdateSharedBookmark updateSharedLink() {
            return new UpdateSharedBookmark(this);
        }
    }

    /**
     * Request for updating information on a shared bookmark
     */
    public static class UpdateSharedBookmark extends BoxRequestUpdateSharedItem<BoxBookmark, UpdateSharedBookmark> {

        /**
         * Creates an update shared bookmark request with the default parameters
         *
         * @param id            id of the file to update information on
         * @param requestUrl    URL of the update file endpoint
         * @param session       the authenticated session that will be used to make the request with
         */
        public UpdateSharedBookmark(String id, String requestUrl, BoxSession session) {
            super(BoxBookmark.class, id, requestUrl, session);
        }

        public UpdateSharedBookmark(UpdateBookmark update) {
            super(update);
        }
    }

    /**
     * Request for copying a bookmark
     */
    public static class CopyBookmark extends BoxRequestItemCopy<BoxBookmark, CopyBookmark> {

        /**
         * Creates a copy bookmark request with the default parameters
         * @param id    id of the bookmark to copy
         * @param parentId  id of the new parent folder
         * @param requestUrl    URL of the copy bookmark endpoint
         * @param session   the authenticated session that will be used to make the request with
         */
        public CopyBookmark(String id, String parentId, String requestUrl, BoxSession session) {
            super(BoxBookmark.class, id, parentId, requestUrl, session);
        }
    }

    /**
     * Request for deleting a bookmark
     */
    public static class DeleteBookmark extends BoxRequestItemDelete<DeleteBookmark> {

        /**
         * Creates a delete bookmark request with the default parameters
         *
         * @param id            id of the bookmark to delete
         * @param requestUrl    URL of the delete bookmark endpoint
         * @param session       the authenticated session that will be used to make the request with
         */
        public DeleteBookmark(String id, String requestUrl, BoxSession session) {
            super(id, requestUrl, session);
        }
    }

    /**
     * Request for retrieving information on a trashed bookmark
     */
    public static class GetTrashedBookmark extends BoxRequestItem<BoxBookmark, GetTrashedBookmark> {

        /**
         * Creates a request to get a trashed bookmark with the default parameters
         *
         * @param id            id of the bookmark in the trash
         * @param requestUrl    URL of the trashed bookmark endpoint
         * @param session       the authenticated session that will be used to make the request with
         */
        public GetTrashedBookmark(String id, String requestUrl, BoxSession session) {
            super(BoxBookmark.class, id, requestUrl, session);
            mRequestMethod = Methods.GET;
        }

        /**
         * Sets the if-none-match header for the request.
         * The trashed bookmark will only be retrieved if the etag does not match the most current etag for the bookmark.
         *
         * @param etag  etag to set in the if-none-match header.
         * @return request with the updated if-none-match header.
         */
        @Override
        public GetTrashedBookmark setIfNoneMatchEtag(String etag) {
            return super.setIfNoneMatchEtag(etag);
        }

        /**
         * Returns the etag currently set in the if-none-match header.
         *
         * @return  etag set in the if-none-match header, or null if none set.
         */
        @Override
        public String getIfNoneMatchEtag() {
            return super.getIfNoneMatchEtag();
        }
    }

    /**
     * Request for permanently deleting a trashed bookmark
     */
    public static class DeleteTrashedBookmark extends BoxRequestItemDelete<DeleteTrashedBookmark> {

        /**
         * Creates a delete trashed bookmark request with the default parameters
         *
         * @param id            id of the trashed bookmark to permanently delete
         * @param requestUrl    URL of the delete trashed bookmark endpoint
         * @param session       the authenticated session that will be used to make the request with
         */
        public DeleteTrashedBookmark(String id, String requestUrl, BoxSession session) {
            super(id, requestUrl, session);
        }
    }

    /**
     * Request for restoring a trashed bookmark
     */
    public static class RestoreTrashedBookmark extends BoxRequestItemRestoreTrashed<BoxBookmark, RestoreTrashedBookmark> {

        /**
         * Creates a restore trashed bookmark request with the default parameters
         *
         * @param id            id of the trashed bookmark to restore
         * @param requestUrl    URL of the restore trashed bookmark endpoint
         * @param session       the authenticated session that will be used to make the request with
         */
        public RestoreTrashedBookmark(String id, String requestUrl, BoxSession session) {
            super(BoxBookmark.class, id, requestUrl, session);
        }
    }

    /**
     * Request for getting the comments on a bookmark
     */
    public static class GetBookmarkComments extends BoxRequestItem<BoxListComments, GetBookmarkComments> {

        /**
         * Creates a get bookmark comments request with the default parameters
         *
         * @param id    id of the bookmark to get comments of
         * @param requestUrl    URL of the bookmark comments endpoint
         * @param session       the authenticated session that will be used to make the request with
         */
        public GetBookmarkComments(String id, String requestUrl, BoxSession session) {
            super(BoxListComments.class, id, requestUrl, session);
            mRequestMethod = Methods.GET;
        }
    }

    /**
     * Request for adding a comment to a bookmark
     */
    public static class AddCommentToBookmark extends BoxRequestCommentAdd<BoxComment, AddCommentToBookmark> {

        /**
         * Creates an add comment to bookmark request with the default parameters
         *
         * @param bookmarkId    id of the bookmark to add a comment to
         * @param message   message of the new comment
         * @param requestUrl    URL of the add comment endpoint
         * @param session       the authenticated session that will be used to make the request with
         */
        public AddCommentToBookmark(String bookmarkId, String message, String requestUrl, BoxSession session) {
            super(BoxComment.class, requestUrl, session);
            setItemId(bookmarkId);
            setItemType(BoxBookmark.TYPE);
            setMessage(message);
        }
    }

    /**
     * Request for adding a bookmark to a collection
     */
    public static class AddBookmarkToCollection extends BoxRequestCollectionUpdate<BoxBookmark, AddBookmarkToCollection> {

        /**
         * Creates an add bookmark to collection request with the default parameters
         *
         * @param id    id of the bookmark to add to the collection
         * @param collectionId  id of the collection to add the bookmark to
         * @param requestUrl    URL of the add to collection endpoint
         * @param session   the authenticated session that will be used to make the request with
         */
        public AddBookmarkToCollection(String id, String collectionId, String requestUrl, BoxSession session) {
            super(BoxBookmark.class, id, requestUrl, session);
            setCollectionId(collectionId);
        }

        /**
         * Sets the collection id to add the bookmark to in the request.
         *
         * @param id    id of the collection to add the bookmark to.
         * @return  request with the updated collection id.
         */
        @Override
        public AddBookmarkToCollection setCollectionId(String id) {
            return super.setCollectionId(id);
        }
    }

    /**
     * Request for removing a bookmark from a collection
     */
    public static class DeleteBookmarkFromCollection extends BoxRequestCollectionUpdate<BoxBookmark, DeleteBookmarkFromCollection> {

        /**
         * Creates a delete bookmark from collection request with the default parameters
         *
         * @param id    id of the bookmark to delete from collection
         * @param requestUrl    URL of the delete from collection endpoint
         * @param session   the authenticated session that will be used to make the request with
         */
        public DeleteBookmarkFromCollection(String id, String requestUrl, BoxSession session) {
            super(BoxBookmark.class, id, requestUrl, session);
            setCollectionId(null);
        }
    }
}


text:
Description
===========

Installs NetIQ NMAS

Requirements
============

Platform:

* SLES 11 SP2

The following Opscode cookbooks are dependencies:

Attributes
==========

* `node["nmas"]["designer_install_loc"]` - The Designer install location, default `/opt/novell/idm/Designer/`.
* `node["nmas"]["designer_build_loc"]` - The Designer build location, default `/home/vagrant/IDM402AE/test/products/Designer/install`.
* `node["nmas"]["jre_loc"]` - The JRE location, default `/root/idm/jre`.
* `node["nmas"]["designer_locale"]` - The default locale for Designer, default `en`.

Usage
=====

License and Author
==================

Author:: Chendil Kumar Manoharan(<kchendil@netiq.com>)

Copyright:: 2010-2012, NetIQ, Inc

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.