~mortenoh/+junk/dhis2-detailed-import-export

« back to all changes in this revision

Viewing changes to dhis-2/dhis-services/dhis-service-importexport/src/main/java/org/hisp/dhis/importexport/dhis14/xml/converter/UserRoleConverter.java

  • Committer: larshelge at gmail
  • Date: 2009-03-03 16:46:36 UTC
  • Revision ID: larshelge@gmail.com-20090303164636-2sjlrquo7ib1gf7r
Initial check-in

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.hisp.dhis.importexport.dhis14.xml.converter;
 
2
 
 
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;
 
8
 
 
9
/*
 
10
 * Copyright (c) 2004-2007, University of Oslo
 
11
 * All rights reserved.
 
12
 *
 
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.
 
23
 *
 
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.
 
34
 */
 
35
 
 
36
/**
 
37
 * @author Lars Helge Overland
 
38
 * @version $Id$
 
39
 */
 
40
public class UserRoleConverter
 
41
    implements XMLConverter
 
42
{
 
43
    public static final String ELEMENT_NAME = "UserInfoRole";
 
44
    
 
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";
 
49
 
 
50
    // -------------------------------------------------------------------------
 
51
    // Constructor
 
52
    // -------------------------------------------------------------------------
 
53
 
 
54
    /**
 
55
     * Constructor for write operations.
 
56
     */
 
57
    public UserRoleConverter()
 
58
    {   
 
59
    }
 
60
 
 
61
    // -------------------------------------------------------------------------
 
62
    // XMLConverter implementation
 
63
    // -------------------------------------------------------------------------
 
64
    
 
65
    public void write( XMLWriter writer, ExportParams params )
 
66
    {
 
67
        writer.openElement( ELEMENT_NAME );
 
68
        
 
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" );
 
73
        
 
74
        writer.closeElement();
 
75
    }    
 
76
 
 
77
    public void read( XMLReader reader, ImportParams params )
 
78
    {
 
79
        // Not implemented        
 
80
    }
 
81
}