Erstellen Sie eine TextCreateHandler-Klasse, die die ActionHandler-Schnittstelle im CorrespondenceManagementSolutionTemplate/Services-Projekt implementiert. Diese Schnittstelle enthält die preProcess()- und postProcess()-Methoden, die vor bzw. nach der Create-Methode aufgerufen werden:
package com.adobe.icc;
import java.util.Map;
import com.adobe.icc.dbforms.obj.TextModule;
import com.adobe.livecycle.content.repository.action.ActionHandler;
import com.adobe.livecycle.content.repository.action.ActionType;
/**
* TextCreateHandler is the handler associated with the Create operation of the Form. The preProcess() and postProcess() methods of
* this class are invoked just before and after the Create operation.
*/
public class TextCreateHandler implements ActionHandler {
private static final String PREFIX = "PREFIX";
/**
* This method is invoked just prior to the Create operation of TextModule. The first parameter of this API is the form object that
* is being Created.
*/
public void preProcess(String nodeType, ActionType actionType, Object obj, Map<String, Object> arg1)
{
TextModule text = (TextModule) obj;
text.setName(PREFIX + text.getName());
}
/**
* This method is invoked just after to the Create operation of Text. The first parameter is the form object that has been
* Created.
*/
public void postProcess(String nodeType, ActionType actionType, Object arg0, Map<String, Object> arg1) {
// Do nothing
}
}