Fabio Dalle Ave hai 2 meses
pai
achega
0b49b5000a

+ 0 - 401
src/main/java/commons/utility/Compression.java

@@ -1,401 +0,0 @@
-package commons.utility;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedOutputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.util.Enumeration;
-import java.util.zip.DataFormatException;
-import java.util.zip.Deflater;
-import java.util.zip.Inflater;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-import java.util.zip.ZipOutputStream;
-
-import commons.utility.database.NullValue;
-import commons.exception.ZCompressException;
-
-
-public class Compression {
-	
-	/**	Factory per la creazione dei file in uscita
-	 */
-	public final static class OutputZipFileFactory
-	{
-		/**	Crea un file zip aperto in scrittura a partire da un OutputStream
-		 * @param outstream lo stream su cui wrappare lo zip
-		 * @param sizeBuffer se != null && > 0 allora lo stream viene wrappato all'interno di un BufferedOutputStream
-		 * @return Una impl wrappata nel seguente modo:
-		 * 			se outstream instanceof ZipOutputStream wrap diretto su outstream
-		 * 			se outstream instanceof BufferedOutputStream allora wrap di un ZipOutputStream intorno a outstrema
-		 * 			negli altri casi,se sizeBuffer > 0 allora wrapping su un BufferedOutputStream(outstream,sizeBuffer)
-		 * 			altrimenti wrapping diretto su outstream
-		 * @throws ZCompressException
-		 */
-		public final static OutputZipFile create(final OutputStream outstream,final Integer sizeBuffer) throws ZCompressException
-		{
-			OutputZipFile impl = null;
-			//	Se lo stream ? quello di un file zip...
-			if(outstream instanceof ZipOutputStream)
-				//	...aggancialo e basta!
-				impl = new OutputZipFile((ZipOutputStream) outstream);
-			else
-			{
-				OutputStream _outstream = outstream;
-				if(null != sizeBuffer && sizeBuffer.intValue() > 0 && !(outstream instanceof BufferedOutputStream))
-					_outstream = new BufferedOutputStream(outstream,sizeBuffer);
-				impl = new OutputZipFile
-				(
-					new ZipOutputStream(_outstream)
-				);
-			}
-			return impl;
-		}
-		
-		/**	Crea un file zip aperto in scrittura,se il file esiste viene sovrascritto
-		 * @param filename
-		 * @return
-		 * @throws ZCompressException
-		 */
-		public final static OutputZipFile create(String filename) throws ZCompressException
-		{
-			FileOutputStream fos = null;
-			try
-			{
-				fos = new FileOutputStream(filename);
-				return create(fos,10);
-			}
-			catch(IOException e)
-			{
-				if(null != fos)
-				{
-					try
-					{
-						fos.close();
-					}
-					catch (IOException e1)
-					{
-					}
-					fos = null;
-				}
-				throw new ZCompressException(e);
-			}
-			finally
-			{
-			}
-		}
-	}
-	
-	public Compression() {}
-	private static final int BUFFER= 2048;
-
-	/////////////////////////////////////////////////////////////////////////////
-	//Compressione Decompressione FILE
-
-	/**	Comprime un blocco di dati all'interno di un file zip
-	 * @param dataToStore il blocco di dati da comprimere
-	 * @param dataToStoreName il nome che il blocco di dati avr? all'interno del file zip
-	 * @param outputFile il nome del file di uscita
-	 * @throws ZCompressException
-	 */
-	public static void CompressFile(byte[] dataToStore, String dataToStoreName, String outputFile) throws ZCompressException
-	{
-		ZipOutputStream out = null;
-		try
-		{
-			out = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(outputFile)));
-			ZipEntry entry = new ZipEntry(dataToStoreName);
-			out.putNextEntry(entry);
-			out.write(dataToStore);
-		}
-		catch(IOException e)
-		{
-			throw new ZCompressException(e);
-		}
-		finally
-		{
-			try
-			{
-				if(null != out)		out.close();
-			}
-			catch(IOException e)
-			{
-				throw new ZCompressException(e);
-			}
-		}
-	}
-	
-	public static String CompressFile(String inputFile, String outputFile) throws ZCompressException {
-		try
-		{
-			String err= "OK";
-			BufferedInputStream origin= null;
-			ZipOutputStream out= null;
-			FileInputStream fi= null;
-			try {
-				FileOutputStream dest= new FileOutputStream(outputFile);
-				out= new ZipOutputStream(new BufferedOutputStream(dest));
-				byte data[]= new byte[BUFFER];
-				File f= new File(inputFile);
-				fi= new FileInputStream(f);
-				origin= new BufferedInputStream(fi, BUFFER);
-				ZipEntry entry= new ZipEntry(f.getName());
-				out.putNextEntry(entry);
-				int count;
-				while ((count= origin.read(data, 0, BUFFER)) != -1) {
-					out.write(data, 0, count);
-				}
-			} catch (IOException ex) {
-				err= ex.getMessage();
-			} finally {
-				origin.close();
-				out.close();
-				fi.close();
-			}
-			return err;
-		}
-		catch (IOException e)
-		{
-			throw new ZCompressException(e);
-		}
-	}
-
-	public static String CompressFile(String[] inputFile, String outputFile) throws ZCompressException {
-		try
-		{
-			String err= "OK";
-			BufferedInputStream origin= null;
-			ZipOutputStream out= null;
-			FileInputStream fi= null;
-			try {
-				FileOutputStream dest= new FileOutputStream(outputFile);
-				out= new ZipOutputStream(new BufferedOutputStream(dest));
-				byte data[]= new byte[BUFFER];
-				for (int i= 0; i < inputFile.length; i++) {
-					File f= new File(inputFile[i]);
-					fi= new FileInputStream(f);
-					origin= new BufferedInputStream(fi, BUFFER);
-					ZipEntry entry= new ZipEntry(f.getName());
-					out.putNextEntry(entry);
-					int count;
-					while ((count= origin.read(data, 0, BUFFER)) != -1) {
-						out.write(data, 0, count);
-					}
-					fi.close();
-				}
-			} catch (IOException ex) {
-				err= ex.getMessage();
-			} finally {
-				if (origin != null) {
-					origin.close();
-				}
-				if (out != null) {
-					out.close();
-				}
-				if (fi != null) {
-					fi.close();
-				}
-			}
-			return err;
-		}
-		catch (IOException e)
-		{
-			throw new ZCompressException(e);
-		}
-	}
-
-	public static String DecompressFile(String inputFile, String outputFile) throws ZCompressException {
-		try
-		{
-			String err= "OK";
-			BufferedOutputStream dest= null;
-			BufferedInputStream is= null;
-			FileOutputStream fos= null;
-			ZipFile zipfile= null;
-			try {
-				ZipEntry entry;
-				zipfile= new ZipFile(inputFile);
-				Enumeration e= zipfile.entries();
-				while (e.hasMoreElements()) {
-					entry= (ZipEntry)e.nextElement();
-					is= new BufferedInputStream(zipfile.getInputStream(entry));
-					int count;
-					byte data[]= new byte[BUFFER];
-					if (null == outputFile || NullValue.STRING.equalsIgnoreCase(outputFile))
-					{
-					    String path = inputFile.substring(0, inputFile.lastIndexOf(File.separator));
-					    fos= new FileOutputStream(path + File.separator + entry.getName());
-					}
-					else
-					{
-					    fos= new FileOutputStream(outputFile);
-					}
-					dest= new BufferedOutputStream(fos, BUFFER);
-					while ((count= is.read(data, 0, BUFFER)) != -1) {
-						dest.write(data, 0, count);
-					}
-					if(dest != null)
-				    {
-				        dest.flush();
-						dest.close();
-				    }
-					
-				    if(is != null)
-				    {
-				        is.close();
-				    }
-				    
-				    if(fos != null)
-				    {
-				        fos.flush();
-						fos.close();    
-				    }
-				}
-			} catch (IOException ex) {
-				err= ex.getMessage();
-			} finally {
-			    if(dest != null)
-			    {
-			        dest.flush();
-					dest.close();
-			    }
-				
-			    if(is != null)
-			    {
-			        is.close();
-			    }
-			    
-			    if(fos != null)
-			    {
-			        fos.flush();
-					fos.close();    
-			    }
-			    
-			    if(zipfile != null)
-			    {
-			        zipfile.close();
-			    }
-			}
-			
-			return err;
-		}
-		catch (IOException e)
-		{
-			throw new ZCompressException(e);
-		}
-	}
-	
-	public static String DecompressFile(String inputFile) throws ZCompressException {
-		return DecompressFile(inputFile, null);
-	}
-
-	/////////////////////////////////////////////////////////////////////////////
-	//Compressione Decompressione BYTE[]
-
-	public static byte[] Compress(byte[] input) throws ZCompressException {
-		try
-		{
-			Deflater compressor= new Deflater();
-			compressor.setLevel(Deflater.BEST_COMPRESSION);
-			
-			// Give the compressor the data to compress
-			compressor.setInput(input);
-			compressor.finish();
-			
-			ByteArrayOutputStream bos= new ByteArrayOutputStream(input.length);
-			
-			// Compress the data
-			byte[] buf= new byte[BUFFER];
-			while (!compressor.finished()) {
-				int count= compressor.deflate(buf);
-				bos.write(buf, 0, count);
-			}
-			//try {
-			bos.close();
-			//} catch (IOException e){
-			//}
-			
-			// Get the compressed data
-			byte[] compressedData= bos.toByteArray();
-			return compressedData;
-		}
-		catch (IOException e)
-		{
-			throw new ZCompressException(e);
-		}
-
-	}
-
-	public static byte[] Decompress(byte[] input) throws ZCompressException {
-		try
-		{
-			Inflater decompressor= new Inflater();
-			decompressor.setInput(input);
-			
-			// Create an expandable byte array to hold the decompressed data
-			ByteArrayOutputStream bos= new ByteArrayOutputStream(input.length);
-			
-			// Decompress the data
-			byte[] buf= new byte[BUFFER];
-			while (!decompressor.finished()) {
-				//try {
-				int count= decompressor.inflate(buf);
-				bos.write(buf, 0, count);
-				//} catch (DataFormatException e) {
-				//}
-			}
-			//try {
-			bos.close();
-			//} catch (IOException e) {
-			//}
-			
-			// Get the decompressed data
-			byte[] decompressedData= bos.toByteArray();
-			return decompressedData;
-		}
-		catch (DataFormatException e)
-		{
-			throw new ZCompressException(e);
-		}
-		catch (IOException e)
-		{
-			throw new ZCompressException(e);
-		}
-	}
-	
-	public static void CompressFile(String pathRedix, String pathSingleFile, ZipOutputStream out) throws IOException {
-        BufferedInputStream origin = null;
-        FileInputStream fi = null;
-        try {
-            byte data[] = new byte[BUFFER];
-
-            File f = new File(pathRedix + pathSingleFile);
-            fi = new FileInputStream(f);
-            origin = new BufferedInputStream(fi, BUFFER);
-
-            ZipEntry entry = new ZipEntry(pathSingleFile);
-            out.putNextEntry(entry);
-            int count;
-            while ((count = origin.read(data, 0, BUFFER)) != -1) {
-                out.write(data, 0, count);
-            }
-            fi.close();
-        } catch (IOException ex) {
-            throw ex;
-        } finally {
-            if (origin != null) {
-                origin.close();
-                origin = null;
-            }
-            if (fi != null) {
-                fi.close();
-                fi = null;
-            }
-        }
-    }
-
-}

