text:
namespace base {
class SingleThreadTaskRunner;
}

namespace blink {

const int64_t kPositionNotSpecified = -1;

class ResourceFetchContext;
class UrlData;
class UrlIndexTest;

// A multibuffer for loading media resources which knows
// how to create MultiBufferDataProviders to load data
// into the cache.
class BLINK_PLATFORM_EXPORT ResourceMultiBuffer : public MultiBuffer {
 public:
  ResourceMultiBuffer(UrlData* url_data_,
                      int block_shift,
                      scoped_refptr<base::SingleThreadTaskRunner> task_runner);
  ~ResourceMultiBuffer() override;

  // MultiBuffer implementation.
  std::unique_ptr<MultiBuffer::DataProvider> CreateWriter(
      const BlockId& pos,
      bool is_client_audio_element) override;
  bool RangeSupported() const override;
  void OnEmpty() override;

 protected:
  // Do not access from destructor, it is a pointer to the
  // object that contains us.
  raw_ptr<UrlData> url_data_;
  const scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
};

class UrlIndex;

// All the data & metadata for a single resource.
// Data is cached using a MultiBuffer instance.
class BLINK_PLATFORM_EXPORT UrlData : public base::RefCounted<UrlData> {
 public:
  // Keep in sync with WebMediaPlayer::CorsMode.
  enum CorsMode { CORS_UNSPECIFIED, CORS_ANONYMOUS, CORS_USE_CREDENTIALS };
  using KeyType = std::pair<GURL, CorsMode>;

  UrlData(const UrlData&) = delete;
  UrlData& operator=(const UrlData&) = delete;

  // Accessors
  const GURL& url() const { return url_; }

  // Cross-origin access mode
  CorsMode cors_mode() const { return cors_mode_; }

  bool has_access_control() const { return has_access_control_; }

  bool passed_timing_allow_origin_check() const {
    return passed_timing_allow_origin_check_;
  }

  const std::string& mime_type() const { return mime_type_; }

  // Are HTTP range requests supported?
  bool range_supported() const { return range_supported_; }

  // True if we found a reason why this URL won't be stored in the
  // HTTP disk cache.
  bool cacheable() const { return cacheable_; }

  // Last used time.
  base::Time last_used() const { return last_used_; }

  // Last modified time.
  base::Time last_modified() const { return last_modified_; }

  const std::string& etag() const { return etag_; }

  // Expiration time.
  base::Time valid_until() const { return valid_until_; }

  // The key used by UrlIndex to find this UrlData.
  KeyType key() const;

  // Length of data associated with url or |kPositionNotSpecified|
  int64_t length() const { return length_; }

  // Returns the number of blocks cached for this resource.
  size_t CachedSize();

  // Returns true if this resource is fully cached in memory.
  bool FullyCached();

  // Returns our url_index.
  UrlIndex* url_index() const { return url_index_; }

  // This must be called after the response arrives.
  bool is_cors_cross_origin() const { return is_cors_cross_origin_; }

  // Notifies the url index that this is currently used.
  // The url <-> URLData mapping will be eventually be invalidated if
  // this is not called regularly.
  void Use();

  // Call this before we add some data to the multibuffer().
  // If the multibuffer is empty, the data origin is set from
  // |origin| and returns true. If not, it compares |origin|
  // to the previous origin and returns whether they match or not.
  bool ValidateDataOrigin(const GURL& origin);

  // Setters.
  void set_length(int64_t length);
  void set_cacheable(bool cacheable);
  void set_valid_until(base::Time valid_until);
  void set_range_supported();
  void set_last_modified(base::Time last_modified);
  void set_etag(const std::string& etag);
  void set_is_cors_cross_origin(bool is_cors_cross_origin);
  void set_has_access_control();
  void set_passed_timing_allow_origin_check(bool);
  void set_mime_type(std::string mime_type);

  // A redirect has occurred (or we've found a better UrlData for the same
  // resource).
  void RedirectTo(const scoped_refptr<UrlData>& to);

  // Fail, tell all clients that a failure has occurred.
  void Fail();

  // Callback for receiving notifications when a redirect occurs.
  using RedirectCB = base::OnceCallback<void(const scoped_refptr<UrlData>&)>;

  // Register a callback to be called when a redirect occurs.
  // Callbacks are cleared when a redirect occurs, so clients must call
  // OnRedirect again if they wish to continue receiving callbacks.
  void OnRedirect(RedirectCB cb);

  // Returns true it is valid to keep using this to access cached data.
  // A single media player instance may choose to ignore this for resources
  // that have already been opened.
  bool Valid();

  // Virtual so we can override it for testing.
  virtual ResourceMultiBuffer* multibuffer();

  void AddBytesRead(int64_t b) { bytes_read_from_cache_ += b; }
  int64_t BytesReadFromCache() const { return bytes_read_from_cache_; }

 protected:
  UrlData(const GURL& url,
          CorsMode cors_mode,
          UrlIndex* url_index,
          scoped_refptr<base::SingleThreadTaskRunner> task_runner);
  virtual ~UrlData();

 private:
  friend class ResourceMultiBuffer;
  friend class UrlIndex;
  friend class UrlIndexTest;
  friend class base::RefCounted<UrlData>;

  void OnEmpty();
  void MergeFrom(const scoped_refptr<UrlData>& other);

  // Url we represent, note that there may be multiple UrlData for
  // the same url.
  const GURL url_;

  // Origin of the data, should only be different from the
  // url_.DeprecatedGetOriginAsURL() when service workers are involved.
  GURL data_origin_;
  bool have_data_origin_;

  // Cross-origin access mode.
  const CorsMode cors_mode_;
  bool has_access_control_;

  // Timing-allow-origin
  bool passed_timing_allow_origin_check_;

  // Mime type category (stashed for UMA / metrics).
  std::string mime_type_;

  const raw_ptr<UrlIndex> url_index_;

  // Length of resource this url points to. (in bytes)
  int64_t length_;

  // Number of bytes read from this resource.
  int64_t bytes_read_from_cache_ = 0;

  // Does the server support ranges?
  bool range_supported_;

  // Set to false if we have reason to believe the chrome disk cache
  // will not cache this url.
  bool cacheable_;

  // https://html.spec.whatwg.org/#cors-cross-origin
  bool is_cors_cross_origin_ = false;

  // Last time some media time used this resource.
  // Note that we use base::Time rather than base::TimeTicks because
  // TimeTicks will stop advancing when a machine goes to sleep.
  // base::Time can go backwards, jump hours at a time and be generally
  // unpredictable, but it doesn't stop, which is preferable here.
  // (False negatives are better than false positivies.)
  base::Time last_used_;

  // Expiration time according to http headers.
  base::Time valid_until_;

  // Last modification time according to http headers.
  base::Time last_modified_;

  // Etag from HTTP reply.
  std::string etag_;

  ResourceMultiBuffer multibuffer_;
  std::vector<RedirectCB> redirect_callbacks_;

  THREAD_CHECKER(thread_checker_);
};

// The UrlIndex lets you look up UrlData instances by url.
class BLINK_PLATFORM_EXPORT UrlIndex {
 public:
  UrlIndex(ResourceFetchContext* fetch_context,
           scoped_refptr<base::SingleThreadTaskRunner> task_runner);
  UrlIndex(ResourceFetchContext* fetch_context,
           int block_shift,
           scoped_refptr<base::SingleThreadTaskRunner> task_runner);
  virtual ~UrlIndex();

  enum CacheMode { kNormal, kCacheDisabled };

  // Look up an UrlData in the index and return it. If none is found,
  // create a new one. Note that newly created UrlData entries are NOT
  // added to the index, instead you must call TryInsert on them after
  // initializing relevant parameters, like whether it support
  // ranges and it's last modified time.
  // Because the returned UrlData has a raw reference to |this|, it must be
  // released before |this| is destroyed.
  scoped_refptr<UrlData> GetByUrl(const GURL& gurl,
                                  UrlData::CorsMode cors_mode,
                                  CacheMode cache_mode);

  // Add the given UrlData to the index if possible. If a better UrlData
  // is already present in the index, return it instead. (If not, we just
  // return the given UrlData.) Please make sure to initialize all the data
  // that can be gathered from HTTP headers in |url_data| before calling this.
  // In particular, the following fields are important:
  //   o range_supported: Entries which do not support ranges cannot be
  //     shared and are not added to the index.
  //   o valid_until, last_used: Entries have to be valid to be inserted
  //     into the index, this means that they have to have been recently
  //     used or have an Expires: header that says when they stop being valid.
  //   o last_modified: Expired cache entries can be re-used if last_modified
  //     matches.
  // Because the returned UrlData has a raw reference to |this|, it must be
  // released before |this| is destroyed.
  // TODO(hubbe): Add etag support.
  scoped_refptr<UrlData> TryInsert(const scoped_refptr<UrlData>& url_data);

  ResourceFetchContext* fetch_context() const { return fetch_context_; }
  int block_shift() const { return block_shift_; }

  // Returns true kMaxParallelPreload or more urls are loading at the same time.
  bool HasReachedMaxParallelPreload() const;

  // Protected rather than private for testing.
 protected:
  friend class UrlData;
  friend class ResourceMultiBuffer;
  friend class UrlIndexTest;
  void RemoveUrlData(const scoped_refptr<UrlData>& url_data);

  // Virtual so we can override it in tests.
  virtual scoped_refptr<UrlData> NewUrlData(const GURL& url,
                                            UrlData::CorsMode cors_mode);

  void OnMemoryPressure(
      base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level);

  raw_ptr<ResourceFetchContext> fetch_context_;
  using UrlDataMap = std::map<UrlData::KeyType, scoped_refptr<UrlData>>;
  UrlDataMap indexed_data_;
  scoped_refptr<MultiBuffer::GlobalLRU> lru_;

  // log2 of block size in multibuffer cache. Defaults to kBlockSizeShift.
  // Currently only changed for testing purposes.
  const int block_shift_;

  std::deque<scoped_refptr<UrlData>> loading_queue_;

