DimensionSubsetExtension.java

Go to the documentation of this file.
00001 /*
00002  * DimensionSubsetExtension.java
00003  *
00004  *  Copyright (C) 2003 Alain MENSEGUEN
00005  *  www.net2map.org
00006  *
00007  *  This program is free software; you can redistribute it and/or
00008  *  modify it under the terms of the GNU General Public License
00009  *  as published by the Free Software Foundation; either version 2
00010  *  of the License, or (at your option) any later version.
00011  *
00012  *  This program is distributed in the hope that it will be useful,
00013  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *  GNU Lesser General Public License for more details.
00016  *
00017  *  You should have received a copy of the GNU General Public License
00018  *  along with this program; if not, write to the Free Software
00019  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00020  */
00021 package org.net2map.pov.server;
00022 
00023 import java.util.*;
00024 
00028 public class DimensionSubsetExtension extends DimensionSubset {
00029     
00030     private String sExtensions;
00031     private ParameterSet pParameters;
00032 
00038     public DimensionSubsetExtension( String extensions, ParameterSet params )
00039     {
00040         sExtensions = extensions;
00041         pParameters = params;
00042     }
00043     
00047     public String getExtensions()
00048     {
00049         return sExtensions;
00050     }
00051     
00055     public void setExtensions( String extensions )
00056     {
00057         sExtensions = extensions;
00058     }
00059     
00061     public void buildSubset()
00062     {
00063         if ( sExtensions != "" )
00064         {
00065             Query qResult = new Query( pParameters );
00066             qResult.setSelect( "dimension.url_id,dimension.extension" );
00067             qResult.setFrom( "dimension" );
00068             qResult.setWhere ("dimension.extension in('" + pParameters.replace( sExtensions, ";", "','" ) + "')" );
00069             qResult.getDimensionFields().addDimensionField( "dimension.url_id", "dimension.url_id", true, false );
00070             qResult.getDimensionFields().addDimensionField( "dimension.extension", "dimension.extension", false, false );
00071             qResult.getDimensionTables().addDimensionTable( "dimension", "dimension" );
00072             qResult.setFieldToJoin( "dimension.url_id" );
00073 
00074             if( pParameters.DEBUG > 2 ) System.out.println( "Dimension extension built using query " + qResult.toString() );
00075 
00076             this.setSubsetQuery( qResult );
00077         }
00078     }
00079 }
Accueil | Téléchargement | Manuel | Doc. technique | Sources CVS | Faq | Nous contacter
©2003 - All Rights Reserved