text:
package hydrograph.ui.propertywindow.widgets.customwidgets;

import hydrograph.ui.common.util.Constants;
import hydrograph.ui.common.util.OSValidator;
import hydrograph.ui.common.util.ParameterUtil;
import hydrograph.ui.datastructure.property.ComponentsOutputSchema;
import hydrograph.ui.datastructure.property.FilterProperties;
import hydrograph.ui.datastructure.property.GridRow;
import hydrograph.ui.datastructure.property.LookupMapProperty;
import hydrograph.ui.datastructure.property.LookupMappingGrid;
import hydrograph.ui.datastructure.property.Schema;
import hydrograph.ui.graph.model.Link;
import hydrograph.ui.graph.schema.propagation.SchemaPropagation;
import hydrograph.ui.propertywindow.property.ComponentConfigrationProperty;
import hydrograph.ui.propertywindow.property.ComponentMiscellaneousProperties;
import hydrograph.ui.propertywindow.property.Property;
import hydrograph.ui.propertywindow.propertydialog.PropertyDialogButtonBar;
import hydrograph.ui.propertywindow.schema.propagation.helper.SchemaPropagationHelper;
import hydrograph.ui.propertywindow.widgets.dialogs.lookup.LookupMapDialog;
import hydrograph.ui.propertywindow.widgets.gridwidgets.basic.AbstractELTWidget;
import hydrograph.ui.propertywindow.widgets.gridwidgets.basic.ELTDefaultButton;
import hydrograph.ui.propertywindow.widgets.gridwidgets.basic.ELTDefaultLable;
import hydrograph.ui.propertywindow.widgets.gridwidgets.container.AbstractELTContainerWidget;
import hydrograph.ui.propertywindow.widgets.gridwidgets.container.ELTDefaultSubgroupComposite;
import hydrograph.ui.propertywindow.widgets.utility.SchemaSyncUtility;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang.StringUtils;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Control;

/**
 *
 * Lookup mapping widget to be shown on Property dialog window
 *
 * @author Bitwise
 *
 */
public class ELTLookupMapWidget extends AbstractWidget {

	private String propertyName;
	private LinkedHashMap<String, Object> property = new LinkedHashMap<>();
	private LookupMappingGrid lookupMappingGrid;
	private List<AbstractWidget> widgets;

	public ELTLookupMapWidget(ComponentConfigrationProperty componentConfigProp,
			ComponentMiscellaneousProperties componentMiscProps, PropertyDialogButtonBar propertyDialogButtonBar) {
		super(componentConfigProp, componentMiscProps, propertyDialogButtonBar);
		if (componentConfigProp.getPropertyValue() == null) {
			lookupMappingGrid = new LookupMappingGrid();
		} else {
			lookupMappingGrid = (LookupMappingGrid) componentConfigProp.getPropertyValue();
		}
		this.propertyName = componentConfigProp.getPropertyName();
	}

	@Override
	public void attachToPropertySubGroup(AbstractELTContainerWidget subGroup) {
		ELTDefaultSubgroupComposite eltSuDefaultSubgroupComposite = new ELTDefaultSubgroupComposite(
				subGroup.getContainerControl());
		eltSuDefaultSubgroupComposite.createContainerWidget();

		AbstractELTWidget eltDefaultLable = new ELTDefaultLable("Lookup\nMapping");
		eltSuDefaultSubgroupComposite.attachWidget(eltDefaultLable);

		setPropertyHelpWidget((Control) eltDefaultLable.getSWTWidgetControl());

		final AbstractELTWidget eltDefaultButton;
		if(OSValidator.isMac()){
			eltDefaultButton = new ELTDefaultButton("Edit").buttonWidth(120);
		}else{
			eltDefaultButton = new ELTDefaultButton("Edit");
		}
		eltSuDefaultSubgroupComposite.attachWidget(eltDefaultButton);
		 LookupMappingGrid lookupMappingGridPopulatedFromTooTipAction=
        		 (LookupMappingGrid) getComponent().getTooltipInformation().get("hash_join_map").getPropertyValue();
		 if(lookupMappingGridPopulatedFromTooTipAction!=null)
		 lookupMappingGrid.setAddPassThroughFields(lookupMappingGridPopulatedFromTooTipAction.isAddPassThroughFields());
		 if(getComponent().isContinuousSchemaPropogationAllow())
		 getPropagatedSchema();
		 if(lookupMappingGrid.isAddPassThroughFields())
		 addPassThroughFields();
		((Button) eltDefaultButton.getSWTWidgetControl()).addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent e) {

				LookupMapDialog lookupMapDialog = new LookupMapDialog(((Button) eltDefaultButton.getSWTWidgetControl()).getShell(), getComponent(),
						lookupMappingGrid,propertyDialogButtonBar);

				lookupMapDialog.open();
				propagateInternalSchema();
				SchemaSyncUtility.INSTANCE.autoSyncSchema(getSchemaForInternalPropagation(), getComponent(), widgets);
				showHideErrorSymbol(widgets);
			}
		});
		propagateInternalSchema();
	}
	private void addPassThroughFields() {
		List<List<FilterProperties>> sourceFieldsListofList=lookupMappingGrid.getLookupInputProperties();
		for(int i=0;i<sourceFieldsListofList.size();i++)
		{
			for(FilterProperties filterProperties2:sourceFieldsListofList.get(i))
			{
			 String socketId="in"+i+"."+filterProperties2.getPropertyname();
			 if(!isSourceFieldAlreadyPresent(socketId))
			 {
			 LookupMapProperty lookupMapProperty=new LookupMapProperty();
			 lookupMapProperty.setSource_Field(socketId);
			 lookupMapProperty.setOutput_Field(filterProperties2.getPropertyname());
			 prependSocketIdForDuplicateOutputField(socketId, lookupMapProperty);
			 lookupMappingGrid.getLookupMapProperties().add(lookupMapProperty);
			 }
			}

		}
		lookupMappingGrid.setAddPassThroughFields(false);
	}
	private void prependSocketIdForDuplicateOutputField(String socketId, LookupMapProperty lookupMapProperty) {
		for(LookupMapProperty lookupMapProperty2:lookupMappingGrid.getLookupMapProperties())
		 {
			 if(lookupMapProperty2.getOutput_Field().contains(lookupMapProperty.getOutput_Field()))
			 {
				 lookupMapProperty.setOutput_Field(socketId.replace(".","_"));
				 break;
			 }
		 }
	}
	private boolean isSourceFieldAlreadyPresent(String socketId) {
		boolean isSourceFieldDuplicate=false;
		 for(LookupMapProperty lookupMapProperty2:lookupMappingGrid.getLookupMapProperties())
		 {
			 if(lookupMapProperty2.getSource_Field().contains(socketId))
			 {
				 isSourceFieldDuplicate=true;
				 break;
			 }
		 }
		return isSourceFieldDuplicate;
	}
	private Schema propagateInternalSchema() {
		if(lookupMappingGrid ==null){
			return null;
		}

		Schema internalSchema = getSchemaForInternalPropagation();
		internalSchema.getGridRow().clear();

		List<String> finalPassThroughFields=new LinkedList<String>();
		Map<String, String> finalMapFields=new LinkedHashMap<String, String>();

		Map<String,String> passThroughFieldsPortInfo = new LinkedHashMap<>();
		Map<String,String> mapFieldsPortInfo = new LinkedHashMap<>();

		List<LookupMapProperty> lookupMapRows = lookupMappingGrid.clone().getLookupMapProperties();

		List<GridRow> outputSchemaGridRowList = new LinkedList<>();

		for(LookupMapProperty row : lookupMapRows){

			if(!ParameterUtil.isParameter(row.getSource_Field())){
				GridRow inputFieldSchema = getInputFieldSchema(row.getSource_Field());
				GridRow outputFieldSchema = null;

				if(inputFieldSchema==null){
					outputFieldSchema = SchemaPropagationHelper.INSTANCE.createSchemaGridRow(row.getOutput_Field());
				}else{
					outputFieldSchema = getOutputFieldSchema(inputFieldSchema,row.getOutput_Field());
				}

				if(!StringUtils.isBlank(row.getSource_Field())){
					if(row.getSource_Field().trim().length() > 0){
						String[] sourceField = row.getSource_Field().split("\\.");
						if(sourceField.length == 2){
							if(row.getOutput_Field().equals(sourceField[1])){
								finalPassThroughFields.add(row.getOutput_Field());
								passThroughFieldsPortInfo.put(row.getOutput_Field(), sourceField[0]);
							}else{
								finalMapFields.put(sourceField[1], row.getOutput_Field());
								mapFieldsPortInfo.put(row.getOutput_Field(), sourceField[0]);
							}
						}
					}
				}

				outputSchemaGridRowList.add(outputFieldSchema);
			}
		}

		addPassthroughFieldsAndMappingFieldsToComponentOuputSchema(finalMapFields, finalPassThroughFields,passThroughFieldsPortInfo,mapFieldsPortInfo);

		internalSchema.getGridRow().addAll(outputSchemaGridRowList);
		return internalSchema;
	}

	private void addPassthroughFieldsAndMappingFieldsToComponentOuputSchema(Map<String, String> mapFields,
			List<String> passThroughFields, Map<String, String> passThroughFieldsPortInfo, Map<String, String> mapFieldsPortInfo) {
		ComponentsOutputSchema componentsOutputSchema = null;
		Map<String, ComponentsOutputSchema> schemaMap = (Map<String, ComponentsOutputSchema>) getComponent()
				.getProperties().get(Constants.SCHEMA_TO_PROPAGATE);
		if (schemaMap != null && schemaMap.get(Constants.FIXED_OUTSOCKET_ID) != null)
			componentsOutputSchema = schemaMap.get(Constants.FIXED_OUTSOCKET_ID);
		else {
			componentsOutputSchema = new ComponentsOutputSchema();
			schemaMap = new LinkedHashMap<>();
			schemaMap.put(Constants.FIXED_OUTSOCKET_ID, componentsOutputSchema);
		}
		getComponent().getProperties().put(Constants.SCHEMA_TO_PROPAGATE, schemaMap);
		componentsOutputSchema.getPassthroughFields().clear();
		componentsOutputSchema.getMapFields().clear();
		componentsOutputSchema.getPassthroughFieldsPortInfo().clear();
		componentsOutputSchema.getMapFieldsPortInfo().clear();

		componentsOutputSchema.getPassthroughFields().addAll(passThroughFields);
		componentsOutputSchema.getMapFields().putAll(mapFields);

		for(String field : passThroughFieldsPortInfo.keySet()){
			componentsOutputSchema.getPassthroughFieldsPortInfo().put(field, passThroughFieldsPortInfo.get(field));
		}

		componentsOutputSchema.getMapFieldsPortInfo().putAll(mapFieldsPortInfo);
	}

	private GridRow getOutputFieldSchema(GridRow inputFieldSchema,
			String output_Field) {
		if(inputFieldSchema!=null)
		{
			GridRow gridRow = inputFieldSchema.copy();
			gridRow.setFieldName(output_Field);
			return gridRow.copy();
		}
		return null;
	}

	private GridRow getInputFieldSchema(String source_Field) {

		String[] source = source_Field.split("\\.");
		if(source.length == 2){
			return getInputFieldSchema(source[1],source[0]);
		}else{
			return null;
		}
	}

	private GridRow getInputFieldSchema(String fieldName,String linkNumber) {
		ComponentsOutputSchema outputSchema = null;
		for (Link link : getComponent().getTargetConnections()) {

			if(linkNumber.equals(link.getTargetTerminal())){
				outputSchema = SchemaPropagation.INSTANCE.getComponentsOutputSchema(link);
				if (outputSchema != null){
					for (GridRow row : outputSchema.getSchemaGridOutputFields(null)) {
						if(row.getFieldName().equals(fieldName)){
							return row.copy();
						}
					}
				}
			}
		}
		return null;
	}

	private void getPropagatedSchema() {
		List<List<FilterProperties>> sorceFieldList = SchemaPropagationHelper.INSTANCE
				.sortedFiledNamesBySocketId(getComponent());
		if (sorceFieldList != null)
			lookupMappingGrid.setLookupInputProperties(sorceFieldList);

	}

	@Override
	public LinkedHashMap<String, Object> getProperties() {
		property.put(propertyName, lookupMappingGrid);
		return property;
	}

	@Override
	public boolean isWidgetValid() {
		return validateAgainstValidationRule(lookupMappingGrid);
	}

	@Override
	public void addModifyListener(Property property,  ArrayList<AbstractWidget> widgetList) {
		widgets=widgetList;

	}
}


