355e5661379644c081271b23fa8b966a098a42d2Jon Branch/*
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
355e5661379644c081271b23fa8b966a098a42d2Jon Branch *
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * Copyright (c) 2015 ForgeRock AS. All Rights Reserved
355e5661379644c081271b23fa8b966a098a42d2Jon Branch *
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * The contents of this file are subject to the terms
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * of the Common Development and Distribution License
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * (the License). You may not use this file except in
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * compliance with the License.
355e5661379644c081271b23fa8b966a098a42d2Jon Branch *
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * You can obtain a copy of the License at
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * http://forgerock.org/license/CDDLv1.0.html
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * See the License for the specific language governing
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * permission and limitations under the License.
355e5661379644c081271b23fa8b966a098a42d2Jon Branch *
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * When distributing Covered Code, include this CDDL
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * Header Notice in each file and include the License file
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * at http://forgerock.org/license/CDDLv1.0.html
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * If applicable, add the following below the CDDL Header,
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * with the fields enclosed by brackets [] replaced by
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * your own identifying information:
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * "Portions Copyrighted [year] [name of copyright owner]"
355e5661379644c081271b23fa8b966a098a42d2Jon Branch *
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * Version {{version}}
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * Author {{author}}
355e5661379644c081271b23fa8b966a098a42d2Jon Branch */
355e5661379644c081271b23fa8b966a098a42d2Jon Branchpackage org.forgerock.openicf.connectors.{{lower packageName}}
355e5661379644c081271b23fa8b966a098a42d2Jon Branch
355e5661379644c081271b23fa8b966a098a42d2Jon Branchimport org.forgerock.openicf.connectors.{{lower packageName}}.{{packageName}}Configuration
355e5661379644c081271b23fa8b966a098a42d2Jon Branchimport org.forgerock.openicf.misc.scriptedcommon.OperationType
355e5661379644c081271b23fa8b966a098a42d2Jon Branchimport org.identityconnectors.common.logging.Log
355e5661379644c081271b23fa8b966a098a42d2Jon Branchimport org.forgerock.openicf.misc.scriptedcommon.ICFObjectBuilder
355e5661379644c081271b23fa8b966a098a42d2Jon Branch
355e5661379644c081271b23fa8b966a098a42d2Jon Branchimport static org.identityconnectors.framework.common.objects.AttributeInfo.Flags.REQUIRED
355e5661379644c081271b23fa8b966a098a42d2Jon Branch
355e5661379644c081271b23fa8b966a098a42d2Jon Branch/**
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * Built-in accessible objects
355e5661379644c081271b23fa8b966a098a42d2Jon Branch **/
355e5661379644c081271b23fa8b966a098a42d2Jon Branch
355e5661379644c081271b23fa8b966a098a42d2Jon Branch// OperationType is SCHEMA for this script
355e5661379644c081271b23fa8b966a098a42d2Jon Branchdef operation = operation as OperationType
355e5661379644c081271b23fa8b966a098a42d2Jon Branch
355e5661379644c081271b23fa8b966a098a42d2Jon Branch// The configuration class created specifically for this connector
355e5661379644c081271b23fa8b966a098a42d2Jon Branchdef configuration = configuration as {{packageName}}Configuration
355e5661379644c081271b23fa8b966a098a42d2Jon Branch
355e5661379644c081271b23fa8b966a098a42d2Jon Branch// Default logging facility
355e5661379644c081271b23fa8b966a098a42d2Jon Branchdef log = log as Log
355e5661379644c081271b23fa8b966a098a42d2Jon Branch
355e5661379644c081271b23fa8b966a098a42d2Jon Branch// The schema builder object
355e5661379644c081271b23fa8b966a098a42d2Jon Branchdef builder = builder as ICFObjectBuilder
355e5661379644c081271b23fa8b966a098a42d2Jon Branch
355e5661379644c081271b23fa8b966a098a42d2Jon Branch/**
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * Script action - Customizable
355e5661379644c081271b23fa8b966a098a42d2Jon Branch *
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * Build the schema for this connector that describes what the ICF client will see. The schema
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * might be statically built or may be built from data retrieved from the external source.
355e5661379644c081271b23fa8b966a098a42d2Jon Branch *
355e5661379644c081271b23fa8b966a098a42d2Jon Branch * This script should use the builder object to create the schema.
355e5661379644c081271b23fa8b966a098a42d2Jon Branch **/
355e5661379644c081271b23fa8b966a098a42d2Jon Branch
355e5661379644c081271b23fa8b966a098a42d2Jon Branch/* Log something to demonstrate this script executed */
355e5661379644c081271b23fa8b966a098a42d2Jon Branchlog.info("Schema script, operation = " + operation.toString());
355e5661379644c081271b23fa8b966a098a42d2Jon Branch
355e5661379644c081271b23fa8b966a098a42d2Jon Branchbuilder.schema({
355e5661379644c081271b23fa8b966a098a42d2Jon Branch {{#objectTypes}}objectClass {
355e5661379644c081271b23fa8b966a098a42d2Jon Branch type {{objectClass}}
355e5661379644c081271b23fa8b966a098a42d2Jon Branch {{#hasProperties}}attributes { {{#properties}}
355e5661379644c081271b23fa8b966a098a42d2Jon Branch {{name}} {{objectDescriptor}}{{/properties}}
355e5661379644c081271b23fa8b966a098a42d2Jon Branch }{{/hasProperties}}
355e5661379644c081271b23fa8b966a098a42d2Jon Branch }
355e5661379644c081271b23fa8b966a098a42d2Jon Branch {{/objectTypes}}
355e5661379644c081271b23fa8b966a098a42d2Jon Branch})