/**
 * ****************************************************************************
 *
 *  Contributors:
 *      IBM Corporation - initial API and implementation
 * *****************************************************************************
 */
package com.ibm.ws.ejbcontainer.cdi.jcdi.ejb;

import java.util.logging.Logger;
import javax.annotation.Resource;
import javax.ejb.Local;
import javax.ejb.Stateless;

/**
 * Stateless bean with multiple local interfaces that should be able to lookup a BeanManager.
 */
@Stateless(name = "MultiLocalStateless")
@Local({ MultiLocalStatelessOne.class, MultiLocalStatelessTwo.class })
public class MultiLocalStatelessBean {

    private static final String CLASS_NAME = MultiLocalStatelessBean.class.getName();

    private static final Logger svLogger = Logger.getLogger(CLASS_NAME);

    @Resource(name = "EJBName")
    private String ivEJBName = "MultiLocalStateless";

    /**
     * Returns the EJB name.
     */

{
        svLogger.info("- " + ivEJBName + ".getName() : ivEJBName");
        return ivEJBName;
    }

    /**
     * Returns the EJB name.
     */
    public String getEjbName() {
        svLogger.info("- " + ivEJBName + ".getEjbName() : ivEJBName");
        return ivEJBName;
    }
}


{
        svLogger.info("- " + ivEJBName + ".getName() : ivEJBName");
        return ivEJBName;
    }

/**
 * ****************************************************************************
 *
 *  Contributors:
 *      IBM Corporation - initial API and implementation
 * *****************************************************************************
 */
package com.ibm.ws.ejbcontainer.cdi.jcdi.ejb;

import java.util.logging.Logger;
import javax.annotation.Resource;
import javax.ejb.Local;
import javax.ejb.Stateless;

/**
 * Stateless bean with multiple local interfaces that should be able to lookup a BeanManager.
 */
@Stateless(name = "MultiLocalStateless")
@Local({ MultiLocalStatelessOne.class, MultiLocalStatelessTwo.class })
public class MultiLocalStatelessBean {

    private static final String CLASS_NAME = MultiLocalStatelessBean.class.getName();

    private static final Logger svLogger = Logger.getLogger(CLASS_NAME);

    @Resource(name = "EJBName")
    private String ivEJBName = "MultiLocalStateless";

    /**
     * Returns the EJB name.
     */
    public String getName()

    /**
     * Returns the EJB name.
     */
    public String getEjbName() {
        svLogger.info("- " + ivEJBName + ".getEjbName() : ivEJBName");
        return ivEJBName;
    }
}


/**
 * ****************************************************************************
 *
 *  Contributors:
 *      IBM Corporation - initial API and implementation
 * *****************************************************************************
 */
package com.ibm.ws.ejbcontainer.cdi.jcdi.ejb;

import java.util.logging.Logger;
import javax.annotation.Resource;
import javax.ejb.Local;
import javax.ejb.Stateless;

/**
 * Stateless bean with multiple local interfaces that should be able to lookup a BeanManager.
 */
@Stateless(name = "MultiLocalStateless")
@Local({ MultiLocalStatelessOne.class, MultiLocalStatelessTwo.class })
public class MultiLocalStatelessBean {

    private static final String CLASS_NAME = MultiLocalStatelessBean.class.getName();

    private static final Logger svLogger = Logger.getLogger(CLASS_NAME);

    @Resource(name = "EJBName")
    private String ivEJBName = "MultiLocalStateless";

    /**
     * Returns the EJB name.
     */
    public String getName() {
        svLogger.info("- " + ivEJBName + ".getName() : ivEJBName");
        retur

    }

    /**
     * Returns the EJB name.
     */
    public String getEjbName() {
        svLogger.info("- " + ivEJBName + ".getEjbName() : ivEJBName");
        return ivEJBName;
    }
}


public String getName() {
        svLogger.info("- " + ivEJBName + ".getName() : ivEJBName");
        return ivEJBName;
    }


***************************
 *
 *  Contributors:
 *      IBM Corporation - initial API and implementation
 * *****************************************************************************
 */
package com.ibm.ws.ejbcontainer.cdi.jcdi.ejb;

import java.util.logging.Logger;
import javax.annotation.Resource;
import javax.ejb.Local;
import javax.ejb.Stateless;

/**
 * Stateless bean with multiple local interfaces that should be able to lookup a BeanManager.
 */
@Stateless(name = "MultiLocalStateless")
@Local({ MultiLocalStatelessOne.class, MultiLocalStatelessTwo.class })
public class MultiLocalStatelessBean {

    private static final String CLASS_NAME = MultiLocalStatelessBean.class.getName();

    private static final Logger svLogger = Logger.getLogger(CLASS_NAME);

    @Resource(name = "EJBName")
    private String ivEJBName = "MultiLocalStateless";

    /**
     * Returns the EJB name.
     */
    public String getName() {
        svLogger.info("- " + ivEJBName + ".getName() : ivEJBName");
        return ivEJBName;
    }

    /**
     * Returns the EJB name.
     */
    public String getEjbName() {
        svLogger.info("- " + ivEJBName + ".getEjbName() : ivEJBName");
        return ivEJBName;
    }
}


package com.carl.sso.support.validate.configuration;

import java.io.Serializable;

/**
 * @author Carl
 * @date 2017/11/2
 * @since
 */
public class MailProperties implements Serializable {

    private boolean enable = true;

    // 有效期，十分钟有效
    private long effective = 60 * 10;

    // 邮件内容，例如：你的验证码为%s
    private String content = "欢迎注册，你的验证码为：%s（统一登录门户）";

    private String subject = "统一门户注册验证码";

    // 来自哪个用户发送
    private String from;

    // 验证码长度
    private int codeLen = 6;

    public long getEffective() {
        return effective;
    }

    public void setEffective(long effective) {
        this.effective = effective;
    }

    public String getContent() {
        return content;
    }

{
        this.content = content;
    }

    public boolean isEnable() {
        return enable;
    }

    public void setEnable(boolean enable) {
        this.enable = enable;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public String getFrom() {
        return from;
    }

    public void setFrom(String from) {
        this.from = from;
    }

    public int getCodeLen() {
        return codeLen;
    }

    public void setCodeLen(int codeLen) {
        this.codeLen = codeLen;
    }
}


package com.carl.sso.support.validate.configuration;

import java.io.Serializable;

/**
 * @author Carl
 * @date 2017/11/2
 * @since
 */
public class MailProperties implements Serializable {

    private boolean enable = true;

    // 有效期，十分钟有效
    private long effective = 60 * 10;

    // 邮件内容，例如：你的验证码为%s
    private String content = "欢迎注册，你的验证码为：%s（统一登录门户）";

    private String subject = "统一门户注册验证码";

    // 来自哪个用户发送
    private String from;

    // 验证码长度
    private int codeLen = 6;

    public long getEffective() {
        return effective;
    }

    public void setEffective(long effective) {
        this.effective = effective;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public boolean isEnable() {
        return enable;
    }

    public void setEnable(boolean enable)

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public String getFrom() {
        return from;
    }

    public void setFrom(String from) {
        this.from = from;
    }

    public int getCodeLen() {
        return codeLen;
    }

    public void setCodeLen(int codeLen) {
        this.codeLen = codeLen;
    }
}


package com.carl.sso.support.validate.configuration;

import java.io.Serializable;

/**
 * @author Carl
 * @date 2017/11/2
 * @since
 */
public class MailProperties implements Serializable {

    private boolean enable = true;

    // 有效期，十分钟有效
    private long effective = 60 * 10;

    // 邮件内容，例如：你的验证码为%s
    private String content = "欢迎注册，你的验证码为：%s（统一登录门户）";

    private String subject = "统一门户注册验证码";

    // 来自哪个用户发送
    private String from;

    // 验证码长度
    private int codeLen = 6;

    public long getEffective() {
        return effective;
    }