+ 0 - 258
src/main/java/commons/utility/OutputZipFile.java

@@ -1,258 +0,0 @@
-package commons.utility;
-
-import java.io.BufferedInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipOutputStream;
-
-import commons.exception.ZCompressException;
-
-/**	Gestione di un file zip in scrittura
- */
-public class OutputZipFile
-{
-	public static final String ENTRY_SEPARATOR = "/";
-	public static final int BUFFER = 2048;
-	private ZipOutputStream out;
-	private List<String> entries = null;
-	
-	public OutputZipFile(ZipOutputStream outStream)
-	{
-		out = outStream;
-		entries = new ArrayList<String>();
-	}
-	
-	/**	Verifica se una entry esiste
-	 * @param entryName
-	 * @return
-	 */
-	private boolean checkEntry(String entryName)
-	{
-		return Collections.binarySearch(entries,entryName) >= 0;
-	}
-	
-	/**	Aggiunge una entry alla lista
-	 * @param entryName
-	 */
-	private void addEntry(String entryName)
-	{
-		entries.add(entryName);
-		Collections.sort(entries);
-	}
-	
-	/**	Forza la chiusura dell'entry corrente
-	 * @throws ZCompressException
-	 */
-	private void ensureCloseEntry() throws ZCompressException
-	{
-		try
-		{
-			out.closeEntry();
-		}
-		catch(IOException ioE)
-		{
-			throw new ZCompressException(ioE);
-		}		
-	}
-
-	/**	Normalizza il nome di una entry eliminando tutti i / all'inizio e 
-	 * 	rendendo i separatori tutti come /
-	 * @param entryName
-	 * @return
-	 */
-	private String normalizeEntry(String entryName)
-	{
-		String en = entryName.replace('\\',OutputZipFile.ENTRY_SEPARATOR.charAt(0));
-		while(en.length() > 0 && OutputZipFile.ENTRY_SEPARATOR.charAt(0) == en.charAt(0))
-		{
-			en = en.substring(1);
-		}
-		return en;
-	}
-	
-	/**	Forza,se non esiste,il / alla fine dell'entry
-	 * @param entryName
-	 * @return
-	 */
-	private String ensureSlash(String entryName)
-	{
-		String en = entryName;
-		if(!en.endsWith(OutputZipFile.ENTRY_SEPARATOR))
-			en += OutputZipFile.ENTRY_SEPARATOR.charAt(0);	
-		return en;
-	}
-	
-	/**	Aggiunge una dir al file
-	 * @param entryName
-	 * @throws ZCompressException
-	 */
-	private void addDirEntry(String entryName) throws ZCompressException
-	{
-		final String en = ensureSlash(normalizeEntry(entryName));
-		if(checkEntry(en))	return;
-		try
-		{
-			ZipEntry entry = new ZipEntry(en);
-			entry.setMethod(ZipEntry.STORED);
-			entry.setCompressedSize(0L);
-			entry.setSize(0L);
-			entry.setCrc(0L);
-			out.putNextEntry(entry);
-		}
-		catch(IOException ioE)
-		{
-			throw new ZCompressException(ioE);
-		}
-		finally
-		{
-			ensureCloseEntry();
-			addEntry(en);
-		}
-	}
-	
-	/**	Aggiunge un blocco usando come entryID un nome
-	 * @param inputfileName
-	 * @throws ZCompressException
-	 */
-	private void addBlock(byte[] data,String entryName) throws ZCompressException
-	{
-		final String en = normalizeEntry(entryName);
-		if(checkEntry(en))	return;
-		try
-		{
-			if(null == out)
-			{
-				throw new ZCompressException("File not open for write.");
-			}
-			ZipEntry entry = new ZipEntry(en);
-			entry.setMethod(ZipEntry.DEFLATED);
-			out.putNextEntry(entry);
-			out.write(data);
-		}
-		catch(IOException e)
-		{
-			throw new ZCompressException(e);
-		}
-		finally
-		{
-			ensureCloseEntry();
-			addEntry(en);
-		}
-	}
-	
-	private void addFile(File f,String entryName) throws ZCompressException
-	{
-		final String en = normalizeEntry(entryName);
-		if(checkEntry(en))	return;
-		if(null == out)
-		{
-			throw new ZCompressException("File not open for write.");
-		}
-		
-		BufferedInputStream inputfileStream = null;
-		try
-		{
-			inputfileStream = new BufferedInputStream(new FileInputStream(f));
-			ZipEntry entry = new ZipEntry(entryName);
-			entry.setMethod(ZipEntry.DEFLATED);
-			out.putNextEntry(entry);
-			byte[] buffer = new byte[BUFFER];
-			int count = 0;
-			while(-1 != (count = inputfileStream.read(buffer,0,buffer.length)))
-			{
-				out.write(buffer,0,count);
-			}
-		}
-		catch(IOException ioE)
-		{
-			throw new ZCompressException(ioE);
-		}
-		finally
-		{			
-			try
-			{
-				ensureCloseEntry();
-				addEntry(en);
-				if(null != inputfileStream)
-					inputfileStream.close();
-			}
-			catch(IOException ioE)
-			{
-				throw new ZCompressException(ioE);
-			}
-		}
-	}
-	
-	//	Public intf
-	public void addDirectory(String entryName) throws ZCompressException
-	{
-		addDirEntry(entryName);
-	}
-	
-	/**	Aggiunge un file allo zip
-	 * @param file
-	 * @param entryPath
-	 * @param addFullPath true per aggiungere come entry il nome completo dell'entry o solo l'ultima parte
-	 * @throws ZCompressException
-	 */
-	public void addFile(File file,String entryPath,boolean addFullPath) throws ZCompressException
-	{
-		String en = entryPath;
-		if(en.endsWith(OutputZipFile.ENTRY_SEPARATOR))
-			throw new ZCompressException("Entries must end with a /");
-		if(!addFullPath)
-		{
-			//	Check for dir path...
-			int lastSlashIndex = en.lastIndexOf(OutputZipFile.ENTRY_SEPARATOR);
-			if(-1 != lastSlashIndex)
-				en = en.substring(lastSlashIndex+1);
-		}		
-		addFile(file,en);
-	}
-
-	/**	Aggiunge un blocco di dati allo zip
-	 * @param file
-	 * @param entryPath
-	 * @param addFullPath true per aggiungere come entry il nome completo dell'entry o solo l'ultima parte
-	 * @throws ZCompressException
-	 */
-	public void addFile(byte[] data,String entryPath,boolean addFullPath) throws ZCompressException
-	{
-		String en = entryPath;
-		if(en.endsWith(OutputZipFile.ENTRY_SEPARATOR))
-			throw new ZCompressException("Entries must end with a /");
-		if(!addFullPath)
-		{
-			//	Check for dir path...
-			int lastSlashIndex = en.lastIndexOf(OutputZipFile.ENTRY_SEPARATOR);
-			if(-1 != lastSlashIndex)
-				en = en.substring(lastSlashIndex+1);
-		}		
-		
-		addBlock(data,en);		
-	}
-	
-	/**	Chiude il file zip
-	 * @throws ZCompressException
-	 */
-	public void close() throws ZCompressException
-	{
-		try
-		{
-			out.close();
-		}
-		catch (IOException e)
-		{
-			throw new ZCompressException(e);
-		}
-		finally
-		{
-			out = null;
-		}
-	}
-}

