br.unifor.mia.xmpsemantico.xmp.MiaSchema.java Source code

Java tutorial

Introduction

Here is the source code for br.unifor.mia.xmpsemantico.xmp.MiaSchema.java

Source

package br.unifor.mia.xmpsemantico.xmp;

import com.itextpdf.text.xml.xmp.XmpArray;
import com.itextpdf.text.xml.xmp.XmpSchema;

/**
* This class was created to discipline the Semantic Web 
* MSc in Applied Informatics of Unifor - University of Fortaleza 
* As part of the research on semantic processing files 
* PDF's using based on the standard ISO XMP, and the iText framework 
* that is about the AGPL license, product version 5.5.2 
* This class extends XMP, add a new schema
 * written by: @author patrick.cunha [adrianopatrick@gmail.com] 
 * @since 10/09/2014
 */
@SuppressWarnings("deprecation")
public class MiaSchema extends XmpSchema {

    private static final long serialVersionUID = -8817728090106843158L;

    /** default namespace identifier*/
    public static final String DEFAULT_XPATH_ID = "mia";
    /** default namespace uri*/
    public static final String DEFAULT_XPATH_URI = "http://www.unifor.br/mia/";

    public static final String FORMAT = "mia:format";

    public static final String DESCRIPTION = "mia:description";

    public static final String DISCIPLINA = "mia:disciplina";

    public static final String PROFESSOR = "mia:professor";

    public static final String CARGA_HORARIA = "mia:cargahoraria";

    public static final String CREDITOS = "mia:creditos";

    public MiaSchema() {
        super("xmlns:" + DEFAULT_XPATH_ID + "=\"" + DEFAULT_XPATH_URI + "\"");
        setProperty(FORMAT, "application/pdf");
    }

    /**
     * Adds a description.
     * @param description
     */
    public void addDescription(String desc) {
        XmpArray array = new XmpArray(XmpArray.ALTERNATIVE);
        array.add(desc);
        setProperty(DESCRIPTION, array);
    }

    /** Adds the name of disciplina.
     * @param disciplina
     */
    public void addDisciplina(String disciplina) {
        setProperty(DISCIPLINA, disciplina);
    }

    public void addProfessor(String professor) {
        setProperty(PROFESSOR, professor);
    }

    public void addCargaHoraria(String cargaHoraria) {
        setProperty(CARGA_HORARIA, cargaHoraria);
    }

    public void addCreditos(String creditos) {
        setProperty(CREDITOS, creditos);
    }

}