    public void setEffective(long effective) {
        this.effective = effective;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public boolean isEnable() {
        return enable;
    }

    public void setEnable(boolean enable) {
        this.enable = enable;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public String getFrom() {
        return from;
    }

    public void setFrom(String from) {
        this.from = f

    }

    public int getCodeLen() {
        return codeLen;
    }

    public void setCodeLen(int codeLen) {
        this.codeLen = codeLen;
    }
}


package com.carl.sso.support.validate.configuration;

import java.io.Serializable;

/**
 * @author Carl
 * @date 2017/11/2
 * @since
 */
public class MailProperties implements Serializable {

    private boolean enable = true;

    // 有效期，十分钟有效
    pri

vate long effective = 60 * 10;

    // 邮件内容，例如：你的验证码为%s
    private String content = "欢迎注册，你的验证码为：%s（统一登录门户）";

    private String subject = "统一门户注册验证码";

    // 来自哪个用户发送
    private String from;

    // 验证码长度
    private int codeLen = 6;

    public long getEffective() {
        return effective;
    }

    public void setEffective(long effective) {
        this.effective = effective;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public boolean isEnable() {
        return enable;
    }

    public void setEnable(boolean enable) {
        this.enable = enable;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public String getFrom() {
        return from;
    }

    public void setFrom(String from) {
        this.from = from;
    }

    public int getCodeLen() {
        return codeLen;
    }

    public void setCodeLen(int codeLen) {
        this.codeLen = codeLen;
    }
}


public static void checkMessageType(Message message)

package com.ibm.mq.samples.jms.spring.globals.utils;

import com.ibm.mq.samples.jms.spring.globals.Constants;
import com.ibm.mq.samples.jms.spring.globals.data.OurData;
import com.ibm.mq.samples.jms.spring.globals.data.OurOtherData;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.jms.*;
import java.io.Serializable;
import java.util.Map;

public class MessageUtils {

    protected static final Log logger = LogFactory.getLog(MessageUtils.class);

    private MessageUtils() {
    }

{
        try {
            if (message instanceof TextMessage) {
                logger.info("Message matches TextMessage");
                logger.info("message payload is " + ((TextMessage) message).getText());
            } else if (message instanceof BytesMessage) {
                logger.info("Message matches BytesMessage");
            } else if (message instanceof MapMessage) {
                logger.info("Message matches MapMessage");
            } else if (message instanceof StreamMessage) {
                logger.info("Message matches StreamMessage");
            } else if (message instanceof ObjectMessage) {
                checkForObject((ObjectMessage) message);
            }
        } catch (JMSException e) {
            logger.warn("Unable to process JMS message");
        }
    }

    public static void logHeaders(Map<String, Object> msgHeaders) {
        if (!msgHeaders.isEmpty()) {
            logger.info("");
            logger.info("Headers found");
            msgHeaders.forEach((k, v) -> {
                logger.info(k + ": is of type" + v.getClass());
            });
        }
    }

    private static void checkForObject(ObjectMessage message) {
        try {
            int typeValue = message.getIntProperty(Constants.DATATYPE);
            if (Constants.DataTypes.OURDATATYPE.getValue() == typeValue) {
                logger.info("It is one of our objects");
                Serializable serObj = message.getObject();
                OurData data = (OurData) serObj;
                logger.info(data);
            } else if (Constants.DataTypes.OUROTHERDATATYPE.getValue() == typeValue) {
                logger.info("It is one of our other objects");
                Serializable serObj = message.getObject();
                OurOtherData data = (OurOtherData) serObj;
                logger.info(data);
            } else {
                logger.warn("It is not one of our objects");
            }
        } catch (JMSException e) {
            logger.warn("Unable to retrieve message data");
        } catch (ClassCastException e2) {
            logger.warn("Not the object we were expecting");
        }
    }
}


{
        if (!msgHeaders.isEmpty()) {
            logger.info("");
            logger.info("Headers found");
            msgHeaders.forEach((k, v) -> {
                logger.info(k + ": is of type" + v.getClass());
            });
        }
    }

package com.ibm.mq.samples.jms.spring.globals.utils;

import com.ibm.mq.samples.jms.spring.globals.Constants;
import com.ibm.mq.samples.jms.spring.globals.data.OurData;
import com.ibm.mq.samples.jms.spring.globals.data.OurOtherData;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.jms.*;
import java.io.Serializable;
import java.util.Map;

public class MessageUtils {

    protected static final Log logger = LogFactory.getLog(MessageUtils.class);

    private MessageUtils() {
    }

    public static void checkMessageType(Message message) {
        try {
            if (message instanceof TextMessage) {
                logger.info("Message matches TextMessage");
                logger.info("message payload is " + ((TextMessage) message).getText());
            } else if (message instanceof BytesMessage) {
                logger.info("Message matches BytesMessage");
            } else if (message instanceof MapMessage) {
                logger.info("Message matches MapMessage");
            } else if (message instanceof StreamMessage) {
                logger.info("Message matches StreamMessage");
            } else if (message instanceof ObjectMessage) {
                checkForObject((ObjectMessage) message);
            }
        } catch (JMSException e) {
            logger.warn("Unable to process JMS message");
        }
    }

    public static void logHeaders(Map<String, Object> msgHeaders)

    private static void checkForObject(ObjectMessage message) {
        try {
            int typeValue = message.getIntProperty(Constants.DATATYPE);
            if (Constants.DataTypes.OURDATATYPE.getValue() == typeValue) {
                logger.info("It is one of our objects");
                Serializable serObj = message.getObject();
                OurData data = (OurData) serObj;
                logger.info(data);
            } else if (Constants.DataTypes.OUROTHERDATATYPE.getValue() == typeValue) {
                logger.info("It is one of our other objects");
                Serializable serObj = message.getObject();
                OurOtherData data = (OurOtherData) serObj;
                logger.info(data);
            } else {
                logger.warn("It is not one of our objects");
            }
        } catch (JMSException e) {
            logger.warn("Unable to retrieve message data");
        } catch (ClassCastException e2) {
            logger.warn("Not the object we were expecting");
        }
    }
}


package com.ibm.mq.samples.jms.spring.globals.utils;

import com.ibm.mq.samples.jms.spring.globals.Constants;
import com.ibm.mq.samples.jms.spring.globals.data.OurData;
import com.ibm.mq.samples.jms.spring.globals.data.OurOtherData;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.jms.*;
import java.io.Serializable;
import java.util.Map;

public class MessageUtils {

    protected static final Log logger = LogFactory.getLog(MessageUtils.class);

    private MessageUtils() {
    }

    public static void checkMessageType(Message message) {
        try {
            if (message instanceof TextMessage) {
                logger.info("Message matches TextMessage");
                logger.info("message payload is " + ((TextMessage) message).getText());
            } else if (message instanceof BytesMessage) {
                logger.info("Message matches BytesMessage");
            } else if (message instanceof MapMessage) {
                logger.info("Message matches MapMessage");
            } else if (message instanceof StreamMessage) {
                logger.info("Message matches StreamMessage");
            } else if (message instanceof ObjectMessage) {
                checkForObject((ObjectMessage) message);
            }
        } catch (JMSException e) {
            logger.warn("Unable to process JMS message");
        }
    }

    public static void logHeaders(Map<String, Object> msgHeaders) {

        if (!msgHeaders.isEmpty()) {
            logger.info("");
            logger.info("Headers found");
            msgHeaders.forEach((k, v) -> {
                logger.info(k + ": is of type" + v.getClass());
            });
        }
    }

    private static void checkForObject(ObjectMessage message) {
        try {
            int typeValue = message.getIntProperty(Constants.DATATYPE);
            if (Constants.DataTypes.OURDATATYPE.getValue() == typeValue) {
                logger.info("It is one of our objects");
                Serializable serObj = message.getObject();
                OurData data = (OurData) serObj;
                logger.info(data);
            } else if (Constants.DataTypes.OUROTHERDATATYPE.getValue() == typeValue) {
                logger.info("It is one of our other objects");
                Serializable serObj = message.getObject();
                OurOtherData data = (OurOtherData) serObj;
                logger.info(data);
            } else {
                logger.warn("It is not one of our objects");
            }
        } catch (JMSException e) {
            logger.warn("Unable to retrieve message data");
        } catch (ClassCastException e2) {
            logger.warn("Not the object we were expecting");
        }
    }
}


if (!msgHeaders.isEmpty()) {
            logger.info("");
            logger.info("Headers found");
            msgHeaders.forEach((k, v) -> {
                logger.info(k + ": is of type" + v.getClass());
            });
        }

    }

    private static void checkForObject(ObjectMessage message) {
        try {
            int typeValue = message.getIntProperty(Constants.DATATYPE);
            if (Constants.DataTypes.OURDATATYPE.getValue() == typeValue) {
                logger.info("It is one of our objects");
                Serializable serObj = message.getObject();
                OurData data = (OurData) serObj;
                logger.info(data);
            } else if (Constants.DataTypes.OUROTHERDATATYPE.getValue() == typeValue) {
                logger.info("It is one of our other objects");
                Serializable serObj = message.getObject();
                OurOtherData data = (OurOtherData) serObj;
                logger.info(data);
            } else {
                logger.warn("It is not one of our objects");
            }
        } catch (JMSException e) {
            logger.warn("Unable to retrieve message data");
        } catch (ClassCastException e2) {
            logger.warn("Not the object we were expecting");
        }
    }
}


package com.ibm.mq.samples.jms.spring.globals.utils;

import com.ibm.mq.samples.jms.spring.globals.Constants;
import com.ibm.mq.samples.jms.spring.globals.data.OurData;
import com.ibm.mq.samples.jms.spring.globals.data.OurOtherData;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.jms.*;
import java.io.Serializable;
import java.util.Map;

public class MessageUtils {

    protected static final Log logger = LogFactory.getLog(MessageUtils.class);

    private MessageUtils() {
    }

    public static void checkMessageType(Message message) {
        try {
            if (message instanceof TextMessage) {
                logger.info("Message matches TextMessage");
                logger.info("message payload is " + ((TextMessage) message).getText());
            } else if (message instanceof BytesMessage) {
                logger.info("Message matches BytesMessage");
            } else if (message instanceof MapMessage) {
                logger.info("Message matches MapMessage");
            } else if (message instanceof StreamMessage) {
                logger.info("Message matches StreamMessage");
            } else if (message instanceof ObjectMessage) {
                checkForObject((ObjectMessage) message);
            }
        } catch (JMSException e) {
            logger.warn("Unable to process JMS message");
        }
    }

    public static void logHeaders(Map<String, Object> msgHeaders) {
        if (!msgHeaders.isEmpty()) {
            logger.info("");
            logger.info("Headers found");
            msgHeaders.forEach((k, v) -> {
                logger.info(k + ": is of type" + v.getClass());
            });
        }


if (message instanceof BytesMessage) {
                logger.info("Message matches BytesMessage");
            } else if (message instanceof MapMessage) {
                logger.info("Message matches MapMessage");
            } else if (message instanceof StreamMessage) {
                logger.info("Message matches StreamMessage");
            } else if (message instanceof ObjectMessage) {
                checkForObject((ObjectMessage) message);
            }

package com.ibm.mq.samples.jms.spring.globals.utils;

import com.ibm.mq.samples.jms.spring.globals.Constants;
import com.ibm.mq.samples.jms.spring.globals.data.OurData;
import com.ibm.mq.samples.jms.spring.globals.data.OurOtherData;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.jms.*;
import java.io.Serializable;
import java.util.Map;

public class MessageUtils {

    protected static final Log logger = LogFactory.getLog(MessageUtils.class);

    private MessageUtils() {
    }

    public static void checkMessageType(Message message) {
        try {
            if (message instanceof TextMessage) {
                logger.info("Message matches TextMessage");
                logger.info("message payload is " + ((TextMessage) message).getText());
            } else

        } catch (JMSException e) {
            logger.warn("Unable to process JMS message");
        }
    }

    public static void logHeaders(Map<String, Object> msgHeaders) {
        if (!msgHeaders.isEmpty()) {
            logger.info("");
            logger.info("Headers found");
            msgHeaders.forEach((k, v) -> {
                logger.info(k + ": is of type" + v.getClass());
            });
        }
    }

    private static void checkForObject(ObjectMessage message) {
        try {
            int typeValue = message.getIntProperty(Constants.DATATYPE);
            if (Constants.DataTypes.OURDATATYPE.getValue() == typeValue) {
                logger.info("It is one of our objects");
                Serializable serObj = message.getObject();
                OurData data = (OurData) serObj;
                logger.info(data);
            } else if (Constants.DataTypes.OUROTHERDATATYPE.getValue() == typeValue) {
                logger.info("It is one of our other objects");
                Serializable serObj = message.getObject();
                OurOtherData data = (OurOtherData) serObj;
                logger.info(data);
            } else {
                logger.warn("It is not one of our objects");
            }
        } catch (JMSException e) {
            logger.warn("Unable to retrieve message data");
        } catch (ClassCastException e2) {
            logger.warn("Not the object we were expecting");
        }
    }
}


package com.ibm.mq.samples.jms.spring.globals.utils;

import com.ibm.mq.samples.jms.spring.globals.Constants;
import com.ibm.mq.samples.jms.spring.globals.data.OurData;
import com.ibm.mq.samples.jms.spring.globals.data.OurOtherData;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import javax.jms.*;
import java.io.Serializable;
import java.util.Map;

public class MessageUtils {

    protected static final Log logger = LogFactory.getLog(MessageUtils.class);

    private MessageUtils() {
    }

    public static void checkMessageType(Message message) {
        try {
            if (message instanceof TextMessage) {
                logger.info("Message matches TextMessage");
                logger.info("message payload is " + ((TextMessage) message).getText());
            } else if (message instanceof BytesMessage) {
                logger.info("Message matches BytesMessage");
            } else if (message instanceof MapMessage) {
                logger.info("Message matches MapMessage");
            } else if (message instanceof

StreamMessage) {
                logger.info("Message matches StreamMessage");
            } else if (message instanceof ObjectMessage) {
                checkForObject((ObjectMessage) message);
            }
        } catch (JMSException e) {
            logger.warn("Unable to process JMS message");
        }
    }

    public static void logHeaders(Map<String, Object> msgHeaders) {
        if (!msgHeaders.isEmpty()) {
            logger.info("");
            logger.info("Headers found");
            msgHeaders.forEach((k, v) -> {
                logger.info(k + ": is of type" + v.getClass());
            });
        }
    }

    private static void checkForObject(ObjectMessage message) {
        try {
            int typeValue = message.getIntProperty(Constants.DATATYPE);
            if (Constants.DataTypes.OURDATATYPE.getValue() == typeValue) {
                logger.info("It is one of our objects");
                Serializable serObj = message.getObject();
                OurData data = (OurData) serObj;
                logger.info(data);
            } else if (Constants.DataTypes.OUROTHERDATATYPE.getValue() == typeValue) {
                logger.info("It is one of our other objects");
                Serializable serObj = message.getObject();
                OurOtherData data = (OurOtherData) serObj;
                logger.info(data);
            } else {
                logger.warn("It is not one of our objects");
            }
        } catch (JMSException e) {
            logger.warn("Unable to retrieve message data");
        } catch (ClassCastException e2) {
            logger.warn("Not the object we were expecting");
        }
    }
}


@Override
    public boolean businessEquals(AbstractFunctionality obj, boolean checkPolicies)

/*
 * LinShare is an open source filesharing software developed by LINAGORA.
 *
 *
 * notably (i) retain the display in the interface of the “LinShare™”
 * trademark/logo, the "Libre & Free" mention, the words “You are using the Free
 * Contribute to Linshare R&D by subscribing to an Enterprise offer!”. You must
 * also retain the latter notice in all asynchronous messages such as e-mails
 * sent with the Program, (ii) retain all hypertext links between LinShare and
 * http://www.linshare.org, between linagora.com and Linagora, and (iii) refrain
 * from infringing Linagora intellectual property rights over its trademarks and
 * commercial brands. Other Additional Terms apply, see
 * version 3 and
 * <http://www.linshare.org/licenses/LinShare-License_AfferoGPL-v3.pdf> for the
 * Additional Terms applicable to LinShare software.
 */
package org.linagora.linshare.core.domain.entities;

import java.util.ArrayList;
import java.util.List;
import org.linagora.linshare.core.domain.constants.FunctionalityType;
import org.linagora.linshare.core.facade.webservice.admin.dto.FunctionalityAdminDto;
import org.linagora.linshare.core.facade.webservice.adminv5.dto.parameters.StringParameterDto;
import org.linagora.linshare.core.facade.webservice.adminv5.dto.parameters.nested.NestedStringParameterDto;
import org.linagora.linshare.core.facade.webservice.common.dto.ParameterDto;
import org.linagora.linshare.core.facade.webservice.user.dto.FunctionalityDto;
import org.linagora.linshare.core.facade.webservice.user.dto.FunctionalityStringDto;

public class StringValueFunctionality extends OneValueFunctionality<String> {

    public StringValueFunctionality() {
        super();
    }

    public StringValueFunctionality(String identifier, boolean system, Policy activationPolicy, Policy configurationPolicy, AbstractDomain domain, String value) {
        super(identifier, system, activationPolicy, configurationPolicy, domain, value);
    }

    @Override
    public FunctionalityType getType() {
        return FunctionalityType.STRING;
    }

{
        if (super.businessEquals(obj, checkPolicies)) {
            StringValueFunctionality o = (StringValueFunctionality) obj;
            if (value.equals(o.getValue())) {
                logger.debug("StringValueFunctionality : " + this.toString() + " is equal to StringValueFunctionality " + obj.toString());
                return true;
            }
        }
        logger.debug("StringValueFunctionality : " + this.toString() + " is not equal to StringValueFunctionality " + obj.toString());
        return false;
    }

    @Override
    public void updateFunctionalityFrom(AbstractFunctionality functionality) {
        super.updateFunctionalityFrom(functionality);
        this.updateFunctionalityValuesOnlyFrom(functionality);
    }

    @Override
    public void updateFunctionalityValuesOnlyFrom(AbstractFunctionality functionality) {
        StringValueFunctionality f = (StringValueFunctionality) functionality;
        this.value = f.getValue();
    }

    @Override
    public void updateFunctionalityValuesOnlyFromDto(Integer version, FunctionalityAdminDto functionality) {
        List<ParameterDto> parameters = functionality.getParameters();
        if (parameters != null && !parameters.isEmpty()) {
            ParameterDto parameterDto = parameters.get(0);
            this.value = parameterDto.getString();
        }
    }

    @Override
    public List<ParameterDto> getParameters(Integer version) {
        List<ParameterDto> res = new ArrayList<ParameterDto>();
        res.add(new ParameterDto(this.getValue()));
        return res;
    }

    @Override
    protected FunctionalityDto getUserDto(boolean enable, Integer version) {
        FunctionalityStringDto f = new FunctionalityStringDto();
        if (enable) {
            f.setValue(value);
        }
        return f;
    }

    @Override
    public org.linagora.linshare.core.facade.webservice.adminv5.dto.parameters.ParameterDto<?> getParameter() {
        // there is no default value for functionality parameters. sad.
        String parentValue = this.value;
        if (this.ancestorFunc != null) {
            parentValue = ((StringValueFunctionality) this.ancestorFunc).getValue();
        }
        NestedStringParameterDto defaut = new NestedStringParameterDto(this.value, parentValue);
        return new StringParameterDto(this.system, !this.getParentAllowParametersUpdate(), defaut);
    }
}


{
        // there is no default value for functionality parameters. sad.
        String parentValue = this.value;
        if (this.ancestorFunc != null) {
            parentValue = ((StringValueFunctionality) this.ancestorFunc).getValue();
        }
        NestedStringParameterDto defaut = new NestedStringParameterDto(this.value, parentValue);
        return new StringParameterDto(this.system, !this.getParentAllowParametersUpdate(), defaut);
    }

/*
 * LinShare is an open source filesharing software developed by LINAGORA.
 *
 *
 * notably (i) retain the display in the interface of the “LinShare™”
 * trademark/logo, the "Libre & Free" mention, the words “You are using the Free
 * Contribute to Linshare R&D by subscribing to an Enterprise offer!”. You must
 * also retain the latter notice in all asynchronous messages such as e-mails
 * sent with the Program, (ii) retain all hypertext links between LinShare and
 * http://www.linshare.org, between linagora.com and Linagora, and (iii) refrain
 * from infringing Linagora intellectual property rights over its trademarks and
 * commercial brands. Other Additional Terms apply, see
 * version 3 and
 * <http://www.linshare.org/licenses/LinShare-License_AfferoGPL-v3.pdf> for the
 * Additional Terms applicable to LinShare software.
 */
package org.linagora.linshare.core.domain.entities;

import java.util.ArrayList;
import java.util.List;
import org.linagora.linshare.core.domain.constants.FunctionalityType;
import org.linagora.linshare.core.facade.webservice.admin.dto.FunctionalityAdminDto;
import org.linagora.linshare.core.facade.webservice.adminv5.dto.parameters.StringParameterDto;
import org.linagora.linshare.core.facade.webservice.adminv5.dto.parameters.nested.NestedStringParameterDto;
import org.linagora.linshare.core.facade.webservice.common.dto.ParameterDto;
import org.linagora.linshare.core.facade.webservice.user.dto.FunctionalityDto;
import org.linagora.linshare.core.facade.webservice.user.dto.FunctionalityStringDto;

public class StringValueFunctionality extends OneValueFunctionality<String> {

    public StringValueFunctionality() {
        super();
    }

    public StringValueFunctionality(String identifier, boolean system, Policy activationPolicy, Policy configurationPolicy, AbstractDomain domain, String value) {
        super(identifier, system, activationPolicy, configurationPolicy, domain, value);
    }

    @Override
    public FunctionalityType getType() {
        return FunctionalityType.STRING;
    }

    @Override
    public boolean businessEquals(AbstractFunctionality obj, boolean checkPolicies) {
        if (super.businessEquals(obj, checkPolicies)) {
            StringValueFunctionality o = (StringValueFunctionality) obj;
            if (value.equals(o.getValue())) {
                logger.debug("StringValueFunctionality : " + this.toString() + " is equal to StringValueFunctionality " + obj.toString());
                return true;
            }
        }
        logger.debug("StringValueFunctionality : " + this.toString() + " is not equal to StringValueFunctionality " + obj.toString());
        return false;
    }

    @Override
    public void updateFunctionalityFrom(AbstractFunctionality functionality) {
        super.updateFunctionalityFrom(functionality);
        this.updateFunctionalityValuesOnlyFrom(functionality);
    }

    @Override
    public void updateFunctionalityValuesOnlyFrom(AbstractFunctionality functionality) {
        StringValueFunctionality f = (StringValueFunctionality) functionality;
        this.value = f.getValue();
    }

    @Override
    public void updateFunctionalityValuesOnlyFromDto(Integer version, FunctionalityAdminDto functionality) {
        List<ParameterDto> parameters = functionality.getParameters();
        if (parameters != null && !parameters.isEmpty()) {
            ParameterDto parameterDto = parameters.get(0);
            this.value = parameterDto.getString();
        }
    }

    @Override
    public List<ParameterDto> getParameters(Integer version) {
        List<ParameterDto> res = new ArrayList<ParameterDto>();
        res.add(new ParameterDto(this.getValue()));
        return res;
    }

    @Override
    protected FunctionalityDto getUserDto(boolean enable, Integer version) {
        FunctionalityStringDto f = new FunctionalityStringDto();
        if (enable) {
            f.setValue(value);
        }
        return f;
    }

    @Override
    public org.linagora.linshare.core.facade.webservice.adminv5.dto.parameters.ParameterDto<?> getParameter()


        if (super.businessEquals(obj, checkPolicies)) {
            StringValueFunctionality o = (StringValueFunctionality) obj;
            if (value.equals(o.getValue())) {
                logger.debug("StringValueFunctionality : " + this.toString() + " is equal to StringValueFunctionality " + obj.toString());
                return true;
            }
        }

/*
 * LinShare is an open source filesharing software developed by LINAGORA.
 *
 *
 * notably (i) retain the display in the interface of the “LinShare™”
 * trademark/logo, the "Libre & Free" mention, the words “You are using the Free
 * Contribute to Linshare R&D by subscribing to an Enterprise offer!”. You must
 * also retain the latter notice in all asynchronous messages such as e-mails
 * sent with the Program, (ii) retain all hypertext links between LinShare and
 * http://www.linshare.org, between linagora.com and Linagora, and (iii) refrain
 * from infringing Linagora intellectual property rights over its trademarks and
 * commercial brands. Other Additional Terms apply, see
 * version 3 and
 * <http://www.linshare.org/licenses/LinShare-License_AfferoGPL-v3.pdf> for the
 * Additional Terms applicable to LinShare software.
 */
package org.linagora.linshare.core.domain.entities;

import java.util.ArrayList;
import java.util.List;
import org.linagora.linshare.core.domain.constants.FunctionalityType;
import org.linagora.linshare.core.facade.webservice.admin.dto.FunctionalityAdminDto;
import org.linagora.linshare.core.facade.webservice.adminv5.dto.parameters.StringParameterDto;
import org.linagora.linshare.core.facade.webservice.adminv5.dto.parameters.nested.NestedStringParameterDto;
import org.linagora.linshare.core.facade.webservice.common.dto.ParameterDto;
import org.linagora.linshare.core.facade.webservice.user.dto.FunctionalityDto;
import org.linagora.linshare.core.facade.webservice.user.dto.FunctionalityStringDto;

public class StringValueFunctionality extends OneValueFunctionality<String> {

    public StringValueFunctionality() {
        super();
    }

    public StringValueFunctionality(String identifier, boolean system, Policy activationPolicy, Policy configurationPolicy, AbstractDomain domain, String value) {
        super(identifier, system, activationPolicy, configurationPolicy, domain, value);
    }

    @Override
    public FunctionalityType getType() {
        return FunctionalityType.STRING;
    }

    @Override
    public boolean businessEquals(AbstractFunctionality obj, boolean checkPolicies) {

        logger.debug("StringValueFunctionality : " + this.toString() + " is not equal to StringValueFunctionality " + obj.toString());
        return false;
    }

    @Override
    public void updateFunctionalityFrom(AbstractFunctionality functionality) {
        super.updateFunctionalityFrom(functionality);
        this.updateFunctionalityValuesOnlyFrom(functionality);
    }

    @Override
    public void updateFunctionalityValuesOnlyFrom(AbstractFunctionality functionality) {
        StringValueFunctionality f = (StringValueFunctionality) functionality;
        this.value = f.getValue();
    }

    @Override
    public void updateFunctionalityValuesOnlyFromDto(Integer version, FunctionalityAdminDto functionality) {
        List<ParameterDto> parameters = functionality.getParameters();
        if (parameters != null && !parameters.isEmpty()) {
            ParameterDto parameterDto = parameters.get(0);
            this.value = parameterDto.getString();
        }
    }

    @Override
    public List<ParameterDto> getParameters(Integer version) {
        List<ParameterDto> res = new ArrayList<ParameterDto>();
        res.add(new ParameterDto(this.getValue()));
        return res;
    }

    @Override
    protected FunctionalityDto getUserDto(boolean enable, Integer version) {
        FunctionalityStringDto f = new FunctionalityStringDto();
        if (enable) {
            f.setValue(value);
        }
        return f;
    }

    @Override
    public org.linagora.linshare.core.facade.webservice.adminv5.dto.parameters.ParameterDto<?> getParameter() {
        // there is no default value for functionality parameters. sad.
        String parentValue = this.value;
        if (this.ancestorFunc != null) {
            parentValue = ((StringValueFunctionality) this.ancestorFunc).getValue();
        }
        NestedStringParameterDto defaut = new NestedStringParameterDto(this.value, parentValue);
        return new StringParameterDto(this.system, !this.getParentAllowParametersUpdate(), defaut);
    }
}


logger.debug("StringValueFunctionality : " + this.toString() + " is not equal to StringValueFunctionality " + obj.toString());

/*
 * LinShare is an open source filesharing software developed by LINAGORA.
 *
 *
 * notably (i) retain the display in the interface of the “LinShare™”
 * trademark/logo, the "Libre & Free" mention, the words “You are using the Free
 * Contribute to Linshare R&D by subscribing to an Enterprise offer!”. You must
 * also retain the latter notice in all asynchronous messages such as e-mails
 * sent with the Program, (ii) retain all hypertext links between LinShare and
 * http://www.linshare.org, between linagora.com and Linagora, and (iii) refrain
 * from infringing Linagora intellectual property rights over its trademarks and
 * commercial brands. Other Additional Terms apply, see
 * version 3 and
 * <http://www.linshare.org/licenses/LinShare-License_AfferoGPL-v3.pdf> for the
 * Additional Terms applicable to LinShare software.
 */
package org.linagora.linshare.core.domain.entities;

import java.util.ArrayList;
import java.util.List;
import org.linagora.linshare.core.domain.constants.FunctionalityType;
import org.linagora.linshare.core.facade.webservice.admin.dto.FunctionalityAdminDto;
import org.linagora.linshare.core.facade.webservice.adminv5.dto.parameters.StringParameterDto;
import org.linagora.linshare.core.facade.webservice.adminv5.dto.parameters.nested.NestedStringParameterDto;
import org.linagora.linshare.core.facade.webservice.common.dto.ParameterDto;
import org.linagora.linshare.core.facade.webservice.user.dto.FunctionalityDto;
import org.linagora.linshare.core.facade.webservice.user.dto.FunctionalityStringDto;

public class StringValueFunctionality extends OneValueFunctionality<String> {

    public StringValueFunctionality() {
        super();
    }

    public StringValueFunctionality(String identifier, boolean system, Policy activationPolicy, Policy configurationPolicy, AbstractDomain domain, String value) {
        super(identifier, system, activationPolicy, configurationPolicy, domain, value);
    }

    @Override
    public FunctionalityType getType() {
        return FunctionalityType.STRING;
    }

    @Override
    public boolean businessEquals(AbstractFunctionality obj, boolean checkPolicies) {
        if (super.businessEquals(obj, checkPolicies)) {
            StringValueFunctionality o = (StringValueFunctionality) obj;
            if (value.equals(o.getValue())) {
                logger.debug("StringValueFunctionality : " + this.toString() + " is equal to StringValueFunctionality " + obj.toString());
                return true;
            }
        }

        return false;
    }

    @Override
    public void updateFunctionalityFrom(AbstractFunctionality functionality) {
        super.updateFunctionalityFrom(functionality);
        this.updateFunctionalityValuesOnlyFrom(functionality);
    }

    @Override
    public void updateFunctionalityValuesOnlyFrom(AbstractFunctionality functionality) {
        StringValueFunctionality f = (StringValueFunctionality) functionality;
        this.value = f.getValue();
    }

    @Override
    public void updateFunctionalityValuesOnlyFromDto(Integer version, FunctionalityAdminDto functionality) {
        List<ParameterDto> parameters = functionality.getParameters();
        if (parameters != null && !parameters.isEmpty()) {
            ParameterDto parameterDto = parameters.get(0);
            this.value = parameterDto.getString();
        }
    }

    @Override
    public List<ParameterDto> getParameters(Integer version) {
        List<ParameterDto> res = new ArrayList<ParameterDto>();
        res.add(new ParameterDto(this.getValue()));
        return res;
    }

    @Override
    protected FunctionalityDto getUserDto(boolean enable, Integer version) {
        FunctionalityStringDto f = new FunctionalityStringDto();
        if (enable) {
            f.setValue(value);
        }
        return f;
    }

    @Override
    public org.linagora.linshare.core.facade.webservice.adminv5.dto.parameters.ParameterDto<?> getParameter() {
        // there is no default value for functionality parameters. sad.
        String parentValue = this.value;
        if (this.ancestorFunc != null) {
            parentValue = ((StringValueFunctionality) this.ancestorFunc).getValue();
        }
        NestedStringParameterDto defaut = new NestedStringParameterDto(this.value, parentValue);
        return new StringParameterDto(this.system, !this.getParentAllowParametersUpdate(), defaut);
    }
}


/*
 * LinShare is an open source filesharing software developed by LINAGORA.
 *
 *
 * notably (i) retain the display in the interface of the “LinShare™”
 * trademark/logo, the "Libre & Free" mention, the words “You are using the Free
 * Contribute to Linshare R&D by subscribing to an Enterprise offer!”. You must
 * also retain the latter notice in all asynchronous messages such as e-mails
 * sent with the Program, (ii) retain all hypertext links between LinShare and
 * http://www.linshare.org, between linagora.com and Linagora, and (iii) refrain
 * from infringing Linagora intellectual property rights over its trademarks and
 * commercial brands. Other Additional Terms apply, see
 * version 3 and
 * <http://www.linshare.org/licenses/LinShare-License_AfferoGPL-v3.pdf> for the
 * Additional Terms applicable to LinShare software.
 */
package org.linagora.linshare.core.domain.entities;

import java.util.ArrayList;
import java.util.List;
import org.linagora.linshare.core.domain.constants.FunctionalityType;
import org.linagora.linshare.core.facade.webservice.admin.dto.FunctionalityAdminDto;
import org.linagora.linshare.core.facade.webservice.adminv5.dto.parameters.StringParameterDto;
import org.linagora.linshare.core.facade.webservice.adminv5.dto.parameters.nested.NestedStringParameterDto;
import org.linagora.linshare.core.facade.webservice.common.dto.ParameterDto;
import org.linagora.linshare.core.facade.webservice.user.dto.FunctionalityDto;
import org.linagora.linshare.core.facade.webservice.user.dto.FunctionalityStringDto;

public class StringValueFunctionality extends OneValueFunctionality<String> {

    public StringValueFunctionality() {
        super();
    }

    public StringValueFunctionality(String identifier, boolean system, Policy activationPolicy, Policy configurationPolicy, AbstractDomain domain, String value) {
        super(identifier, system, activationPolicy, configurationPolicy, domain, value);
    }

    @Override
    public FunctionalityType getType() {
        return FunctionalityType.STRING;
    }

    @Override
    public boolean businessEquals(AbstractFunctionality obj, boolean checkPolicies) {
        if (super.businessEquals(obj, checkPolicies)) {
            StringValueFunctionality o = (StringValueFunctionality) obj;
            if (value.equals(o.getValue())) {
                logger.debug("StringValueFunctionality : " + this.toString() + " is equal to StringValueFunctionality " + obj.toString());
                return true;
            }
        }
        logger.debug("StringValueFunctionality : " + this.toString() + " is not equal to StringValueFunctionality " + obj.toString());

    @Override
    public void updateFunctionalityFrom(AbstractFunctionality functionality) {
        super.updateFunctionalityFrom(functionality);
        this.updateFunctionalityValuesOnlyFrom(functionality);
    }

    @Override
    public void updateFunctionalityValuesOnlyFrom(AbstractFunctionality functionality) {
        StringValueFunctionality f = (StringValueFunctionality) functionality;
        this.value = f.getValue();
    }

    @Override
    public void updateFunctionalityValuesOnlyFromDto(Integer version, FunctionalityAdminDto functionality) {
        List<ParameterDto> parameters = functionality.getParameters();
        if (parameters != null && !parameters.isEmpty()) {
            ParameterDto parameterDto = parameters.get(0);
            this.value = parameterDto.getString();
        }
    }

    @Override
    public List<ParameterDto> getParameters(Integer version) {
        List<ParameterDto> res = new ArrayList<ParameterDto>();
        res.add(new ParameterDto(this.getValue()));
        return res;
    }

    @Override
    protected FunctionalityDto getUserDto(boolean enable, Integer version) {
        FunctionalityStringDto f = new FunctionalityStringDto();
        if (enable) {
            f.setValue(value);
        }
        return f;
    }

    @Override
    public org.linagora.linshare.core.facade.webservice.adminv5.dto.parameters.ParameterDto<?> getParameter() {
        // there is no default value for functionality parameters. sad.
        String parentValue = this.value;
        if (this.ancestorFunc != null) {
            parentValue = ((StringValueFunctionality) this.ancestorFunc).getValue();
        }
        NestedStringParameterDto defaut = new NestedStringParameterDto(this.value, parentValue);
        return new StringParameterDto(this.system, !this.getParentAllowParametersUpdate(), defaut);
    }
}


/*
 * LinShare is an open source filesharing software developed by LINAGORA.
 *
 *
 * notably (i) retain the display in the interface of the “LinShare™”
 * trademark/logo, the "Libre & Free" mention, the words “You are using the Free
 * Contribute to Linshare R&D by subscribing to an Enterprise offer!”. You must
 * also retain the latter notice in all asynchronous messages such as e-mails
 * sent with the Program, (ii) retain all hypertext links between LinShare and
 * http://www.linshare.org, between linagora.com and Linagora, and (iii) refrain
 * from infringing Linagora intellectual property rights over its trademarks and
 * commercial brands. Other Additional Terms apply, see
 * version 3 and
 * <http://www.linshare.org/licenses/LinShare-License_AfferoGPL-v3.pdf> for the
 * Additional Terms applicable to LinShare software.
 */
package org.linagora.linshare.core.domain.entities;

import java.util.ArrayList;
import java.util.List;
import org.linagora.linshare.core.domain.constants.FunctionalityType;
import org.linagora.linshare.core.facade.webservice.admin.dto.FunctionalityAdminDto;
import org.linagora.linshare.core.facade.webservice.adminv5.dto.parameters.StringParameterDto;
import org.linagora.linshare.core.facade.webservice.adminv5.dto.parameters.nested.NestedStringParameterDto;
import org.linagora.linshare.core.facade.webservice.common.dto.ParameterDto;
import org.linagora.linshare.core.facade.webservice.user.dto.FunctionalityDto;
import org.linagora.linshare.core.facade.webservice.user.dto.FunctionalityStringDto;

public class StringValueFunctionality extends OneValueFunctionality<String> {

    public StringValueFunctionality() {
        super();
    }

    public StringValueFunctionality(String identifier, boolean system, Policy activationPolicy, Policy configurationPolicy, AbstractDomain domain, String value) {
        super(identifier, system, activationPolicy, configurationPolicy, domain, value);
    }

    @Override
    public FunctionalityType getType() {
        return FunctionalityType.STRING;
    }

    @Override
    public boolean businessEquals(AbstractFunctionality obj, boolean checkPolicies) {
        if (super.businessEquals(obj, checkPolicies)) {
            StringValueFunctionality o = (StringValueFunctionality) obj;
            if (value.equals(o.getValue())) {
                logger.debug("StringValueFunctionality : " + this.toString() + " is equal to StringValueFunctionality " + obj.toString());
                return true;
            }
        }
        logger.debug("StringValueFunctionality : " + this.toString() + " is not equal to StringValueFunctionality " + obj.toString());
        return false;
    }

    @Override
    public void updateFunctionalityFrom(AbstractFunctionality functionality) {
        super.updateFunctionalityFrom(functionality);
        this.updateFunctionalityValuesOnlyFrom(functionality);
    }

    @Override
    public void updateFunctionalityValuesOnlyFrom(AbstractFunctionality functionality) {
        StringValueFunctionality f = (StringValueFunctionality) functionality;
        this.value = f.getValue();
    }

    @Override
    public void updateFunctionalityValuesOnlyFromDto(Integer version, FunctionalityAdminDto functionality) {
        List<ParameterDto> parameters = functionality.getParameters();
        if (parameters != null && !parameters.isEmpty()) {
            ParameterDto parameterDto = parameters.get(0);
            this.value = parameterDto.getString();
        }
    }

    @Override
    public List<ParameterDto> getParameters(Integer version) {
        List<ParameterDto> res = new

        res.add(new ParameterDto(this.getValue()));
        return res;
    }

    @Override
    protected FunctionalityDto getUserDto(boolean enable, Integer version) {
        FunctionalityStringDto f = new FunctionalityStringDto();
        if (enable) {
            f.setValue(value);
        }
        return f;
    }

    @Override
    public org.linagora.linshare.core.facade.webservice.adminv5.dto.parameters.ParameterDto<?> getParameter() {
        // there is no default value for functionality parameters. sad.
        String parentValue = this.value;
        if (this.ancestorFunc != null) {
            parentValue = ((StringValueFunctionality) this.ancestorFunc).getValue();
        }
        NestedStringParameterDto defaut = new NestedStringParameterDto(this.value, parentValue);
        return new StringParameterDto(this.system, !this.getParentAllowParametersUpdate(), defaut);
    }
}


if (super.businessEquals(obj, checkPolicies)) {
            StringValueFunctionality o = (StringValueFunctionality) obj;
            if (value.equals(o.getValue())) {
                logger.debug("StringValueFunctionality : " + this.toString() + " is equal to StringValueFunctionality " + obj.toString());
                return true;
            }
        }


/*
 * LinShare is an open source filesharing software developed by LINAGORA.
 *
 *
 * notably (i) retain the display in the interface of the “LinShare™”
 * trademark/logo, the "Libre & Free" mention, the words “You are using the Free
 * Contribute to Linshare R&D by subscribing to an Enterprise offer!”. You must
 * also retain the latter notice in all asynchronous messages such as e-mails
 * sent with the Program, (ii) retain all hypertext links between LinShare and
 * http://www.linshare.org, between linagora.com and Linagora, and (iii) refrain
 * from infringing Linagora intellectual property rights over its trademarks and
 * commercial brands. Other Additional Terms apply, see
 * version 3 and
 * <http://www.linshare.org/licenses/LinShare-License_AfferoGPL-v3.pdf> for the
 * Additional Terms applicable to LinShare software.
 */
package org.linagora.linshare.core.domain.entities;

import java.util.ArrayList;
import java.util.List;
import org.linagora.linshare.core.domain.constants.FunctionalityType;
import org.linagora.linshare.core.facade.webservice.admin.dto.FunctionalityAdminDto;
import org.linagora.linshare.core.facade.webservice.adminv5.dto.parameters.StringParameterDto;
import org.linagora.linshare.core.facade.web

service.adminv5.dto.parameters.nested.NestedStringParameterDto;
import org.linagora.linshare.core.facade.webservice.common.dto.ParameterDto;
import org.linagora.linshare.core.facade.webservice.user.dto.FunctionalityDto;
import org.linagora.linshare.core.facade.webservice.user.dto.FunctionalityStringDto;

public class StringValueFunctionality extends OneValueFunctionality<String> {

    public StringValueFunctionality() {
        super();
    }

    public StringValueFunctionality(String identifier, boolean system, Policy activationPolicy, Policy configurationPolicy, AbstractDomain domain, String value) {
        super(identifier, system, activationPolicy, configurationPolicy, domain, value);
    }

    @Override
    public FunctionalityType getType() {
        return FunctionalityType.STRING;
    }

    @Override
    public boolean businessEquals(AbstractFunctionality obj, boolean checkPolicies) {
        if (super.businessEquals(obj, checkPolicies)) {
            StringValueFunctionality o = (StringValueFunctionality) obj;
            if (value.equals(o.getValue())) {
                logger.debug("StringValueFunctionality : " + this.toString() + " is equal to StringValueFunctionality " + obj.toString());
                return true;
            }
        }
        logger.debug("StringValueFunctionality : " + this.toString() + " is not equal to StringValueFunctionality " + obj.toString());
        return false;
    }

    @Override
    public void updateFunctionalityFrom(AbstractFunctionality functionality) {
        super.updateFunctionalityFrom(functionality);
        this.updateFunctionalityValuesOnlyFrom(functionality);
    }

    @Override
    public void updateFunctionalityValuesOnlyFrom(AbstractFunctionality functionality) {
        StringValueFunctionality f = (StringValueFunctionality) functionality;
        this.value = f.getValue();
    }

    @Override
    public void updateFunctionalityValuesOnlyFromDto(Integer version, FunctionalityAdminDto functionality) {
        List<ParameterDto> parameters = functionality.getParameters();
        if (parameters != null && !parameters.isEmpty()) {
            ParameterDto parameterDto = parameters.get(0);
            this.value = parameterDto.getString();
        }
    }

    @Override
    public List<ParameterDto> getParameters(Integer version) {
        List<ParameterDto> res = new ArrayList<ParameterDto>();
        res.add(new ParameterDto(this.getValue()));
        return res;
    }

    @Override
    protected FunctionalityDto getUserDto(boolean enable, Integer version) {
        FunctionalityStringDto f = new FunctionalityStringDto();
        if (enable) {
            f.setValue(value);
        }
        return f;
    }

    @Override
    public org.linagora.linshare.core.facade.webservice.adminv5.dto.parameters.ParameterDto<?> getParameter() {
        // there is no default value for functionality parameters. sad.
        String parentValue = this.value;
        if (this.ancestorFunc != null) {
            parentValue = ((StringValueFunctionality) this.ancestorFunc).getValue();
        }
        NestedStringParameterDto defaut = new NestedStringParameterDto(this.value, parentValue);
        return new StringParameterDto(this.system, !this.getParentAllowParametersUpdate(), defaut);
    }
}


package com.webcodepro.applecommander.ui.swt.filteradapter;

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import com.webcodepro.applecommander.ui.swt.FileViewerWindow;
import com.webcodepro.applecommander.ui.swt.util.contentadapter.StyledTextAdapter;

/**
 * Provides a view of a simple text file.
 *
 * @author Rob Greene
 */
public class TextFilterAdapter extends FilterAdapter {

    private String textContent;

    public TextFilterAdapter(FileViewerWindow window, String text, String toolTipText, Image image) {
        super(window, text, toolTipText, image);
    }

    public void display() {
        if (textContent == null) {
            textContent = createTextContent();
        }
        getCopyToolItem().setEnabled(true);
        createTextWidget(textContent);
    }

{
        return new String(getFileFilter().filter(getFileEntry()));
    }

    protected void createTextWidget(String textContents) {
        StyledText styledText = new StyledText(getComposite(), SWT.NONE);
        styledText.setText(textContents);
        styledText.setFont(getCourierFont());
        styledText.setEditable(false);
        Point size = styledText.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
        getComposite().setContent(styledText);
        getComposite().setExpandHorizontal(true);
        getComposite().setExpandVertical(true);
        getComposite().setMinWidth(size.x);
        getComposite().setMinHeight(size.y);
        getComposite().getContent().addListener(SWT.KeyUp, getToolbarCommandHandler());
        getToolItem().setSelection(true);
        setContentTypeAdapter(new StyledTextAdapter(styledText, getFileEntry().getFilename()));
    }
}


{
        return new String(getFileFilter().filter(getFileEntry()));
    }

package com.webcodepro.applecommander.ui.swt.filteradapter;

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import com.webcodepro.applecommander.ui.swt.FileViewerWindow;
import com.webcodepro.applecommander.ui.swt.util.contentadapter.StyledTextAdapter;

/**
 * Provides a view of a simple text file.
 *
 * @author Rob Greene
 */
public class TextFilterAdapter extends FilterAdapter {

    private String textContent;

    public TextFilterAdapter(FileViewerWindow window, String text, String toolTipText, Image image) {
        super(window, text, toolTipText, image);
    }

    public void display() {
        if (textContent == null) {
            textContent = createTextContent();
        }
        getCopyToolItem().setEnabled(true);
        createTextWidget(textContent);
    }

    protected String createTextContent()

    protected void createTextWidget(String textContents) {
        StyledText styledText = new StyledText(getComposite(), SWT.NONE);
        styledText.setText(textContents);
        styledText.setFont(getCourierFont());
        styledText.setEditable(false);
        Point size = styledText.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
        getComposite().setContent(styledText);
        getComposite().setExpandHorizontal(true);
        getComposite().setExpandVertical(true);
        getComposite().setMinWidth(size.x);
        getComposite().setMinHeight(size.y);
        getComposite().getContent().addListener(SWT.KeyUp, getToolbarCommandHandler());
        getToolItem().setSelection(true);
        setContentTypeAdapter(new StyledTextAdapter(styledText, getFileEntry().getFilename()));
    }
}


        StyledText styledText = new StyledText(getComposite(), SWT.NONE);
        styledText.setText(textContents);
        styledText.setFont(getCourierFont());
        styledText.setEditable(false);

package com.webcodepro.applecommander.ui.swt.filteradapter;

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import com.webcodepro.applecommander.ui.swt.FileViewerWindow;
import com.webcodepro.applecommander.ui.swt.util.contentadapter.StyledTextAdapter;

/**
 * Provides a view of a simple text file.
 *
 * @author Rob Greene
 */
public class TextFilterAdapter extends FilterAdapter {

    private String textContent;

    public TextFilterAdapter(FileViewerWindow window, String text, String toolTipText, Image image) {
        super(window, text, toolTipText, image);
    }

    public void display() {
        if (textContent == null) {
            textContent = createTextContent();
        }
        getCopyToolItem().setEnabled(true);
        createTextWidget(textContent);
    }

    protected String createTextContent() {
        return new String(getFileFilter().filter(getFileEntry()));
    }

    protected void createTextWidget(String textContents) {

        Point size = styledText.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
        getComposite().setContent(styledText);
        getComposite().setExpandHorizontal(true);
        getComposite().setExpandVertical(true);
        getComposite().setMinWidth(size.x);
        getComposite().setMinHeight(size.y);
        getComposite().getContent().addListener(SWT.KeyUp, getToolbarCommandHandler());
        getToolItem().setSelection(true);
        setContentTypeAdapter(new StyledTextAdapter(styledText, getFileEntry().getFilename()));
    }
}


Point size = styledText.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
        getComposite().setContent(styledText);
        getComposite().setExpandHorizontal(true);
        getComposite().setExpandVertical(true);
        getComposite().setMinWidth(size.x);

package com.webcodepro.applecommander.ui.swt.filteradapter;

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import com.webcodepro.applecommander.ui.swt.FileViewerWindow;
import com.webcodepro.applecommander.ui.swt.util.contentadapter.StyledTextAdapter;

/**
 * Provides a view of a simple text file.
 *
 * @author Rob Greene
 */
public class TextFilterAdapter extends FilterAdapter {

    private String textContent;

    public TextFilterAdapter(FileViewerWindow window, String text, String toolTipText, Image image) {
        super(window, text, toolTipText, image);
    }

    public void display() {
        if (textContent == null) {
            textContent = createTextContent();
        }
        getCopyToolItem().setEnabled(true);
        createTextWidget(textContent);
    }

    protected String createTextContent() {
        return new String(getFileFilter().filter(getFileEntry()));
    }

    protected void createTextWidget(String textContents) {
        StyledText styledText = new StyledText(getComposite(), SWT.NONE);
        styledText.setText(textContents);
        styledText.setFont(getCourierFont());
        styledText.setEditable(false);

        getComposite().setMinHeight(size.y);
        getComposite().getContent().addListener(SWT.KeyUp, getToolbarCommandHandler());
        getToolItem().setSelection(true);
        setContentTypeAdapter(new StyledTextAdapter(styledText, getFileEntry().getFilename()));
    }
}


getComposite().setMinHeight(size.y);
        getComposite().getContent().addListener(SWT.KeyUp, getToolbarCommandHandler());
        getToolItem().setSelection(true);
        setContentTypeAdapter(new StyledTextAdapter(styledText, getFileEntry().getFilename()));
    }

package com.webcodepro.applecommander.ui.swt.filteradapter;

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import com.webcodepro.applecommander.ui.swt.FileViewerWindow;
import com.webcodepro.applecommander.ui.swt.util.contentadapter.StyledTextAdapter;

/**
 * Provides a view of a simple text file.
 *
 * @author Rob Greene
 */
public class TextFilterAdapter extends FilterAdapter {

    private String textContent;

    public TextFilterAdapter(FileViewerWindow window, String text, String toolTipText, Image image) {
        super(window, text, toolTipText, image);
    }

    public void display() {
        if (textContent == null) {
            textContent = createTextContent();
        }
        getCopyToolItem().setEnabled(true);
        createTextWidget(textContent);
    }

    protected String createTextContent() {
        return new String(getFileFilter().filter(getFileEntry()));
    }

    protected void createTextWidget(String textContents) {
        StyledText styledText = new StyledText(getComposite(), SWT.NONE);
        styledText.setText(textContents);
        styledText.setFont(getCourierFont());
        styledText.setEditable(false);
        Point size = styledText.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
        getComposite().setContent(styledText);
        getComposite().setExpandHorizontal(true);
        getComposite().setExpandVertical(true);
        getComposite().setMinWidth(size.x);


package com.webcodepro.applecommander.ui.swt.filteradapter;

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import com.webcodepro.applecommander.ui.swt.FileViewerWindow;
import com.webcodepro.applecommander.ui.swt.util.contentadapter.StyledTextAdapter;

/**
 * Provides a view of a simple text file.
 *
 * @author Rob Greene
 */
public class TextFilterAdapter extends FilterAdapter {

    private String textContent;

    public TextFilterAdapter(FileViewerWindow window, String text, String toolTipText, Image image) {
        super(window, text, toolTipText, image);
    }

    public void display() {
        if (textContent == null) {
            textContent = createTextContent();
        }
        getCopyToo

        createTextWidget(textContent);
    }

    protected String createTextContent() {
        return new String(getFileFilter().filter(getFileEntry()));
    }

    protected void createTextWidget(String textContents) {
        StyledText styledText = new StyledText(getComposite(), SWT.NONE);
        styledText.setText(textContents);
        styledText.setFont(getCourierFont());
        styledText.setEditable(false);
        Point size = styledText.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
        getComposite().setContent(styledText);
        getComposite().setExpandHorizontal(true);
        getComposite().setExpandVertical(true);
        getComposite().setMinWidth(size.x);
        getComposite().setMinHeight(size.y);
        getComposite().getContent().addListener(SWT.KeyUp, getToolbarCommandHandler());
        getToolItem().setSelection(true);
        setContentTypeAdapter(new StyledTextAdapter(styledText, getFileEntry().getFilename()));
    }
}


if (textContent == null) {
            textContent = createTextContent();
        }

package com.webcodepro.applecommander.ui.swt.filteradapter;

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import com.webcodepro.applecommander.ui.swt.FileViewerWindow;
import com.webcodepro.applecommander.ui.swt.util.contentadapter.StyledTextAdapter;

/**
 * Provides a view of a simple text file.
 *
 * @author Rob Greene
 */
public class TextFilterAdapter extends FilterAdapter {

    private String textContent;

    public TextFilterAdapter(FileViewerWindow window, String text, String toolTipText, Image image) {
        super(window, text, toolTipText, image);
    }

    public void display() {

        getCopyToolItem().setEnabled(true);
        createTextWidget(textContent);
    }

    protected String createTextContent() {
        return new String(getFileFilter().filter(getFileEntry()));
    }

    protected void createTextWidget(String textContents) {
        StyledText styledText = new StyledText(getComposite(), SWT.NONE);
        styledText.setText(textContents);
        styledText.setFont(getCourierFont());
        styledText.setEditable(false);
        Point size = styledText.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
        getComposite().setContent(styledText);
        getComposite().setExpandHorizontal(true);
        getComposite().setExpandVertical(true);
        getComposite().setMinWidth(size.x);
        getComposite().setMinHeight(size.y);
        getComposite().getContent().addListener(SWT.KeyUp, getToolbarCommandHandler());
        getToolItem().setSelection(true);
        setContentTypeAdapter(new StyledTextAdapter(styledText, getFileEntry().getFilename()));
    }
}


package com.webcodepro.applecommander.ui.swt.filteradapter;

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
import com.webcodepro.applecommander.ui.swt.FileViewerWindow;
import com.webcodepro.applecommander.ui.swt.util.contentadapter.StyledTextAdapter;

/**
 * Provides a view of a simple text file.
 *
 * @author Rob Greene
 */
public class TextFilterAdapter extends FilterAdapter {

    private String textContent;

    public TextFilterAdapter(FileViewerWindow window, String text, String toolTipText, Image image) {
        super(window, text, toolTipText, image);
    }

    public void display() {
        if (textContent == null) {
            textContent = createTextContent();
        }
        getCopyToolItem().setEnabled(true);
        createTextWidget(textContent);
    }

    protected String createTextContent() {
        return new String(getFileFilter().filter(getFileEntry()));
    }

    protected void createTextWidget(String textContents) {
        StyledText styledText = new StyledText(getComposite(), SWT.NONE);
        styledText.setText(textContents);
        styledText.setFont(getCourierFont());
        styledText.setEditable(false);
        Point size = styledText.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
        getComposite().setContent(styledText);
        getComposite().setExpandHorizon

tal(true);
        getComposite().setExpandVertical(true);
        getComposite().setMinWidth(size.x);
        getComposite().setMinHeight(size.y);
        getComposite().getContent().addListener(SWT.KeyUp, getToolbarCommandHandler());
        getToolItem().setSelection(true);
        setContentTypeAdapter(new StyledTextAdapter(styledText, getFileEntry().getFilename()));
    }
}


package org.openhab.binding.lcn.internal.pchkdiscovery;

import org.eclipse.jdt.annotation.NonNullByDefault;
import com.thoughtworks.xstream.annotations.XStreamConverter;
import com.thoughtworks.xstream.converters.extended.ToAttributedValueConverter;

/**
 * Used for deserializing the XML response of the LCN-PCHK discovery protocol.
 *
 * @author Fabian Wolter - Initial contribution
 */
@NonNullByDefault
@XStreamConverter(value = ToAttributedValueConverter.class, strings = { "content" })
public class ExtService {

    private final int localPort;

    @SuppressWarnings("unused")
    private final String content = "";

    public ExtService(int localPort) {
        this.localPort = localPort;
    }


package org.openhab.binding.lcn.internal.pchkdiscovery;

import org.eclipse.jdt.annotation.NonNullByDefault;
import com.thoughtworks.xstream.annotations.XStreamConverter;
import com.thoughtworks.xstream.converters.extended.ToAttributedValueConverter;

/**
 * Used for deserializing the XML response of the LCN-PCHK discovery protocol.
 *
 * @author Fabian Wolter - Initial contribution
 */
@NonNullByDefault
@XStreamConverter(value = ToAttributedValueConverter.class, strings = { "content" })
public class ExtService {

    private final int localPort;

    @SuppressWarnings("unused")
    private final String content = "";

    public ExtService(int localPort) {
        this.localPort = localPort;
    }

    public int getLocalPort()


package org.openhab.binding.lcn.internal.pchkdiscovery;

import org.eclipse.jdt.annotation.NonNullByDefault;
import com.thoughtworks.xstream.annotations.XStreamConverter;
import com.thoughtworks.xstream.converters.extended.ToAttributedValueConverter;

/**
 * Used for deserializing the XML response of the LCN-PCHK discovery protocol.
 *
 * @author Fabian Wolter - Initial contribution
 */
@NonNullByDefault
@XStreamConverter(value = ToAttributedValueConverter.class, strings = { "content" })
public class ExtService {

    private final int localPort;

    @SuppressWarnings("unused")
    private final String content = "";

    public ExtService(int localPort) {
        this.localPort = localPort;
    }

    public int getLocalPort() {
        return


package org.openhab.binding.lcn.internal.pchkdiscovery;

import org.eclipse.jdt.annotation.NonNullByDefault;
import com.thoughtworks.xstream.annotations.XStreamConverter;
import com.thoughtworks.xstream.converters.extended.ToAttributedValueConverter;

/**
 * Used for deserializing the XML response of the LCN-PCHK discovery protocol.
 *
 * @author Fabian Wolter - Initial contribution
 */
@NonNullByDefault
@XStreamConverter(value = ToAttributedVal

ueConverter.class, strings = { "content" })
public class ExtService {

    private final int localPort;

    @SuppressWarnings("unused")
    private final String content = "";

    public ExtService(int localPort) {
        this.localPort = localPort;
    }

    public int getLocalPort() {
        return localPort;
    }
}


@Bean
    public ViewResolver rockerViewResolver()

package com.jeroenreijn.examples.configuration;

import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import com.jeroenreijn.examples.view.*;
import org.fusesource.scalate.spring.view.ScalateViewResolver;
import org.rythmengine.spring.web.RythmConfigurer;
import org.rythmengine.spring.web.RythmViewResolver;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.MessageSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.ViewResolver;
import org.springframework.web.servlet.config.annotation.DefaultServletHandlerConfigurer;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.i18n.SessionLocaleResolver;
import org.springframework.web.servlet.view.InternalResourceViewResolver;
import org.springframework.web.servlet.view.JstlView;
import org.thymeleaf.spring5.SpringTemplateEngine;
import org.thymeleaf.spring5.templateresolver.SpringResourceTemplateResolver;
import org.thymeleaf.spring5.view.ThymeleafViewResolver;
import org.thymeleaf.templatemode.TemplateMode;
import com.github.enpassant.ickenham.springmvc.IckenhamViewResolver;
import com.github.jknack.handlebars.springmvc.HandlebarsViewResolver;
import com.jeroenreijn.examples.repository.InMemoryPresentationsRepository;
import com.jeroenreijn.examples.repository.PresentationsRepository;
import com.x5.template.spring.ChunkTemplateView;
import de.neuland.jade4j.JadeConfiguration;
import de.neuland.jade4j.spring.template.SpringTemplateLoader;
import de.neuland.jade4j.spring.view.JadeViewResolver;
import httl.web.springmvc.HttlViewResolver;

@Configuration
@EnableWebMvc
@ComponentScan(basePackages = { "com.jeroenreijn.examples.controller", "com.jeroenreijn.examples.factory" })
public class WebMvcConfig implements ApplicationContextAware, WebMvcConfigurer {

    private ApplicationContext applicationContext;

    @Override
    public void setApplicationContext(final ApplicationContext applicationContext) throws BeansException {
        this.applicationContext = applicationContext;
    }

    @Override
    public void configureDefaultServletHandling(DefaultServletHandlerConfigurer configurer) {
        configurer.enable();
    }

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/robots.txt").addResourceLocations("/robots.txt");
        registry.addResourceHandler("/webjars/**").addResourceLocations("/webjars/");
        registry.addResourceHandler("/resources/**").addResourceLocations("/resources/");
    }

    @Bean
    public MessageSource messageSource() {
        ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
        messageSource.setBasename("classpath:/messages");
        messageSource.setDefaultEncoding("UTF-8");
        return messageSource;
    }

    @Bean
    public LocaleResolver localeResolver() {
        SessionLocaleResolver slr = new SessionLocaleResolver();
        slr.setDefaultLocale(Locale.US);
        return slr;
    }

    @Bean
    public PresentationsRepository presentationsRepository() {
        PresentationsRepository inMemory = new InMemoryPresentationsRepository();
        return inMemory;
    }

    @Bean
    public SpringResourceTemplateResolver thymeleafTemplateResolver() {
        SpringResourceTemplateResolver templateResolver = new SpringResourceTemplateResolver();
        templateResolver.setApplicationContext(this.applicationContext);
        templateResolver.setPrefix("/WEB-INF/thymeleaf/");
        templateResolver.setSuffix(".html");
        templateResolver.setTemplateMode(TemplateMode.HTML);
        templateResolver.setCacheable(false);
        templateResolver.setCharacterEncoding("UTF-8");
        return templateResolver;
    }

    @Bean
    public SpringTemplateEngine thymeleafTemplateEngine() {
        SpringTemplateEngine templateEngine = new SpringTemplateEngine();
        templateEngine.setTemplateResolver(thymeleafTemplateResolver());
        return templateEngine;
    }

    @Bean
    public ViewResolver thymeleafViewResolver() {
        ThymeleafViewResolver viewResolver = new ThymeleafViewResolver();
        viewResolver.setViewNames(new String[] { "*-thymeleaf" });
        viewResolver.setTemplateEngine(thymeleafTemplateEngine());
        viewResolver.setCharacterEncoding("UTF-8");
        viewResolver.setCache(false);
        return viewResolver;
    }

    @Bean
    public ViewResolver handlebarsViewResolver() {
        HandlebarsViewResolver viewResolver = new HandlebarsViewResolver();
        viewResolver.setViewNames("*-handlebars");
        viewResolver.setPrefix("/WEB-INF/handlebars/");
        viewResolver.setSuffix(".hbs");
        viewResolver.setCache(false);
        return viewResolver;
    }

    @Bean(name = "chunkTemplatesConfig")
    @Scope("prototype")
    public Map<String, String> chunkTemplatesConfig() {
        Map<String, String> config = new HashMap<>();
        config.put("default_extension", "chtml");
        config.put("cache_minutes", "0");
        config.put("layers", "");
        config.put("theme_path", "");
        config.put("hide_errors", "FALSE");
        config.put("error_log", "");
        config.put("encoding", "UTF-8");
        config.put("locale", "");
        config.put("filters", "");
        return config;
    }

    @Bean
    public ViewResolver chunkViewResolver() {
        InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
        viewResolver.setViewClass(ChunkTemplateView.class);
        viewResolver.setPrefix("/WEB-INF/chunk/");
        viewResolver.setViewNames("*-chunk");
        viewResolver.setSuffix(".chtml");
        viewResolver.setCache(false);
        viewResolver.setRequestContextAttribute("rc");
        viewResolver.setContentType("text/html;charset=UTF-8");
        return viewResolver;
    }

    @Bean
    public ViewResolver jspViewResolver() {
        InternalResourceViewResolver viewResolver = new InternalResourceViewResolver();
        viewResolver.setViewClass(JstlView.class);
        viewResolver.setPrefix("/WEB-INF/jsp/");
        viewResolver.setViewNames("*-jsp");
        viewResolver.setSuffix(".jsp");
        viewResolver.setCache(false);
        viewResolver.setRequestContextAttribute("rc");
        return viewResolver;
    }

    @Bean
    public ViewResolver httlViewResolver() {
        HttlViewResolver viewResolver = new HttlViewResolver();
        viewResolver.setContentType("text/html;charset=UTF-8");
        viewResolver.setViewNames("*-httl");
        viewResolver.setCache(false);
        return viewResolver;
    }

    @Bean
    public SpringTemplateLoader jade4jTemplateLoader() {
        SpringTemplateLoader templateLoader = new SpringTemplateLoader();
        templateLoader.setEncoding("UTF-8");
        return templateLoader;
    }

    @Bean
    public JadeConfiguration jadeConfiguration() {
        JadeConfiguration config = new JadeConfiguration();
        config.setPrettyPrint(true);
        config.setCaching(false);
        config.setTemplateLoader(applicationContext.getBean(SpringTemplateLoader.class));
        return config;
    }

    @Bean
    public ViewResolver jadeViewResolver() {
        JadeViewResolver viewResolver = new JadeViewResolver();
        viewResolver.setPrefix("/WEB-INF/jade/");
        viewResolver.setSuffix(".jade");
        viewResolver.setViewNames("*-jade");
        viewResolver.setRenderExceptions(true);
        viewResolver.setCache(false);
        viewResolver.setConfiguration(applicationContext.getBean(JadeConfiguration.class));
        return viewResolver;
    }

    @Bean
    public ViewResolver scalateViewResolver() {
        ScalateViewResolver viewResolver = new ScalateViewResolver();
        viewResolver.setPrefix("/WEB-INF/scalate/");
        viewResolver.setSuffix(".scaml");
        viewResolver.setViewNames("*-scalate");
        viewResolver.setRequestContextAttribute("rc");
        viewResolver.setCache(false);
        viewResolver.setContentType("text/html;charset=UTF-8");
        return viewResolver;
    }

    @Bean
    public ViewResolver htmlFlowViewResolver() {
        HtmlFlowViewResolver viewResolver = new HtmlFlowViewResolver();
        viewResolver.setViewNames("*-htmlFlow");
        viewResolver.setCache(false);
        return viewResolver;
    }

    @Bean
    public ViewResolver trimouViewResolver() {
        MessageSource messageSource = applicationContext.getBean(MessageSource.class);
        TrimouViewResolver viewResolver = new TrimouViewResolver(messageSource);
        viewResolver.setPrefix("classpath:/templates/trimou/");
        viewResolver.setSuffix(".trimou");
        viewResolver.setViewNames("*-trimou");
        viewResolver.setCache(false);
        return viewResolver;
    }

{
        RockerViewResolver viewResolver = new RockerViewResolver();
        viewResolver.setViewNames("*-rocker");
        viewResolver.setCache(false);
        return viewResolver;
    }

    @Bean
    public ViewResolver ickenhamViewResolver() {
        IckenhamViewResolver viewResolver = new IckenhamViewResolver();
        viewResolver.setPrefix("/WEB-INF/ickenham/");
        viewResolver.setSuffix(".hbs");
        viewResolver.setViewNames("*-ickenham");
        viewResolver.setRequestContextAttribute("rc");
        viewResolver.setCache(false);
        viewResolver.setContentType("text/html;charset=UTF-8");
        return viewResolver;
    }

    @Bean
    public RythmConfigurer rythmConfigurer() {
        RythmConfigurer conf = new RythmConfigurer();
        conf.setDevMode(true);
        conf.setResourceLoaderPath("/WEB-INF/rythm/");
        conf.setAutoImports("com.jeroenreijn.examples.model.*");
        return conf;
    }

    @Bean
    public ViewResolver rythmViewResolver() {
        RythmViewResolver viewResolver = new RythmViewResolver();
        viewResolver.setPrefix("/WEB-INF/rythm/");
        viewResolver.setSuffix(".html");
        viewResolver.setViewNames("*-rythm");
        viewResolver.setCache(false);
        viewResolver.setContentType("text/html;charset=UTF-8");
        return viewResolver;
    }

    @Bean
    public LiqpViewResolver liqpViewResolver() {
        LiqpViewResolver viewResolver = new LiqpViewResolver(applicationContext.getBean(MessageSource.class));
        viewResolver.setViewClass(LiqpView.class);
        viewResolver.setPrefix("classpath:./templates/liqp/");
        viewResolver.setSuffix(".liqp");
        viewResolver.setViewNames("*-liqp");
        viewResolver.setCache(false);
        viewResolver.setContentType("text/html;charset=UTF-8");
        return viewResolver;
    }

    @Bean
    public ViewResolver kotlinxHtmlViewResolver() {
        KotlinxHtmlViewResolver viewResolver = new KotlinxHtmlViewResolver();
        viewResolver.setViewNames("*-kotlinx");
        viewResolver.setCache(false);
        return viewResolver;
    }

    @Controller
    static class FaviconController {

        @RequestMapping("favicon.ico")
        String favicon() {
            return "forward:/resources/images/favicon.ico";
        }
    }
}