+ 0 - 284
src/main/java/commons/web/mvc/BaseFieldForm.java

@@ -1,284 +0,0 @@
-package commons.web.mvc;
-
-import jakarta.servlet.jsp.JspException;
-import jakarta.servlet.jsp.JspWriter;
-import jakarta.servlet.jsp.tagext.BodyTagSupport;
-
-import commons.utility.StringUtility;
-
-public abstract class BaseFieldForm extends BodyTagSupport {
-
-	protected static final String CR = "\r\n";
-	protected static final String TAB = "\t";
-	
-	/* inizio attributi del tag*/
-	private String id;
-	private String name;
-	private String value;
-	private String size;
-	private String tabindex;
-	private String cssStyle;
-	private String cssClass;
-	private String disabled;
-	private String onclick;
-	private String onchange;
-	private String onblur;
-	private String onfocus;
-	private String ondblclick;
-	private String onhelp;
-	private String onkeydown;
-	private String onkeypress;
-	private String onkeyup;
-	private String onmousedown;
-	private String onmousemove;
-	private String onmouseout;
-	private String onmouseover;
-	private String onmouseup;
-	/* fine attributi*/
-	
-	@Override
-	public int doStartTag() throws JspException 
-	{
-		try 
-		{
-			
-			buildTag(pageContext.getOut());
-		} 
-		catch (Exception e) 
-		{
-			e.printStackTrace();
-			throw (new JspException(e.getMessage()));
-		}
-		return EVAL_BODY_BUFFERED;
-	}
-	
-
-    @Override
-	public int doEndTag() {
-    	// valore di default
-        return EVAL_PAGE;
-    }
-
-	
-	protected StringBuffer getSelectAttribute(){
-		StringBuffer sb = new StringBuffer();
-		setAttributo(sb,"name",name);
-		setAttributo(sb,"id",id);
-		setAttributo(sb,"style",cssStyle);
-		setAttributo(sb,"class",cssClass);
-		setAttributo(sb,"size",size);
-		setAttributo(sb,"tabindex",tabindex);
-		
-		if (!StringUtility.empty(disabled))
-			setAttributo(sb,"disabled",disabled);
-		
-		setAttributo(sb,"onclick",onclick);
-		setAttributo(sb,"onchange",onchange);
-		setAttributo(sb,"onfocus",onfocus);
-		setAttributo(sb,"ondblclick",ondblclick);
-		setAttributo(sb,"onhelp",onhelp);
-		setAttributo(sb,"onkeydown",onkeydown);
-		setAttributo(sb,"onkeypress",onkeypress);
-		setAttributo(sb,"onkeyup",onkeyup);
-		setAttributo(sb,"onmousedown",onmousedown);
-		setAttributo(sb,"onmousemove",onmousemove);
-		setAttributo(sb,"onmouseout",onmouseout);
-		setAttributo(sb,"onmouseover",onmouseover);
-		setAttributo(sb,"onmouseup",onmouseup);
-		return sb;
-		
-	}
-	protected void setAttributo(final StringBuffer sb, String attName, String attValue){
-		if (!StringUtility.empty(attValue)){
-			sb.append(getPrefixAttribute(sb)).append(attName).append("=\"").append(attValue).append("\"");
-		}
-	}
-	private String getPrefixAttribute(StringBuffer sb){
-		return sb.length() > 0 ?  " " : "";
-		
-	}
-	protected abstract void buildTag(JspWriter out) throws Exception;
-
-	public String getId() {
-    	return id;
-    }
-
-	public void setId(String id) {
-    	this.id = id;
-    }
-
-	public String getName() {
-    	return name;
-    }
-
-	public void setName(String name) {
-    	this.name = name;
-    }
-
-	public String getValue() {
-    	return value;
-    }
-
-	public void setValue(String value) {
-    	this.value = value;
-    }
-
-	public String getSize() {
-    	return size;
-    }
-
-	public void setSize(String size) {
-    	this.size = size;
-    }
-
-	public String getTabindex() {
-    	return tabindex;
-    }
-
-	public void setTabindex(String tabindex) {
-    	this.tabindex = tabindex;
-    }
-
-	public String getCssStyle() {
-    	return cssStyle;
-    }
-
-	public void setCssStyle(String cssStyle) {
-    	this.cssStyle = cssStyle;
-    }
-
-	public String getDisabled() {
-    	return disabled;
-    }
-
-
-	public void setDisabled(String disabled) {
-    	this.disabled = disabled;
-    }
-
-
-	public String getCssClass() {
-    	return cssClass;
-    }
-
-	public void setCssClass(String cssClass) {
-    	this.cssClass = cssClass;
-    }
-
-	public String getOnclick() {
-    	return onclick;
-    }
-
-	public void setOnclick(String onclick) {
-    	this.onclick = onclick;
-    }
-
-	public String getOnchange() {
-    	return onchange;
-    }
-
-	public void setOnchange(String onchange) {
-    	this.onchange = onchange;
-    }
-
-	public String getOnblur() {
-    	return onblur;
-    }
-
-	public void setOnblur(String onblur) {
-    	this.onblur = onblur;
-    }
-
-	public String getOnfocus() {
-    	return onfocus;
-    }
-
-	public void setOnfocus(String onfocus) {
-    	this.onfocus = onfocus;
-    }
-
-	public String getOndblclick() {
-    	return ondblclick;
-    }
-
-	public void setOndblclick(String ondblclick) {
-    	this.ondblclick = ondblclick;
-    }
-
-	public String getOnhelp() {
-    	return onhelp;
-    }
-
-	public void setOnhelp(String onhelp) {
-    	this.onhelp = onhelp;
-    }
-
-	public String getOnkeydown() {
-    	return onkeydown;
-    }
-
-	public void setOnkeydown(String onkeydown) {
-    	this.onkeydown = onkeydown;
-    }
-
-	public String getOnkeypress() {
-    	return onkeypress;
-    }
-
-	public void setOnkeypress(String onkeypress) {
-    	this.onkeypress = onkeypress;
-    }
-
-	public String getOnkeyup() {
-    	return onkeyup;
-    }
-
-	public void setOnkeyup(String onkeyup) {
-    	this.onkeyup = onkeyup;
-    }
-
-	public String getOnmousedown() {
-    	return onmousedown;
-    }
-
-	public void setOnmousedown(String onmousedown) {
-    	this.onmousedown = onmousedown;
-    }
-
-	public String getOnmousemove() {
-    	return onmousemove;
-    }
-
-	public void setOnmousemove(String onmousemove) {
-    	this.onmousemove = onmousemove;
-    }
-
-	public String getOnmouseout() {
-    	return onmouseout;
-    }
-
-	public void setOnmouseout(String onmouseout) {
-    	this.onmouseout = onmouseout;
-    }
-
-	public String getOnmouseover() {
-    	return onmouseover;
-    }
-
-	public void setOnmouseover(String onmouseover) {
-    	this.onmouseover = onmouseover;
-    }
-
-	public String getOnmouseup() {
-    	return onmouseup;
-    }
-
-	public void setOnmouseup(String onmouseup) {
-    	this.onmouseup = onmouseup;
-    }
-	
-	
-	
-	
-	
-}

