Package com.zesped.model

Source Code of com.zesped.model.ExistsDocument

package com.zesped.model;

import es.ipsa.atril.doc.user.Dms;
import es.ipsa.atril.documentindexer.DocumentIndexer;
import es.ipsa.atril.exceptions.ElementNotFoundException;
import es.ipsa.atril.sec.authentication.AtrilSession;

public class ExistsDocument implements CustomConstraint {
  public boolean check (AtrilSession oSes, DocumentIndexer oIdx, BaseModelObject oObj) {
    boolean bFound;
    if (oObj.getStringNull("related_document","").length()>0) {
      try {
        Dms oDms = oSes.getDms();
        oDms.getDocument(oObj.getString("related_document"));
        bFound=true;
      } catch (ElementNotFoundException enfe) {
        bFound=false;
      }
    } else {
      bFound=true;
    }
    return bFound;
  }
 
  public static ExistsDocument INSTANCE = new ExistsDocument();
}
TOP

Related Classes of com.zesped.model.ExistsDocument

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.