text:
using Skele.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Skele.Input
{
    class InputMapper
    {
        private Dictionary<string, MappingBase> mappings;

        public IMapping<T> Map<T>(string command) where T : ICommand, new()
        {
            var m = new MappingImpl<T>();
            mappings.Add(command, m);

            return m;
        }

        public ICommand Parse(string[] args)
        {
            if (args == null || args.Length == 0)
            {
                throw new ArgumentException("args must not be null or empty.");
            }

            if (mappings.ContainsKey(args[0]))
            {
                return mappings[args[0]].CreateCommand(
                    args.Skip(1).ToArray());
            }

            throw new InvalidOperationException(string.Format("Unrecognized command: {0}", args[0]));
        }

        private abstract class MappingBase
        {
            public abstract ICommand CreateCommand(string[] args);
        }

        private class MappingImpl<T> : MappingBase, IMapping<T> where T : ICommand, new()
        {
            private Dictionary<string, Action<T, string>> args;
            private Dictionary<string, Action<T>> switches;
            private Func<T> factory;
            private Action<T> initializer;

            public MappingImpl()
            {
                args = new Dictionary<string, Action<T, string>>();
                switches = new Dictionary<string, Action<T>>();
                factory = () => new T();
            }

            public override ICommand CreateCommand(string[] args)
            {
                var command = factory();

                if (initializer != null)
                {
                    initializer(command);
                }

                foreach (var a in args)
                {
                    if (a.StartsWith("/") || a.StartsWith("-"))
                    {
                        var parts = a.Substring(1).Split('=');
                        var name = parts[0];

                        if (parts.Length == 1)
                        {
                            TriggerSwitch(command, parts[0]);
                        }
                        else
                        {
                            TriggerArg(command, parts[0], parts[1]);
                        }
                    }
                }

                return command;
            }

            private void TriggerSwitch(T command, string name)
            {
                if (switches.ContainsKey(name))
                {
                    switches[name](command);
                }
            }

            private void TriggerArg(T command, string name, string value)
            {
                if (args.ContainsKey(name))
                {
                    args[name](command, value);
                }
            }

            public IMapping<T> Arg(string name, Action<T, string> setter)
            {
                args.Add(name, setter);
                return this;
            }

            public IMapping<T> Switch(string code, Action<T> setter)
            {
                switches.Add(code, setter);
                return this;
            }

            public IMapping<T> Factory(Func<T> factory)
            {
                this.factory = factory;
                return this;
            }

            public IMapping<T> Init(Action<T> initializerd)
            {
                this.initializer = initializer;
                return this;
            }
        }

        public interface IMapping<T> where T : ICommand
        {
            IMapping<T> Init(Action<T> initializer);

            IMapping<T> Arg(string name, Action<T, string> setter);

            IMapping<T> Factory(Func<T> factory);

            IMapping<T> Switch(string code, Action<T> setter);
        }
    }
}

redpajama_set_name: RedPajamaGithub


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
in Wang, Zhuang & Li, Acta Mycol. Sin. 2(1): 7 (1983)

#### Original name
Aecidium holboelliae Y.C. Wang & J.Y. Zhuang, 1983

### Remarks
null


text:
'use strict';

const boom = require('boom');
const schema = require('screwdriver-data-schema');
const urlLib = require('url');

module.exports = () => ({
    method: 'POST',
    path: '/banners',
    config: {
        description: 'Create a new banner',
        notes: 'Create a specific banner',
        tags: ['api', 'banners'],
        auth: {
            strategies: ['token'],
            scope: ['user', '!guest']
        },
        plugins: {
            'hapi-swagger': {
                security: [{ token: [] }]
            }
        },
        handler: (request, reply) => {
            const { bannerFactory } = request.server.app;
            const username = request.auth.credentials.username;
            const scmContext = request.auth.credentials.scmContext;

            // lookup whether user is admin
            const adminDetails = request.server.plugins.banners
                .screwdriverAdminDetails(username, scmContext);

            // verify user is authorized to create banners
            // return unauthorized if not system admin
            if (!adminDetails.isAdmin) {
                return reply(boom.forbidden(
                    `User ${adminDetails.userDisplayName}` +
                    'does not have Screwdriver administrative privileges.'
                ));
            }

            // define banner config for creation
            const config = Object.assign({}, request.payload, { createdBy: username });

            return bannerFactory.create(config)
                .then((banner) => {
                    const location = urlLib.format({
                        host: request.headers.host,
                        port: request.headers.port,
                        protocol: request.server.info.protocol,
                        pathname: `${request.path}/${banner.id}`
                    });

                    return reply(banner.toJson()).header('Location', location).code(201);
                })
                .catch(err => reply(boom.boomify(err)));
        },
        validate: {
            payload: schema.models.banner.create
        }
    }
});


text:
package com.microsoft.azure.management.sql.implementation;

import com.microsoft.azure.management.apigeneration.LangDefinition;
import com.microsoft.azure.management.resources.fluentcore.arm.ResourceId;
import com.microsoft.azure.management.resources.fluentcore.arm.collection.implementation.ReadableWrappersImpl;
import com.microsoft.azure.management.resources.fluentcore.model.implementation.RefreshableWrapperImpl;
import com.microsoft.azure.management.resources.fluentcore.utils.PagedListConverter;
import com.microsoft.azure.management.sql.ServiceTierAdvisor;
import com.microsoft.azure.management.sql.SloUsageMetric;
import com.microsoft.azure.management.sql.SloUsageMetricInterface;
import org.joda.time.DateTime;
import rx.Observable;

import java.util.List;
import java.util.UUID;

/**
 * Implementation for Azure SQL Database's service tier advisor.
 */
@LangDefinition
class ServiceTierAdvisorImpl
        extends RefreshableWrapperImpl<ServiceTierAdvisorInner, ServiceTierAdvisor>
        implements ServiceTierAdvisor {
    private final ResourceId resourceId;
    private final DatabasesInner databasesInner;
    private List<SloUsageMetricInterface> sloUsageMetrics;

    protected ServiceTierAdvisorImpl(ServiceTierAdvisorInner innerObject, DatabasesInner databasesInner) {
        super(innerObject);
        this.resourceId = ResourceId.fromString(this.inner().id());
        this.databasesInner = databasesInner;
    }

    @Override
    public String name() {
        return this.inner().name();
    }

    @Override
    public String id() {
        return this.inner().id();
    }

    @Override
    public String resourceGroupName() {
        return this.resourceId.resourceGroupName();
    }

    @Override
    public String sqlServerName() {
        return this.resourceId.parent().parent().name();
    }

    @Override
    public String databaseName() {
        return this.resourceId.parent().name();
    }

    @Override
    public DateTime observationPeriodStart() {
        return this.inner().observationPeriodStart();
    }

    @Override
    public DateTime observationPeriodEnd() {
        return this.inner().observationPeriodEnd();
    }

    @Override
    public double activeTimeRatio() {
        return this.inner().activeTimeRatio();
    }

    @Override
    public double minDtu() {
        return this.inner().minDtu();
    }

    @Override
    public double avgDtu() {
        return this.inner().avgDtu();
    }

    @Override
    public double maxDtu() {
        return this.inner().maxDtu();
    }

    @Override
    public double maxSizeInGB() {
        return this.inner().maxSizeInGB();
    }

    @Override
    public List<SloUsageMetricInterface> serviceLevelObjectiveUsageMetrics() {
        if (sloUsageMetrics == null) {
            PagedListConverter<SloUsageMetric, SloUsageMetricInterface> converter = new PagedListConverter<SloUsageMetric, SloUsageMetricInterface>() {
                @Override
                public SloUsageMetricInterface typeConvert(SloUsageMetric sloUsageMetricInner) {

                    return new SloUsageMetricImpl(sloUsageMetricInner);
                }
            };

            sloUsageMetrics = converter.convert(ReadableWrappersImpl.convertToPagedList(this.inner().serviceLevelObjectiveUsageMetrics()));
        }
        return sloUsageMetrics;
    }

    @Override
    public String currentServiceLevelObjective() {
        return this.inner().currentServiceLevelObjective();
    }

    @Override
    public UUID currentServiceLevelObjectiveId() {
        return this.inner().currentServiceLevelObjectiveId();
    }

    @Override
    public String usageBasedRecommendationServiceLevelObjective() {
        return this.inner().usageBasedRecommendationServiceLevelObjective();
    }

    @Override
    public UUID usageBasedRecommendationServiceLevelObjectiveId() {
        return this.inner().currentServiceLevelObjectiveId();
    }

    @Override
    public String databaseSizeBasedRecommendationServiceLevelObjective() {
        return this.inner().databaseSizeBasedRecommendationServiceLevelObjective();
    }

    @Override
    public UUID databaseSizeBasedRecommendationServiceLevelObjectiveId() {
        return this.inner().databaseSizeBasedRecommendationServiceLevelObjectiveId();
    }

    @Override
    public String disasterPlanBasedRecommendationServiceLevelObjective() {
        return this.inner().disasterPlanBasedRecommendationServiceLevelObjective();
    }

    @Override
    public UUID disasterPlanBasedRecommendationServiceLevelObjectiveId() {
        return this.inner().disasterPlanBasedRecommendationServiceLevelObjectiveId();
    }

    @Override
    public String overallRecommendationServiceLevelObjective() {
        return this.inner().overallRecommendationServiceLevelObjective();
    }

    @Override
    public UUID overallRecommendationServiceLevelObjectiveId() {
        return this.inner().overallRecommendationServiceLevelObjectiveId();
    }

    @Override
    public double confidence() {
        return this.inner().confidence();
    }

    @Override
    protected Observable<ServiceTierAdvisorInner> getInnerAsync() {
        sloUsageMetrics = null;

        return this.databasesInner.getServiceTierAdvisorAsync(this.resourceGroupName(), this.sqlServerName(), this.databaseName(), this.name());
    }
}


text:
package controllers;

import models.Project;
import models.User;
import models.enumeration.Operation;
import org.apache.commons.lang.ArrayUtils;
import org.apache.commons.lang3.StringUtils;
import org.tmatesoft.svn.core.internal.server.dav.handlers.DAVHandlerFactory;
import play.mvc.*;
import playRepository.PlayRepository;
import playRepository.RepositoryService;
import utils.*;

import javax.servlet.ServletException;
import java.io.IOException;
import java.io.PipedInputStream;
import java.net.URISyntaxException;

public class SvnApp extends Controller {
    private static final String[] WEBDAV_METHODS = {
        DAVHandlerFactory.METHOD_PROPFIND,
        DAVHandlerFactory.METHOD_REPORT,
        DAVHandlerFactory.METHOD_TRACE,
        DAVHandlerFactory.METHOD_PROPPATCH,
        DAVHandlerFactory.METHOD_COPY,
        DAVHandlerFactory.METHOD_MOVE,
        DAVHandlerFactory.METHOD_LOCK,
        DAVHandlerFactory.METHOD_UNLOCK,
        DAVHandlerFactory.METHOD_MKCOL,
        DAVHandlerFactory.METHOD_VERSION_CONTROL,
        DAVHandlerFactory.METHOD_MKWORKSPACE,
        DAVHandlerFactory.METHOD_MKACTIVITY,
        DAVHandlerFactory.METHOD_CHECKIN,
        DAVHandlerFactory.METHOD_CHECKOUT,
        DAVHandlerFactory.METHOD_MERGE
    };

