|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.internet2.middleware.grouper.ui.util.MembershipExporter
public class MembershipExporter
Reads an XML configuration file and exports membership data as specified. The configuration file is determined by looking up the media.properties key 'membership-export.config'. The base Grouper UI distribution does not have a value set. If you want to allow membership export you must configure one or more formats appropriate to your site.
<membership-export> <format name="CSV (Open with Excel)" separator="," quote="true" extension=".csv" content-type="application/ms-excel" >
<headers>
<header name="Id"/>
<header name="Name"/>
<header name="Type"/>
</headers>
<source id="g:gsa">
<field name="id"/>
<field name="displayName"/>
<field value="group"/>
</source>
<source id="qsuob">
<field name="id"/>
<field name="name"/>
<field value="person"/>
</source>
</format> </membership-export>
Currently only simple delimited files are supported
format tag
name | is the text seen by the user to identify this format - unless there is only one format, in which case it is used as the default |
quote=true | indicates that double-quotes will surround each exported field. |
extension | determines the file extension that will be presented to the web browser - which helps the browser choose the correct application to open, and in the case where an application recognizes different formats, lets the application know the format to expect |
content-type | if configured, is sent as an HTTP header. This will determine how a web browser tries to handle the data. If no content-type is specified, it will be displayed in the UI as a normal page. |
separator | String used to separate fields - typically a comma or tab (\t) |
headers tag
Optionally specifies column headings
source tag
Specifies which fields should be exported for Subjects with the specified source id. If a Subject to be exported has a source which has no configuration it is ignored.
Each source should specify the same number of fields, which should, if they are present, match the number of header fields specified.
field tag
name | the name of the subject attribute, the value of which will be exported |
value | if name is not specified then the text in the value attribute will be used, as is. This allows 'padding' where Subjects from different sources may nnot always have equivalent fields |
Constructor Summary | |
---|---|
MembershipExporter()
|
Method Summary | |
---|---|
void |
export(String name,
Collection subjects,
PrintWriter writer)
|
List |
getAvailableFormats()
|
String |
getContentType(String format)
|
String |
getExtension(String format)
|
int |
getNumberOfAvailableFormats()
|
boolean |
isActive()
|
static void |
main(String[] args)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MembershipExporter() throws Exception
Exception
Method Detail |
---|
public static void main(String[] args) throws Exception
Exception
public boolean isActive()
public List getAvailableFormats() throws Exception
Exception
public int getNumberOfAvailableFormats() throws Exception
Exception
public void export(String name, Collection subjects, PrintWriter writer) throws Exception, IOException
Exception
IOException
public String getContentType(String format) throws Exception
Exception
public String getExtension(String format) throws Exception
Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |