Package org.apache.syncope.core.persistence.beans.conf

Examples of org.apache.syncope.core.persistence.beans.conf.CSchema


    }

    @Test
    public void setAndDelete() {
        // 1. create CSChema
        CSchema useless = new CSchema();
        useless.setName("useless");
        useless.setType(AttributeSchemaType.Date);
        useless.setConversionPattern("yyyy-MM-dd");
        useless = schemaDAO.save(useless);

        // 2. create conf
        CAttr newConf = new CAttr();
        newConf.setSchema(useless);
View Full Code Here


    }

    @Test
    public void issueSYNCOPE418() {
        try {
            CSchema failing = new CSchema();
            failing.setName("http://schemas.examples.org/security/authorization/organizationUnit");
            failing.setType(AttributeSchemaType.String);
            schemaDAO.save(failing);

            fail();
        } catch (InvalidEntityException e) {
            assertTrue(e.hasViolation(EntityViolationType.InvalidName));
View Full Code Here

        return attributeTO;
    }

    public CAttr getAttribute(final AttributeTO attributeTO) {
        CSchema schema = getNormalSchema(attributeTO.getSchema(), CSchema.class);
        if (schema == null) {
            throw new NotFoundException("Conf schema " + attributeTO.getSchema());
        } else {
            SyncopeClientException invalidValues = SyncopeClientException.build(ClientExceptionType.InvalidValues);
View Full Code Here

            case MEMBERSHIP:
                result = (T) new MSchema();
                break;

            case CONFIGURATION:
                result = (T) new CSchema();
                break;

            default:
        }
View Full Code Here

        // save new, well-formed SyncopeConf and associated CSchema, CAttr and CAttrValue
        for (Map.Entry<String, String> entry : syncopeConf.entrySet()) {
            final String key = entry.getKey();
            final String value = entry.getValue();
            // 1. create CSChema
            CSchema confSchema = new CSchema();
            confSchema.setName(key);
            confSchema.setType(AttributeSchemaType.String);
            confSchema.setMultivalue(value.contains("|"));
            confSchema.setUniqueConstraint(false);
            confSchema.setReadonly(false);
            confSchema = schemaDAO.save(confSchema);
            // 2. create and save CAttr
            final CAttr confAttr = new CAttr();
            confAttr.setSchema(confSchema);
            confAttr.setOwner(confDAO.get());
            if (confSchema.isMultivalue()) {
                for (String singleValue : value.split("|")) {
                    confAttr.addValue(singleValue, AttributableUtil.getInstance(AttributableType.CONFIGURATION));
                }
            } else {
                confAttr.addValue(value, AttributableUtil.getInstance(AttributableType.CONFIGURATION));
View Full Code Here

TOP

Related Classes of org.apache.syncope.core.persistence.beans.conf.CSchema

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.