+ 0 - 95
src/main/java/commons/web/mvc/CustomPathMatcher.java

@@ -1,95 +0,0 @@
-package commons.web.mvc;
-
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Map;
-
-import org.springframework.util.AntPathMatcher;
-import org.springframework.util.PathMatcher;
-
-public class CustomPathMatcher implements PathMatcher {
-    private PathMatcher target;
-
-    public CustomPathMatcher() {
-        target = new AntPathMatcher();
-    }
-
-    public String combine(String pattern1, String pattern2) {
-        return target.combine(pattern1, pattern2); 
-    }
-
-    public String extractPathWithinPattern(String pattern, String path) {
-        if (isEncoded(pattern)) {
-            pattern = resolvePattern(pattern);
-            if (pattern == null) return "";
-        }
-        return target.extractPathWithinPattern(pattern, path);
-    }
-
-    public Map<String, String> extractUriTemplateVariables(String pattern,
-            String path) {
-        if (isEncoded(pattern)) {
-            pattern = resolvePattern(pattern);
-            if (pattern == null) return Collections.emptyMap();
-        }
-        return target.extractUriTemplateVariables(pattern, path);
-    }
-
-    public Comparator<String> getPatternComparator(String pattern) {
-        final Comparator<String> targetComparator = target.getPatternComparator(pattern);
-        return new Comparator<String>() {
-            public int compare(String o1, String o2) {
-                if (isEncoded(o1)) {
-                    if (isEncoded(o2)) {
-                        return 0;
-                    } else {
-                        return -1;
-                    }
-                } else if (isEncoded(o2)) {
-                    return 1;
-                }
-                return targetComparator.compare(o1, o2);
-            }        
-        };
-    }
-
-    public boolean isPattern(String pattern) {
-        if (isEncoded(pattern)) {
-            pattern = resolvePattern(pattern);
-            if (pattern == null) return true;
-        }
-        return target.isPattern(pattern);
-    }
-
-    public boolean match(String pattern, String path) {
-        if (isEncoded(pattern)) {
-            pattern = resolvePattern(pattern);
-            if (pattern == null) return false;
-        }
-        return target.match(pattern, path);
-    }
-
-    public boolean matchStart(String pattern, String path) {
-        if (isEncoded(pattern)) {
-            pattern = resolvePattern(pattern);
-            if (pattern == null) return false;
-        }
-        return target.match(pattern, path);
-    }
-
-    private boolean isEncoded(String pattern) {
-        return pattern != null && pattern.contains("$");
-    }
-
-    private String resolvePattern(String pattern) {
-        int i = pattern.indexOf('$');
-        if (i < 0) return pattern;
-        else if (i == pattern.length() - 1) {
-            return pattern.substring(0, i);
-        } else {
-            String tail = pattern.substring(i + 1);
-            if (tail.startsWith(".")) return null;
-            else return pattern.substring(0, i) + tail;
-        }
-    }
-}

