Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.

...

Ein Beispiel dazu ist jeweils in einem Kommentarblock angegeben, dieses Beispiel ist an das tatsächlich genutzte Währungsbusinessobjekt Debitorenbusinessobjekt (bzw. dessen BusinessObject-Klasse) anzupassen.

...

In der Klasse ReferenceFacade müssen die Methode getWrappedClass() und getNuclosStateAttribute() drei Methoden implementiert werden:

  • getReferenceWrapper(Modifiable) wandelt ein Referenz-Businessobjekt in ein Objekt vom Typ AbstractReferenceWrapper
  • getWrappedClass() sollte die Java-Klasse des verwendeten Referenzobjektes (bspw. org.nuclet.businessobject.ClientBilling) zurückgeben
  • getNuclosStateAttribute() sollte dasjenige Attribut des verwendeten Referenzobjektes zurückliefern, dass den Nuclos-Status repräsentiert

Ein Beispiel dazu ist jeweils in einem Kommentarblock angegeben, dieses Beispiel ist an das tatsächlich genutzte Währungsbusinessobjekt Referenzbusinessobjekt (bzw. dessen BusinessObject-Klasse) anzupassen.

Die Beschreibung zur Anpassung der beiden Methoden getSourceStates() und getDestinationStates() finden Sie im nächsten Abschnitt (4.7.3).

Codeblock
languagejava
titleorg.nuclet.sepa.facade.ReferenceFacade
linenumberstrue
collapsetrue
package org.nuclet.sepa.facade;


import java.util.ArrayList;
import java.util.List;

import org.nuclos.api.businessobject.BusinessObject;
import org.nuclos.api.businessobject.facade.Modifiable;
import org.nuclos.api.exception.BusinessException; 

import org.nuclet.sepa.wrapper.AbstractReferenceWrapper;
import org.nuclet.sepa.wrapper.ReferenceWrapper;


// @replace! Bitte bei Nuclet-Integration mit eigenem Code ersetzen!
//
// Beispiel:
// 
// import org.nuclet.businesstemplate.ClientBilling;
import de.bffs.Rechnung;


/**
 * Facade for Business Objects of type "Reference"
 *  
 * @version 1.0
 * @date 21.03.2014
 * @nuclet org.nuclet.SEPA
 * @nucletversion 1.0.0
 * @sincenucletversion 1.0.0
 * @since 21.03.2014
 * 
 * @author frank.lehmann@nuclos.de
 * 
 */
public class ReferenceFacade<T extends BusinessObject & Modifiable> extends AbstractReferenceFacade<Rechnung>
{
    private static final ReferenceFacade instance = new ReferenceFacade();            
    
    
    /**
     * Liefert die Singleton-Instanz dieser Klasse
     *
     */
    public static ReferenceFacade getInstance()
    {
        return instance;
    }                 
    
    /**
     * Wrap the actual reference objects inside an <code>AbstractReferenceWrapper</code>
     * 
     * @return the actual reference objects, wrapped inside an <code>AbstractReferenceWrapper</code>
     *
     */
    public AbstractReferenceWrapper getReferenceWrapper(final Modifiable boReference)
    {
        // @replace! 
        //
        // return new ReferenceWrapper(boReference);
        
        return new ReferenceWrapper(boReference);
    }
    
    /**
     * Get the class of the actual reference objects, i.e. the class wrapped by <code>ReferenceWrapper</code>
     * 
     * @return the class of the actual reference objects, i.e. the class wrapped by <code>ReferenceWrapper</code>
     *
     */
    public Class<Rechnung> getWrappedClass()
    {
        // @replace! 
        //
        // return ClientBilling.class;
        
        return Rechnung.class;
    } 
        
}

 

4.7.2.3 PaymentReferenceFacade

In der Klasse PaymentReferenceFacade müssen drei Methoden implementiert werden:

  • getPaymentReferenceWrapper(Modifiable) wandelt ein Zahlungsreferenz-Businessobjekt in ein Objekt vom Typ AbstractPaymentReferenceWrapper
  • getWrappedClass() sollte die Java-Klasse des verwendeten Zahlungsreferenzobjektes zurückgeben

Ein Beispiel dazu ist jeweils in einem Kommentarblock angegeben, dieses Beispiel ist an das tatsächlich genutzte Zahlungsreferenzbusinessobjekt (bzw. dessen BusinessObject-Klasse) anzupassen.

Codeblock
languagejava
titleorg.nuclet.sepa.facade.PaymentReferenceFacade
linenumberstrue
collapsetrue
package org.nuclet.sepa.facade;


import java.util.ArrayList;
import java.util.List;

import org.nuclos.api.businessobject.BusinessObject;
import org.nuclos.api.businessobject.facade.Modifiable;
import org.nuclos.api.businessobject.Query;
import org.nuclos.api.businessobject.QueryOperation;
import org.nuclos.api.businessobject.SearchExpression;
import org.nuclos.api.businessobject.attribute.ForeignKeyAttribute;
import org.nuclos.api.businessobject.facade.Stateful;
import org.nuclos.api.context.JobContext;
import org.nuclos.api.context.RuleContext;
import org.nuclos.api.exception.BusinessException; 
import org.nuclos.api.provider.QueryProvider;
import org.nuclos.api.provider.BusinessObjectProvider;

import org.nuclet.sepa.wrapper.AbstractPaymentReferenceWrapper;
import org.nuclet.sepa.wrapper.PaymentReferenceWrapper;


// @replace! Bitte bei Nuclet-Integration mit eigenem Code ersetzen!
//
// Beispiel:
// 
// import org.nuclet.businesstemplate.ClientBillingPosition;
import de.bffs.Forderung;


/**
 * Facade for Business Objects of type "PaymentReference"
 *  
 * @version 1.0
 * @date 21.03.2014
 * @nuclet org.nuclet.SEPA
 * @nucletversion 1.0.0
 * @sincenucletversion 1.0.0
 * @since 21.03.2014
 * 
 * @author frank.lehmann@nuclos.de
 * 
 */
public class PaymentReferenceFacade<T extends BusinessObject & Modifiable> extends AbstractPaymentReferenceFacade<Forderung>
{
    private static final PaymentReferenceFacade instance = new PaymentReferenceFacade();            
    
    
    /**
     * Liefert die Singleton-Instanz dieser Klasse
     *
     */
    public static PaymentReferenceFacade getInstance()
    {
        return instance;
    }                 
    
    /**
     * Wrap the actual payment reference objects inside an <code>AbstractPaymentReferenceWrapper</code>
     * 
     * @return the actual payment reference objects, wrapped inside an <code>AbstractPaymentReferenceWrapper</code>
     *
     */
    public AbstractPaymentReferenceWrapper getPaymentReferenceWrapper(final Modifiable boPaymentReference)
    {
        // @replace! 
        //
        // return new PaymentReferenceWrapper(boPaymentReference);
        
        return new PaymentReferenceWrapper(boPaymentReference);
    }
    
    /**
     * Get the class of the actual payment reference objects, i.e. the class wrapped by <code>PaymentReferenceWrapper</code>
     * 
     * @return the class of the actual payment reference objects, i.e. the class wrapped by <code>PaymentReferenceWrapper</code>
     *
     */
    public Class<Forderung> getWrappedClass()
    {
        // @replace! 
        //
        // return ClientBillingPosition.class;
        
        return Forderung.class;
    } 
    
    protected ForeignKeyAttribute<Long> getSEPAPaymentInformationAttribute()
    {
        // @replace!
        //
        // return ClientBillingPosition.SEPAPaymentInformation;
        
        return Forderung.SepaZahlungsinfo;
    }
        
}