rendered paste body<!DOCTYPE project [
<!ENTITY common SYSTEM "../shared/common.xml">
]>
<!--
=============================================
Community Sample Content Configuration
=============================================
The purpose of this script is to configure the sample with content.
-->
<project name="ConfigureCommunitySample" default="run" basedir=".">
<!-- include common ant tasks and define global properties -->
&common;
<property name="orgName" value="CommunitySample"/>
<property name="authlessUserName" value="commauthlessanonymous"/>
<!--
=====================
Initialize properties
=====================
The purpose of this target is to initialize all the properties used during
configuration. This includes setting properties based on installer
settings (common.xml), setting the os type and os properties (common.xml),
and finally properties used by the sample.
-->
<target name="init" depends="setProperties, setLocalProperties">
<!-- organization base dn (o=org,dc=siroe,dc=com) -->
<property name="orgBaseDN" value="${org.naming.attribute}=${orgName},${default.org.dn}"/>
<!-- people container (ou=People) -->
<property name="peopleContainer" value="${peoplecontainer.naming.attribute}=People"/>
<!-- people container base dn (ou=People,o=org,dc=siroe,dc=com) -->
<property name="peopleBaseDN" value="${peopleContainer},${orgBaseDN}"/>
<!-- authless user dn (uid=user,ou=People,o=org,dc=siroe,dc=com) -->
<property name="authlessUserDN"
value="${user.naming.attribute}=${authlessUserName},${peopleBaseDN}"/>
<!-- sample access url -->
<property name="sampleAccessURL"
value="${ps.webapp.uri}/dt?desktop.suid=${authlessUserDN}"/>
<!-- password file used by psadmin, amadmin commands -->
<tempfile property="passwordFile" destdir="${ps.tmp.location}" prefix="password"/>
<echo file="${passwordFile}" message="${amadminPassword}" />
<echo>
========================================================================
Community Sample Configuration
========================================================================
This ant script is responsible for installing and configuring the
Portal Server community sample. Please find configuration
details below.
The community sample is installed into an access manager
organization and creates a few sample users.
o organization: ${orgName}
o organization dn: ${orgBaseDN}
o authless anonymous user dn: ${authlessUserDN}
o authless access url: ${sampleAccessURL}
</echo>
</target>
<!-- Set properties that are specific to the sample configuration -->
<target name="setLocalProperties" depends="setLocalUNIXProperties, setLocalWindowsProperties">
</target>
<!-- Set properties that are specific to the sample configuration -->
<target name="setLocalWindowsProperties" if="Windows" depends="setProperties">
<!-- setup -->
<property name="setup.location" value="${ps.samples.community.location}/setup"/>
<property name="orgAmConfigSrc" value="${setup.location}/CommunitySampleConfigRequest.xml"/>
<property name="orgAmConfig" value="${ps.tmp.location}/CommunitySampleConfigRequest.xml"/>
<property name="orgSecureAmConfigSrc" value="${setup.location}/CommunitySampleSRAConfigRequest.xml"/>
<property name="orgSecureAmConfig" value="${ps.tmp.location}/CommunitySampleSRAConfigRequest.xml"/>
<property name="deleteAmConfigSrc" value="${setup.location}/DeleteOrgRequest.xml"/>
<property name="deleteAmConfig" value="${ps.tmp.location}/DeleteOrgRequest.xml"/>
<property name="portalConfigSrc" value="${setup.location}/CommunitySamplePortalRequest.input"/>
<property name="portalConfig" value="${ps.tmp.location}/CommunitySampleConfigRequest.input"/>
<!-- par -->
<property name="par.src.location" value="${ps.parsrc.location}/community_sample"/>
<property name="par.dest.location" value="${ps.tmp.location}/par/community_sample"/>
<property name="parFile" value="${ps.tmp.location}/par/community_sample.par"/>
</target>
<!-- Set properties that are specific to the sample configuration -->
<target name="setLocalUNIXProperties" if="Unix" depends="setProperties">
<!-- setup -->
<property name="setup.location" value="${ps.samples.community.location}/setup"/>
<property name="orgAmConfigSrc" value="${setup.location}/CommunitySampleConfigRequest.xml"/>
<property name="orgAmConfig" value="${ps.tmp.location}/CommunitySampleConfigRequest.xml"/>
<property name="orgSecureAmConfigSrc" value="${setup.location}/CommunitySampleSRAConfigRequest.xml"/>
<property name="orgSecureAmConfig" value="${ps.tmp.location}/CommunitySampleSRAConfigRequest.xml"/>
<property name="deleteAmConfigSrc" value="${setup.location}/DeleteOrgRequest.xml"/>
<property name="deleteAmConfig" value="${ps.tmp.location}/DeleteOrgRequest.xml"/>
<property name="portalConfigSrc" value="${setup.location}/CommunitySamplePortalRequest.input"/>
<property name="portalConfig" value="${ps.tmp.location}/CommunitySampleConfigRequest.input"/>
<!-- par -->
<property name="par.src.location" value="${ps.parsrc.location}/community_sample"/>
<property name="par.dest.location" value="${ps.tmp.location}/par/community_sample"/>
<property name="parFile" value="${ps.tmp.location}/par/community_sample.par"/>
</target>
<!--
=======================
Configure Access Manger
=======================
The purpose of this target to configure the Access Manager Objects like Service templates,
Orgs, Users, etc
-->
<target name="config_am" depends="init">
<echo message="configure access manager for organization: ${orgName}"/>
<copy file="${orgAmConfigSrc}" toFile="${orgAmConfig}" overwrite="true">
<filterset>
<filter token="AMLDAPUSER_PASSWORD" value="${amldapuserPassword}" />
<filter token="DEFAULT_ORG" value="${default.org.dn}" />
<filter token="PEOPLE_CONTAINER" value="${peopleContainer}" />
<filter token="PORTAL_DEPLOY_URI" value="${ps.access.url}/dt" />
<filter token="PORTAL_ID" value="${am.request.portal.id}" />
<filter token="ORG_NAMING_ATTR" value="${org.naming.attribute}" />
<filter token="SAMPLE_ORG" value="${orgName}" />
<filter token="USER_NAMING_ATTR" value="${user.naming.attribute}" />
</filterset>
</copy>
<echo message="${amadmin} --data ${orgAmConfig} --verbose --continue"/>
<exec executable="${amadmin}">
<arg value="-c"/>
<arg value="-u"/>
<arg value="${am.admin.dn}"/>
<arg value="-f"/>
<arg value="${passwordFile}"/>
<arg value="--data"/>
<arg file="${orgAmConfig}"/>
<arg value="--verbose"/>
</exec>
<delete file="${orgAmConfig}"/>
</target>
<!--
===============================
Configure Portal Attributes
===============================
The purpose of this target to configure Portal attributes like authless DNs,
Default channel, default desktop, etc
-->
<target name="config_portal" depends="init, file_setup">
<echo message="configure portal attributes for organization: ${orgName}"/>
<copy file="${portalConfigSrc}" toFile="${portalConfig}" overwrite="true">
<filterset>
<filter token="AMADMIN_DN" value="${am.admin.dn}" />
<filter token="AMADMIN_PASSWORD_FILE" value="${passwordFile}" />
<filter token="DEFAULT_ORG" value="${default.org.dn}" />
<filter token="ORG_NAMING_ATTR" value="${org.naming.attribute}" />
<filter token="PAR_DIR" value="${par.dest.location}" />
<filter token="PAR_FILE" value="${parFile}" />
<filter token="PEOPLE_CONTAINER" value="${peopleContainer}" />
<filter token="PORTAL_ID" value="${ps.portal.id}" />
<filter token="SAMPLE_ORG" value="${orgName}" />
<filter token="USER_NAMING_ATTR" value="${user.naming.attribute}" />
<filter token="SEARCH_ID" value="${search.id}" />
</filterset>
</copy>
<echo message="${psadmin} multimode --printprompt=false --input=${portalConfig}"/>
<exec executable="${psadmin}">
<arg value="multimode"/>
<arg value="-u"/>
<arg value="${am.admin.dn}"/>
<arg value="-f"/>
<arg value="${passwordFile}"/>
<arg value="--printprompt=false"/>
<arg value="--input"/>
<arg value="${portalConfig}"/>
</exec>
<delete file="${portalConfig}"/>
</target>
<!--
===============================
Configure Access Manger for SRA
===============================
The purpose of this target to configure the Access Manager Objects like Service templates,
Orgs, Users, etc
-->
<target name="config_sra" depends="init">
<echo message="Configuring access manager for secure remote access"/>
<copy file="${orgSecureAmConfigSrc}" toFile="${orgSecureAmConfig}" overwrite="true">
<filterset>
<filter token="DEFAULT_ORG" value="${default.org.dn}" />
<filter token="SAMPLE_ORG" value="${org.naming.attribute}=${orgName}" />
<filter token="PEOPLE_CONTAINER" value="${peopleContainer}" />
<filter token="AUTHLESS_USER" value="${user.naming.attribute}=${authlessUserName}" />
<filter token="USER_NAMING_ATTR" value="${user.naming.attribute}" />
</filterset>
</copy>
<echo message="${amadmin} --data ${orgSecureAmConfig} --verbose --continue"/>
<exec executable="${amadmin}">
<arg value="-u"/>
<arg value="${am.admin.dn}"/>
<arg value="-f"/>
<arg value="${passwordFile}"/>
<arg value="--data"/>
<arg value="${orgSecureAmConfig}"/>
<arg value="--verbose"/>
<arg value="--continue"/>
</exec>
</target>
<!--
==========================
Unconfigure Access Manager
==========================
The purpose of this target is to unconfigure the sample from access manager
-->
<target name="unconfig_am" depends="init">
<copy file="${deleteAmConfigSrc}" toFile="${deleteAmConfig}" overwrite="true">
<filterset>
<filter token="DEFAULT_ORG" value="${default.org.dn}"/>
<filter token="ORG_NAMING_ATTR" value="${org.naming.attribute}" />
<filter token="SAMPLE_ORG" value="${orgName}"/>
</filterset>
</copy>
<exec executable="${amadmin}">
<arg value="-u"/>
<arg value="${am.admin.dn}"/>
<arg value="-f"/>
<arg value="${passwordFile}"/>
<arg value="--data"/>
<arg value="${deleteAmConfig}"/>
<arg value="--verbose"/>
<arg value="--continue"/>
</exec>
</target>
<!--
==========================
Create sample taxonomy
==========================
The purpose of this target is to copy a sample taxonomy into search instance
If there is no search instance locally, the failure will be just ignored.
-->
<target name="create_sample_taxonomy.pre.nonwin" depends="init" unless="Windows">
<property name="run-cs-cli" value="${ps.data.location}/searchservers/${search.id}/run-cs-cli"/>
</target>
<target name="create_sample_taxonomy.pre.win" depends="init" if="Windows">
<property name="run-cs-cli" value="${ps.data.location}/searchservers/${search.id}/run-cs-cli.bat"/>
</target>
<target name="create_sample_taxonomy" depends="init,create_sample_taxonomy.pre.nonwin,create_sample_taxonomy.pre.win">
<echo message="Copy Sample Taxonomy from ${ps.product.location}/samples/taxonomy/sun.soif"/>
<copy file="${ps.product.location}/samples/taxonomy/sun.soif" toFile="${ps.data.location}/searchservers/${search.id}/config/taxonomy.rdm" overwrite="true" failonerror="false"/>
<echo message="Reindex Taxonomy"/>
<exec executable="${ps.data.location}/searchservers/${search.id}/${run-cs-cli}" failonerror="false" failifexecutionfails="false">
<arg value="rdmgr"/>
<arg value="-I"/>
<arg value="-T"/>
</exec>
</target>
<!--
===================
File Setup
===================
The purpose of this target is to copy and tokenize files. Fore example, setup the
par directory by copying and tokenizing files from <basedir>/par-src/community_sample
to <productdir>/tmp/par/community_sample
-->
<target name="file_setup" depends="init">
<echo message="Copying par-src directory to ${par.dest.location}"/>
<copy todir="${par.dest.location}" overwrite="true" encoding="utf-8" outputencoding="utf-8">
<fileset dir="${par.src.location}" excludes="static/web-src/community/** **/*.class **/*.jar"/>
<filterset>
<filter token="AUTHLESS_USER_DN" value="${authlessUserDN}"/>
<filter token="SAMPLE_ACCESS_URL" value="${sampleAccessURL}" />
<filter token="portaluri" value="${ps.webapp.uri}"/>
</filterset>
</copy>
<copy todir="${par.dest.location}" overwrite="true" encoding="utf-8" outputencoding="utf-8">
<fileset dir="${par.src.location}" includes="static/web-src/community/**"/>
</copy>
<copy todir="${par.dest.location}" overwrite="true">
<fileset dir="${par.src.location}" includes="**/*.class **/*.jar"/>
</copy>
</target>
<target name="cleanPassword" >
<delete file="${passwordFile}" quiet="true"/>
</target>
<target name="run" depends="config_am, config_portal, deploy, create_sample_taxonomy, cleanPassword"/>
<target name="install_portal" depends="config_am, config_portal, create_sample_taxonomy, cleanPassword"/>
<target name="install_sra" depends="config_sra, cleanPassword"/>
<target name="install_post"/>
<target name="uninstall" depends="unconfig_am, cleanPassword"/>
</project>