Package org.apache.syncope.client.to

Examples of org.apache.syncope.client.to.DerivedSchemaTO


     *
     * @param name (e.g.:surname)
     * @return DerivedSchemaTO
     */
    public DerivedSchemaTO readDerivedSchema(final AttributableType type, final String name) {
        DerivedSchemaTO derivedSchemaTO = null;
        try {
            derivedSchemaTO = SyncopeSession.get().getRestTemplate().getForObject(
                    baseURL + "derivedSchema/" + type.name().toLowerCase() + "/read/" + name + ".json",
                    DerivedSchemaTO.class);
        } catch (SyncopeClientCompositeErrorException e) {
View Full Code Here


                new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST));
    }

    public <T extends AbstractDerSchema> DerivedSchemaTO getDerivedSchemaTO(final T derivedSchema) {

        DerivedSchemaTO derivedSchemaTO = new DerivedSchemaTO();
        BeanUtils.copyProperties(derivedSchema, derivedSchemaTO, ignoreDerivedSchemaProperties);

        return derivedSchemaTO;
    }
View Full Code Here

    @Override
    public void setSchemaModalPage(final PageReference callerPageRef, final ModalWindow window,
            AbstractBaseBean schema, final boolean createFlag) {

        if (schema == null) {
            schema = new DerivedSchemaTO();
        }

        final Form schemaForm = new Form("form");

        schemaForm.setModel(new CompoundPropertyModel(schema));

        final AjaxTextFieldPanel name = new AjaxTextFieldPanel("name", getString("name"), new PropertyModel<String>(
                schema, "name"));
        name.addRequiredLabel();

        final AjaxTextFieldPanel expression = new AjaxTextFieldPanel("expression", getString("expression"),
                new PropertyModel<String>(schema, "expression"));
        expression.addRequiredLabel();

        name.setEnabled(createFlag);

        final IndicatingAjaxButton submit = new IndicatingAjaxButton("apply", new ResourceModel("submit")) {

            private static final long serialVersionUID = -958724007591692537L;

            @Override
            protected void onSubmit(final AjaxRequestTarget target, final Form form) {

                DerivedSchemaTO schemaTO = (DerivedSchemaTO) form.getDefaultModelObject();

                try {
                    if (createFlag) {
                        restClient.createDerivedSchema(kind, schemaTO);
                    } else {
View Full Code Here

        }
    }

    @Test
    public void read() {
        DerivedSchemaTO derivedSchemaTO = restTemplate.getForObject(BASE_URL + "derivedSchema/user/read/cn.json",
                DerivedSchemaTO.class);
        assertNotNull(derivedSchemaTO);
    }
View Full Code Here

        assertNotNull(derivedSchemaTO);
    }

    @Test
    public void create() {
        DerivedSchemaTO schema = new DerivedSchemaTO();
        schema.setName("derived");
        schema.setExpression("derived_sx + '_' + derived_dx");

        DerivedSchemaTO actual = restTemplate.postForObject(BASE_URL + "derivedSchema/user/create.json", schema,
                DerivedSchemaTO.class);
        assertNotNull(actual);

        actual = restTemplate.getForObject(BASE_URL + "derivedSchema/user/read/" + actual.getName() + ".json",
                DerivedSchemaTO.class);
        assertNotNull(actual);
        assertEquals(actual.getExpression(), "derived_sx + '_' + derived_dx");
    }
View Full Code Here

        assertEquals(actual.getExpression(), "derived_sx + '_' + derived_dx");
    }

    @Test
    public void delete() {
        DerivedSchemaTO schema = restTemplate.getForObject(BASE_URL + "derivedSchema/role/read/rderiveddata.json",
                DerivedSchemaTO.class);
        assertNotNull(schema);

        DerivedSchemaTO schemaToDelete =
                restTemplate.getForObject(
                BASE_URL + "derivedSchema/role/delete/{schema}", DerivedSchemaTO.class, schema.getName());
        assertNotNull(schemaToDelete);

        Throwable t = null;
View Full Code Here

        assertNotNull(t);
    }

    @Test
    public void update() {
        DerivedSchemaTO schema = restTemplate.getForObject(
                BASE_URL + "derivedSchema/membership/read/mderiveddata.json", DerivedSchemaTO.class);
        assertNotNull(schema);
        assertEquals("mderived_sx + '-' + mderived_dx", schema.getExpression());

        schema.setExpression("mderived_sx + '.' + mderived_dx");

        schema = restTemplate.postForObject(BASE_URL + "derivedSchema/membership/update.json", schema,
                DerivedSchemaTO.class);
        assertNotNull(schema);

        schema = restTemplate.getForObject(BASE_URL + "derivedSchema/membership/read/mderiveddata.json",
                DerivedSchemaTO.class);
        assertNotNull(schema);
        assertEquals("mderived_sx + '.' + mderived_dx", schema.getExpression());
    }
View Full Code Here

    @Override
    public void setSchemaModalPage(final PageReference pageRef, final ModalWindow window,
            AbstractBaseBean schema, final boolean createFlag) {

        if (schema == null) {
            schema = new DerivedSchemaTO();
        }

        final Form schemaForm = new Form("form");

        schemaForm.setModel(new CompoundPropertyModel(schema));

        final AjaxTextFieldPanel name = new AjaxTextFieldPanel("name", getString("name"), new PropertyModel<String>(
                schema, "name"));
        name.addRequiredLabel();

        final AjaxTextFieldPanel expression = new AjaxTextFieldPanel("expression", getString("expression"),
                new PropertyModel<String>(schema, "expression"));
        expression.addRequiredLabel();

        name.setEnabled(createFlag);

        final AjaxButton submit = new ClearIndicatingAjaxButton("apply", new ResourceModel("submit"), pageRef) {

            private static final long serialVersionUID = -958724007591692537L;

            @Override
            protected void onSubmitInternal(final AjaxRequestTarget target, final Form form) {
                DerivedSchemaTO schemaTO = (DerivedSchemaTO) form.getDefaultModelObject();

                try {
                    if (createFlag) {
                        restClient.createDerivedSchema(kind, schemaTO);
                    } else {
View Full Code Here

     *
     * @param name (e.g.:surname)
     * @return DerivedSchemaTO
     */
    public DerivedSchemaTO readDerivedSchema(final AttributableType type, final String name) {
        DerivedSchemaTO derivedSchemaTO = null;
        try {
            derivedSchemaTO = SyncopeSession.get().getRestTemplate().getForObject(
                    baseURL + "derivedSchema/" + type.name().toLowerCase() + "/read/" + name + ".json",
                    DerivedSchemaTO.class);
        } catch (SyncopeClientCompositeErrorException e) {
View Full Code Here

                new SyncopeClientCompositeErrorException(HttpStatus.BAD_REQUEST));
    }

    public <T extends AbstractDerSchema> DerivedSchemaTO getDerivedSchemaTO(final T derivedSchema) {

        DerivedSchemaTO derivedSchemaTO = new DerivedSchemaTO();
        BeanUtils.copyProperties(derivedSchema, derivedSchemaTO, ignoreDerivedSchemaProperties);

        return derivedSchemaTO;
    }
View Full Code Here

TOP

Related Classes of org.apache.syncope.client.to.DerivedSchemaTO

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.