+ 0 - 38
src/main/java/commons/web/mvc/ExpEval.java

@@ -1,38 +0,0 @@
-package commons.web.mvc;
-
-import jakarta.servlet.jsp.JspException;
-import jakarta.servlet.jsp.PageContext;
-import jakarta.servlet.jsp.tagext.Tag;
-
-public class ExpEval {
-	public static Object evalObject(String attrName, String attrValue, Tag tagObject, PageContext pageContext) throws JspException {
-		return evalExpression(attrName, attrValue, Object.class, tagObject, pageContext);
-	}
-
-	public static String evalString(String attrName, String attrValue, Tag tagObject, PageContext pageContext) throws JspException {
-		return (String) evalExpression(attrName, attrValue, String.class, tagObject, pageContext);
-	}
-
-	public static Integer evalInteger(String attrName, String attrValue, Tag tagObject, PageContext pageContext) throws JspException {
-		return (Integer) evalExpression(attrName, attrValue, Integer.class, tagObject, pageContext);
-	}
-
-	public static Boolean evalBoolean(String attrName, String attrValue, Tag tagObject, PageContext pageContext) throws JspException {
-		return (Boolean) evalExpression(attrName, attrValue, Boolean.class, tagObject, pageContext);
-	}
-
-	private static Object evalExpression(String attrName, String attrValue, Class<?> expectedType, Tag tagObject, PageContext pageContext) throws JspException {
-		if (attrValue == null) return null;
-		if (attrValue.indexOf("${") == -1) {
-			return attrValue;
-		}
-		try {
-			jakarta.el.ELProcessor elProcessor = new jakarta.el.ELProcessor();
-			elProcessor.defineBean("pageContext", pageContext);
-			elProcessor.defineBean("param", pageContext.getRequest().getParameterMap());
-			return elProcessor.eval(attrValue);
-		} catch (Exception e) {
-			throw new JspException("Error evaluating expression: " + attrValue, e);
-		}
-	}
-}

+ 0 - 28
src/main/java/commons/web/mvc/IBeanBase.java

@@ -1,28 +0,0 @@
-package commons.web.mvc;
-
-import java.io.Serializable;
-
-public interface IBeanBase<T extends Serializable> extends Serializable {
-
-	/**
-	 * Metodo utilizzato per riepire il bean a partire
-	 * dai dati del pojo
-	 * @param pojo da cui leggere i dati
-	 */
-	public abstract void fillBean(final T pojo);
-
-	/**
-	 * Metodo utilizzato per riempire i dati del pojo, questi poi 
-	 * viene tornato per essere salvato 
-	 * @param pojos pojos da popolare
-	 * @return pojo da salvare
-	 */
-	public abstract T fillPojo(final T pojo);
-	
-	/**
-	 * @return
-	 */
-	public abstract boolean isVuoto();
-
-
-}

+ 0 - 209
src/main/java/commons/web/mvc/SelectEnumJava.java

@@ -1,209 +0,0 @@
-package commons.web.mvc;
-
-import java.lang.reflect.Field;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-
-import jakarta.servlet.jsp.JspException;
-import jakarta.servlet.jsp.JspWriter;
-
-import commons.utility.StringUtility;
-import commons.utility.database.NullValue;
-
-public class SelectEnumJava extends BaseFieldForm 
-{
-
-	private static final long serialVersionUID = 1L;
-	
-	private static final String SEPARATOR_EXCLUDED = ",";
-
-	/* inizio attributi del tag*/
-	
-	/* I due tag sono alternativi, la presenza di enumValue esclude il valore di enumClass*/
-	private String enumClass;
-	private String enumValue;
-
-	private String nullValue;
-	/* fine attributi del tag*/
-
-	private Enum<?> NULLO;
-	private Class<Enum<?>> enumJavaClass;
-	private List<Enum<?>> enumJavaValues;
-	//private Enum<?> enumInstace;
-	
-	//contiene il valore ordinale degli enumerati da escludere
-	private List<Integer> excluded = new ArrayList<Integer>();
-	//madilati di visualizzazione delle descrizione
-	private boolean viewOrdinal = NullValue.BOOLEAN;
-
-	@Override
-	// eseguo il metodo doStartTag della classe super 
-	// e voglio che venga ignorato il body del tag se presente
-	public int doStartTag() throws JspException 
-	{
-		super.doStartTag();
-		return SKIP_BODY;
-	};
-
-	protected void buildTag(JspWriter out) throws Exception
-	{
-		StringBuffer sb = new StringBuffer();
-		sb.append("<select ").append(getSelectAttribute()).append(">");
-		sb.append(CR).append(createOption()).append(CR);
-		sb.append("</select>");
-
-		out.write(sb.toString());
-	}
-
-	private boolean doSelected(Enum<?> enumJava)
-	{
-        try
-        {        	
-			final Method methodForSelected = enumJava.getClass().getMethod("valueOf", String.class);
-			final Enum<?> enumSelected = (Enum<?>) methodForSelected.invoke(enumJava, enumValue);
-			
-			return enumJava.equals( enumSelected );
-			
-        }
-        catch (Exception e1)
-        {
-
-        }
-        
-        return NullValue.BOOLEAN;
-	}
-
-	private String getNullValueName(Enum<?> enumJava)
-	{
-
-        try
-        {
-	        final Method methodForOrdinal = enumJava.getClass().getMethod("getDrOrdinal", new Class[] {});
-			final int valoreOrdinale = (Integer) methodForOrdinal.invoke(enumJava, new Object[] {});
-			
-			final Method methodForDescription = enumJava.getClass().getMethod("getDescription", new Class[] {});		
-			final String descrizione = (String) methodForDescription.invoke(enumJava, new Object[] {});
-
-			String val = ( ! viewOrdinal ) ? descrizione : valoreOrdinale +  " - " + descrizione;
-			if (enumJava.equals(NULLO))
-			{
-				if (nullValue != null)
-					val = nullValue;
-
-			}
-			return StringUtility.empty(val) ? "&nbsp;" : val;
-        }        
-    	catch(Exception e)
-    	{
-    	
-    	}
-
-        return NullValue.STRING;
-	}
-
-	private StringBuffer createOption() 
-	{
-		StringBuffer sb = new StringBuffer();
-		//for (Enumerate enumerate : enumerateValues) 
-		for (Enum<?> enumJava : enumJavaValues)
-		{
-            try
-            {
-            	final Method methodForName; methodForName = enumJava.getClass().getMethod("name", new Class[] {});
-	            final String nome = (String) methodForName.invoke(enumJava, new Object[] {});
-
-            	final Method methodForOrdinal; methodForOrdinal = enumJava.getClass().getMethod("ordinal", new Class[] {});
-	            final Integer ordinal = (Integer) methodForOrdinal.invoke(enumJava, new Object[] {});
-	            
-				//if ( excluded.contains(valoreOrdinale) )
-					//continue;
-
-				if (excluded.contains(ordinal))
-					continue;
-
-				sb.append(TAB).append("<option value=").append("\"").append(nome).append("\"").append(doSelected(enumJava) ? " selected=\"selected\" " : "").append(">");
-				sb.append(getNullValueName(enumJava));
-				sb.append("</option>").append(CR);
-
-            }
-            catch (Exception e)
-            {
-
-            }
-			
-		}
-		return sb;
-	}
-
-	public void setEnumValue(String enumValue) throws JspException {
-		Object obj;
-		obj = ExpEval.evalString("enumValue", enumValue, this, pageContext);
-		this.enumValue = (String)obj;
-	}
-
-	@SuppressWarnings("unchecked")
-    public void setEnumClass(String enumClass) throws JspException 
-	{
-		Enum<?> enumInstace;
-		this.enumClass = enumClass;
-		try
-		{
-			enumJavaClass = (Class<Enum<?>>) Class.forName(enumClass);
-			enumJavaValues = new ArrayList<Enum<?>>();
-			Field[] f = enumJavaClass.getFields();
-			for (Field field : f)
-			{
-				if (field.get(null) instanceof Enum<?>)
-				{
-					enumInstace = (Enum<?>) field.get(null);
-					enumJavaValues.add(enumInstace);
-					if (field.getName().equalsIgnoreCase("NULLO"))
-						NULLO = enumInstace;
-				}
-			}
-		}
-		catch(ClassNotFoundException e){
-			throw new JspException(e);
-		} catch (SecurityException e) {
-			throw new JspException(e);
-		} catch (IllegalArgumentException e) {
-			throw new JspException(e);
-		} catch (IllegalAccessException e) {
-			throw new JspException(e);
-		}
-	}
-
-	public void setNullValue(String nullValue) {
-		this.nullValue = nullValue;
-	}
-
-	public void setEnumToExclude(String valoriDaEscludere) throws JspException 
-	{
-		//elimina i precedenti valori perch� la lista viene istanziata staticamente !!! 
-		excluded.clear();
-		Object obj = ExpEval.evalString("enumToExclude", valoriDaEscludere, this, pageContext);
-		if ( obj != null )
-		{
-			String[] exc = ( (String) obj).split(SEPARATOR_EXCLUDED);
-			for (int i = 0; i < exc.length; i++) {
-				try 
-				{
-					excluded.add(Integer.parseInt(exc[i].trim()));
-				}
-				catch (NumberFormatException e) {
-					// nothing...
-				}
-			}
-		}
-	}
-
-	public void setViewOrdinal(boolean viewOrdinal) 
-	{
-    	this.viewOrdinal = viewOrdinal;
-    }
-	public static void main(String[] args)
-    {
-		
-    }
-}