Changeset 14402


Ignore:
Timestamp:
2007-09-03T13:39:51+12:00 (14 years ago)
Author:
qq6
Message:

added getCollectList() for making authentication groups

File:
1 edited

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/src/java/org/greenstone/gsdl3/service/Authentication.java

    r14349 r14402  
    22
    33import org.greenstone.gsdl3.util.GSXML;
    4 import org.greenstone.gsdl3.util.GSPath;
    54import org.greenstone.gsdl3.util.DerbyWrapper;
    65import org.greenstone.gsdl3.util.UserQueryResult;
    76import org.greenstone.gsdl3.util.UserTermInfo;
    8 import org.greenstone.gsdl3.util.GlobalProperties;
    97
    108import org.w3c.dom.Element;
    119import org.w3c.dom.NodeList;
    1210
    13 import java.util.ArrayList;
    14 import java.util.Map;
    15 import java.util.Iterator;
    16 import java.util.Set;
    17 import java.util.HashMap;
    1811import java.util.Vector;
    1912import java.sql.SQLException;
    2013import org.apache.log4j.*;
    2114
    22 import java.net.InetAddress;
    23 import java.net.URLEncoder;
    24 import java.util.Properties;
    25 import java.util.Date;
    2615import java.util.regex.Pattern;
    2716import java.io.File;
    2817import java.io.UnsupportedEncodingException;
    29 //import javax.mail.*;
    30 //import javax.mail.internet.*;
    31 
    32 import java.awt.event.ActionEvent;
    33 import java.awt.event.ActionListener;
    34 import javax.swing.Timer;
    35 
    36 import org.apache.log4j.*;
    3718
    3819public class Authentication
     
    172153    Element authen_node = this.doc.createElement(GSXML.AUTHEN_NODE_ELEM);
    173154    result.appendChild(authen_node);
     155    result.appendChild(getCollectList(this.site_home + File.separatorChar + "collect"));
    174156    // create a service node added into the Authentication node
    175157    Element service_node = this.doc.createElement(GSXML.SERVICE_ELEM);
     
    653635    }
    654636       
     637    private Element getCollectList(String collect){
     638    Element collect_list_node = this.doc.createElement(GSXML.COLLECTION_ELEM+"List");
     639    File[] collect_dir= (new File(collect)).listFiles();
     640    if(collect_dir!=null && collect_dir.length > 0){
     641        for (int i=0;i<collect_dir.length;i++){
     642        if (collect_dir[i].isDirectory() && (!collect_dir[i].getName().startsWith(".svn"))){
     643            Element collect_node = this.doc.createElement(GSXML.COLLECTION_ELEM);
     644            collect_node.setAttribute("name",collect_dir[i].getName());
     645            collect_list_node.appendChild(collect_node);
     646        }
     647        }
     648    }
     649    return collect_list_node;
     650    }
    655651}
    656652 
Note: See TracChangeset for help on using the changeset viewer.