    public static boolean isWebDavMethod(String method) {
        for (String webDavMethod : WEBDAV_METHODS) {
            if (StringUtils.equalsIgnoreCase(webDavMethod, method)) {
                return true;
            }
        }
        return false;
    }

    @With(BasicAuthAction.class)
    @BodyParser.Of(value = BodyParser.Raw.class, maxLength = Integer.MAX_VALUE)
    public static Result serviceWithPath(String path) throws ServletException, IOException, InterruptedException {
        return service();
    }

    @With(BasicAuthAction.class)
    @BodyParser.Of(value = BodyParser.Raw.class, maxLength = Integer.MAX_VALUE)
    public static Result service() throws ServletException, IOException, InterruptedException {
        // FIXME DAVServlet 들어내고 싶다.
        String path;
        try {
            path = new java.net.URI(request().uri()).getPath();
        } catch (URISyntaxException e) {
            return badRequest();
        }

        // If the url starts with slash, remove the slash.
        if (path.startsWith("/")) {
            path = path.substring(1);
        }

        // Split the url into three segments: "svn", userName, pathInfo
        String[] segments = path.split("/", 3);
        if (segments.length < 3) {
            return forbidden();
        }

        // Get userName and pathInfo from path segments.
        final String userName = segments[1];
        String pathInfo = segments[2];

        // Get projectName from the pathInfo.
        String projectName = pathInfo.split("/", 2)[0];

        // if user is anon, currentUser is null
        User currentUser = UserApp.currentUser();
        // Check the user has a permission to access this repository.
        Project project = Project.findByOwnerAndProjectName(userName, projectName);

        if (project == null) {
            return notFound();
        }

        PlayRepository repository = RepositoryService.getRepository(project);
        if (!AccessControl.isAllowed(currentUser, repository.asResource(),
                getRequestedOperation(request().method()))) {
            if (currentUser.isAnonymous()) {
                return BasicAuthAction.unauthorized(response());
            } else {
                return forbidden("You have no permission to access this repository.");
            }
        }

        // Start DAV Service
        PlayServletResponse response = startDavService(userName, pathInfo);

        // Wait until the status code is decided by the DAV service.
        // After that, get the status code.
        int status = response.waitAndGetStatus();

        // Send the response.
        UserApp.currentUser().visits(project);
        return sendResponse(status, response.getInputStream());
    }

    /**
     * WebDAV 서비스를 시작한다.
     *
     * @param ownerName 저장소 소유자의 이름. 저장소의 부모 경로를 얻기 위해 필요하다.
     * @param pathInfo
     */
    private static PlayServletResponse startDavService(final String ownerName, String pathInfo) throws IOException {
        // For DavServlet, transform HTTP request and HTTP response in this context to
        // ServletRequest and ServletResponse
        final PlayServletRequest request = new PlayServletRequest(request(),
                UserApp.currentUser().loginId, pathInfo);
        final PlayServletResponse response = new PlayServletResponse(response());

        new Thread() {
            @Override
            public void run() {
                try {
                    RepositoryService.createDavServlet(ownerName).service(request, response);
                    response.flushBuffer();
                    response.getOutputStream().close();
                } catch (Exception e) {
                    response.setStatus(500);
                    response.getStatusLock().notifyAll();
                    play.Logger.error("Failed to process a SVN request.", e);
                }
            }
        }.start();

        return response;
    }

    /**
     * 상태코드에 맞게 적절히 응답을 돌려준다.
     *
     * 1xx, 204, 304는 message body가 없어야 하며, 205는 길이가 0인 message body를 가져야만 한다.
     *
     * @param statusCode
     * @param input
     * @return
     */
    private static Result sendResponse(int statusCode, PipedInputStream input) {
        if (statusCode < 200 || statusCode == 204 || statusCode == 304) {
            // 1xx, 204 and 304 MUST NOT include message body.
            return status(statusCode);
        } else if (statusCode == 205) {
            // 205 MUST include message body of zero length.
            return status(statusCode, "");
        } else {
            return status(statusCode, input);
        }
    }

    private static Operation getRequestedOperation(String method) {
        if (DAVHandlerFactory.METHOD_OPTIONS.equals(method)
                || DAVHandlerFactory.METHOD_PROPFIND.equals(method)
                || DAVHandlerFactory.METHOD_GET.equals(method)
                || DAVHandlerFactory.METHOD_REPORT.equals(method)) {
            return Operation.READ;
        } else {
            return Operation.UPDATE;
        }
    }

}


text:
* { padding:0; margin:0; outline:0; }
body {
	background:#f9ebae;
	font-family: Verdana, sans-serif;
	font-size:11px;
	line-height:14px;
	color:#5e5e5e;
}
input, textarea, select { font-family: Verdana, sans-serif; font-size:13px; }
textarea { overflow:hidden; }

