public class MembershipExporter extends Object implements Serializable
<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 and Description |
---|
MembershipExporter() |
Modifier and Type | Method and Description |
---|---|
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) |
public boolean isActive()
public int getNumberOfAvailableFormats() throws Exception
Exception
public void export(String name, Collection subjects, PrintWriter writer) throws Exception, IOException
Exception
IOException
Copyright © 2016 Internet2. All rights reserved.