Changeset 2481

Show
Ignore:
Timestamp:
09/30/08 16:22:24 (3 months ago)
Author:
jimse
Message:

many more build file refactors to minimize war file size and make war building and deployment easier

Location:
trunk/otis
Files:
4 added
1 removed
7 modified
2 copied

Legend:

Unmodified
Added
Removed
  • trunk/otis/build.xml

    r2477 r2481  
    9696                        <include name="org/bandit/otis/impl/**" /> 
    9797                        <include name="org/bandit/otis/utils/**" /> 
     98                        <classpath refid="sdk.classpath"/> 
     99                </javac> 
     100        </target> 
     101 
     102        <target name="compile.samples" depends="-init,compile.sdk"> 
     103                <javac destdir="${build.dir}/classes" 
     104                        srcdir="samples" 
     105                        deprecation="on" 
     106                        target="1.5" 
     107                        source="1.5" 
     108                        debug="on"   
     109                        verbose="off"> 
    98110                        <classpath refid="sdk.classpath"/> 
    99111                </javac> 
     
    197209        </target> 
    198210 
    199         <fileset id="warconfigfiles" dir="${config.dir}" 
    200                 includes="      web.xml, 
    201                                         otis-config.client.local.xml, 
    202                                         otis-config.server.xml, 
    203                                         AuthenticatedSessionResponse.fmt, 
    204                                         GET_AttributeResponse.fmt, 
    205                                         GET_AuthEntityResponse.fmt, 
    206                                         GET_EntityResponse.fmt, 
    207                                         GET_PropertiesResponse.fmt, 
    208                                         GET_RoleResponse.fmt  
    209         "/>                      
    210211        <target name="-copy.warconfigs" depends="-init"> 
    211212                <condition property="war.filter.properties.match"> 
     
    216217                <antcall target="-update.warconfigs" /> 
    217218                <copy todir="${war.config.dir}"> 
    218                         <fileset refid="warconfigfiles" /> 
     219                        <fileset refid="${war.config.fileset.id}" /> 
    219220                        <filterset> 
    220221                                <filtersfile file="${war.config.dir}/filter.properties"/> 
     
    231232        <target name="-warbuilder" depends="jar.nosrc,compile.srv"> 
    232233                <war 
    233                         destfile="${build.dir}/${project.war.file}" 
     234                        destfile="${build.dir}/${war.file.name}" 
    234235                        webxml="${build.dir}/config/war/web.xml" 
    235236                        duplicate="preserve" 
     
    248249                        <!-- dependencies of server classes --> 
    249250                        <lib dir="${lib.dir}/srv" includes="*.jar" /> 
     251                        <lib dir="${lib.dir}/srv/config" includes="*.jar" /> 
    250252                        <!-- cp and dependencies (set by caller) --> 
    251                         <lib refid="war.cp.fileset" /> 
     253                        <lib refid="${war.cp.fileset.id}" /> 
    252254                         
    253255                </war> 
     
    335337        </target> 
    336338 
    337         <target name="tar.client" depends="jar.nosrc"> 
     339        <target name="tar.client" depends="jar.nosrc,compile.samples"> 
    338340                <concat destfile="${out.config.root.dir}/filter.properties"> 
    339341                        OTIS.ENDPOINT=http://example.org/otis/ 
     
    353355                                <include name="PUT_ContextChangesRequest.fmt"/> 
    354356                        </tarfileset> 
     357                        <tarfileset dir="${build.dir}/classes" prefix="/"> 
     358                                <include name="HelloWorld.class"/> 
     359                        </tarfileset> 
     360                        <tarfileset dir="samples" prefix="/"> 
     361                                <include name="HelloWorld.java"/> 
     362                        </tarfileset> 
    355363                </tar>           
    356364        </target> 
  • trunk/otis/config/otis-config.client.local.xml

    r2475 r2481  
    3030        <Setting Name="OTISConfiguration" Type="htf:map"> 
    3131 
    32                 <Setting Name="defaultContextId" Type="xsd:string">urn:Corporate-LDAP-Server</Setting> 
     32                <Setting Name="defaultContextId" Type="xsd:string">@DEFAULT.CONTEXT.ID@</Setting> 
    3333                 
    3434                <Setting Name="lenientReauth" Type="xsd:boolean">false</Setting> 
     
    122122                                        <Setting Name="JNDIContextFactory" Type="htf:map" /> 
    123123                                        <Setting Name="InMemoryContextFactory" Type="htf:map" /> 
     124                                        <Setting Name="XMLFileContextFactory" Type="htf:map" /> 
    124125                                </Setting> 
    125126                                <Setting Name="JNDIContextFactory" Type="htf:classinstance">org.eclipse.higgins.idas.cp.jndi.JNDIContextFactory</Setting> 
    126127                                <Setting Name="InMemoryContextFactory" Type="htf:classinstance">org.eclipse.higgins.idas.cp.inmem.InMemoryContextFactory</Setting> 
     128                                <Setting Name="XMLFileContextFactory" Type="htf:classinstance">org.eclipse.higgins.idas.cp.xmlfile.NonsharedContextFactory</Setting> 
    127129                                <Setting Name="ContextFactoryInstancesList" Type="htf:list"> 
    128130                                        <Setting Name="JNDIContextFactory" Type="htf:map"> 
     
    138140                                                </Setting> 
    139141                                        </Setting> 
     142                                        <Setting Name="XMLFileContextFactory" Type="htf:map"> 
     143                                                <Setting Name="Instance" Type="xsd:string">XMLFileContextFactory</Setting> 
     144                                                <Setting Name="ContextTypes" Type="htf:list"> 
     145                                                        <Setting Name="XMLFileContextType" Type="xsd:string">$context+xmlfile</Setting> 
     146                                                </Setting> 
     147                                        </Setting> 
    140148                                </Setting> 
    141149                                <Setting Name="ContextIdsList" Type="htf:list"> 
     
    151159                                                        <Setting Name="AuditRecordClass" Type="xsd:string">org.bandit.otis.impl.OtisAuditRecord</Setting> 
    152160                                                        --> 
     161                                        </Setting> 
     162                                        <Setting Name="urn:XmlFileProvider" Type="htf:map" >      <!-- The Name of this setting is ignored because the parent setting is a list --> 
     163                                                <Setting Name="ContextId" Type="xsd:string">urn:XmlFileProvider</Setting> 
     164                                                <Setting Name="ContextTypes" Type="htf:list"> 
     165                                                        <Setting Name="XMLFileContextType" Type="xsd:string">$context+xmlfile</Setting> 
     166                                                </Setting> 
     167                                                <Setting Name="ContextUris" Type="htf:list"> 
     168                                                        <Setting Name="DefaultContextUri" Type="xsd:anyURI">urn:Local-XMLFile</Setting> 
     169                                                </Setting> 
     170                                                <!-- Context provider specific settings go here --> 
     171                                                <XmlFileName>@XMLFILE.CP.DATA.FILENAME@</XmlFileName> 
    153172                                        </Setting> 
    154173                                        <Setting Name="urn:Corporate-LDAP-Server" Type="htf:map"> 
  • trunk/otis/config/otis-config.client.remote.xml

    r2475 r2481  
    2020                <SettingHandler Type="htf:classinstance" Class="java.lang.Object" Handler="org.eclipse.higgins.configuration.xml.ClassInstanceHandler"/> 
    2121                <SettingHandler Type="htf:classsingleton" Class="java.lang.Object" Handler="org.eclipse.higgins.configuration.xml.ClassSingletonHandler"/> 
    22                 <SettingHandler Type="htf:jscriptexec" Class="org.eclipse.higgins.util.jscript.JScriptExec" Handler="org.eclipse.higgins.util.idas.cp.jscript.JScriptExecSettingHandler"/> 
    23                 <SettingHandler Type="htf:jscriptscope" Class="org.eclipse.higgins.util.jscript.JScriptScope" Handler="org.eclipse.higgins.util.idas.cp.jscript.JScriptScopeSettingHandler"/> 
    2422                <SettingHandler Type="htf:include" Class="java.util.Map" Handler="org.eclipse.higgins.configuration.xml.IncludeHandler"/> 
    2523                <SettingHandler Type="htf:remoteEndPointHandler" Class="org.bandit.otis.impl.RemoteEndPointClient" Handler="org.bandit.otis.impl.RemoteEndPointClientHandler"/> 
  • trunk/otis/config/otis-config.server.xml

    r2475 r2481  
    630630 
    631631                <!-- Settings that are passed to the local session object --> 
    632                 <Setting Name="LocalAuthSession" Type="htf:include">otis-config.client.local.xml</Setting> 
     632                <Setting Name="LocalAuthSession" Type="htf:include">@LOCAL.AUTH.CONFIG@</Setting> 
    633633 
    634634        </Setting> 
  • trunk/otis/lib/cp-rest-xml/higgins-idas-spi_1.0.100.jar

  • trunk/otis/otis.war.targets.xml

    r2477 r2481  
    1717        <import file="build.xml"/> 
    1818 
     19        <fileset id="war.config.fileset" dir="${config.dir}" 
     20                includes="      web.xml, 
     21                                        otis-config.client.xmlfile.xml, 
     22                                        otis-config.server.xml, 
     23                                        AuthenticatedSessionResponse.fmt, 
     24                                        GET_AttributeResponse.fmt, 
     25                                        GET_AuthEntityResponse.fmt, 
     26                                        GET_EntityResponse.fmt, 
     27                                        GET_PropertiesResponse.fmt, 
     28                                        GET_RoleResponse.fmt  
     29        "/>                      
     30        <fileset id="war.cp.fileset" dir="${lib.dir}/cp-xmlfile" includes="*.jar" /> 
    1931        <target name="war"> 
    2032                <concat destfile="${out.config.root.dir}/filter.properties"> 
    21                         SERVER.CONF.DIR=otis 
    22                         LDAP.SERVER.ADDR=ldap://example.org:389 
    23                         SESSION.SECRET.BITSIZE=1024 
     33                        SERVER.CONF.DIR=@@PATH.CONTAINER@@ 
     34                        XMLFILE.CP.DATA.FILENAME=example.identities.xml 
     35                        SESSION.SECRET.BITSIZE=0 
    2436                        ALLOW.INSECURE.CHANNEL=false 
     37                        LOCAL.AUTH.CONFIG=otis-config.client.xmlfile.xml 
    2538                </concat> 
    26                 <property name="project.war.file" value="otis-${project.version}.war" /> 
    27                 <fileset id="war.cp.fileset" dir="${lib.dir}/cp.jndi" includes="*.jar" /> 
     39                <property name="war.file.name" value="otis-${project.version}.war" /> 
     40                <property name="war.config.fileset.id" value="war.config.fileset" /> 
     41                <property name="war.cp.fileset.id" value="war.cp.fileset" /> 
    2842                <antcall target="-copy.warconfigs" /> 
    2943                <antcall target="-warbuilder" /> 
    3044        </target> 
    3145 
     46        <fileset id="war.wag.config.fileset" dir="${config.dir}" 
     47                includes="      web.xml, 
     48                                        otis-config.client.ldap.xml, 
     49                                        otis-config.server.xml, 
     50                                        AuthenticatedSessionResponse.fmt, 
     51                                        GET_AttributeResponse.fmt, 
     52                                        GET_AuthEntityResponse.fmt, 
     53                                        GET_EntityResponse.fmt, 
     54                                        GET_PropertiesResponse.fmt, 
     55                                        GET_RoleResponse.fmt  
     56        "/>                      
     57        <fileset id="war.wag.cp.fileset" dir="${lib.dir}/cp-jndi" includes="*.jar" /> 
    3258        <target name="war.wag"> 
    3359                <concat destfile="${out.config.root.dir}/filter.properties"> 
    3460                        SERVER.CONF.DIR=/usr/share/java/otis-config 
     61                        DEFAULT.CONTEXT.ID=urn:Corporate-LDAP-Server 
    3562                        LDAP.SERVER.ADDR=ldap://wag.bandit-project.org:389 
    3663                        SESSION.SECRET.BITSIZE=1024 
    3764                        ALLOW.INSECURE.CHANNEL=false 
     65                        LOCAL.AUTH.CONFIG=otis-config.client.local.xml 
    3866                </concat> 
    39                 <fileset id="war.cp.fileset" dir="${lib.dir}/cp.jndi" includes="*.jar" /> 
    40                 <property name="project.war.file" value="otis.war" /> 
     67                <property name="war.file.name" value="otis.war" /> 
     68                <property name="war.config.fileset.id" value="war.wag.config.fileset" /> 
     69                <property name="war.cp.fileset.id" value="war.wag.cp.fileset" /> 
    4170                <antcall target="-copy.warconfigs" /> 
    4271                <antcall target="-warbuilder" /> 
    4372        </target> 
    4473 
     74        <fileset id="war.test.config.fileset" dir="${config.dir}" 
     75                includes="      web.xml, 
     76                                        otis-config.client.test.xml, 
     77                                        otis-config.server.xml, 
     78                                        AuthenticatedSessionResponse.fmt, 
     79                                        GET_AttributeResponse.fmt, 
     80                                        GET_AuthEntityResponse.fmt, 
     81                                        GET_EntityResponse.fmt, 
     82                                        GET_PropertiesResponse.fmt, 
     83                                        GET_RoleResponse.fmt  
     84        "/>                      
     85        <fileset id="war.test.cp.fileset" dir="${lib.dir}/cp-jndi" includes="*.jar" /> 
    4586        <target name="war.test"> 
    4687                <concat destfile="${out.config.root.dir}/filter.properties"> 
    4788                        SERVER.CONF.DIR=otis-test 
     89                        DEFAULT.CONTEXT.ID=urn:Corporate-LDAP-Server 
    4890                        LDAP.SERVER.ADDR=ldap://localhost:50389 
    4991                        SESSION.SECRET.BITSIZE=0 
    5092                        ALLOW.INSECURE.CHANNEL=true 
     93                        LOCAL.AUTH.CONFIG=otis-config.client.local.xml 
    5194                </concat> 
    52                 <fileset id="war.cp.fileset" dir="${lib.dir}/cp-jndi" includes="*.jar" /> 
    53                 <property name="project.war.file" value="${war.test.file}" /> 
     95                <property name="war.file.name" value="${war.test.file}" /> 
     96                <property name="war.config.fileset.id" value="war.test.config.fileset" /> 
     97                <property name="war.cp.fileset.id" value="war.test.cp.fileset" /> 
    5498                <antcall target="-copy.warconfigs" /> 
    5599                <antcall target="-warbuilder" /> 
  • trunk/otis/src/org/bandit/otis/server/OtisServlet.java

    r2462 r2481  
    6161import org.apache.commons.logging.LogFactory; 
    6262 
     63import java.io.ByteArrayOutputStream; 
    6364import java.io.IOException; 
     65import java.io.PrintStream; 
    6466import java.io.PrintWriter; 
    6567import java.io.StringWriter; 
     
    163165        { 
    164166                log.debug( errMsg.outString( false)); 
     167                OtisException otisException = new OtisException(errMsg.outString( true)); 
    165168                if (responseMap != null) 
    166169                { 
     
    171174                { 
    172175                        responseMap.put( Constants.TEMPLATE_EXCEPTION, e); 
    173                 } 
    174                 return( new OtisException( errMsg.outString( true))); 
     176                        otisException.setStackTrace(e.getStackTrace()); 
     177                } 
     178                return( otisException); 
    175179        } 
    176180         
     
    182186                Map                     responseMap) throws OtisException 
    183187        { 
     188                ByteArrayOutputStream bs = new ByteArrayOutputStream(); 
     189                PrintStream ps = new PrintStream(bs); 
     190                e.printStackTrace(ps); 
     191                log.debug("Originating exception's stack:\n" + bs.toString()); 
    184192                throw OtisServlet.getOtisException( log, errMsg, e, iHttpResponseCode, responseMap); 
    185193        } 
     
    191199                Map                     responseMap) throws OtisException 
    192200        { 
    193                 throw OtisServlet.getOtisException( m_log, errMsg, e, iHttpResponseCode, responseMap); 
     201                throwException(m_log, errMsg, e, iHttpResponseCode, responseMap); 
    194202        } 
    195203 
     
    692700                        else 
    693701                        { 
     702                                if (m_strConfigDir.startsWith(Constants.PATH_CWD)) 
     703                                { 
     704                                        String replacement = servletContext.getRealPath(""); 
     705                                        m_strConfigDir = m_strConfigDir.replace(Constants.PATH_CWD, replacement); 
     706                                } 
    694707                                m_log.debug( "Got configuration params: configDir='" + m_strConfigDir + "', configFile='" + m_strConfigFile + "'"); 
    695708                                 
  • trunk/otis/src/org/bandit/otis/utils/Constants.java

    r2447 r2481  
    314314        public static final String              SCHEME_USER_ID = OTIS_NAMESPACE + "#" + NOUN_ENTITY_ID; 
    315315        public static final String              TERM_USER_ID = OTIS_NAMESPACE + "#" + NOUN_ENTITY_ID; 
     316        public static final String              PATH_CWD = "@@PATH.CONTAINER@@"; 
    316317         
    317318}