.field { border:solid 1px #d3cfc7; background:#fff; padding:5px; }
.small-field { border:solid 1px #d3cfc7; background:#fff; padding:3px 1px; font-size:11px; }

.checkbox { width:13px; height:13px; vertical-align:top; position:relative; top:2px; }

.button { background:#eee url(../img/images/button.gif) repeat-x 0 0; border:solid 1px #b1a874; color:#7f7f7f; font-size:11px; padding:2px 6px 2px 6px; cursor:pointer; line-height:14px !important; }
.button:hover { color:#333; border-color:#857b42; }

.field:focus { color:#000; border-color:#857b42;}

a img { border:0; }

a { color:#ba4c32; text-decoration: underline; cursor:pointer; }
a:hover { color:#8d341f; text-decoration: none;}

.left, .alignleft { float:left; display:inline; }
.right, .alignright { float:right; display:inline; }

.cl { font-size:0; line-height:0; clear:both; display:block; height:0; }

.al { text-align: left; }
.ar { text-align: right; }
.ac { text-align: center !important; }

h1{ font-size:22px; line-height:24px; color:#fff; font-weight: normal;}
h1 a{ color:#fff; text-decoration: none; }
h2 { font-size:15px; font-weight: normal; }
h3 { font-size:12px; line-height:14px; font-weight: normal; }
h3 a{ text-decoration: none; }

.shell { width:988px; margin:0 auto; }

#header { height:89px; background:url(../img/images/header.gif); white-space:nowrap; }
#header h1{ float:left; display:inline; padding-top:12px; }
#top-navigation { float:right; white-space:nowrap; color:#fff; padding-top:15px; }
#top-navigation a{ color:#fff; }
#top-navigation span{ color:#dca598; }
#top { height:53px; }

#navigation { height:36px;}
#navigation ul{ list-style-type: none;}
#navigation ul li{ float:left; display:inline; margin-right:2px;}
#navigation ul li a,
#navigation ul li a span { float:left; width: 100px; height:36px; background:url(../img/images/tab.gif) no-repeat 0 0; padding:0 0 0 15px;}
#navigation ul li a span { background-position:right 0; padding:0 15px 0 0;}
#navigation ul li a { line-height:36px; color:#907525; text-decoration: none; }

#navigation ul li a.active,
#navigation ul li a:hover { background-position:0 bottom;}

#navigation ul li a.active span,
#navigation ul li a:hover span{ background-position:right bottom;}

#navigation ul li a.active { font-size:12px; font-weight: bold; color:#887e42; }

#container { padding:20px 0;}

.small-nav { color:#978b48; padding-bottom:20px; }
.small-nav a{ color:#6f6636; }

#main {}
#content { float:left; width:750px; }
#sidebar { float:right; width:225px; }

.table {}
.table th{ background:#fffdfa url(../img/images/th.gif) repeat-x 0 0; color:#818181; text-align: left; padding:7px 10px; border-bottom:solid 1px #d2d1cb;}
.table td{ background:#fbfcfc;  border-bottom:solid 1px #e0e0e0; padding:8px 10px; }
.table tr.odd td{ background:#f8f8f8; }
.table tr:hover td{ background:#fff9e1; }
.table a.ico{ }

.box { background:#fbfcfc; height:100%; padding:1px; margin-bottom:20px; }
.box-head { background:#ba4c32; height:32px; color:#fff; padding: 0 10px; line-height:32px; white-space:nowrap; border-bottom:solid 1px #fff; }
.box-head .right{ padding-top:5px; line-height:13px;}
.box-head .right label,
.box-head .right input { float:left; }
.box-head .right label { padding:4px 0 0 0;}
.box-head .right input { margin-left:5px;}

.pagging { height:20px; padding:8px 10px; line-height:19px; color:#949494; }
.pagging a{ background:url(../img/images/pagging.gif) repeat-x 0 0; height:20px; float:left; padding:0 8px; border:solid 1px #d5d5d5; text-decoration: none; color:#949494; margin-left:5px;  }
.pagging a:hover { border-color:#8c3521; background:#ba4c32; color:#fff; }
.pagging span{ float:left; margin-left:5px; padding-top:2px; }

a.ico { color:#9d9c9a; font-size:10px; text-decoration: none; padding:0 0 0 14px; background-repeat:no-repeat; background-position:0 0; }
a.ico:hover { color:#333;}
a.del { background-image:url(../img/images/del.gif)}
a.edit { background-image:url(../img/images/edit.gif); margin-left:14px;}

.form { padding:15px 10px 5px 10px; }
.form label{ display:block; font-weight: bold; font-size:13px; padding-bottom:4px; }
.form label span{ color:#999; font-weight: normal;}
.form .field { display:block; }
.form .inline-field .field { display:inline;}
.form .req { font-size:13px; float:right; white-space:nowrap; color:#999;  }
.form p{ padding-bottom:15px; }

.size1 { width:716px; }
.size2 { width:80px; }
.size3 { width:120px; }
textarea.size1 { height:180px; }

.buttons { text-align: right; padding:10px; background:#eee; border-top:solid 1px #e0e0e0; }
.buttons .button{ margin-left:3px;}

.box-content { padding:10px; }

.sort { border-top:solid 1px #e0e0e0; padding-top:10px; margin-top:15px;   }
.sort label{ display:block; font-weight: bold;}
.sort .field{ display:block; margin-top:5px; }
.sort select.field{ width:203px; }

.box-content p { padding-top:10px; }
.select-all{}
.select-all label{ text-decoration: underline; padding-left:4px; }

.add-button,
.add-button span { float:left; height:26px; background:url(../img/images/add-button.gif) no-repeat 0 0; padding:0 0 0 28px; }
.add-button span { background-position:right 0; padding:0 10px 0 0; }
.add-button { font-weight: bold; font-size:12px; color:#747474; text-decoration: none; line-height:26px; }
.add-button:hover { color:#333;}

#footer { height:44px; background:url(../img/images/footer.gif); line-height:44px; color:#fff;}
#footer a{ color:#fff; }

.msg { position:relative; padding-right:35px; margin-bottom:10px; }
.msg p{ padding:9px 10px 9px 40px; font-size:12px; background-repeat:no-repeat; background-position:10px 5px;}
.msg a.close{ font-size:0; line-height:0; position:absolute; top:0; right:0; width:34px; height:34px; background:url(../img/images/close.gif); text-indent: -4000px;}

.msg-ok p{ background-color:#fffac2; border:solid 1px #dbd6a2; color:#5e5c40; background-image:url(../img/images/msg-ok.gif); }
.msg-error p{ background-color:#f3c598; border:solid 1px #e8b084; color:#ba4c32; background-image:url(../img/images/msg-error.gif);  }

/*** CSS3 ***/
.box { -moz-border-radius:5px; -webkit-border-radius:5px; -moz-box-shadow: 0 0 6px #978f6c; -webkit-box-shadow: 0 0 6px #978f6c; min-height: 440px;}
.box-head { -moz-border-radius-topleft:5px; -moz-border-radius-topright:5px; -webkit-border-top-left-radius:5px; -webkit-border-top-right-radius:5px; }

.field, .button { -moz-border-radius:4px; -webkit-border-radius:4px; }
.small-field, .button, .pagging a { -moz-border-radius:3px; -webkit-border-radius:3px; }

.msg p { -moz-border-radius:6px; -webkit-border-radius:6px; }

.button { -moz-box-shadow: 0 0 2px #978f6c; -webkit-box-shadow: 0 0 2px #978f6c;}
#flashMessage{
     margin-bottom: 10px;
    padding-right: 35px;
    position: relative;
     background-color: #F3C598;
    background-image: url("images/msg-error.gif");
    border: 1px solid #E8B084;
    color: #BA4C32;
    font-size: 15px;
    height: 30px;
}
.error-message{
    color:red;
}


text:
package org.wso2.andes.kernel;

import org.wso2.andes.framing.AMQShortString;
import org.wso2.andes.framing.BasicContentHeaderProperties;
import org.wso2.andes.framing.ContentHeaderBody;
import org.wso2.andes.framing.FieldTable;
import org.wso2.andes.framing.abstraction.MessagePublishInfo;
import org.wso2.andes.server.message.AMQMessage;
import org.wso2.andes.server.message.CustomMessagePublishInfo;
import org.wso2.andes.server.message.MessageMetaData;
import org.wso2.andes.server.queue.QueueEntry;
import org.wso2.andes.server.store.StorableMessageMetaData;

import java.nio.ByteBuffer;

import static org.wso2.andes.kernel.AndesConstants.JMSX_DELIVERY_COUNT_HEADER;

/**
 * Will handle cloning of metadata at an even where AMQP message is published
 */
public class AMQPMetaDataHandler {

    /**
     * Update message metadata for AMQP; after an update of the routing key and the exchange of a message, for
     * durable topic subscriptions.
     *
     * @param routingKey       routing key of the message
     * @param buf              buffer of the original metadata
     * @param originalMetadata source metadata that needs to be copied
     * @param exchange         exchange of the message
     * @return copy of the metadata as a byte array
     */
    public static byte[] constructMetadata(String routingKey, ByteBuffer buf, StorableMessageMetaData originalMetadata,
                                           String exchange, long arrivalTime) {
        ContentHeaderBody contentHeaderBody = ((MessageMetaData) originalMetadata).getContentHeaderBody();
        int contentChunkCount = ((MessageMetaData) originalMetadata).getContentChunkCount();
        long sessionID = ((MessageMetaData) originalMetadata).getPublisherSessionID();

        //Set expiration value to 0 to indicate no expiration
        BasicContentHeaderProperties props = (BasicContentHeaderProperties) contentHeaderBody.getProperties();
        if (props.getExpiration() != 0) {
            props.setExpiration(0);
        }

        // modify routing key to the binding name
        MessagePublishInfo messagePublishInfo = new CustomMessagePublishInfo(originalMetadata);
        messagePublishInfo.setRoutingKey(new AMQShortString(routingKey));
        messagePublishInfo.setExchange(new AMQShortString(exchange));
        MessageMetaData modifiedMetaData = new MessageMetaData(messagePublishInfo, contentHeaderBody, sessionID,
                                                               contentChunkCount, arrivalTime);

        final int bodySize = 1 + modifiedMetaData.getStorableSize();
        byte[] underlying = new byte[bodySize];
        underlying[0] = (byte) modifiedMetaData.getType().ordinal();
        buf = java.nio.ByteBuffer.wrap(underlying);
        buf.position(1);
        buf = buf.slice();
        modifiedMetaData.writeToBuffer(0, buf);

        return underlying;
    }

    /**
     * Update message metadata for AMQP; to indicate the message is a compressed one.
     *
     * @param buf                       buffer of the original metadata
     * @param originalMetadata          source metadata that needs to be copied
     * @param newCompressedMessageValue Value to indicate if the message is compressed or not
     * @return copy of the metadata as a byte array
     */
    public static byte[] constructMetadata(ByteBuffer buf, StorableMessageMetaData originalMetadata,
                                           boolean newCompressedMessageValue) {
        ContentHeaderBody contentHeaderBody = ((MessageMetaData) originalMetadata).getContentHeaderBody();
        int contentChunkCount = ((MessageMetaData) originalMetadata).getContentChunkCount();
        long arrivalTime = ((MessageMetaData) originalMetadata).getArrivalTime();
        long sessionID = ((MessageMetaData) originalMetadata).getPublisherSessionID();

        //Modify message metadata, to update if the message is compressed or not
        MessagePublishInfo messagePublishInfo = new CustomMessagePublishInfo(originalMetadata);
        MessageMetaData modifiedMetaData = new MessageMetaData(messagePublishInfo, contentHeaderBody, sessionID,
                contentChunkCount, arrivalTime, newCompressedMessageValue);

        BasicContentHeaderProperties cdf = (BasicContentHeaderProperties)contentHeaderBody.getProperties();
        FieldTable headers = cdf.getHeaders();
        headers.setInteger("JMSXDeliveryCount", 5);

        //bodySize = (1 for metadata type) + (size of metadata)
        final int bodySize = modifiedMetaData.getStorableSize() + 1;

        byte[] underlying = new byte[bodySize];

        //Writing metadata into a byte array
        //Write metadata type: as a position in its enum declaration
        underlying[0] = (byte) modifiedMetaData.getType().ordinal();

        //Wraps byte array into a buffer. Modifications to the buffer will cause the array.
        buf = java.nio.ByteBuffer.wrap(underlying);

        buf.position(1);

        //Creates a new byte buffer whose content is a shared subsequence of this buffer's content. Content of the
        // new buffer will start at this buffer's current position.
        buf = buf.slice();

        //Writing modified metadata into the buffer
        modifiedMetaData.writeToBuffer(0, buf);

        return underlying;
    }

    /**
     * Set Integer property to message.
     *
     * @param message AMQMessage to set the property
     * @param count count to set
     */
    public static void setIntProperty(AMQMessage message, int count) {
        StorableMessageMetaData metaData = message.getMessageMetaData();
        ContentHeaderBody contentHeaderBody = ((MessageMetaData) metaData).getContentHeaderBody();
        BasicContentHeaderProperties cdf = (BasicContentHeaderProperties)contentHeaderBody.getProperties();
        FieldTable headers = cdf.getHeaders();
        headers.setInteger(JMSX_DELIVERY_COUNT_HEADER, count);
        /*
         * This step is mandatory as clearEncodedForm() needs
         * to be called to clear buffer and rebuild it from updated headers
         */
        ((BasicContentHeaderProperties)message.getMessageMetaData()
                .getContentHeaderBody().getProperties()).setHeaders(headers);
    }
}


text:
/**
 * @fileOverview Property operations.
 */
define(['exports',
        'bes/object',
        'atum/compute',
        'atum/builtin/operations/object',
        'atum/operations/boolean',
        'atum/operations/error',
        'atum/operations/func',
        'atum/operations/object',
        'atum/operations/string',
        'atum/operations/undef',
        'atum/operations/value_reference',
        'atum/value/boolean',
        'atum/value/property',
        'atum/value/undef',
        'atum/value/value'],
function(exports,
        amulet_object,
        compute,
        object_builtin,
        boolean,
        error,
        func,
        object,
        string,
        undef,
        value_reference,
        boolean_value,
        property,
        undef_value,
        value) {
"use strict";

/* Descriptor Operations
 ******************************************************************************/
/**
 * Create a hosted object from a property descriptor.
 */
var fromPropertyDescriptor = function(desc) {
    if (!desc)
        return undef.UNDEFINED;

    var properties = {
        'enumerable':  property.createValuePropertyFlags(
            boolean_value.create(desc.enumerable),
            property.ALL),

        'configurable': property.createValuePropertyFlags(
            boolean_value.create(desc.configurable),
            property.ALL)
    };

    if (property.isDataDescriptor(desc)) {
        properties['value'] = property.createValuePropertyFlags(
            desc.value || undef_value.UNDEFINED,
            property.ALL);

        properties['writable'] = property.createValuePropertyFlags(
            boolean_value.create(desc.writable),
            property.ALL);
    } else {
        properties['get'] = property.createValuePropertyFlags(
            desc.get || undef_value.UNDEFINED,
            property.ALL);

        properties['set'] = property.createValuePropertyFlags(
            desc.set || undef_value.UNDEFINED,
            property.ALL);
    }

    return compute.bind(object_builtin.create(), function(obj) {
        return object.defineProperties(obj, properties)
    });
};
/**
 * Convert a hosted object to a property descriptor.
 *
 * @TODO: ugly
 */
var toPropertyDescriptor = (function(){
    var getProperty = function(obj, prop, f, desc) {
        return compute.branch(object.hasProperty(obj, prop),
            compute.binds(
                compute.enumeration(
                    compute.bind(object.get(obj, prop), f),
                    desc),
                function(x, desc) {
                    return compute.just(amulet_object.setProperty(desc, prop, x, true));
                }),
            desc);
    };

    var isCallable = function(ref) {
        return compute.branch(func.isCallable(ref),
            compute.just(ref),
            error.typeError());
    };

    return function(obj) {
        return value_reference.dereference(obj, function(t) {
            if (!value.isObject(t))
                return error.typeError();

            return compute.bind(
                getProperty(t, 'set', isCallable,
                getProperty(t, 'get', isCallable,
                getProperty(t, 'writable', boolean.isTrue,
                getProperty(t, 'value', compute.just,
                getProperty(t, 'configurable', boolean.isTrue,
                getProperty(t, 'enumerable', boolean.isTrue,
                compute.just(new property.Property))))))),
                function(desc) {
                    if (desc.get || desc.set) {
                        if (desc.value || desc.writable)
                            return error.typeError();
                    }
                    return compute.just(desc);
                });
        });
    };
}());

/* Exports
 ******************************************************************************/
exports.fromPropertyDescriptor = fromPropertyDescriptor;
exports.toPropertyDescriptor = toPropertyDescriptor;

});


text:
package org.gluu.oxtrust.service;

import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;
import java.util.List;
import java.util.Properties;

import javax.enterprise.context.ApplicationScoped;
import javax.faces.context.FacesContext;
import javax.inject.Inject;
import javax.inject.Named;

import org.gluu.model.ApplicationType;
import org.gluu.model.AuthenticationScriptUsageType;
import org.gluu.model.ProgrammingLanguage;
import org.gluu.model.ScriptLocationType;
import org.gluu.model.SmtpConfiguration;
import org.gluu.model.custom.script.CustomScriptType;
import org.gluu.oxtrust.model.GluuConfiguration;
import org.gluu.oxtrust.model.GluuOxTrustStat;
import org.gluu.persist.PersistenceEntryManager;
import org.gluu.service.metric.MetricService;
import org.gluu.util.StringHelper;
import org.gluu.util.security.StringEncrypter.EncryptionException;
import org.slf4j.Logger;

/**
 * GluuConfiguration service
 *
 * @author Reda Zerrad Date: 08.10.2012
 */
@ApplicationScoped
@Named("configurationService")
public class ConfigurationService implements Serializable {

    private static final long serialVersionUID = 8842838732456296435L;

    @Inject
    private Logger log;

    @Inject
    private PersistenceEntryManager persistenceEntryManager;

    @Inject
    private OrganizationService organizationService;

    @Inject
    private EncryptionService encryptionService;

    @Inject
    private MetricService metricService;

    private static final SimpleDateFormat PERIOD_DATE_FORMAT = new SimpleDateFormat("yyyyMM");
    DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");

    public boolean contains(String configurationDn) {
        return persistenceEntryManager.contains(configurationDn, GluuConfiguration.class);
    }

    /**
     * Add new configuration
     *
     * @param configuration
     *            Configuration
     */
    public void addConfiguration(GluuConfiguration configuration) {
        persistenceEntryManager.persist(configuration);
    }

    /**
     * Update configuration entry
     *
     * @param configuration
     *            GluuConfiguration
     */
    public void updateConfiguration(GluuConfiguration configuration) {
        try {
            persistenceEntryManager.merge(configuration);
        } catch (Exception e) {
            log.info("", e);
        }
    }

    public void updateOxtrustStat(GluuOxTrustStat oxTrustStat) {
        try {
            persistenceEntryManager.merge(oxTrustStat);
        } catch (Exception e) {
            log.info("", e);
        }

    }

    /**
     * Check if LDAP server contains configuration with specified attributes
     *
     * @return True if configuration with specified attributes exist
     */
    public boolean containsConfiguration(String dn) {
        return persistenceEntryManager.contains(dn, GluuConfiguration.class);
    }

    /**
     * Get configuration by inum
     *
     * @param inum
     *            Configuration Inum
     * @return Configuration
     * @throws Exception
     */
    public GluuConfiguration getConfigurationByInum(String inum) {
        return persistenceEntryManager.find(GluuConfiguration.class, getDnForConfiguration());
    }

    /**
     * Get configuration
     *
     * @return Configuration
     * @throws Exception
     */
    public GluuConfiguration getConfiguration(String[] returnAttributes) {
        GluuConfiguration result = null;
        result = persistenceEntryManager.find(getDnForConfiguration(), GluuConfiguration.class, returnAttributes);
        return result;
    }

    public GluuOxTrustStat getOxtrustStat(String[] returnAttributes) {
    	Date statDate = new Date();
    	String statDn = metricService.buildDn(LocalDateTime.now().format(formatter), statDate, ApplicationType.OX_TRUST);

    	GluuOxTrustStat result = new GluuOxTrustStat();
        if (persistenceEntryManager.contains(statDn, GluuOxTrustStat.class)) {
            result = persistenceEntryManager.find(statDn, GluuOxTrustStat.class, returnAttributes);
        } else {
            result.setDn(statDn);

            metricService.prepareBranch(statDate, ApplicationType.OX_TRUST);
            persistenceEntryManager.persist(result);
        }
        return result;
    }

    /**
     * Get configuration
     *
     * @return Configuration
     * @throws Exception
     */
    public GluuConfiguration getConfiguration() {
        return getConfiguration(null);
    }

    public GluuOxTrustStat getOxtrustStat() {
        return getOxtrustStat(null);
    }

    /**
     * Get all configurations
     *
     * @return List of attributes
     * @throws Exception
     */
    public List<GluuConfiguration> getConfigurations() {
        return persistenceEntryManager.findEntries(getDnForConfiguration(), GluuConfiguration.class, null);
    }

    /**
     * Build DN string for configuration
     *
     * @return DN string for specified configuration or DN for configurations branch
     *         if inum is null
     * @throws Exception
     */
    public String getDnForConfiguration() {
        String baseDn = organizationService.getBaseDn();
        return String.format("ou=configuration,%s", baseDn);
    }

    public AuthenticationScriptUsageType[] getScriptUsageTypes() {
        return new AuthenticationScriptUsageType[] { AuthenticationScriptUsageType.INTERACTIVE,
                AuthenticationScriptUsageType.SERVICE, AuthenticationScriptUsageType.BOTH };
    }

    public ProgrammingLanguage[] getProgrammingLanguages() {
        return new ProgrammingLanguage[] { ProgrammingLanguage.PYTHON };
    }

    public ScriptLocationType[] getLocationTypes() {
        return new ScriptLocationType[] { ScriptLocationType.LDAP, ScriptLocationType.FILE };
    }

    public CustomScriptType[] getCustomScriptTypes() {
        return new CustomScriptType[] { CustomScriptType.PERSON_AUTHENTICATION, CustomScriptType.CONSENT_GATHERING,
                CustomScriptType.UPDATE_USER, CustomScriptType.USER_REGISTRATION, CustomScriptType.CLIENT_REGISTRATION,
                CustomScriptType.DYNAMIC_SCOPE, CustomScriptType.ID_GENERATOR, CustomScriptType.CACHE_REFRESH,
                CustomScriptType.UMA_RPT_POLICY, CustomScriptType.UMA_CLAIMS_GATHERING, CustomScriptType.UMA_RPT_CLAIMS,
                CustomScriptType.INTROSPECTION, CustomScriptType.RESOURCE_OWNER_PASSWORD_CREDENTIALS,
                CustomScriptType.APPLICATION_SESSION, CustomScriptType.END_SESSION, CustomScriptType.SCIM,
                CustomScriptType.POST_AUTHN, CustomScriptType.PERSISTENCE_EXTENSION, CustomScriptType.IDP,
                CustomScriptType.REVOKE_TOKEN };
    }

    public CustomScriptType[] getOthersCustomScriptTypes() {
        return new CustomScriptType[] { CustomScriptType.CONSENT_GATHERING, CustomScriptType.UPDATE_USER,
                CustomScriptType.USER_REGISTRATION, CustomScriptType.CLIENT_REGISTRATION,
                CustomScriptType.DYNAMIC_SCOPE, CustomScriptType.ID_GENERATOR, CustomScriptType.CACHE_REFRESH,
                CustomScriptType.UMA_RPT_POLICY, CustomScriptType.UMA_CLAIMS_GATHERING, CustomScriptType.UMA_RPT_CLAIMS,
                CustomScriptType.INTROSPECTION, CustomScriptType.RESOURCE_OWNER_PASSWORD_CREDENTIALS,
                CustomScriptType.APPLICATION_SESSION, CustomScriptType.END_SESSION, CustomScriptType.SCIM,
                CustomScriptType.POST_AUTHN, CustomScriptType.PERSISTENCE_EXTENSION, CustomScriptType.IDP,
                CustomScriptType.REVOKE_TOKEN, CustomScriptType.UPDATE_TOKEN, CustomScriptType.CIBA_END_USER_NOTIFICATION };
    }

    public void encryptSmtpPassword(SmtpConfiguration smtpConfiguration) {
        if (smtpConfiguration == null) {
            return;
        }
        String password = smtpConfiguration.getPasswordDecrypted();
        if (StringHelper.isNotEmpty(password)) {
            try {
                String encryptedPassword = encryptionService.encrypt(password);
                smtpConfiguration.setPassword(encryptedPassword);
            } catch (EncryptionException ex) {
                log.error("Failed to encrypt SMTP password", ex);
            }
        }
    }

    public void decryptSmtpPassword(SmtpConfiguration smtpConfiguration) {
        if (smtpConfiguration == null) {
            return;
        }
        String password = smtpConfiguration.getPassword();
        if (StringHelper.isNotEmpty(password)) {
            try {
                smtpConfiguration.setPasswordDecrypted(encryptionService.decrypt(password));
            } catch (EncryptionException ex) {
                log.error("Failed to decrypt SMTP password", ex);
            }
        }
    }

    public void encryptKeyStorePassword(SmtpConfiguration smtpConfiguration) {
        if (smtpConfiguration == null) {
            return;
        }
        String keyStorePassword = smtpConfiguration.getKeyStorePasswordDecrypted();
        if (StringHelper.isNotEmpty(keyStorePassword)) {
            try {
                String encryptedKeyStorePassword = encryptionService.encrypt(keyStorePassword);
                smtpConfiguration.setKeyStorePassword(encryptedKeyStorePassword);
            } catch (EncryptionException ex) {
                log.error("Failed to encrypt KeyStore password", ex);
            }
        }
    }

    public void decryptKeyStorePassword(SmtpConfiguration smtpConfiguration) {
        if (smtpConfiguration == null) {
            return;
        }
        String keyStorePassword = smtpConfiguration.getKeyStorePassword();
        if (StringHelper.isNotEmpty(keyStorePassword)) {
            try {
                smtpConfiguration.setKeyStorePasswordDecrypted(encryptionService.decrypt(keyStorePassword));
            } catch (EncryptionException ex) {
                log.error("Failed to decrypt KeyStore password", ex);
            }
        }
    }

    public String getVersion() {
        String version = getClass().getPackage().getImplementationVersion();
        if (version == null) {
            Properties prop = new Properties();
            try (InputStream is = FacesContext.getCurrentInstance().getExternalContext()
                    .getResourceAsStream("/META-INF/MANIFEST.MF")) {
            	if (is != null) {
	                prop.load(is);
	                version = prop.getProperty("Implementation-Version");
            	}
            } catch (IOException e) {
                log.error(e.toString());
            }
        }
        log.info("Starting App version " + version);
        if (version != null) {
            version = version.replace("-SNAPSHOT", "");
            return version;
        }
        return "";
    }

}


text:
FILE(REMOVE_RECURSE
  "CMakeFiles/filter_utilities.dir/src/filter_utilities.cpp.o"
  "devel/lib/libfilter_utilities.pdb"
  "devel/lib/libfilter_utilities.so"
)

# Per-language clean rules from dependency scanning.
FOREACH(lang CXX)
  INCLUDE(CMakeFiles/filter_utilities.dir/cmake_clean_${lang}.cmake OPTIONAL)
ENDFOREACH(lang)


text:
#include "common.h"
#include "language.h"
#include "locale.h"

Language::Language() {
	this->config = NULL;
	this->log = NULL;
}

Language::Language(Config *config) {
	setConfig(config);
}

Language::~Language() {
	if (this->isTranslation) delete this->map;
	delete this->locale;
}

void Language::init() {
	/* set locale */
	locale = new Locale();
	this->isTranslation = true;

	string root = config->get("config.directory") + '/';

	string filename;
	/* language_COUNTRY */
	filename = root + toLower(this->locale->toString()) + ".language";
	if (!fileExists(filename)) {
		/* language */
		filename = root + this->locale->getLanguage() + ".language";
		if (!fileExists(filename)) {
			/* default */
			filename = root + "default.language";
			if (!fileExists(filename)) this->isTranslation = false;
		}
	}

	if (isTranslation) {
		this->map = new Parameter();
		this->map->loadFromFile(filename);
	}

}

void Language::setConfig(Config *config) {
	this->config = config;
	this->log = config->getLog();
	init();
}

string Language::getText(const string str) {
	if (this->isTranslation) {
		string trans = this->map->get(str);
		if (!trans.empty()) return trans;
	}

	return str;
}

Locale *Language::getLocale() {
	return this->locale;
}


text:
This cookbook installs a selected set of browsers.
The following recipes may apply:

- `browsers::default`  - purges unselected packages and includes recipes as nedeed.
- `browsers::chrome`   - installs __Google Chrome Stable__ and suggested packages.
- `browsers::chromium` - installs __Chromium__ and suggested packages.
- `browsers::firefox`  - installs __Mozilla Firefox__ and suggested packages.
- `browsers::midori`   - installs __Midori__ and suggested packages.
- `browsers::opera`    - installs __Opera__ and suggested packages.

## Requirements

This cookbook applies to the following platforms:
- `CrunchBang 11+`
- `Linux Mint 17+`
- `Ubuntu 14.04+`

#### cookbooks
- `core`

#### recipes
- `core::default`

## Usage

#### browsers::default
Just include `browsers` in your node's `run_list`:

```json
{
  "name":"my_node",
  "run_list": [
    "recipe[browsers]"
  ]
}
```

## Contact

By Email:   carles.ml.dev at gmail dot com
On Twitter: [@zuzudev](https://twitter.com/zuzudev)
On Google+: [Carles Muiños](https://plus.google.com/109480759201585988691)

## License

Copyright (c) 2013,2014 Carles Muiños

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](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.


text:
class ProfileSyncService;
class ProgressMarkerWatcher;

// Waits until all provided clients have finished committing any unsynced items
// and downloading each others' udpates.
//
// This requires that "self-notifications" be enabled.  Otherwise the clients
// will not fetch the latest progress markers on their own, and the latest
// progress markers are needed to confirm that clients are in sync.
//
// There is a race condition here.  If we manage to perform the check at
// precisely the wrong time, we could end up seeing stale snapshot state
// (crbug.com/95742), which would make us think that the client has finished
// syncing when it hasn't.  In practice, this race is rare enough that it
// doesn't cause test failures.
class QuiesceStatusChangeChecker : public StatusChangeChecker {
 public:
  explicit QuiesceStatusChangeChecker(
      std::vector<ProfileSyncService*> services);
  virtual ~QuiesceStatusChangeChecker();

  // Timeout length for this operation.  Default is 45s.
  virtual base::TimeDelta GetTimeoutDuration();

  // Blocks until all clients have quiesced or we time out.
  void Await();

  // A callback function for some helper objects.
  void OnServiceStateChanged(ProfileSyncService* service);

  // A callback for when the time limit is exceeded.
  void OnTimeout();

  virtual bool IsExitConditionSatisfied() OVERRIDE;
  virtual std::string GetDebugMessage() const OVERRIDE;

  bool TimedOut() const;

 private:
  std::vector<ProfileSyncService*> services_;
  ScopedVector<ProgressMarkerWatcher> observers_;
  bool timed_out_;

  DISALLOW_COPY_AND_ASSIGN(QuiesceStatusChangeChecker);
};

#endif  // CHROME_BROWSER_SYNC_TEST_INTEGRATION_QUIESCE_STATUS_CHANGE_CHECKER_H_


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
	android:layout_height="wrap_content" android:layout_width="fill_parent"
	android:background="@android:color/background_light">

	<TextView android:text="" android:id="@+id/chatRowText"
		android:layout_width="wrap_content" android:layout_height="wrap_content"
		android:background="@android:color/background_light"
		android:textColor="@android:color/primary_text_light"></TextView>

</LinearLayout>


text:
package codechicken.translocator;

import java.util.Map;

import org.lwjgl.opengl.GL11;

import codechicken.core.ClientUtils;
import codechicken.lib.math.MathHelper;
import codechicken.lib.colour.CustomGradient;
import codechicken.lib.render.CCModel;
import codechicken.lib.render.CCRenderState;
import codechicken.lib.render.RenderUtils;
import codechicken.lib.vec.Matrix4;
import codechicken.lib.vec.SwapYZ;
import codechicken.lib.vec.Vector3;
import codechicken.translocator.TileItemTranslocator.MovingItem;
import codechicken.translocator.TileLiquidTranslocator.MovingLiquid;
import codechicken.translocator.TileTranslocator.Attachment;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.fluids.FluidStack;

import static codechicken.lib.vec.Rotation.*;

public class TileTranslocatorRenderer extends TileEntitySpecialRenderer
{
    public static Vector3[] sidePos = new Vector3[]{
        new Vector3(0.5, 0, 0.5),
        new Vector3(0.5, 1, 0.5),
        new Vector3(0.5, 0.5, 0),
        new Vector3(0.5, 0.5, 1),
        new Vector3(0, 0.5, 0.5),
        new Vector3(1, 0.5, 0.5)};
    public static Vector3[] sideVec = new Vector3[]{
        new Vector3( 0,-1, 0),
        new Vector3( 0, 1, 0),
        new Vector3( 0, 0,-1),
        new Vector3( 0, 0, 1),
        new Vector3(-1, 0, 0),
        new Vector3( 1, 0, 0)};

    public static CCModel[] plates = new CCModel[6];
    public static CCModel insert;

    static
    {
        Map<String, CCModel> models = CCModel.parseObjModels(new ResourceLocation("translocator", "models/model.obj"), new SwapYZ());
        plates[0] = models.get("Plate");
        insert = models.get("Insert");
        CCModel.generateSidedModels(plates, 0, new Vector3());
    }

    private CustomGradient gradient = new CustomGradient(new ResourceLocation("translocator", "textures/grad.png"));

    public TileTranslocatorRenderer()
    {
    }

    @Override
    public void renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f)
    {
        TileTranslocator ttrans = (TileTranslocator)tileentity;
        double time = ClientUtils.getRenderTime();

        CCRenderState.reset();
        CCRenderState.changeTexture("translocator:textures/tex.png");
        CCRenderState.pullLightmap();
        CCRenderState.useNormals = true;
        CCRenderState.setColour(-1);
        CCRenderState.startDrawing(4);

        for(int i = 0; i < 6; i++)
        {
            Attachment a = ttrans.attachments[i];
            if(a != null)
                renderAttachment(i, ttrans.getBlockMetadata(),
                        MathHelper.interpolate(a.b_insertpos, a.a_insertpos, f),
                        a.getIconIndex(),
                        x, y, z);
        }
        CCRenderState.draw();

        if(ttrans instanceof TileItemTranslocator)
        {
            TileItemTranslocator titrans = (TileItemTranslocator)ttrans;
            for(MovingItem m : titrans.movingItems)
            {
                GL11.glPushMatrix();
                double d = MathHelper.interpolate(m.b_progress, m.a_progress, f);
                    Vector3 pos = getPath(m.src, m.dst, d)
                            .add(itemFloat(m.src, m.dst, d));
                    GL11.glTranslated(x+pos.x, y+pos.y-0.06, z+pos.z);
                    GL11.glScaled(0.35, 0.35, 0.35);

                    RenderUtils.renderItemUniform(m.stack);
                GL11.glPopMatrix();
            }
        }
        if(ttrans instanceof TileLiquidTranslocator)
        {
            TileLiquidTranslocator tltrans = (TileLiquidTranslocator)ttrans;
            for(MovingLiquid m : tltrans.movingLiquids())
            {
                double start = MathHelper.interpolate(m.b_start, m.a_start, f);
                double end = MathHelper.interpolate(m.b_end, m.a_end, f);

                drawLiquidSpiral(m.src, m.dst, m.liquid, start, end, time, 0, x, y, z);
                if(m.fast)
                    drawLiquidSpiral(m.src, m.dst, m.liquid, start, end, time, 0.5, x, y, z);
            }
        }

        GL11.glDisable(GL11.GL_LIGHTING);
        GL11.glEnable(GL11.GL_BLEND);
        GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
        CCRenderState.changeTexture("translocator:textures/particle.png");
        CCRenderState.startDrawing(7);
        for(int src = 0; src < 6; src++)
        {
            Attachment asrc = ttrans.attachments[src];
            if(asrc == null || !asrc.a_eject)
                continue;

            for(int dst = 0; dst < 6; dst++)
            {
                Attachment adst = ttrans.attachments[dst];
                if(adst != null && !adst.a_eject)
                    renderLink(src, dst, time, ttrans.xCoord, ttrans.yCoord, ttrans.zCoord);
            }
        }
        CCRenderState.draw();
        GL11.glDisable(GL11.GL_BLEND);
        GL11.glEnable(GL11.GL_LIGHTING);
    }

    private void drawLiquidSpiral(int src, int dst, FluidStack stack, double start, double end, double time, double theta0, double x, double y, double z)
    {
        IIcon tex = RenderUtils.prepareFluidRender(stack, 255);

        CCRenderState.startDrawing(7);
        Tessellator t = Tessellator.instance;
        t.setTranslation(x, y, z);

        Vector3[] last = new Vector3[]{new Vector3(), new Vector3(), new Vector3(), new Vector3()};
        Vector3[] next = new Vector3[]{new Vector3(), new Vector3(), new Vector3(), new Vector3()};
        double tess = 0.05;

        Vector3 a = getPerp(src, dst);
        boolean rev = sum(a.copy().crossProduct(getPathNormal(src, dst, 0))) != sum(sideVec[src]);

        for(double di = end; di <= start; di+=tess)
        {
            Vector3 b = getPathNormal(src, dst, di);
            Vector3 c = getPath(src, dst, di);

            if(rev)
                b.negate();

            double r = (2*di-time/10+theta0+dst/6)*2*Math.PI;
            double sz = 0.1;
            Vector3 p = c.add(a.copy().multiply(MathHelper.sin(r)*sz)).add(b.copy().multiply(MathHelper.cos(r)*sz));

            double s1 = 0.02;
            double s2 =-0.02;
            next[0].set(p).add(a.x*s1+b.x*s1, a.y*s1+b.y*s1, a.z*s1+b.z*s1);
            next[1].set(p).add(a.x*s2+b.x*s1, a.y*s2+b.y*s1, a.z*s2+b.z*s1);
            next[2].set(p).add(a.x*s2+b.x*s2, a.y*s2+b.y*s2, a.z*s2+b.z*s2);
            next[3].set(p).add(a.x*s1+b.x*s2, a.y*s1+b.y*s2, a.z*s1+b.z*s2);

            if(di > end)
            {
                double u1 = tex.getInterpolatedU(Math.abs(di)*16);
                double u2 = tex.getInterpolatedU(Math.abs(di-tess)*16);
                for(int i = 0; i < 4; i++)
                {
                    int j = (i+1)%4;
                    Vector3 axis = next[j].copy().subtract(next[i]);
                    double v1 = tex.getInterpolatedV(Math.abs(next[i].scalarProject(axis))*16);
                    double v2 = tex.getInterpolatedV(Math.abs(next[j].scalarProject(axis))*16);
                    t.addVertexWithUV(next[i].x, next[i].y, next[i].z, u1, v1);
                    t.addVertexWithUV(next[j].x, next[j].y, next[j].z, u1, v2);
                    t.addVertexWithUV(last[j].x, last[j].y, last[j].z, u2, v2);
                    t.addVertexWithUV(last[i].x, last[i].y, last[i].z, u2, v1);
                }
            }

            Vector3[] tmp = last;
            last = next;
            next = tmp;
        }

        CCRenderState.draw();
        t.setTranslation(0, 0, 0);

        RenderUtils.postFluidRender();
    }

    private double sum(Vector3 v)
    {
        return v.x+v.y+v.z;
    }

    private void renderLink(int src, int dst, double time, int x, int y, int z)
    {
        double d = ((time+src+dst*2)%10)/6;
        //0 is head
        for(int n = 0; n < 20; n++)
        {
            double dn = d-n*0.1;
            int spriteX = (int) (7-n*1.5-d*2);
            if(!MathHelper.between(0, dn, 1) || spriteX < 0)
                continue;

            Vector3 pos = getPath(src, dst, dn).add(x, y, z);
            double b = 1;//d*0.6+0.4;
            double s = 1;//d*0.6+0.4;

            double u1 = spriteX/8D;
            double u2 = u1+1/8D;
            double v1 = 0;
            double v2 = 1;

            RenderParticle.render(pos.x, pos.y, pos.z, gradient.getColour((dn-0.5)*1.2+0.5).multiplyC(b), s*0.12, u1, v1, u2, v2);
        }
    }

    private Vector3 itemFloat(int src, int dst, double d)
    {
        return getPerp(src, dst).multiply(0.01*MathHelper.sin(d*4*Math.PI));
    }

    public static Vector3 getPath(int src, int dst, double d)
    {
        Vector3 v;
        if((src^1) == dst)//opposite
            v = sideVec[src^1].copy().multiply(d);
        else
        {
            Vector3 vsrc = sideVec[src^1];
            Vector3 vdst = sideVec[dst^1];
            Vector3 a = vsrc.copy().multiply(5/16D);
            Vector3 b = vdst.copy().multiply(6/16D);
            double sind = MathHelper.sin(d*Math.PI/2);
            double cosd = MathHelper.cos(d*Math.PI/2);
            v = a.multiply(sind).add(b.multiply(cosd-1)).add(vsrc.copy().multiply(3/16D));
        }
        return v.add(sidePos[src]);
    }

    public static Vector3 getPerp(int src, int dst)
    {
        if((src^1) == dst)
            return sideVec[(src+2)%6].copy();

        for(int i = 0; i < 3; i++)
            if(i != src/2 && i != dst/2)
                return sideVec[i*2].copy();

        return null;
    }

    private static Vector3 getPathNormal(int src, int dst, double d)
    {
        if((src^1) == dst)
            return sideVec[(src+4)%6].copy();

        double sind = MathHelper.sin(d*Math.PI/2);
        double cosd = MathHelper.cos(d*Math.PI/2);

        Vector3 vsrc = sideVec[src^1].copy();
        Vector3 vdst = sideVec[dst^1].copy();

        return vsrc.multiply(sind).add(vdst.multiply(cosd)).normalize();
    }

    public static void renderAttachment(int i, int type, double insertpos, int field, double x, double y, double z)
    {
        double tx = field/64D;
        double ty = type/2D;

        plates[i].render(x+0.5, y+0.5, z+0.5, tx, ty);

        Matrix4 matrix = new Matrix4()
            .translate(new Vector3(x+0.5, y+0.5, z+0.5))
            .apply(sideRotations[i])
            .translate(new Vector3(0, -0.5, 0))
            .scale(new Vector3(1, insertpos*2/3+1/3D, 1));

        insert.render(matrix, tx, ty);
    }
}


text:
This test demonstrates the new JSX functionality of TypeScript.

Note that React is not actually bundled here.

This particular test demonstrates the "preserve" capability of TypeScript. In order to be
used with React it needs to be further transformed with Babel (as seen in this example).

See [this blog post](http://www.jbrantly.com/typescript-and-jsx/) for more information about JSX in TypeScript.


text:
title: "JIRA"
version: 1.0
weight: 2
---

**ENTERPRISE: Built-in integrations are available for [Sensu Enterprise][1]
users only.**

# JIRA Integration

- [Overview](#overview)
- [Configuration](#configuration)
  - [Example(s)](#examples)
  - [Integration specification](#integration-specification)
    - [`jira` attributes](#jira-attributes)

## Overview

Create and resolve [Jira][2] issues for [Sensu events][3].

## Configuration

### Example(s)

The following is an example global configuration for the `jira` enterprise
event handler (integration).

~~~ json
{
  "jira": {
    "host": "jira.example.com",
    "user": "admin",
    "password": "secret",
    "project": "Sensu",
    "timeout": 10
  }
}
~~~

### Integration Specification

#### `jira` attributes

The following attributes are configured within the `{"jira": {} }`
[configuration scope][4].

`host`
: description
  : The JIRA host address.
: required
  : true
: type
  : String
: example
  : ~~~ shell
    "host": "jira.example.com"
    ~~~

`user`
: description
  : The JIRA user used to authenticate.
: required
  : true
: type
  : String
: example
  : ~~~ shell
    "user": "admin"
    ~~~

`password`
: description
  : The JIRA user password.
: required
  : true
: type
  : String
: example
  : ~~~ shell
    "password": "secret"
    ~~~

`project`
: description
  : The JIRA project to use for issues.
: required
  : false
: type
  : String
: default
  : `Sensu`
: example
  : ~~~ shell
    "project": "Alerts"
    ~~~

`project_key`
: description
  : The JIRA project key to use for issues. This option allows the
  integration to work without querying JIRA for a projects key. Using
  this option is recommended.
: required
  : false
: type
  : String
: example
  : ~~~ shell
    "project_key": "SEN"
    ~~~

`root_url`
: description
  : The JIRA root URL. When set, this option overrides the `host`
  option, most commonly used when a service proxy is in use.
: required
  : false
: type
  : String
: example
  : ~~~ shell
    "root_url": "https://services.example.com/proxy/jira"
    ~~~

`timeout`
: description
  : The handler execution duration timeout in seconds (hard stop).
: required
  : false
: type
  : Integer
: default
  : `10`
: example
  : ~~~ shell
    "timeout": 30
    ~~~

[?]:  #
[1]:  /enterprise
[2]:  https://www.atlassian.com/software/jira
[3]:  ../../reference/events.html
[4]:  ../../reference/configuration.html#configuration-scopes


text:
Set-Variable -Scope Global -Name SolutionDir -Option readonly -Value ($env:APPVEYOR_BUILD_FOLDER).TrimEnd('\');
Set-Variable -Scope Global -Name ConfigurationName -Option readonly -Value $env:Configuration;
Set-Variable -Scope Global -Name PackagesDir -Option readonly -Value "$($env:USERPROFILE)\.nuget\packages";

# psCheckPoint Test Variables
Set-Variable -Scope Global -Name Settings -Description "psCheckPoint Pester Settings" -Option readonly -Value $(Get-Content -ErrorAction Stop "$env:APPVEYOR_BUILD_FOLDER\run\Settings.json" | ConvertFrom-Json);

Write-Host -ForegroundColor Yellow "Import-Module $env:APPVEYOR_BUILD_FOLDER\psCheckPoint\bin\$ConfigurationName\psCheckPoint.psd1 -Force";
Import-Module $env:APPVEYOR_BUILD_FOLDER\psCheckPoint\bin\$ConfigurationName\psCheckPoint.psd1 -Force;


text:
package org.project.openbaton.nubomedia.paas.messages;

import org.project.openbaton.nubomedia.paas.model.persistence.Port;
import org.project.openbaton.nubomedia.paas.model.persistence.SupportingService;
import org.project.openbaton.nubomedia.paas.model.persistence.openbaton.Flavor;
import org.project.openbaton.nubomedia.paas.model.persistence.openbaton.QoS;

import java.util.List;

/**
 * Created by maa on 28.09.15.
 */
public class NubomediaCreateAppRequest {

  private String gitURL;
  private String name;
  private List<Port> ports;
  private Flavor flavor;
  private int replicasNumber;
  private String secretName;
  private QoS qualityOfService;
  private boolean cloudRepository;
  private boolean cdnConnector;
  private boolean turnServerActivate;
  private String turnServerUrl;
  private String turnServerUsername;
  private String turnServerPassword;
  private boolean stunServerActivate;
  private String stunServerIp;
  private String stunServerPort;
  private int numberOfInstances;
  private int scaleOutLimit;
  private double scaleOutThreshold;
  private List<SupportingService> services;

  public NubomediaCreateAppRequest() {}

  public String getGitURL() {
    return gitURL;
  }

  public void setGitURL(String gitURL) {
    this.gitURL = gitURL;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public List<Port> getPorts() {
    return ports;
  }

  public void setPorts(List<Port> ports) {
    this.ports = ports;
  }

  public Flavor getFlavor() {
    return flavor;
  }

  public void setFlavor(Flavor flavor) {
    this.flavor = flavor;
  }

  public int getReplicasNumber() {
    return replicasNumber;
  }

  public void setReplicasNumber(int replicasNumber) {
    this.replicasNumber = replicasNumber;
  }

  public String getSecretName() {
    return secretName;
  }

  public void setSecretName(String secretName) {
    this.secretName = secretName;
  }

  public QoS getQualityOfService() {
    return qualityOfService;
  }

  public void setQualityOfService(QoS qualityOfService) {
    this.qualityOfService = qualityOfService;
  }

  public boolean isCloudRepository() {
    return cloudRepository;
  }

  public void setCloudRepository(boolean cloudRepository) {
    this.cloudRepository = cloudRepository;
  }

  public boolean isTurnServerActivate() {
    return turnServerActivate;
  }

  public void setTurnServerActivate(boolean turnServerActivate) {
    this.turnServerActivate = turnServerActivate;
  }

  public String getTurnServerUrl() {
    return turnServerUrl;
  }

  public void setTurnServerUrl(String turnServerUrl) {
    this.turnServerUrl = turnServerUrl;
  }

  public String getTurnServerUsername() {
    return turnServerUsername;
  }

  public void setTurnServerUsername(String turnServerUsername) {
    this.turnServerUsername = turnServerUsername;
  }

  public String getTurnServerPassword() {
    return turnServerPassword;
  }

  public void setTurnServerPassword(String turnServerPassword) {
    this.turnServerPassword = turnServerPassword;
  }

  public boolean isStunServerActivate() {
    return stunServerActivate;
  }

  public void setStunServerActivate(boolean stunServerActivate) {
    this.stunServerActivate = stunServerActivate;
  }

  public String getStunServerIp() {
    return stunServerIp;
  }

  public void setStunServerIp(String stunServerIp) {
    this.stunServerIp = stunServerIp;
  }

  public String getStunServerPort() {
    return stunServerPort;
  }

  public void setStunServerPort(String stunServerPort) {
    this.stunServerPort = stunServerPort;
  }

  public int getScaleOutLimit() {
    return scaleOutLimit;
  }

  public void setScaleOutLimit(int scaleOutLimit) {
    this.scaleOutLimit = scaleOutLimit;
  }

  public double getScaleOutThreshold() {
    return scaleOutThreshold;
  }

  public void setScaleOutThreshold(double scaleOutThreshold) {
    this.scaleOutThreshold = scaleOutThreshold;
  }

  public boolean isCdnConnector() {
    return cdnConnector;
  }

  public void setCdnConnector(boolean cdnConnector) {
    this.cdnConnector = cdnConnector;
  }

  public List<SupportingService> getServices() {
    return services;
  }

  public void setServices(List<SupportingService> services) {
    this.services = services;
  }

  public int getNumberOfInstances() {
    return numberOfInstances;
  }

  public void setNumberOfInstances(int numberOfInstances) {
    this.numberOfInstances = numberOfInstances;
  }

  @Override
  public String toString() {
    return "NubomediaCreateAppRequest{"
        + "gitURL='"
        + gitURL
        + '\''
        + ", name='"
        + name
        + '\''
        + ", ports="
        + ports
        + ", flavor="
        + flavor
        + ", replicasNumber="
        + replicasNumber
        + ", secretName='"
        + secretName
        + '\''
        + ", qualityOfService="
        + qualityOfService
        + ", cloudRepository="
        + cloudRepository
        + ", cdnConnector="
        + cdnConnector
        + ", turnServerActivate="
        + turnServerActivate
        + ", turnServerUrl='"
        + turnServerUrl
        + '\''
        + ", turnServerUsername='"
        + turnServerUsername
        + '\''
        + ", turnServerPassword='"
        + turnServerPassword
        + '\''
        + ", stunServerActivate="
        + stunServerActivate
        + ", stunServerIp='"
        + stunServerIp
        + '\''
        + ", stunServerPort='"
        + stunServerPort
        + '\''
        + ", numberOfInstances="
        + numberOfInstances
        + ", scaleOutLimit="
        + scaleOutLimit
        + ", scaleOutThreshold="
        + scaleOutThreshold
        + ", services="
        + services
        + '}';
  }
}


text:
/***********************************************************************
    created:    21/2/2004
    author:     Paul D Turner

    purpose:    Defines class for a named collection of Event objects
*************************************************************************/
/***************************************************************************
 *   Copyright (C) 2004 - 2010 Paul D Turner & The CEGUI Development Team
 *
 *   Permission is hereby granted, free of charge, to any person obtaining
 *   a copy of this software and associated documentation files (the
 *   "Software"), to deal in the Software without restriction, including
 *   without limitation the rights to use, copy, modify, merge, publish,
 *   distribute, sublicense, and/or sell copies of the Software, and to
 *   permit persons to whom the Software is furnished to do so, subject to
 *   the following conditions:
 *
 *   The above copyright notice and this permission notice shall be
 *   included in all copies or substantial portions of the Software.
 *
 *   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 *   EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 *   MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 *   IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 *   OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 *   ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 *   OTHER DEALINGS IN THE SOFTWARE.
 ***************************************************************************/
#ifndef _CEGUIEventSet_h_
#define _CEGUIEventSet_h_

#include "CEGUI/Base.h"
#include "CEGUI/String.h"
#include "CEGUI/Event.h"
#include "CEGUI/IteratorBase.h"
#include <map>

#if defined (_MSC_VER)
#   pragma warning(push)
#   pragma warning(disable : 4251)
#endif

// Start of CEGUI namespace section
namespace CEGUI
{
/*!
\brief
    Interface providing event signaling and handling

    The EventSet is a means for code to attach a handler function to some
    named event, and later, for that event to be fired and the subscribed
    handler(s) called.

    Its purpose is similar to Qt's signal and slot system, you can think of
    Event name as the signal and the subscribed handler as the slot.

    Each Event has a name and a set of handlers. Handlers can be free functions,
    class member functions or even functors. Whenever an Event is fired all of
    its handlers are invoked. You are most likely looking for a way to react
    to mouse clicks or other events fired internally by CEGUI.

    The handlers have to have a very specific signature. They have to return
    bool and they have to take const EventArgs&. If this is not met you will
    encounter build errors!

\par Reacting to internal CEGUI events

\code{.cpp}
bool handler(const EventArgs& args)
{
    std::cout << "Don't you dare click me again!" << std::endl;

    // returning true means we handled the Event and it doesn't need to be
    // propagated any further
    return true;
}

void example()
{
    CEGUI::Window* wnd = ...;
    wnd->subscribeEvent(CEGUI::Window::EventMouseClick, &handler);
}
\endcode

\par A contrived example of various handler types

\code{.cpp}
bool freeFunction(const EventArgs& args)
{
    // your handler code here
}

// nothing special about this class!
class CustomClass
{
    public:
        bool memberFunction(const EventArgs& args)
        {
            // your handler code here
        }

        static bool staticMemberFunction(const EventArgs& args)
        {
            // your handler code here
        }

        bool memberFunctionWithArg(const EventArgs& args, bool something)
        {
            // your handler code here
        }
};

class Functor
{
    public:
        bool operator()(const EventArgs& args)
        {
            // your handler code here
        }
}

void example()
{
    CustomClass instance;

    CEGUI::Window* wnd = ...;

    // creates "CustomEvent", subscribes freeFunction to it
    wnd->subscribeEvent("CustomEvent", &freeFunction);
    // subscribes memberFunction of "instance" to CustomEvent
    wnd->subscribeEvent("CustomEvent", &CustomClass::memberFunction, &instance);
    // subscribes staticMemberFunction of CustomClass to CustomEvent
    wnd->subscribeEvent("CustomEvent", &CustomClass::staticMemberFunction);
    // subscribes Functor to CustomEvent, Functor instance is owned by EventSet
    // after this call, it will be destroyed by EventSet
    wnd->subscribeEvent("CustomEvent", Functor());

    // Advanced subscribers using boost::bind follow:

    // subscribes memberFunctionWithArg of CustomClass to CustomEvent
    wnd->subscribeEvent("CustomEvent", boost::bind(&CustomClass::memberFunctionWithArg, _1, _2, true), &instance);
    // same as above, binding the instance itself as well
    wnd->subscribeEvent("CustomEvent", boost::bind(&CustomClass::memberFunctionWithArg, instance, _1, true));

    // the following line causes all subscribed handlers to be called
    wnd->fireEvent("CustomEvent");
}
\endcode

\par EventSet works well with others
    The EventSet can also subscribe boost::function, std::function, functors
    created by boost::bind and possibly others. This is not a feature of
    CEGUI per se, just a fortunate side effect of being able to call functors.

\par Events are automatically created on demand
    As of CEGUI 0.5, the EventSet no longer needs to be filled with available events.
    Events are now added to the set as they are first used; that is, the first
    time a handler is subscribed to an event for a given EventSet, an Event
    object is created and added to the EventSet.

    Instead of throwing an exception when firing an event that does not actually
    exist in the set, we now do nothing (if the Event does not exist, then it
    has no handlers subscribed, and therefore doing nothing is the correct
    course action).
*/
class CEGUIEXPORT EventSet
{
public:
    /*!
    \brief
        Constructor for EventSet objects
    */
    EventSet();

    /*!
    \brief
        Destructor for EventSet objects
    */
    virtual ~EventSet(void);

    /*!
    \brief
        Creates a new Event object with the given name and adds it to the
        EventSet.

    \param name
        String object containing the name to give the new Event.  The name must
        be unique for the EventSet.

    \exception AlreadyExistsException
        Thrown if an Event already exists named \a name.
    */
    void addEvent(const String& name);

    /*!
    \brief
        Adds the given Event object to the EventSet.  Ownership of the object
        passes to EventSet and it will be deleted when it is removed from the
        EventSet - whether explicitly via removeEvent or when the EventSet
        is destroyed.

    \param event
        Reference to an Event or Event based object that is to be added to the
        EventSaet

    \exception AlreadyExistsException
        Thrown if the EventSet already contains an Event with the same name
        as \a event.  Note that \a event will be destroyed under this scenario.
    */
    void addEvent(Event& event);

    /*!
    \brief
        Removes the Event with the given name.  All connections to the event
        are disconnected, and the underlying Event object is destroyed.

    \param name
        String object containing the name of the Event to remove.  If no such
        Event exists, nothing happens.
    */
    void removeEvent(const String& name);

    /*!
    \brief
        Removes the given event from the EventSet.  All connections to the event
        are disconnected, and the event object is destroyed.

    \param event
        Reference to the Event or Event based object to be removed from the
        EventSet.
    */
    void removeEvent(Event& event);

    /*!
    \brief
        Remove all Event objects from the EventSet.  Add connections will be
        disconnected, and all Event objects destroyed.
    */
    void removeAllEvents(void);

    /*!
    \brief
        Checks to see if an Event with the given name is present in this
        EventSet.

    \return
        - true if an Event named \a name is defined for this EventSet.
        - false if no Event named \a name is defined for this EventSet.
    */
    bool isEventPresent(const String& name);

    /*!
    \brief
        Subscribes a handler to the named Event.  If the named Event is not yet
        present in the EventSet, it is created and added.

    \param name
        String object containing the name of the Event to subscribe to.

    \param subscriber
        Function or object that is to be subscribed to the Event.

    \return
        Connection object that can be used to check the status of the Event
        connection and to disconnect (unsubscribe) from the Event.
    */
    virtual Event::Connection subscribeEvent(const String& name,
                                             Event::Subscriber subscriber);

    /*!
    \brief
        Subscribes a handler to the specified group of the named Event.  If the
        named Event is not yet present in the EventSet, it is created and added.

    \param name
        String object containing the name of the Event to subscribe to.

    \param group
        Group which is to be subscribed to.  Subscription groups are called in
        ascending order.

    \param subscriber
        Function or object that is to be subscribed to the Event.

    \return
        Connection object that can be used to check the status of the Event
        connection and to disconnect (unsubscribe) from the Event.
    */
    virtual Event::Connection subscribeEvent(const String& name,
                                             Event::Group group,
                                             Event::Subscriber subscriber);

    /*!
    \copydoc EventSet::subscribeEvent

    \internal This is there just to make the syntax a tad easier
    */
    template<typename Arg1, typename Arg2>
    inline Event::Connection subscribeEvent(const String& name, Arg1 arg1, Arg2 arg2)
    {
        return subscribeEvent(name, Event::Subscriber(arg1, arg2));
    }

    /*!
    \copydoc EventSet::subscribeEvent

    \internal This is there just to make the syntax a tad easier
    */
    template<typename Arg1, typename Arg2>
    inline Event::Connection subscribeEvent(const String& name, Event::Group group, Arg1 arg1, Arg2 arg2)
    {
        return subscribeEvent(name, group, Event::Subscriber(arg1, arg2));
    }

    /*!
    \brief
        Subscribes the named Event to a scripted funtion

    \param name
        String object containing the name of the Event to subscribe to.

    \param subscriber_name
        String object containing the name of the script funtion that is to be
        subscribed to the Event.

    \return
        Connection object that can be used to check the status of the Event
        connection and to disconnect (unsubscribe) from the Event.
    */
    virtual Event::Connection subscribeScriptedEvent(const String& name,
                                                     const String& subscriber_name);

    /*!
    \brief
        Subscribes the specified group of the named Event to a scripted funtion.

    \param name
        String object containing the name of the Event to subscribe to.

    \param group
        Group which is to be subscribed to.  Subscription groups are called in
        ascending order.

    \param subscriber_name
        String object containing the name of the script funtion that is to be
        subscribed to the Event.

    \return
        Connection object that can be used to check the status of the Event
        connection and to disconnect (unsubscribe) from the Event.
    */
    virtual Event::Connection subscribeScriptedEvent(const String& name,
                                                     Event::Group group,
                                                     const String& subscriber_name);

    /*!
    \brief
        Fires the named event passing the given EventArgs object.

    \param name
        String object holding the name of the Event that is to be fired
        (triggered)

    \param args
        The EventArgs (or derived) object that is to be bassed to each
        subscriber of the Event.  Once all subscribers
        have been called the 'handled' field of the event is updated
        appropriately.

    \param eventNamespace
        String object describing the global event namespace prefix for this
        event.
    */
    virtual void fireEvent(const String& name, EventArgs& args,
                           const String& eventNamespace = "");

    /*!
    \brief
        Return whether the EventSet is muted or not.

    \return
        - true if the EventSet is muted.  All requests to fire events will be
          ignored.
        - false if the EventSet is not muted.  Requests to fire events are
          processed as normal.
    */
    bool isMuted(void) const;

    /*!
    \brief
        Set the mute state for this EventSet.

    \param setting
        - true if the EventSet is to be muted (no further event firing requests
          will be honoured until EventSet is unmuted).
        - false if the EventSet is not to be muted and all events should fired
          as requested.
    */
    void    setMutedState(bool setting);

    /*!
    \brief
        Return a pointer to the Event object with the given name, optionally
        adding such an Event object to the EventSet if it does not already
        exist.

    \param name
        String object holding the name of the Event to return.

    \param autoAdd
        - true if an Event object named \a name should be added to the set
          if such an Event does not currently exist.
        - false if no object should automatically be added to the set.  In this
          case, if the Event does not already exist 0 will be returned.

    \return
        Pointer to the Event object in this EventSet with the specifed name.
        Or 0 if such an Event does not exist and \a autoAdd was false.
    */
    Event* getEventObject(const String& name, bool autoAdd = false);

protected:
    //! Implementation event firing member
    void fireEvent_impl(const String& name, EventArgs& args);
    //! Helper to return the script module pointer or throw.
    ScriptModule* getScriptModule() const;

    // Do not allow copying, assignment, or any other usage than simple creation.
    EventSet(EventSet&) {}
    EventSet& operator=(EventSet&)
    {
        return *this;
    }

    typedef std::map<String, Event*, StringFastLessCompare> EventMap;
    EventMap    d_events;

    bool d_muted;    //!< true if events for this EventSet have been muted.

public:
    /*************************************************************************
        Iterator stuff
    *************************************************************************/
    typedef ConstMapIterator<EventMap> EventIterator;

    /*!
    \brief
        Return a EventSet::EventIterator object to iterate over the events currently
        added to the EventSet.
    */
    EventIterator getEventIterator(void) const;
};

} // End of  CEGUI namespace section

#if defined(_MSC_VER)
#   pragma warning(pop)
#endif

#endif  // end of guard _CEGUIEventSet_h_


text:
<?php

require_once('./../inc/header.inc.php');
require_once(BX_DIRECTORY_PATH_INC . 'design.inc.php');

bx_import('BxDolLanguages');

bx_require_authentication(true);

$sPage = bx_get('page');
$sPage = $sPage !== false ? bx_process_input($sPage) : '';

$oPage = new BxTemplStudioPolyglot($sPage);
$oPage->init();

$oTemplate = BxDolStudioTemplate::getInstance();
$oTemplate->setPageNameIndex($oPage->getPageIndex());
$oTemplate->setPageHeader($oPage->getPageHeader());
$oTemplate->setPageContent('page_caption_code', $oPage->getPageCaption());
$oTemplate->setPageContent('page_attributes', $oPage->getPageAttributes());
$oTemplate->setPageContent('page_menu_code', $oPage->getPageMenu());
$oTemplate->setPageContent('page_main_code', $oPage->getPageCode() . $oPage->getPageJsCode());
$oTemplate->addCss($oPage->getPageCss());
$oTemplate->addJs($oPage->getPageJs());
$oTemplate->getPageCode();
/** @} */