1
package org.hisp.dhis.importexport.dhis14.xml.converter;
3
import org.amplecode.staxwax.reader.XMLReader;
4
import org.amplecode.staxwax.writer.XMLWriter;
5
import org.hisp.dhis.importexport.ExportParams;
6
import org.hisp.dhis.importexport.ImportParams;
7
import org.hisp.dhis.importexport.XMLConverter;
10
* Copyright (c) 2004-2007, University of Oslo
11
* All rights reserved.
13
* Redistribution and use in source and binary forms, with or without
14
* modification, are permitted provided that the following conditions are met:
15
* * Redistributions of source code must retain the above copyright notice, this
16
* list of conditions and the following disclaimer.
17
* * Redistributions in binary form must reproduce the above copyright notice,
18
* this list of conditions and the following disclaimer in the documentation
19
* and/or other materials provided with the distribution.
20
* * Neither the name of the HISP project nor the names of its contributors may
21
* be used to endorse or promote products derived from this software without
22
* specific prior written permission.
24
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
25
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
28
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
31
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37
* @author Lars Helge Overland
40
public class UserRoleConverter
41
implements XMLConverter
43
public static final String ELEMENT_NAME = "UserInfoRole";
45
private static final String FIELD_ID = "InfoRoleID";
46
private static final String FIELD_NAME = "InfoRoleName";
47
private static final String FIELD_NAME_ML = "InfoRoleName_ML";
48
private static final String FIELD_DESCRIPTION = "InfoRoleDescription";
50
// -------------------------------------------------------------------------
52
// -------------------------------------------------------------------------
55
* Constructor for write operations.
57
public UserRoleConverter()
61
// -------------------------------------------------------------------------
62
// XMLConverter implementation
63
// -------------------------------------------------------------------------
65
public void write( XMLWriter writer, ExportParams params )
67
writer.openElement( ELEMENT_NAME );
69
writer.writeElement( FIELD_ID, String.valueOf( 1 ) );
70
writer.writeElement( FIELD_NAME, "Unknown" );
71
writer.writeElement( FIELD_NAME_ML, "4387" );
72
writer.writeElement( FIELD_DESCRIPTION, "Unknown" );
74
writer.closeElement();
77
public void read( XMLReader reader, ImportParams params )