  base::MemoryPressureListener memory_pressure_listener_;
  const scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_PUBLIC_PLATFORM_MEDIA_URL_INDEX_H_


text:
package org.waveprotocol.wave.model.id;

/**
 * This allows us to serialize and deserialise ids.
 *
 * @author zdwang@google.com (David Wang)
 * @author anorth@google.com (Alex North)
 */
public interface IdSerialiser {
  /**
   * Checked exception indicating that a serialised wave or wavelet id is
   * invalid.
   */
  public static class InvalidIdException extends Exception {
    private final String id;
    public InvalidIdException(String id, String message) {
      super(message);
      this.id = id;
    }

    public String getId() {
      return id;
    }

    @Override
    public String getMessage() {
      return "Invalid id '" + id + "': " + super.getMessage();
    }
  }

  /**
   * Runtime exception indicating that a serialised wave or wavelet id is
   * invalid. It's an @link {@link IllegalArgumentException} but more specific
   * so that it may be caught without catching other IAEs.
   */
  public static class RuntimeInvalidIdException extends IllegalArgumentException {
    private final String id;
    public RuntimeInvalidIdException(String id, String message) {
      super(message);
      this.id = id;
    }

    public String getId() {
      return id;
    }

    @Override
    public String getMessage() {
      return "Invalid id '" + id + "': " + super.getMessage();
    }
  }

  /** Separates a wave id from a wavelet id in serialised form. */
  public static final char PART_SEPARATOR = '!';

  /**
   * Serialises a wave id into a string.
   */
  String serialiseWaveId(WaveId waveId);

  /**
   * Serialises a wavelet id into a string.
   */
  String serialiseWaveletId(WaveletId waveletId);

  /**
   * Deserialises a wave id encoded in a string.
   *
   * @throws InvalidIdException if the serialised id is invalid
   */
  WaveId deserialiseWaveId(String serialisedForm) throws InvalidIdException;

  /**
   * @throws InvalidIdException if the serialised id is invalid
   */
  WaveletId deserialiseWaveletId(String serialisedForm) throws InvalidIdException;
}

redpajama_set_name: RedPajamaGithub


text:
[Module Description]: #module-description

[Setup]: #setup
[Setup Requirements]: #setup-requirements
[Beginning with AEM]: #beginning-with-aem

[Reference]: #reference
[Public Classes]: #public-classes
[Public Defines]: #public-defines
[Public Types]: #public-types
[Private Defines]: #private-defines
[Private Types]: #private-types

[Limitations]: #limitations
[Known Issues]: #known-issues

[Development]: #development

[wiki]: https://github.com/bstopp/puppet-aem/blob/master/docs/README.md

[Adobe]: http://www.adobe.com
[Adobe Experience Manager]: http://www.adobe.com/marketing-cloud/enterprise-content-management.html

[Felix Configuration]: http://felix.apache.org/documentation/subprojects/apache-felix-config-admin.html

[Sling launchpad]: https://sling.apache.org/documentation/the-sling-engine/the-sling-launchpad.html
[Sling command-line-options]: https://sling.apache.org/documentation/the-sling-engine/the-sling-launchpad.html#command-line-options

[AEM Runmodes]: https://docs.adobe.com/docs/en/aem/6-1/deploy/configuring/configure-runmodes.html
[AEM Sample Content]: https://docs.adobe.com/docs/en/aem/6-1/deploy/configuring/configure-runmodes.html#Using%20samplecontent%20and%20nosamplecontent
[AEM Installation Runmodes]: https://docs.adobe.com/docs/en/aem/6-1/deploy/configuring/configure-runmodes.html#Installation%20Run%20Modes
[AEM Java Requirements]: https://docs.adobe.com/docs/en/aem/6-1/deploy/technical-requirements.html#Java%20Virtual%20Machines

# aem - Adobe Experience Manager
[![Puppet Forge Version](https://img.shields.io/puppetforge/v/bstopp/aem.svg)](https://forge.puppetlabs.com/bstopp/aem)
[![Puppet Forge Downloads](https://img.shields.io/puppetforge/dt/bstopp/aem.svg)](https://forge.puppetlabs.com/bstopp/aem)
[![Build Status](https://travis-ci.org/bstopp/puppet-aem.svg?branch=master)](https://travis-ci.org/bstopp/puppet-aem)
[![Dependency Status](https://gemnasium.com/bstopp/puppet-aem.svg)](https://gemnasium.com/bstopp/puppet-aem)
[![Code Climate](https://codeclimate.com/github/bstopp/puppet-aem/badges/gpa.svg)](https://codeclimate.com/github/bstopp/puppet-aem)
[![Test Coverage](https://codeclimate.com/github/bstopp/puppet-aem/badges/coverage.svg)](https://codeclimate.com/github/bstopp/puppet-aem/coverage)
[![Join the chat at https://gitter.im/bstopp/puppet-aem](https://badges.gitter.im/bstopp/puppet-aem.svg)](https://gitter.im/bstopp/puppet-aem?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

#### Table of Contents

1. [Module Description - What does the module do?][Module Description]
1. [Setup - The basics of getting started with AEM module][Setup]
  * [Setup Requirements][]
  * [Beginning with AEM][]
1. [Reference - AEM Module Classes, Defines & Types][Reference]
  * [Public Classes][]
  * [Public Defines][]
  * [Public Types][]
  * [Private Defines][]
  * [Private Types][]
1. [Limitations - OS compatibility, etc.][Limitations]
1. [Development - Contributing to the module][Development]

## Module Description

[Adobe Experience Manager][] (also known as AEM, formerly CQ5) is an enterprise content management system offered by [Adobe][]. This puppet module provides a set of tools to ease the tasks of installing, configuring and maintaining AEM instances.

## Setup

**What the AEM Puppet module affects:**

- AEM Installation files and directories
- Service configuration and startup files
- Listened-to ports

**Note**: This module modifies AEM installation directories and configuration files, overwriting any existing configurations. AEM configurations should be managed by Puppet, as unmanaged configuration files may cause unexpected behaviour.

### Setup Requirements

AEM uses Ruby-based providers, so you must enable pluginsync. Java is also required to be installed on the system. Finally, due to the AEM platform being proprietary, this module does not provide the installation jar file; it must be provided by the consumer.

### Beginning with AEM

A minimal AEM configuration is specified as:

~~~
aem::instance { 'aem' :
  source => '/path/to/aem-quickstart.jar',
}
~~~

For more options and detailed explanations, please see the [Puppet AEM Wiki][wiki].

## Reference

- **[Public Classes][]**
  - [Class: aem::dispatcher](#class-aemdispatcher)
- **[Public Defines][]**
  - [Define: aem::agent::replication](#define-aemagentreplication)
  - [Define: aem::agent::replication::flush](#define-aemagentreplicationflush)
  - [Define: aem::agent::replication::publish](#define-aemagentreplicationpublish)
  - [Define: aem::agent::replication::reverse](#define-aemagentreplicationreverse)
  - [Define: aem::agent::replication::static](#define-aemagentreplicationstatic)
  - [Define: aem::crx::package](#define-aemcrxpackage)
  - [Define: aem::dispatcher::farm](#define-aemdispatcherfarm)
  - [Define: aem::instance](#define-aeminstance)
  - [Define: aem::license](#define-aemlicense)
  - [Define: aem::osgi::config](#define-aemosgiconfig)
  - [Define: aem::service](#define-aemservice)
- **[Public Types][]**
  - [Type: Aem_Sling_Resource](#type-aem_sling_resource)
- **[Private Defines][]**
  - [Define: aem::config](#define-aemconfig)
  - [Define: aem::crx::`package::file](#define-aemcrxpackagefile)
  - [Define: aem::osgi::config::file](#define-aemosgiconfigfile)
  - [Define: aem::package](#define-aempackage)
- **[Private Types][]**
  - [Type: Aem_Crx_Package](#type-aem_crx_package)
  - [Type: Aem_Installer](#type-aem_installer)
  - [Type: Aem_Osgi_Config](#type-aem_osgi_config)

### Public Classes

#### Class: `aem::dispatcher`

Installs and configures a specified AEM Dispatcher module. For more details and examples see the [wiki][].

**Note:** Currently only Apache HTTP is supported by this module.

#### `ensure`
Optional. Changes the state of the dispatcher configuration. Valid options: `present` or `absent`. Default: `present`.

#### `decline_root`
Optional. Sets the *DispatcherDelcineRoot* value for the dispatcher configuration. Valid options: `0`, `1`, `off` or `on`. Default: `off`.

#### `dispatcher_name`
Optional. Sets the *name* of the dispatcher in the root dispatcher farm file. Valid options: any string.

##### `group`
Optional. Sets the group for file ownership. Valid options: any valid group. Default: Apache's root group.

##### `log_file`
Optional. Sets the name and location of the dispatcher log file. Valid options: any fully qualified file name. Default: *<apache log root>/dispatcher.log*.

##### `log_level`
Optional. Sets the log level for dispatcher logging. Valid options: `0`, `1`, `2`, `3`, `4`, `error`, `warn`, `info`, `debug`, `trace`. Default: `warn`.

#### `module_file`
Required. Specifies which dispatcher module will be loaded. Valid options: any absolute path to file.

#### `pass_error`
Optional. Sets the *DispatcherPassError* value for the dispatcher configuration. Valid options: any string. Default: `0`.

#### `use_processed_url`
Optional. Sets the *DispatcherUseProcessedURL* value for the dispatcher configuration. Valid options: `0`, `1`, `off` or `on`. Default: `off`.

##### `user`
Optional. Sets the user for file ownership. Valid options: any valid user. Default: `root`.

### Public Defines

#### Define: `aem::agent::replication`

 Creates a replication Agent. Provides support for all AEM Replication agent options. For more details and examples, see the [wiki][]. For information on AEM Replications agents, see the [documentation](https://docs.adobe.com/docs/en/aem/6-2/deploy/configuring/replication.html).

##### `name`
Namevar. Required. Specifies the name of this replication agent. The name must only contain letters and numbers. This will be the node name when it is created.

##### `title`
Required. The title of the replication agent. This can be different than the `name`.

##### `ensure`
Optional. Changes the state of the replication agent. Valid options: `present` or `absent`. Default: `present`.

#### `agent_user`
Optional. The AEM/System user which is used to perform the replication actions.

##### `batch_enabled`
Optional. Sets the replication batch enabled flag. Valid options: `true` or `false`.

##### `batch_max_wait`
Optional. Sets the replication batch wait time. Valid options: any positive integer.

##### `batch_trigger_size`
Optional. Sets the replication batch trigger size. Valid options: any positive integer.

##### `description`
Optional. Set's the description for the agent. The default value is always part of the value. Default: _\*\*Managed by Puppet. Any changes made will be overwritten**_

##### `enabled`
Optional. Sets whether or not the agent is enabled. Valid options: `true` or `false`. Default: `true`.

##### `force_passwords`
Optional. Set's whether or not to overwrite the current password values. For more details, see the Sling Resource type's _force_paswords_ parameter. Password properties for this type are `proxy_password` and `transfport_pasword` . Valid options: `true` or `false`. Default: `false`.

##### `home`
Required. Sets the directory in which AEM exists. Valid options: any absolute path.

##### `log_level`
Optional. Sets the log level of the agent. Valid options: `debug`, `info`, `error`. Default: `info`.

##### `password`
Required. The password for authenticating to AEM.

##### `protocol_close_conn`
Optional. Sets the connection close flag . Valid options: `true` or `false`.

##### `protocol_conn_timeout`
Optional. Sets the connection timeout. Valid options: any positive integer.

##### `protocol_http_headers`
Optional. Sets the list of additional headers for the HTTP Request. Valid options: String or Array of Strings.

##### `protocol_http_method`
Optional. Sets the HTTP method to use for the replication request.

##### `protocol_interface`
Optional. Sets the network interface to use for the replication request.

##### `protocol_sock_timeout`
Optional. Sets the socket timeout. Valid options: any positive integer.

##### `protocol_version`
Optional. Sets the HTTP version (e.g. 1.1) to use for the replication request.

##### `proxy_host`
Optional. Sets the host for a proxy connection.

##### `proxy_ntlm_domain`
Optional. Sets the NLTM Domain for a proxy connection.

##### `proxy_ntlm_host`
Optional. Sets the NLTM host for a proxy connection.

##### `proxy_password`
Optional. Sets the password for a proxy connection.

##### `proxy_port`
Optional. Sets the port for a proxy connection. Valid options: any positive integer.

##### `proxy_user`
Optional. Sets the user for a proxy connection.

##### `resource_type`
Required. The Sling resource type for this replication agent.

##### `retry_delay`
Optional. Sets the retry delay. Valid options: any positive integer.

##### `reverse`
Optional. Sets whether or not this is a reverse replication agent. Valid options: `true` or `false`.

##### `runmode`
Required. Sets the runmode for persisting the Replication agent.

##### `serialize_type`
Required if `ensure` is _present_. Sets the serialization type.

##### `static_directory`
Optional. Sets the directory for the output of a static replication agent. Valid options: any absolute path.

##### `static_definition`
Optional. Sets the static replication agent's configuration.

##### `template`
Required if `ensure` is _present_. Sets the template resource for this replication agent.

##### `timeout`
Optional. Sets the timeout, in seconds, when waiting for a response. Valid options: any positive integer. Default: `60`.

##### `trans_allow_exp_cert`
Optional. Sets whether or not to allow expired certs on the connection. Valid options: `true` or `false`.

##### `trans_ntlm_domain`
Optional. Sets the transport NLTM domain.

##### `trans_ntlm_host`
Optional. Sets the transport NLTM host.

##### `trans_password`
Optional. Sets the password for authentication to the remote system.

##### `trans_ssl`
Optional. Sets whether or to enable SSL on the transport. Valid options: `true` or `false`.

##### `trans_uri`
Opional. Sets the URI for the remote system.

##### `trans_user`
Optional. Sets the user for authentication to the remote system.

##### `trigger_ignore_def`
Optional. Sets the _Ignore default_ flag. Valid options: `true` or `false`.

##### `trigger_no_status`
Optional. Sets the _No Status Update_ flag. Valid options: `true` or `false`.

##### `trigger_no_version`
Optional. Sets the _No Versioning_ flag. Valid options: `true` or `false`.

##### `trigger_on_dist`
Optional. Sets the _On Distribute_ flag. Valid options: `true` or `false`.

##### `trigger_on_mod`
Optional. Sets the _On Modification_ flag. Valid options: `true` or `false`.

##### `trigger_on_receive`
Optional. Sets the _On Receive_ flag. Valid options: `true` or `false`.

##### `trigger_onoff_time`
Optional. Sets the _On/Off Time reached_ flag. Valid options: `true` or `false`.

##### `username`
Required. The username for authenticating to AEM.

#### Define: `aem::agent::replication::flush`

 Creates a _Flush_ replication agent. This definition has a limited property set based on the parameters typically required for this type of agent. For more details and examples, see the [wiki][]. For information on AEM Replications agents, see the [documentation](https://docs.adobe.com/docs/en/aem/6-2/deploy/configuring/replication.html).

##### `name`
Namevar. Required. Specifies the name of this replication agent. The name must only contain letters and numbers. This will be the node name when it is created.

##### `title`
Required. The title of the replication agent. This can be different than the `name`.

##### `ensure`
Optional. Changes the state of the replication agent. Valid options: `present` or `absent`. Default: `present`.

#### `agent_user`
Optional. The AEM/System user which is used to perform the replication actions.

##### `description`
Optional. Set's the description for the agent. The default value is always part of the value. Default: _\*\*Managed by Puppet. Any changes made will be overwritten**_

##### `enabled`
Optional. Sets whether or not the agent is enabled. Valid options: `true` or `false`. Default: `true`.

##### `force_passwords`
Optional. Set's whether or not to overwrite the current password values. For more details, see the Sling Resource type's _force_paswords_ parameter. Password properties for this type are `proxy_password` and `transfport_pasword` . Valid options: `true` or `false`. Default: `false`.

##### `home`
Required. Sets the directory in which AEM exists. Valid options: any absolute path.

##### `log_level`
Optional. Sets the log level of the agent. Valid options: `debug`, `info`, `error`. Default: `info`.

##### `password`
Required. The password for authenticating to AEM.

##### `protocol_http_headers`
Optional. Sets the list of additional headers for the HTTP Request. Valid options: String or Array of Strings. Default: `[ 'CQ-Action:{action}', 'CQ-Handle:{path}', 'CQ-Path: {path}' ]`.

##### `protocol_http_method`
Optional. Sets the HTTP method to use for the replication request. Default: `GET`

##### `runmode`
Required. Sets the runmode for persisting the Replication agent.

##### `timeout`
Optional. Sets the timeout, in seconds, when waiting for a response. Valid options: any positive integer. Default: `60`.

##### `trans_allow_exp_cert`
Optional. Sets whether or not to allow expired certs on the connection. Valid options: `true` or `false`.

##### `trans_password`
Optional. Sets the password for authentication to the remote system.

##### `trans_ssl`
Optional. Sets whether or to enable SSL on the transport. Valid options: `true` or `false`.

##### `trans_uri`
Opional. Sets the URI for the remote system.

##### `trans_user`
Optional. Sets the user for authentication to the remote system.

##### `trigger_ignore_def`
Optional. Sets the _Ignore default_ flag. Valid options: `true` or `false`.

##### `trigger_no_status`
Optional. Sets the _No Status Update_ flag. Valid options: `true` or `false`.

##### `trigger_no_version`
Optional. Sets the _No Versioning_ flag. Valid options: `true` or `false`.

##### `trigger_on_dist`
Optional. Sets the _On Distribute_ flag. Valid options: `true` or `false`.

##### `trigger_on_mod`
Optional. Sets the _On Modification_ flag. Valid options: `true` or `false`.

##### `trigger_on_receive`
Optional. Sets the _On Receive_ flag. Valid options: `true` or `false`.

##### `trigger_onoff_time`
Optional. Sets the _On/Off Time reached_ flag. Valid options: `true` or `false`.

##### `username`
Required. The username for authenticating to AEM.

#### Define: `aem::agent::replication::publish`

 Creates a _Publish_ replication agent. This definition has a limited property set based on the parameters typically required for this type of agent. For more details and examples, see the [wiki][]. For information on AEM Replications agents, see the [documentation](https://docs.adobe.com/docs/en/aem/6-2/deploy/configuring/replication.html).

##### `name`
Namevar. Required. Specifies the name of this replication agent. The name must only contain letters and numbers. This will be the node name when it is created.

##### `title`
Required. The title of the replication agent. This can be different than the `name`.

##### `ensure`
Optional. Changes the state of the replication agent. Valid options: `present` or `absent`. Default: `present`.

#### `agent_user`
Optional. The AEM/System user which is used to perform the replication actions.

##### `description`
Optional. Set's the description for the agent. The default value is always part of the value. Default: _\*\*Managed by Puppet. Any changes made will be overwritten**_

##### `enabled`
Optional. Sets whether or not the agent is enabled. Valid options: `true` or `false`. Default: `true`.

##### `force_passwords`
Optional. Set's whether or not to overwrite the current password values. For more details, see the Sling Resource type's _force_paswords_ parameter. Password properties for this type are `proxy_password` and `transfport_pasword` . Valid options: `true` or `false`. Default: `false`.

##### `home`
Required. Sets the directory in which AEM exists. Valid options: any absolute path.

##### `log_level`
Optional. Sets the log level of the agent. Valid options: `debug`, `info`, `error`. Default: `info`.

##### `password`
Required. The password for authenticating to AEM.

##### `runmode`
Required. Sets the runmode for persisting the Replication agent.

##### `timeout`
Optional. Sets the timeout, in seconds, when waiting for a response. Valid options: any positive integer. Default: `60`.

##### `trans_allow_exp_cert`
Optional. Sets whether or not to allow expired certs on the connection. Valid options: `true` or `false`.

##### `trans_password`
Optional. Sets the password for authentication to the remote system.

##### `trans_ssl`
Optional. Sets whether or to enable SSL on the transport. Valid options: `true` or `false`.

##### `trans_uri`
Opional. Sets the URI for the remote system.

##### `trans_user`
Optional. Sets the user for authentication to the remote system.

##### `trigger_ignore_def`
Optional. Sets the _Ignore default_ flag. Valid options: `true` or `false`.

##### `trigger_no_status`
Optional. Sets the _No Status Update_ flag. Valid options: `true` or `false`.

##### `trigger_no_version`
Optional. Sets the _No Versioning_ flag. Valid options: `true` or `false`.

##### `trigger_on_dist`
Optional. Sets the _On Distribute_ flag. Valid options: `true` or `false`.

##### `trigger_on_mod`
Optional. Sets the _On Modification_ flag. Valid options: `true` or `false`.

##### `trigger_on_receive`
Optional. Sets the _On Receive_ flag. Valid options: `true` or `false`.

##### `trigger_onoff_time`
Optional. Sets the _On/Off Time reached_ flag. Valid options: `true` or `false`.

##### `username`
Required. The username for authenticating to AEM.

#### Define: `aem::agent::replication::reverse`

 Creates a _Reverse_ replication agent. This definition has a limited property set based on the parameters typically required for this type of agent. For more details and examples, see the [wiki][]. For information on AEM Replications agents, see the [documentation](https://docs.adobe.com/docs/en/aem/6-2/deploy/configuring/replication.html).

##### `name`
Namevar. Required. Specifies the name of this replication agent. The name must only contain letters and numbers. This will be the node name when it is created.

##### `title`
Required. The title of the replication agent. This can be different than the `name`.

##### `ensure`
Optional. Changes the state of the replication agent. Valid options: `present` or `absent`. Default: `present`.

#### `agent_user`
Optional. The AEM/System user which is used to perform the replication actions.

##### `description`
Optional. Set's the description for the agent. The default value is always part of the value. Default: _\*\*Managed by Puppet. Any changes made will be overwritten**_

##### `enabled`
Optional. Sets whether or not the agent is enabled. Valid options: `true` or `false`. Default: `true`.

##### `force_passwords`
Optional. Set's whether or not to overwrite the current password values. For more details, see the Sling Resource type's _force_paswords_ parameter. Password properties for this type are `proxy_password` and `transfport_pasword` . Valid options: `true` or `false`. Default: `false`.

##### `home`
Required. Sets the directory in which AEM exists. Valid options: any absolute path.

##### `log_level`
Optional. Sets the log level of the agent. Valid options: `debug`, `info`, `error`. Default: `info`.

##### `password`
Required. The password for authenticating to AEM.

##### `protocol_http_method`
Optional. Sets the HTTP method to use for the reverse replication request. Default: `GET`

##### `runmode`
Required. Sets the runmode for persisting the Replication agent.

##### `timeout`
Optional. Sets the timeout, in seconds, when waiting for a response. Valid options: any positive integer. Default: `60`.

##### `trans_allow_exp_cert`
Optional. Sets whether or not to allow expired certs on the connection. Valid options: `true` or `false`.

##### `trans_password`
Optional. Sets the password for authentication to the remote system.

##### `trans_ssl`
Optional. Sets whether or to enable SSL on the transport. Valid options: `true` or `false`.

##### `trans_uri`
Opional. Sets the URI for the remote system.

##### `trans_user`
Optional. Sets the user for authentication to the remote system.

##### `username`
Required. The username for authenticating to AEM.

#### Define: `aem::agent::replication::static`

 Creates a _Static_ replication agent. This definition has a limited property set based on the parameters typically required for this type of agent. For more details and examples, see the [wiki][]. For information on AEM Replications agents, see the [documentation](https://docs.adobe.com/docs/en/aem/6-2/deploy/configuring/replication.html).

##### `name`
Namevar. Required. Specifies the name of this replication agent. The name must only contain letters and numbers. This will be the node name when it is created.

##### `title`
Required. The title of the replication agent. This can be different than the `name`.

##### `ensure`
Required. Changes the state of the replication agent. Valid options: `present` or `absent`. Default: `present`.

#### `agent_user`
Optional. The AEM/System user which is used to perform the replication actions.

##### `definition`
Optional. Sets the static replication agent's configuration.

##### `description`
Optional. Set's the description for the agent. The default value is always part of the value. Default: _\*\*Managed by Puppet. Any changes made will be overwritten**_

##### `directory`
Optional. Sets the directory for the output of a static replication agent. Valid options: any absolute path.

##### `enabled`
Optional. Sets whether or not the agent is enabled. Valid options: `true` or `false`. Default: `true`.

##### `home`
Required. Sets the directory in which AEM exists. Valid options: any absolute path.

##### `log_level`
Optional. Sets the log level of the agent. Valid options: `debug`, `info`, `error`. Default: `info`.

##### `password`
Required. The password for authenticating to AEM.

##### `retry_delay`
Optional. Sets the retry delay. Valid options: any positive integer.

##### `runmode`
Required. Sets the runmode for persisting the Replication agent.

##### `username`
Required. The username for authenticating to AEM.

#### Define: `aem::crx:package`

Manages an AEM CRX Package; allows for saving packages via a file (in the crx-quickstart/install directory) or posted to the CRX Package Manager API. For examples, see the [wiki][].

##### `name`
Namevar. Required.

##### `ensure`
Required. Changes the state of this CRX Package.
* `present`: Uploaded but not installed; if installed will uninstall.
* `installed`: Uploaded and installed; Equivalent to `present` when **type** == `file`. (**Default**)
* `purged`: Uninstalled, then removed from the package manager. Equivalent to `absent` when **type** == `file`.
* `absent`: Removed from the package manager.

##### `group`
Optional. Sets the group for file ownership. Valid options: any valid group. Default: `aem`.

##### `home`
Required. Sets the directory in which AEM exists. Valid options: any absolute path.

##### `pkg_group`
Required if **type** == `api`. The CRX Package group.

##### `pkg_name`
Required if **type** == `api`. The CRX Package name.

##### `pkg_version`
Required if **type** == `api`. The CRX Package group.

##### `password`
Required if **type** == `api`. Sets the password of the CRX Package Manager API user. Valid options: any valid password.

##### `source`
Required. Sets the source package file to use. Valid options: any absolute path to file.

##### `type`
Required. Sets the means by which to persist the package. Valid options: `api` or `file`. `api` will use API client to the CRX Package Manager. `file` will copy the package file in the *crx-quickstart/install* folder.

##### `user`
Optional. Sets the user for file ownership. Valid options: any valid user. Default: `aem`.

##### `username`
Required if **type** == `api`. Sets the user for accessing the CRX Package Manager API. Valid options: any valid user.

##### `manage_rubygems`
Optional. Setting to false will stop this define managing the Ruby and rubygems installs. This is necessary if these are managed via another way, like systempackages for example.
Default: `true`.

##### `timeout`
Optional. Timeout value for AEM to finish the install and reply with an OK state.
Default: 60(seconds).

#### Define: `aem::dispatcher::farm`

Configures a single farm instance within the Dispatcher. For more details and examples, see the [wiki][].

##### `ensure`
Required. Changes the state of this dispatcher farm configuration. Valid options: `present` or `absent`. Default: `present`.

##### `allow_authorized`
Optional. Sets the cache */allowAuthorized* rule. Valid options: `0` or `1`.

##### `allowed_clients`
Optional. Sets the cache */allowedClients* section. Valid options: Hash, or Array of Hashes. Default:
~~~ puppet
{
  'type' => 'allow',
  'glob' => '*',
}
~~~

##### `auth_checker`
Optional. Sets the */auth_checker* section. Valid options: Hash. Example
~~~ puppet
{
  url => '/bin/permissioncheck',
  filter => [
    {
      'type' => 'allow',
      'glob' => '*',
    }
  ],
  headers => [
    {
      'type' => 'allow',
      'glob' => '*',
    }
  ],
}
~~~

##### `cache_headers`
Optional. Sets the cache */headers* section. Valid options: String or Array of Strings.

##### `cache_rules`
Optional. Sets the cache */rules* section. Valid options: Hash, or Array of Hashes. Default:
~~~ puppet
{
  'type' => 'deny',
  'glob' => '*',
}
~~~

##### `cache_ttl`
Optional. Sets the cache */enableTTL* rule. Valid options: `0` or `1`.

##### `client_headers`
Optional. Sets the */clientheaders* rule. Valid options: String or Array of Strings. Default: `*`

##### `docroot`
Required. Sets the cache */docroot* rule. Valid options: any absolute path.

##### `failover`
Optional. Sets the */failover* rule. Valid options: `0` or `1`.

##### `filters`
Optional. Sets the */fiters* section. Valid options: Hash, or Array of Hashes. Default:
~~~ puppet
{
  'type' => 'allow',
  'glob' => '*',
}
~~~

##### `grace_period`
Optional. Sets the cache */grace* rule. Valid options: any positive integer.

##### `ignore_parameters`
Optional. Sets the cache */ignoreUrlParams* section. Valid options: Hash, or Array of Hashes.

##### `invalidate`
Optional. Sets the cache */invalidate* section. Valid options: Hash, or Array of Hashes. Default:
~~~ puppet
[
  {
    'type' => 'allow',
    'glob' => '*',
  }
]
~~~

##### `invalidate_handler`
Optional. Sets the cache */invalidateHandler* rule. Valid options: any absolute path to file.

##### `priority`
Optional. Defines a priority for the resulting farm configuration to be included in the global dispatcher farm configuration. Farms with a lower priority will be included first. Farms with the same priority will be included in alphabetical order. Valid options are integers from `0` to `99`. Default value: 0

##### `propagate_synd_post`
Optional. Sets the */propagateSyndPost* rule. Valid options: `0` or `1`.

##### `renders`
Optional. Sets the */renders* section. Valid options: Hash, or Array of Hashes. Default:
~~~ puppet
{
  'hostname' => 'localhost',
  'port'     => 4503,
}
~~~

##### `retries`
Optional. Sets the */numberOfRetries* rule. Valid options: any positive integer.

##### `retry_delay`
Optional. Sets the */retryDelay* rule. Valid options: any positive integer.

##### `serve_stale`
Optional. Sets the cache */serveStaleOnError* rule. Valid options: `0` or `1`.

##### `session_management`
Optional. Sets the */sessionmanagement* section. Valid options: Hash of values.

##### `stat_file`
Optional. Sets the cache */statfile* rule. Valid options: any absolute path to file.

##### `stat_files_level`
Optional. Sets the cache */statfileslevel* rule. Valid options: any integer >= 0.

##### `statistics`
Optional. Sets the */statistics* section. Valid options: Hash of values.

##### `sticky_connections`
Optional. Sets the */stickyConnectionsFor* rule or */stickyConnectionsFor* section based on value.. Valid options: String or Array of Strings.

##### `unavailable_penalty`
Optional. Sets the */unavailablePenalty* rule. Valid options: any positive integer.

##### `vanity_urls`
Optional. Sets the */vanity_urls* section. Valid options: Hash of values.

##### `virtualhosts`
Optional. Sets the */virtualhosts* section. Valid options: String or Array of Strings. Default: `*`.

#### Define: `aem::instance`

Installs an AEM instance into your system. For more details and examples see the [wiki][].

When this type is declared with the default options, Puppet:

- Unpacks the specified AEM jar file.
- Configures the AEM start scripts with the default configuration options.
- Starts AEM for the first time to ensure repository creation.
- Shuts AEM down to create a consistent state.
- Defines and starts an AEM Service for the instance.

See [Beginning with AEM][] for the minimum configuration required to create an AEM installation. It is suggested that you customize the AEM definion with the following parameters, as the default parameters are not recommended for production.

**Parameters within `aem::instance`:**

##### `name`
Namevar. Required. Specifies the name of the AEM instance.

##### `ensure`
Optional. Changes the state of the AEM instance. Valid options: `present` or `absent`. Default: `present`.

##### `context_root`
Optional. Specifies the URL context root for the AEM application. [Sling documentation][Sling launchpad]. Valid options: any valid URI path. Defaults to `/`.

##### `debug_port`
Optional. Specifies the port on which to listen for remote debugging connections. Setting this will add the following JVM options: `-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=<<port>>` Valid options: any port number.

##### `group`
Optional. Sets the group for installation. Valid options: any valid group. Default: `aem`.

##### `home`
Optional. Sets the directory in which AEM will be installed. Valid options: any absolute path. Default: `/opt/aem`.

##### `jvm_mem_opts`
Optional. Specifies options for the JVM memory. This is separated from the JVM opts to simplify configurations. Valid options: any valid JVM parameter string. Default: `-Xmx1024m`.

##### `jvm_opts`
Optional. Specifies options to pass to the JVM. Valid options: any valid JVM parameter string. Default: None. The following string is always passed, and cannot be overwritten: `-server -Djava.awt.headless=true`

##### `manage_group`
Optional. Sets whether or not this instance will manage the defined group. Valid options: `true` or `false`. Default: `true`.

##### `manage_home`
Optional. Sets whether or not this instance will manage the defined home directory. Valid options: `true` or `false`. Default: `true`.

##### `manage_user`
Optional. Sets whether or not this instance will manage the defined user. Valid options: `true` or `false`. Default: `true`.

##### `osgi_configs`
Optional. Creates *file* type definitions of `aem::osgi::config` which will be applied prior to initial AEM start. The structure can either be a hash of the properties, or a Hash specifying the *pid* and the *properties*. If only properties are specified, the key is expected to be the *pid*. Valid options: Hash or Array of Hash configurations.

##### `port`
Optional. Specifies the port on which AEM will listen. Valid options: any valid port. Default: 4502. [Sling documentation][Sling command-line-options]

##### `runmodes`
Optional. Sets the array of runmodes to apply to the AEM instance. Do not use this to set options available via `type` configuration, or a `sample_content` state. Valid options: any string array. [AEM documentation][AEM Runmodes].

##### `sample_content`
Optional. Sets whether or not to include the sample content (e.g. Geometrixx). Valid options: `true` or `false`. Default: `true`. [AEM Documentation][AEM Sample Content].

##### `snooze`
Optional. Sets the wait period between checks for installation completion. When monitoring the system for up state, this is the wait period between checks. Value is specified in seconds. Valid options: any number. Default: `10`.

##### `source`
Required. Sets the source jar file to use, provided by user. Valid options: any absolute path to file.

##### `status`
Optional. Changes the state of the service on the system, defining whether or not the service starts at system boot and/or is currently running. Valid options:
* `enabled`: Start at boot & currently running (**Default**)
* `disabled`: Not started at boot & not currently running.
* `running`: Not started at boot but is currently running.
* `unmanaged`: Don't manage it with service manager, running state is arbitrary.

##### `timeout`
Optional. Sets the timeout allowed for startup monitoring. If the installation doesn't finish by the timeout, an error will be generated. Value is specified in seconds. Valid option: any number. Default: `600` (10 minutes).

##### `type`
Optional. Specifies the AEM installation type. Valid options: `author` or `publish`. Default: `author`. [AEM documentation][AEM Installation Runmodes]

##### `user`
Optional. Sets the user for installation. Valid options: any valid user. Default: `aem`.

##### `version`
Optional. Sets the version of AEM. Informational only, does not affect installation or resource management. Valid options: any semantic version.

#### Define: `aem::license`

Manages an AEM License file. Provides a convenient tool for managing the license file contents without needing to know the structure. For examples, see the [wiki][].

**Parameters within `aem::license`:**

##### `name`
Namevar. Required. Specifies the name of the AEM license.

##### `ensure`
Optional. Changes the state of the AEM license. Valid options: `present` or `absent`. Default: `present`.

##### `customer`
Optional. Specifies the customer name for the license file. Valid options: any string

##### `group`
Optional. Sets the group for file ownership. Valid options: any valid group. Default: `aem`.

##### `home`
Required. Sets the directory in which the license will be placed. Valid options: any absolute path.

##### `license_key`
Required. Sets the license key for AEM. Valid options: any string.

##### `user`
Optional. Sets the user for file ownership. Valid options: any valid user. Default: `aem`.

##### `version`
Optional. Sets the version of AEM for the license file contents. Valid options: any string.

#### Define: `aem::osgi::config`

Manages an AEM OSGi Configuration; allows for saving Service/Component configurations via a file or posted to the Felix Web Console. For examples, see the [wiki][].

**Parameters within `aem::osgi::config`:**

##### `name`
Namevar. Required. Specifies the name of the AEM OSGi Configuration. This should be the Service PID. [Apache Felix Documentation][Felix Configuration]

##### `ensure`
Optional. Changes the state of the AEM OSGi configuration. A value of `absent` will delete the configuration. Valid options: `present` or `absent`. Default: `present`.

##### `group`
Optional. Sets the group for file ownership. Valid options: any valid group. Default: `aem`.

##### `handle_missing`
Required if **type** == `console`. Determine how to handle properties which are configured in the console, but not provided. See [wiki] for examples. Valid options: `merge` or `remove`.

##### `home`
Required. Sets the directory in which AEM exists. Valid options: any absolute path.

##### `password`
Required if **type** == `console`. Sets the password of the OSGI console user. Valid options: any valid password.

##### `properties`
Required. Sets the configuration properties to persist. Valid options: a hash of values.

##### `type`
Required. Sets the means by which to persist the configuration. Valid options:  `console` or `file`. `console` will use API calls to the OSGi Web Console. `file` will persist to a properties file in the *crx-quickstart/install* folder.

##### `user`
Optional. Sets the user for file ownership. Valid options: any valid user. Default: `aem`.

##### `username`
Required if **type** == `console`. Sets the user for accessing the OSGI console. Valid options: any valid user.

#### Define: `aem::service`

Manages the AEM daemon. Creating a definition for this is not necessary unless the `aem::instance`'s *manage_service* is **false**. For examples, see the [wiki][]

**Parameters within `aem::service`:**

##### `name`
Namevar. Required. Specifies the name of the AEM Service.

##### `ensure`
Optional. Changes the state of the AEM Service within puppet. Valid options: `present` or `absent`. Default: `present`.

##### `group`
Optional. Sets the group for file ownership. Valid options: any valid group. Default: `aem`.

##### `home`
Required. Sets the directory in which the AEM instance exists, necessary for service configuration definition. Valid options: any absolute path.

##### `status`
Optional. Changes the state of the service on the system, defining whether or not the service starts at system boot and/or is currently running. Valid options:
* `enabled`: Start at boot & currently running (**Default**)
* `disabled`: Not started at boot & not currently running.
* `running`: Not started at boot but is currently running.
* `unmanaged`: Don't manage it with service manager, running state is arbitrary.

##### `user`
Optional. Sets the user for file ownership. Valid options: any valid user. Default: `aem`.

### Public Types

#### Type: `Aem_Sling_Resource'

##### `name`
Namevar. Required. The name of this resource. A unique name or the fully qualified path to the resource in the repository.

##### `ensure`
Required. Changes the state of the Sling resource definition. Valid options: `present` or `absent`.

##### `force_passwords`
Optiona. Flag to specify whether or not to update password properties, they are submitted regardless of current state. Setting this will cause an update each time the agent runs.

## ### `handle_missing`
Optional. Determine how to handle properties which are specified in the repository, but not not provided. See [wiki][wiki] for examples. Valid options: `ignore` or `remove`. Default: `ingore`.

##### `home`
Required. Sets the directory in which AEM exists. Valid options: any absolute path.

##### `ignored_properties`
Optional. Properties to ignore when comparing repository values against those provided. Valid options: Array of values. Default: `['jcr:created', 'jcr:createdBy', 'cq:lastModified', 'cq:lastModifiedBy']`

##### `path`
Optional. Specifies the fully qualified path to the resource in the repository.

##### `password`
Required. The password for authentication to AEM.

##### `password_properties`
Optional. List of resource properties which should be ignored as _passwords_ unless `force_passwords` is _true_. Valid options: Array of values.

##### `protected_properties`
Optional. List of properties which cannot be updated. They will be persisted when creating, but ignored during updates. Valid options: Array of values. Default: `['jcr:primaryType']`.

##### `username`
Required. The username for authentication to AEM.

##### `properties`
Optional. Hash of properties to store in the repository. Sub hashes are created as children nodes. Hashes can be nested to an arbitrary depth. See [wiki][wiki] for examples. Valid options: Hash of values.

##### `timeout`
Optional. Sets the timeout, in seconds, when waiting for a response. Valid options: any positive integer. Default: `120`.

### Private Defines

#### Define: `aem::config`
This define sets up the start templates to ensure the AEM instance executes with the correct state.

#### Define: `aem::crx::package::file`
This define is used to manage CRX Packages which are of type `file`.

#### Define: `aem::osgi::config::file`
This define is used to manage OSGi Configurations which are of type `file`.

#### Define: `aem::package`
This define unpacks the AEM Quickstart jar for preparation to configure.

### Private Types

#### Type: `aem_crx_package`
This custom type manages CRX Packages which are of type `api`.

#### Type: `aem_installer`
This custom type starts the AEM instance to create the base repository, monitors for it's initialization, then shuts the system down.

#### Type: `aem_osgi_config`
This custom type manages OSGi Configurations which are of type `console`.

## Limitations

### Dependencies

The `aem::dispatcher` class requires the Puppet Apache module; however since the use of this class is optional, this dependency is not declared explicitly.

### OS Compatibility

This module has been tested on:

- CentOS 7, 7.2
- Ubuntu 12.04*, 14.04
- Debian 7.8*, 8.2

*See [Known Issues][]*

### AEM Compatibility

This module has been tested with the following AEM versions:

- 6.0
- 6.1
- 6.2

### Minimum Ruby Requirement

Using the OSGi Configuration options require a Minimum ruby version of 1.9.x.

### Warnings

It is up to the consumer to ensure that the correct version of Java is installed based on the AEM version. See [AEM Documentation][AEM Java Requirements] for compatibility.

Defining an AEM resource as absent will remove the instance from the system, regardless of whether or not it was originally managed by puppet.

### Known Issues

Ubuntu 12.04 ships with Ruby 1.8.x; therefore the OSGi configurations acceptance tests fail.

There is an oddity with the `aem::service` support on Debian: even though specifying a valid status sends the correct parameters to the underlying service resource, the service is not enabled, nor do state changes occur correctly. Acceptance tests on those Virtual Machines fail for issues with service management. See [issue #36](https://github.com/bstopp/puppet-aem/issues/36).

## Development

This module in its early stages, any updates or feature additions are welcome.

_Please make sure you do not include any AEM Installer jars in PRs._

#### Running Acceptance Tests

I ask that prior to creating PR for a new feature, unit and acceptance tests exist to ensure it's operation. Running all of the AEM acceptance tests take time, so be prepared. To assist with acceptance testing, there are a number of Beaker configurations. For more information, see the Beaker project's documentation.

To run the AEM acceptance tests, for all features against all boxes:
```shell
$ spec/acceptance/runall_aem.sh
```
Use the Dispatcher w/o SSL

To run just the Dispatcher acceptance tests:
```shell
$ bundle exec rspec spec/accpetance/dispatcher_acceptance_spec.rb
```


text:
/***
Profile Page
***/
.profile {
  position:relative;
}

.profile p {
  color:#636363;
  font-size:13px;
}

.profile p a {
  color:#169ef4;
}

.profile label {
  margin-top:10px;
}

.profile label:first-child {
  margin-top:0;
}

/*profile info*/
.profile-classic .span2 {
  position:relative;
}

.profile-classic .span2 a {
  top:0;
  right:0;
  margin:0;
  color:#fff;
  opacity:0.6;
  padding:0 9px;
  font-size:11px;
  background:#000;
  position:absolute;
  filter:alpha(opacity=60); /*for ie*/
}
.profile-classic .span2 img {
  margin-bottom:15px;
}

.profile-classic li {
  padding:8px 0;
  font-size:13px;
  border-top:solid 1px #f5f5f5;
}

.profile-classic li:first-child {
  border-top:none;
}

.profile-classic li span {
  color:#666;
  font-size:13px;
  margin-right:7px;
}

/*profile tabs*/
.profile .tabbable-custom-profile .nav-tabs > li > a {
  padding:6px 12px;
}

/*profile navigation*/
.profile ul.profile-nav {
  margin-bottom:30px;
}

.profile ul.profile-nav li {
  position:relative;
}

.profile ul.profile-nav li a {
  color:#557386;
  display:block;
  font-size:14px;
  padding:8px 10px;
  margin-bottom:1px;
  background:#f0f6fa;
  border-left:solid 2px #c4d5df;
}

.profile ul.profile-nav li a:hover {
  color:#169ef4;
  background:#ecf5fb;
  text-decoration:none;
  border-left:solid 2px #169ef4;
}

.profile ul.profile-nav li a.profile-edit {
  top:0;
  right:0;
  margin:0;
  color:#fff;
  opacity:0.6;
  border:none;
  padding:0 9px;
  font-size:11px;
  background:#000;
  position:absolute;
  filter:alpha(opacity=60); /*for ie*/
}

.profile ul.profile-nav li a.profile-edit:hover {
  text-decoration:underline;
}

.profile ul.profile-nav a span {
  top:0;
  right:0;
  color:#fff;
  font-size:20px;
  padding:8px 13px;
  position:absolute;
  background:#169ef4;
}

.profile ul.profile-nav a:hover span {
  background:#0b94ea;
}

/*profile information*/
.profile-info h1 {
  color:#383839;
  font-size:24px;
  font-weight:400;
  margin:-11px 0 10px 0;
}

.profile-info ul {
  margin-bottom:15px;
}

.profile-info li {
  color:#6b6b6b;
  font-size:13px;
  margin-right:15px;
  margin-bottom:5px;
  padding:0 !important;
}

.profile-info li i {
  color:#b5c1c9;
  font-size:15px;
}

.profile-info li:hover i {
  color:#169ef4;
}

/*profile sales summary*/
.sale-summary ul {
  margin-top:-12px;
}
.sale-summary li {
  padding:10px 0;
  overflow:hidden;
  border-top:solid 1px #eee;
}

.sale-summary li:first-child {
  border-top:none;
}

.sale-summary li .sale-info {
  float:left;
  color:#646464;
  font-size:14px;
  text-transform:uppercase;
}

.sale-summary li .sale-num {
  float:right;
  color:#169ef4;
  font-size:20px;
  font-weight:300;
}

.sale-summary li span i {
  top:1px;
  width:13px;
  height:14px;
  margin-left:3px;
  position:relative;
  display:inline-block;
}

.sale-summary li i.icon-img-up {
  background:url(../image/icon-img-up.png) no-repeat !important;
}

.sale-summary li i.icon-img-down {
  background:url(../image/icon-img-down.png) no-repeat !important;
}

.sale-summary .portlet-title h4 {
  color:#383839;
  font-size:18px;
}

.sale-summary .portlet-title {
  border-color:#c9c9c9;
}

/*latest customers table*/
.profile .table-advance thead tr th {
  background:#f0f6fa;
}

.profile .table-bordered th,
.profile .table-bordered td,
.profile .table-bordered {
  border-color:#e5eff6;
}

.profile .table-striped tbody > tr:nth-child(2n+1) > td,
.profile .table-striped tbody > tr:nth-child(2n+1) > th {
  background:#fcfcfc;
}

.profile .table-hover tbody tr:hover td,
.profile .table-hover tbody tr:hover th {
  background:#f5fafd;
}

/*add portfolio*/
.add-portfolio {
  overflow:hidden;
  margin-bottom:30px;
  background:#f0f6fa;
}

.add-portfolio .pull-left,
.add-portfolio .pull-right {
  padding:12px 14px;
}

.add-portfolio .pull-left {
  color:#555d69;
  font-size:20px;
}

.add-portfolio .pull-left span {
  top:8px;
  position:relative;
}

.add-portfolio .pull-right i {
  margin-left:5px;
}

/*portfolio block*/
.portfolio-block {
  background:#f7f7f7;
  margin-bottom:15px;
}

.portfolio-block .span5 {
  overflow:hidden;
}

/*portfolio text*/
.portfolio-text {
  overflow:hidden;
}

.portfolio-text h4 {
}

.portfolio-text img {
  float:left;
  margin-right:15px;
}

.portfolio-text .portfolio-text-info {
  overflow:hidden;
}

/*portfolio button*/
.portfolio-btn a {
  display:block;
  padding:28px 0;
  background:#ddd !important;
}

.portfolio-btn a:hover {
  background:#1d943b !important;
}

.portfolio-btn span {
  color:#fff;
  font-size:22px;
  font-weight:200;
}

/*portfolio info*/
.portfolio-info {
  float:left;
  color:#616161;
  font-size:12px;
  padding:12px 25px;
  margin-bottom:5px;
  text-transform:uppercase;
}

.portfolio-info span {
  color:#16a1f2;
  display:block;
  font-size:30px;
  margin-top:5px;
  font-weight:200;
  text-transform:uppercase;
}

/*portfolio settings*/
.profile-settings {
  background:#fafafa;
  padding:15px 8px 0;
  margin-bottom:5px;
}

.profile-settings p {
  padding-left:5px;
  margin-bottom:3px;
}

.profile-settings .controls > .radio,
.profile-settings .controls > .checkbox {
  font-size:12px;
  margin-top:2px !important;
}


text:
using System;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Xml.Linq;
using System.Xml.Serialization;
using log4net;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace Moonlit.Weixin
{
    public class WeixinProxy
    {
        private readonly IWeixinProxy _proxy;
        private WeixinJsonConverter _jsonConverter;

        public WeixinProxy(IWeixinProxy proxy)
        {
            _proxy = proxy;
            _jsonConverter = new WeixinJsonConverter();
        }

        public async Task<T> GetAsync<T>(string url)
        {
            var value = await _proxy.GetAsync(url);
            if (string.IsNullOrWhiteSpace(value))
            {
                throw new Exception("not response from weixin server");
            }
            CheckJsonResponseError(value);
            return _jsonConverter.DeserializeObject<T>(value);
        }
        public async Task<byte[]> GetBytesAsync (string url)
        {
            var value = await _proxy.GetBytesAsync(url);
            //if (string.IsNullOrWhiteSpace(value))
            //{
            //    throw new Exception("not response from weixin server");
            //}
            //CheckJsonResponseError(value);
            //return _jsonConverter.DeserializeObject<T>(value);
            return value;
        }

        private static void CheckJsonResponseError(string value)
        {
            var jobj = JsonConvert.DeserializeObject(value) as JObject;
            if (jobj != null && jobj.Property("errcode") != null && (int)jobj["errcode"] != 0)
            {
                throw new WeixinException((int)jobj["errcode"], (string)jobj["errmsg"]);
            }
        }

        private static void CheckXmlResponseError(string value)
        {
            XElement xele = XElement.Parse(value);
            var returnCode = (string)xele.Element("return_code");
            if (!returnCode.EqualsIgnoreCase("success"))
            {
                throw new WeixinException(0, (string)xele.Element("return_msg"));
            }
        }

        public async Task<T> PostAsXmlAsync<T>(string url, string text)
        {

            var response = await _proxy.PostAsync(url, text);
            CheckXmlResponseError(response);

            var xmlSerialier = new XmlSerializer(typeof(T));
            return (T)xmlSerialier.Deserialize(new StringReader(response));
        }

        public async Task<T> PostAsJsonAsync<T>(string url, object data)
        {
            var response = await _proxy.PostAsync(url, _jsonConverter.SerializeObject(data));
            CheckJsonResponseError(response);
            return _jsonConverter.DeserializeObject<T>(response);
        }

    }
}


text:
// Copyright 2017 The Bazel Authors. All rights reserved.
//
// 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.

package com.google.devtools.build.lib.syntax;

import com.google.auto.value.AutoValue;

/**
 * Options that affect Skylark semantics.
 *
 *
For descriptions of what these options do, see {@link SkylarkSemanticsOptions}.
 */
// TODO(brandjon): User error messages that reference options should maybe be substituted with the
// option name outside of the core Skylark interpreter?
// TODO(brandjon): Eventually these should be documented in full here, and SkylarkSemanticsOptions
// should refer to this class for documentation. But this doesn't play nice with the options
// parser's annotation mechanism.
@AutoValue
public abstract class SkylarkSemantics {

  /**
   * The AutoValue-generated concrete class implementing this one.
   *
   *
AutoValue implementation classes are usually package-private. We expose it here for the
   * benefit of code that relies on reflection.
   */
  public static final Class<? extends SkylarkSemantics> IMPL_CLASS =
      AutoValue_SkylarkSemantics.class;

  // <== Add new options here in alphabetic order ==>
  public abstract boolean incompatibleBzlDisallowLoadAfterStatement();
  public abstract boolean incompatibleCheckedArithmetic();
  public abstract boolean incompatibleComprehensionVariablesDoNotLeak();
  public abstract boolean incompatibleDepsetIsNotIterable();
  public abstract boolean incompatibleDictLiteralHasNoDuplicates();
  public abstract boolean incompatibleDisallowDictPlus();
  public abstract boolean incompatibleDisallowKeywordOnlyArgs();
  public abstract boolean incompatibleDisallowSetConstructor();
  public abstract boolean incompatibleDisallowToplevelIfStatement();
  public abstract boolean incompatibleListPlusEqualsInplace();
  public abstract boolean incompatibleLoadArgumentIsLabel();
  public abstract boolean incompatibleNewActionsApi();
  public abstract boolean incompatibleStringIsNotIterable();
  public abstract boolean internalDoNotExportBuiltins();
  public abstract boolean internalSkylarkFlagTestCanary();

  public static Builder builder() {
    return new AutoValue_SkylarkSemantics.Builder();
  }

  public static final SkylarkSemantics DEFAULT_SEMANTICS = builder()
      // <== Add new options here in alphabetic order ==>
      .incompatibleBzlDisallowLoadAfterStatement(false)
      .incompatibleCheckedArithmetic(true)
      .incompatibleComprehensionVariablesDoNotLeak(true)
      .incompatibleDepsetIsNotIterable(false)
      .incompatibleDictLiteralHasNoDuplicates(true)
      .incompatibleDisallowDictPlus(false)
      .incompatibleDisallowKeywordOnlyArgs(true)
      .incompatibleDisallowSetConstructor(true)
      .incompatibleDisallowToplevelIfStatement(true)
      .incompatibleListPlusEqualsInplace(true)
      .incompatibleLoadArgumentIsLabel(false)
      .incompatibleNewActionsApi(false)
      .incompatibleStringIsNotIterable(false)
      .internalDoNotExportBuiltins(false)
      .internalSkylarkFlagTestCanary(false)
      .build();

  /** Builder for {@link SkylarkSemantics}. All fields are mandatory. */
  @AutoValue.Builder
  public abstract static class Builder {

    // <== Add new options here in alphabetic order ==>
    public abstract Builder incompatibleBzlDisallowLoadAfterStatement(boolean value);
    public abstract Builder incompatibleCheckedArithmetic(boolean value);
    public abstract Builder incompatibleComprehensionVariablesDoNotLeak(boolean value);
    public abstract Builder incompatibleDepsetIsNotIterable(boolean value);
    public abstract Builder incompatibleDictLiteralHasNoDuplicates(boolean value);
    public abstract Builder incompatibleDisallowDictPlus(boolean value);
    public abstract Builder incompatibleDisallowKeywordOnlyArgs(boolean value);
    public abstract Builder incompatibleDisallowSetConstructor(boolean value);
    public abstract Builder incompatibleDisallowToplevelIfStatement(boolean value);
    public abstract Builder incompatibleListPlusEqualsInplace(boolean value);
    public abstract Builder incompatibleLoadArgumentIsLabel(boolean value);
    public abstract Builder incompatibleNewActionsApi(boolean value);
    public abstract Builder incompatibleStringIsNotIterable(boolean value);
    public abstract Builder internalDoNotExportBuiltins(boolean value);
    public abstract Builder internalSkylarkFlagTestCanary(boolean value);

    public abstract SkylarkSemantics build();
  }
}


text:
package de.bund.bva.isyfact.batchrahmen.batch;

import java.util.Date;

import de.bund.bva.isyfact.batchrahmen.batch.exception.BatchAusfuehrungsException;
import de.bund.bva.isyfact.batchrahmen.batch.konfiguration.BatchKonfiguration;
import de.bund.bva.isyfact.batchrahmen.batch.protokoll.BatchErgebnisProtokoll;
import de.bund.bva.isyfact.batchrahmen.batch.rahmen.AuthenticationCredentials;
import de.bund.bva.isyfact.batchrahmen.batch.rahmen.BatchStartTyp;
import de.bund.bva.isyfact.batchrahmen.batch.rahmen.VerarbeitungsErgebnis;
import de.bund.bva.isyfact.sicherheit.annotation.Gesichert;

/**
 * Verhält sich wie der BasicTest-Batch - jedoch wird eine Autorisierung vor der Verarbeitung eines Satzes durchgeführt.
 * <p>
 * Die Daten, die zur Autorisierung verwendet werden, können in der Konfiguration hinterlegt werden.
 *
 *
 */
public class GesicherterTestBatch extends BasicTestBatch {

    /** Konfigurationsschlüssel für den verwendeten Nutzer. */
    public static final String BATCH_BENUTZER = "batch.benutzer";

    /** Konfigurationsschlüssel für das verwendeten Psaswort. */
    public static final String BATCH_PASSWORT = "batch.passwort";

    /** Konfigurationsschlüssel für das verwendete Behördenkennzeichen. */
    public static final String BATCH_BHKNZ = "batch.bhknz";

    /** Zugriff auf die Batch-Konfiguration. */
    private BatchKonfiguration konfiguration;

    /**
     * Diese Methode wird gesichert. {@inheritDoc}
     */
    @Gesichert("Recht")
    public VerarbeitungsErgebnis verarbeiteSatz() throws BatchAusfuehrungsException {
        return super.verarbeiteSatz();
    }

    /**
     * speichert die Referenz auf die Konfiguration. {@inheritDoc}
     */
    public int initialisieren(BatchKonfiguration konfiguration, long satzNummer, String dbKey,
        BatchStartTyp startTyp, Date datumLetzterErfolg, BatchErgebnisProtokoll protokoll)
        throws BatchAusfuehrungsException {
        this.konfiguration = konfiguration;
        return super
            .initialisieren(konfiguration, satzNummer, dbKey, startTyp, datumLetzterErfolg, protokoll);
    }

    /**
     * Liefert das Feld {@link #batchBenutzerKennung} zurück.
     * @return Wert von batchBenutzerKennung
     */
    protected String getBatchBenutzerKennung(BatchKonfiguration konfiguration) {
        return konfiguration.getAsString(BATCH_BENUTZER);
    }

    /**
     * Liefert das Feld {@link #batchBenutzerPasswort} zurück.
     * @return Wert von batchBenutzerPasswort
     */
    protected String getBatchBenutzerPasswort(BatchKonfiguration konfiguration) {
        return konfiguration.getAsString(BATCH_PASSWORT);
    }

    /**
     * Liefert das Feld {@link #batchBenutzerBhknz} zurück.
     * @return Wert von batchBenutzerBhknz
     */
    protected String getBatchBenutzerBhknz(BatchKonfiguration konfiguration) {
        return konfiguration.getAsString(BATCH_BHKNZ);
    }

    /**
     * Dieser Batch verwendet keine Sicherung.
     * {@inheritDoc}
     */
    @Override
    public AuthenticationCredentials getAuthenticationCredentials(BatchKonfiguration konfiguration) {
        AuthenticationCredentials authentifizierung = new AuthenticationCredentials();
        authentifizierung.setBehoerdenkennzeichen(getBatchBenutzerBhknz(konfiguration));
        authentifizierung.setBenutzerkennung(getBatchBenutzerKennung(konfiguration));
        authentifizierung.setPasswort(getBatchBenutzerPasswort(konfiguration));
        return authentifizierung;
    }

}


text:
package org.nd4j.autodiff.functions.impl.unary.transform;

import org.nd4j.autodiff.ArrayField;
import org.nd4j.autodiff.functions.AbstractUnaryFunction;
import org.nd4j.autodiff.functions.DifferentialFunction;
import org.nd4j.autodiff.samediff.SameDiff;

public class ATan extends AbstractUnaryFunction<ArrayField> {

    public ATan(SameDiff sameDiff, DifferentialFunction<ArrayField> i_v, Object[] extraArgs) {
        super(sameDiff, i_v, extraArgs);
    }

    @Override
    public ArrayField doGetValue() {
        return sameDiff.getArrayFactory().atan(arg().getValue(true));
    }

    @Override
    public double getReal() {
        return Math.atan(arg().getReal());
    }

    @Override
    public DifferentialFunction<ArrayField> diff(DifferentialFunction<ArrayField> i_v) {
        return sameDiff.getFunctionFactory().one(getResultShape()).div(sameDiff.getFunctionFactory().one(getResultShape()).add(arg().pow(2)));
    }

    @Override
    public String functionName() {
        return new org.nd4j.linalg.api.ops.impl.transforms.ATan().name();
    }
}


text:
SCRIPT_DIRECTORY="$(dirname "$0")"
source $SCRIPT_DIRECTORY/util.sh

set -e

declare -A branch_parents
declare -A visited_branches
outputs=()

LIGHT_BLUE="\033[0;34m"
GREEN="\033[0;32m"
RED="\033[0;31m"
NO_COLOR="\033[0m"

render_branch_tree() {
    local branch=$1
    local depth=($2)
    depth=$((depth))

    local upstream=$(git rev-parse --abbrev-ref --symbolic-full-name $branch@{upstream})
    local siblings=(${branch_parents[$upstream]})
    local child_branches=("${branch_parents[$branch]}")

    local prefix=""

    for i in $(seq 2 $depth); do
        prefix+="   "
    done

    if (( depth > 0 )); then
        if [ "$branch" = "${siblings[-1]}" ]; then
          prefix+="└─ "
      elif (( ${#siblings[@]} > 1 )); then
          prefix+="├─ "
        fi
    fi

    commits_diff=($(git rev-list --left-right --count $upstream...$branch))
    commits_ahead=$((commits_diff[1]))
    commits_behind=$((commits_diff[0]))
    local commits_output="("

    if (( commits_ahead > 0 )); then
        commits_output+="$GREEN+$commits_ahead$NO_COLOR"
    fi

    if (( commits_behind > 0 )); then
        if ((commits_ahead > 0)); then
            commits_output+=", "
        fi
        commits_output+="$RED-$commits_behind$NO_COLOR"
    fi

    if (( commits_ahead == 0 && commits_behind == 0)); then
        commits_output+="0"
    fi

    commits_output+=")"

    local commit_message=$(git show -q --format=%s $branch)

    if (( depth > 0 )) && (( no_external_calls == 0 )); then
        set +e
        TMPFILE=$(mktemp)
        local pr_info_output=$(gh pr view $branch --json number,state,isDraft 2> $TMPFILE)
        if (( $? == 0 )); then
            local pr_number=$(echo $pr_info_output | jq .number)
            local pr_state=$(echo $pr_info_output | jq .state)
            local pr_draft=$(echo $pr_info_output | jq .isDraft)
        fi
        set -e
    fi

    pr_info=""
    if [ "$pr_draft" = "true" ]; then
        pr_info+="$LIGHT_BLUE"
    elif [ "$pr_state" = "\"OPEN\"" ]; then
        pr_info+="$GREEN"
    else
        pr_info+="$RED"
    fi

    pr_info+="$pr_number$NO_COLOR"

    branch_output="$branch$NO_COLOR"
    if [ "$branch" = "$current_branch" ]; then
        branch_output="$GREEN$branch_output"
    fi
    outputs+=("$prefix$branch_output	$commits_output	$pr_info	$commit_message")

    visited_branches[$branch]="foo"
    for child_branch in $child_branches; do
        render_branch_tree $child_branch $depth+1
    done
}

# Pass --fast to the script to disable calls to GitHub and print only local information
no_external_calls=0
if [[ "$1" == "--fast" ]]; then
    no_external_calls=1
fi

find_current_branch
find_starting_branch all
build_branch_tree branch_parents

render_branch_tree $starting_branch 0

# Render any branches not inheriting from the starting branch
all_heads=$(git for-each-ref --format='%(refname:short)' refs/heads)
while IFS= read -r branch; do
    if [ ! ${visited_branches[$branch]+nothing} ]; then
        render_branch_tree $branch 0
    fi
done <<< "$all_heads"

for info in "${outputs[@]}"; do
    echo -e "$info"
done | column -t -s "	" -T 4


text:
@interface MusicPlayer : NSObject <AVAudioPlayerDelegate> {
   AVAudioPlayer *thePlayer;
}

- (void)playSong:(NSString *)name;
+ (MusicPlayer *)sharedMusicPlayer;

@end


text:
// Licensed to the Software Freedom Conservancy (SFC) under one
// or more contributor license agreements.  See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership.  The SFC licenses this file
// to you 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.

goog.provide('bot.locators.tagName');

goog.require('bot.Error');
goog.require('bot.ErrorCode');
goog.require('goog.array');

/**
 * Find an element by its tag name.
 * @param {string} target The tag name to search for.
 * @param {!(Document|Element)} root The document or element to perform the
 *     search under.
 * @return {Element} The first matching element found in the DOM, or null if no
 *     such element could be found.
 */
bot.locators.tagName.single = function(target, root) {
  if (target === "") {
    throw new bot.Error(bot.ErrorCode.INVALID_SELECTOR_ERROR,
        'Unable to locate an element with the tagName ""');
  }
  return root.getElementsByTagName(target)[0] || null;
};

/**
 * Find all elements with a given tag name.
 * @param {string} target The tag name to search for.
 * @param {!(Document|Element)} root The document or element to perform the
 *     search under.
 * @return {goog.array.ArrayLike} All matching elements, or an empty list.
 */
bot.locators.tagName.many = function(target, root) {
  if (target === "") {
    throw new bot.Error(bot.ErrorCode.INVALID_SELECTOR_ERROR,
        'Unable to locate an element with the tagName ""');
  }
  return root.getElementsByTagName(target);
};


text:
<?php

namespace App\Http\Controllers;

use App;

use Illuminate\Http\Request;
use Illuminate\Contracts\Filesystem\Filesystem;
use Illuminate\Support\Facades\Storage;
use App\Http\Requests;
use App\Module;
use App\Commentary;
use App\Http\Controllers\Controller;
use App\Http\Controllers\Auth\AuthController;
use Auth;

class ModuleController extends Controller
{

  public function index() {
    $modules = Module::all();
    $commentaries = Commentary::all();
    for ($j = 0; $j < count($modules); $j++) {
      $k = 0;
      $sum = 0;
      if (count($commentaries) > 0) {
        for ($i = 0; $i < count($commentaries); $i++)
        {
          if ($commentaries[$i]['module'] == $modules[$j]['id']) {
            $k++;
            $sum += $commentaries[$i]['mark'];
          }
          $mark = new \stdClass();
          $mark->number = $k;
          $mark->sum = $sum;
          if ($k > 0)
            $mark->average = $sum / $k;
          else
            $mark->average = 0;
          $modules[$j]['mark'] = $mark;
        }
      }
      else {
        $mark = new \stdClass();
        $mark->number = $k;
        $mark->sum = $sum;
        if ($k > 0)
          $mark->average = $sum / $k;
        else
          $mark->average = 0;
        $modules[$j]['mark'] = $mark;
      }
    }
    return response()->success(compact('get', 'modules'));
  }

  public function show($id)
  {
    $module = Module::find($id);

    return response()->success(compact('get', 'module'));
  }

  public function store(Request $request) {

    $path = $request->file('file')->getClientOriginalName();
    $ext = pathinfo($path, PATHINFO_EXTENSION);

    $pathPicture = $request->file('pictureFile')->getClientOriginalName();
    $extPicture = pathinfo($pathPicture, PATHINFO_EXTENSION);

    $fileName = 'module_' . $request->input('name') . '_' . uniqid() . '.' . $ext;
    $pictureName = 'modulePicture_' . $request->input('name') . '_' . uniqid() . '.' . $extPicture;

    $s3 = Storage::disk('s3');
    if ($s3->put($fileName, file_get_contents($request->file('file')), 'public') && $s3->put($pictureName, file_get_contents($request->file('pictureFile')), 'public')) {
      $module = new Module;
      $module->name = $request->input('name');
      $module->description = $request->input('description');
      $module->filepath = $fileName;
      $module->user_id = $request->input('user');
      $module->username = $request->input('username');
      $module->imgpath = $pictureName;
      $module->owner_picture = $request->input('owner_picture');
      $module->filter_id = $request->input('filter_id');
      $module->save();
    }

    return response()->success(compact('post', 'module'));
  }

  public function update($id, Request $request)
  {
    $module = Module::findOrFail($id);
      $module->name = $request->input('name');
      $module->description = $request->input('description');
    $module->save();

    return response()->success(compact('update', 'module'));
  }

  public function destroy($id)
  {
    $module = Module::findOrFail($id);

    $module->delete();

    return response()->success(compact('delete', 'module'));
  }
}