initialer Uplad
This commit is contained in:
682
_Vorlagen/Hooks.groovy
Normal file
682
_Vorlagen/Hooks.groovy
Normal file
@@ -0,0 +1,682 @@
|
||||
import com.dvelop.d3.server.Condition
|
||||
import com.dvelop.d3.server.Document
|
||||
import com.dvelop.d3.server.DocumentType
|
||||
import com.dvelop.d3.server.DocumentVersion
|
||||
import com.dvelop.d3.server.PhysicalVersion
|
||||
import com.dvelop.d3.server.Entrypoint
|
||||
import com.dvelop.d3.server.RepositoryField
|
||||
import com.dvelop.d3.server.User
|
||||
import com.dvelop.d3.server.UserGroup
|
||||
import com.dvelop.d3.server.UserOrUserGroup
|
||||
import com.dvelop.d3.server.Document.DocStatus
|
||||
import com.dvelop.d3.server.core.D3Interface
|
||||
import com.dvelop.d3.server.exceptions.D3Exception
|
||||
|
||||
import groovy.sql.GroovyRowResult
|
||||
import groovy.sql.Sql
|
||||
|
||||
|
||||
|
||||
public class Hooks {
|
||||
|
||||
Document oldDocAttributes = null;
|
||||
|
||||
/*
|
||||
* Abhängige Dateien
|
||||
*/
|
||||
|
||||
@Entrypoint( entrypoint = "hook_dep_doc_entry_10" )
|
||||
@Condition( doctype = [Const.DTS_ANGEBOT])
|
||||
public int hookDepDocEntry10(D3Interface d3, Document doc, String status, Integer fileId, User editor, String depExt, Integer transfer) {
|
||||
d3.log.error("START | hookDepDocEntry10 ");
|
||||
d3.log.error("ENDE | hookDepDocEntry10 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_dep_doc_exit_10" )
|
||||
public int hookDepDocExit10(D3Interface d3, Document doc, String status, Integer fileId, User editor, String depExt, Integer transfer) {
|
||||
d3.log.error("START | hookDepDocExit10 ");
|
||||
d3.log.error("ENDE | hookDepDocExit10 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Aktualisieren der Eigenschaftswerte
|
||||
*/
|
||||
|
||||
@Entrypoint( entrypoint = "hook_upd_attrib_entry_10" )
|
||||
public int hookUpdAttribEntry10() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_upd_attrib_entry_20" )
|
||||
public int hookUpdAttribEntry20(D3Interface d3, Document doc, User user, DocumentType docType, DocumentType docTypeNew) {
|
||||
d3.log.error("START | hookUpdAttribEntry20")
|
||||
|
||||
// temporäres Objekt holen, um zu prüfen, das sich Eigenschaften geändert haben
|
||||
oldDocAttributes = d3.archive.getDocument(doc.id());
|
||||
|
||||
d3.log.error("ENDE | hookUpdAttribEntry20")
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_upd_attrib_entry_30" )
|
||||
public int hookUpdAttribEntry30() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_upd_attrib_exit_10" )
|
||||
public int hookUpdAttribExit10(D3Interface d3, Document doc, Integer errorCode, User user, DocumentType docType, DocumentType docTypeOld) {
|
||||
d3.log.error("START | hookUpdAttribExit10 ")
|
||||
d3.log.error("ENDE | hookUpdAttribExit10 ")
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_upd_attrib_exit_20" )
|
||||
public int hookUpdAttribExit20(D3Interface d3, Document doc, Integer errorCode, User user, DocumentType docType, DocumentType docTypeOld) {
|
||||
d3.log.error("START | hookUpdAttribExit20 ")
|
||||
d3.log.error("ENDE | hookUpdAttribExit20 ")
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_upd_attrib_exit_30" )
|
||||
public int hookUpdAttribExit30() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Dokumentanlage
|
||||
*/
|
||||
|
||||
// Dieser Einsprungpunkt ist aktuell nicht mit der Groovy-Hookschnittstelle kompatibel und kann deshalb noch nicht genutzt werden.
|
||||
@Entrypoint( entrypoint = "hook_hostimp_entry_10" )
|
||||
public int hookHostimpEntry10(D3Interface d3, User user, DocumentType docType, String test1, String test2, String test3) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_hostimp_exit_10" )
|
||||
public int hookHostimpExit10(D3Interface d3, String importDir, String fileName, Document doc, DocumentType docType, String newImport) {
|
||||
d3.log.error("START | hookHostimpExit10 ");
|
||||
d3.log.error("ENDE | hookHostimpExit10 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_insert_entry_10" )
|
||||
public int hookInsertEntry10(D3Interface d3, User user, DocumentType docType, Document doc) {
|
||||
d3.log.error("START | hookInsertEntry10 ");
|
||||
FunctionsCustom.splitCustomerData(d3, doc);
|
||||
d3.log.error("ENDE | hookInsertEntry10 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_insert_entry_20" )
|
||||
public int hookInsertEntry20(D3Interface d3, Document doc, DocumentType docType, User user) {
|
||||
d3.log.error("START | hookInsertEntry20 ");
|
||||
d3.log.error("ENDE | hookInsertEntry20 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_insert_entry_30" )
|
||||
public int hookInsertEntry30() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_insert_exit_10" )
|
||||
public int hookInsertExit10 (D3Interface d3, Document doc, String fileDestination, Integer importOk, User user, DocumentType docType) {
|
||||
d3.log.error("START | hookInsertExit10 ");
|
||||
d3.log.error("ENDE | hookInsertExit10 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_insert_exit_20" )
|
||||
public int hookInsertExit20(D3Interface d3, Document doc, String fileDestination, Integer importOk, User user, DocumentType docType) {
|
||||
d3.log.error("START | hookInsertExit20 - ");
|
||||
d3.log.error("ENDE | hookInsertExit20 - ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_insert_exit_30" )
|
||||
public int hookInsertExit30 (D3Interface d3, Document doc, String fileDestination, Integer importOk, User user, DocumentType docType) {
|
||||
d3.log.error("START | hookInsertExit30 ")
|
||||
d3.log.error("ENDE | hookInsertExit30 ")
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Dokumente freigeben
|
||||
*/
|
||||
|
||||
@Entrypoint( entrypoint = "hook_release_entry_10" )
|
||||
public int hookReleaseEntry10(D3Interface d3, Document doc, User user, DocumentType docType, String unblock) {
|
||||
d3.log.error("START | hookReleaseEntry10 ");
|
||||
d3.log.error("ENDE | hookReleaseEntry10 ");
|
||||
return 0
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_release_exit_10" )
|
||||
public int hookReleaseExit10(D3Interface d3, Document doc, User user, Integer errorCode, DocumentType docType, String unblock) {
|
||||
d3.log.error("START | hookReleaseExit10 ");
|
||||
d3.log.error("ENDE | hookReleaseExit10 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Dokument prüfen
|
||||
*/
|
||||
|
||||
@Entrypoint( entrypoint = "hook_verify_entry_10" )
|
||||
public int hookVerifyEntry10(D3Interface d3, Document doc, Integer versionId, User user) {
|
||||
d3.log.error("START | hookVerifyEntry10 ");
|
||||
d3.log.error("ENDE | hookVerifyEntry10 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_verify_exit_10" )
|
||||
public int hookVerifyExit10(D3Interface d3, Document doc, Integer versionId, User user, Integer errorCode) {
|
||||
d3.log.error("START | hookVerifyExit10 ");
|
||||
d3.log.error("ENDE | hookVerifyExit10 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Dokumentsuche
|
||||
*/
|
||||
|
||||
// Dokumente suchen
|
||||
@Entrypoint( entrypoint = "hook_search_entry_05" )
|
||||
public int hookSearchEntry05(D3Interface d3, User user, DocumentType docType, Document searchContext) {
|
||||
d3.log.error("START | hookSearchEntry05 ");
|
||||
d3.log.error("ENDE | hookSearchEntry05 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_search_entry_10" )
|
||||
public int hookSearchEntry10(D3Interface d3, User user, DocumentType docType, Document searchContext) {
|
||||
d3.log.error("START | hookSearchEntry10 ");
|
||||
d3.log.error("ENDE | hookSearchEntry10 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_search_entry_20" )
|
||||
public int hookSearchEntry20() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_search_entry_30" )
|
||||
public int hookSearchEntry30(D3Interface d3, User user, DocumentType docType) {
|
||||
d3.log.error("START | hookSearchEntry30 ");
|
||||
d3.log.error("ENDE | hookSearchEntry30 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_search_exit_10" )
|
||||
public int hookSearchExit10() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_search_exit_20" )
|
||||
public int hookSearchExit20() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_search_exit_30" )
|
||||
public int hookSearchExit30(D3Interface d3, User user, Integer errorCode, Integer noResults, Integer noRefused, DocumentType docType) {
|
||||
d3.log.error("START | hookSearchExit30 ");
|
||||
d3.log.error("ENDE | hookSearchExit30 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Einspielen einer neuen Version
|
||||
*/
|
||||
|
||||
// neue Version
|
||||
@Entrypoint( entrypoint = "hook_new_version_entry_10" )
|
||||
public int hookNewVersionEntry10(D3Interface d3, Document doc, String fileSource, String fileDestination, User user, DocumentType docType) {
|
||||
d3.log.error("START | hookNewVersionEntry10 ");
|
||||
d3.log.error("ENDE | hookNewVersionEntry10 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_new_version_entry_20" )
|
||||
public int hookNewVersionEntry20(D3Interface d3, Document doc, String fileSource, String fileDestination, User user, DocumentType docType) {
|
||||
d3.log.error("START | hookNewVersionEntry20 ");
|
||||
d3.log.error("ENDE | hookNewVersionEntry20 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_new_version_entry_30" )
|
||||
public int hookNewVersionEntry30(D3Interface d3, Document doc, String fileSource, String fileDestination, User user, DocumentType docType) {
|
||||
d3.log.error("START | hookNewVersionEntry30 ");
|
||||
d3.log.error("ENDE | hookNewVersionEntry30 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_new_version_exit_10" )
|
||||
public int hookNewVersionExit10(D3Interface d3, Document doc, Integer errorCode, User user, DocumentType docType) {
|
||||
d3.log.error("START | hookNewVersionExit10 ");
|
||||
d3.log.error("ENDE | hookNewVersionExit10 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_new_version_exit_20" )
|
||||
public int hookNewVersionExit20(D3Interface d3, Document doc, String fileDestination, Integer importOk, User user, DocumentType docType) {
|
||||
d3.log.error("START | hookNewVersionExit20 ");
|
||||
d3.log.error("ENDE | hookNewVersionExit20 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_new_version_exit_30" )
|
||||
public int hookNewVersionExit30(D3Interface d3, Document doc, Integer importOk, Integer errorCode, User user, DocumentType docType) {
|
||||
d3.log.error("START | hookNewVersionExit30 ");
|
||||
d3.log.error("ENDE | hookNewVersionExit30 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Erzeugen/ Bearbeiten von TIFF- oder PDF-Dokumenten
|
||||
*/
|
||||
|
||||
@Entrypoint( entrypoint = "hook_rendition_entry_10" )
|
||||
public int hookRenditionEntry10(D3Interface d3, Document doc, User user) {
|
||||
d3.log.error("START | hookRenditionEntry10 ");
|
||||
d3.log.error("ENDE | hookRenditionEntry10 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_rendition_entry_20" )
|
||||
public int hookRenditionEntry20(D3Interface d3, Document doc, DocumentType docType, String sourcePath, String sourceFilename, String destFilename) {
|
||||
d3.log.error("START | hookRenditionEntry20 ");
|
||||
d3.log.error("ENDE | hookRenditionEntry20 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_rendition_exit_30" )
|
||||
public int hookRenditionExit30(D3Interface d3, Document doc, String destStatus, String tiffFilename, Integer errorCode, String fileType) {
|
||||
d3.log.info("START | hookRenditionExit30 ");
|
||||
d3.log.info("ENDE | hookRenditionExit30 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Login
|
||||
*/
|
||||
|
||||
@Entrypoint( entrypoint = "hook_val_passwd_entry_10" )
|
||||
public int hookValPasswdEntry10(D3Interface d3, User user, String appLanguage, String appVersion) {
|
||||
d3.log.error("START | hookValPasswdEntry10 ");
|
||||
d3.log.error("ENDE | hookValPasswdEntry10 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_val_passwd_exit_10" )
|
||||
public int hookValPasswdExit10(D3Interface d3, int errorCode, User user, String appLanguage, String appVersion) {
|
||||
d3.log.error("START | hookValPasswdExit10 ");
|
||||
d3.log.error("ENDE | hookValPasswdExit10 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Löschen eines Dokuments
|
||||
*/
|
||||
|
||||
@Entrypoint( entrypoint = "hook_delete_entry_10" )
|
||||
public int hookDeleteEntry10(D3Interface d3, Document doc, User user, DocumentType docType) {
|
||||
d3.log.error("START | hookDeleteEntry10 ");
|
||||
d3.log.error("ENDE | hookDeleteEntry10 ");
|
||||
return 0;
|
||||
}
|
||||
@Entrypoint( entrypoint = "hook_delete_exit_10" )
|
||||
public int hookDeleteExit10(D3Interface d3, Document doc, User user, Integer errorCode, DocumentType docType) {
|
||||
d3.log.error("START | hookDeleteExit10 ");
|
||||
d3.log.error("ENDE | hookDeleteExit10 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Löschen von Verknüpfungen
|
||||
*/
|
||||
|
||||
@Entrypoint( entrypoint = "hook_unlink_entry_30" )
|
||||
public int hookUnlinkEntry30(D3Interface d3, Document docFather, Document docChild) {
|
||||
d3.log.error("START | hookUnlinkEntry30 ");
|
||||
d3.log.error("ENDE | hookUnlinkEntry30 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_unlink_exit_10" )
|
||||
public int hookUnlinkExit10(D3Interface d3, Document docFather, Document docChild, Integer unlinkErrorCode, Integer errorCode) {
|
||||
d3.log.error("START | hookUnlinkExit10 ");
|
||||
d3.log.error("ENDE | hookUnlinkExit10 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Postkorb
|
||||
*/
|
||||
|
||||
@Entrypoint( entrypoint = "hook_ack_holdfile_exit_10" )
|
||||
public int hookAckHoldfileExit10(D3Interface d3, User user, Document doc, Integer holdfileId) {
|
||||
d3.log.error("START | hookAckHoldfileExit10 ");
|
||||
d3.log.error("ENDE | hookAckHoldfileExit10 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Redlining
|
||||
*/
|
||||
|
||||
@Entrypoint( entrypoint = "hook_write_redline_entry_10" )
|
||||
public int hookWriteRedlineEntry10(D3Interface d3, Document doc, User user, DocumentType docType) {
|
||||
d3.log.error("START | hookWriteRedlineEntry10 ");
|
||||
d3.log.error("ENDE | hookWriteRedlineEntry10 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_write_redline_exit_30" )
|
||||
public int hookWriteRedlineExit30() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Senden einer Wiedervorlage
|
||||
*/
|
||||
|
||||
@Entrypoint( entrypoint = "hook_holdfile_entry_10" )
|
||||
public int hookHoldfileEntry10(D3Interface d3, Document doc, UserOrUserGroup recipient, UserOrUserGroup sender, Integer chainId, String notice, String wvType) {
|
||||
d3.log.error("START | hookHoldfileEntry10 ");
|
||||
d3.log.error("ENDE | hookHoldfileEntry10 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_holdfile_entry_20" )
|
||||
public int hookHoldfileEntry20(D3Interface d3, Document doc, UserOrUserGroup recipient, UserOrUserGroup sender, Integer chainId, String notice, String wvType) {
|
||||
d3.log.error("START | hookHoldfileEntry20 ");
|
||||
d3.log.error("ENDE | hookHoldfileEntry20 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_holdfile_entry_30" )
|
||||
public int hookHoldfileEntry30(D3Interface d3, Document doc, UserOrUserGroup recipient, UserOrUserGroup sender, Integer chainId, String notice, String wvType) {
|
||||
d3.log.error("START | hookHoldfileEntry30 ");
|
||||
d3.log.error("ENDE | hookHoldfileEntry30 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_holdfile_exit_10" )
|
||||
public int hookHoldfileExit10(D3Interface d3, Document doc, UserOrUserGroup recipient, UserOrUserGroup sender, Integer chainId, Integer errorCode) {
|
||||
d3.log.error("START | hookHoldfileExit10 ");
|
||||
d3.log.error("ENDE | hookHoldfileExit10 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Senden einer Wiedervorlage (#Balance)
|
||||
*/
|
||||
|
||||
@Entrypoint( entrypoint = "hook_holdfile_balance_entry_10" )
|
||||
public int hookHoldfileBalanceEntry10() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_holdfile_balance_entry_20" )
|
||||
public int hookHoldfileBalanceEntry20() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_holdfile_balance_exit_10" )
|
||||
public int hookHoldfileBalanceExit10() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_holdfile_balance_exit_20" )
|
||||
public int hookHoldfileBalanceExit20() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_holdfile_balance_exit_30" )
|
||||
public int hookHoldfileBalanceExit30() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Senden von E-Mails bei Wiedervorlage
|
||||
*/
|
||||
|
||||
@Entrypoint( entrypoint = "hook_send_email_entry_10" )
|
||||
public int hookSendEmailEntry10(D3Interface d3, Document doc, String recipient, String sender, String subject, Integer trigger, String url_link) {
|
||||
d3.log.error("START | hookSendEmailEntry10 ");
|
||||
d3.log.error("ENDE | hookSendEmailEntry10 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_send_email_entry_20" )
|
||||
public int hookSendEmailEntry20(D3Interface d3, Document doc, String recipient, String sender, String subject, Integer trigger) {
|
||||
d3.log.error("START | hookSendEmailEntry20 ");
|
||||
d3.log.error("ENDE | hookSendEmailEntry20 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_send_email_exit_10" )
|
||||
public int hookSendEmailExit10(D3Interface d3, Document doc, String recipient, String sender, String subject, Integer retCode) {
|
||||
d3.log.error("START | hookSendEmailExit10 ");
|
||||
d3.log.error("ENDE | hookSendEmailExit10 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Sperren eines Dokuments
|
||||
*/
|
||||
|
||||
@Entrypoint( entrypoint = "hook_block_entry_10" )
|
||||
public int hookBlockEntry10(D3Interface d3, Document doc, User user) {
|
||||
d3.log.error("START | hookBlockEntry10 ");
|
||||
d3.log.error("ENDE | hookBlockEntry10 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_block_exit_10" )
|
||||
public int hookBlockExit10( D3Interface d3, Document doc, User user ) {
|
||||
d3.log.error("START | hookBlockExit10 ");
|
||||
d3.log.error("ENDE | hookBlockExit10 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Stammdaten
|
||||
*/
|
||||
|
||||
@Entrypoint( entrypoint = "hook_on_user_change_exit_10" )
|
||||
public int hookOnUserChangeExit10(D3Interface d3, User actionUser, User newUser, User oldUser) {
|
||||
d3.log.error("START | hookOnUserChangeExit10 ");
|
||||
d3.log.error("ENDE | hookOnUserChangeExit10 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Statustransfer
|
||||
*/
|
||||
|
||||
@Entrypoint( entrypoint = "hook_transfer_entry_30" )
|
||||
public int hookTransferEntry30(D3Interface d3, User user, Document doc, Integer fileId, String sourceStatus, String destStatus, UserOrUserGroup destEditor) {
|
||||
d3.log.error("START | hookTransferEntry30 ");
|
||||
d3.log.error("ENDE | hookTransferEntry30 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_transfer_exit_30" )
|
||||
public int hookTransferExit30(D3Interface d3, User user, Document doc, Integer fileId, String sourceStatus, String destStatus, UserOrUserGroup destEditor, Integer errorCode) {
|
||||
d3.log.error("START | hookTransferExit30 ");
|
||||
d3.log.error("ENDE | hookTransferExit30 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Validieren von Eigenschaftswerten
|
||||
*/
|
||||
|
||||
@Entrypoint( entrypoint = "hook_validate_import_entry_10" )
|
||||
public int hookValidateImportEntry10(D3Interface d3, User user, DocumentType docType, Document doc, String nextcall) {
|
||||
d3.log.error("START | hookValidateImportEntry10 ");
|
||||
d3.log.error("ENDE | hookValidateImportEntry10 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_validate_search_entry_10" )
|
||||
public int hookValidateSearchEntry10(D3Interface d3, User user, DocumentType docType, Document searchContext, String nextcall) {
|
||||
d3.log.error("START | hookValidateSearchEntry10 ");
|
||||
d3.log.error("ENDE | hookValidateSearchEntry10 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_validate_update_entry_10" )
|
||||
public int hookValidateUpdateEntry10(D3Interface d3, User user, DocumentType docType, Document doc, String nextcall) {
|
||||
d3.log.error("START | hookValidateUpdateEntry10 ");
|
||||
d3.log.error("ENDE | hookValidateUpdateEntry10 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Verknüpfen von Dokumente bzw. Akten
|
||||
*/
|
||||
|
||||
@Entrypoint( entrypoint = "hook_link_entry_30" )
|
||||
public int hookLinkEntry30( D3Interface d3, Document docFather, Document docChild ){
|
||||
d3.log.error("START | hookLinkEntry30 ");
|
||||
d3.log.error("ENDE | hookLinkEntry30 ");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_link_exit_10" )
|
||||
public int hooklinkexit10(D3Interface d3, Document docFather, Document docChild, Integer errorCode) {
|
||||
d3.log.error("START | hooklinkexit10 " );
|
||||
d3.log.error("ENDE | hooklinkexit10 " );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Web-Veröffentlichtungen
|
||||
*/
|
||||
|
||||
@Entrypoint( entrypoint = "hook_webpublish_entry_10" )
|
||||
public int hookWebpublishEntry10(D3Interface d3, Document doc, User user, Integer publish) {
|
||||
d3.log.error("START | hookWebpublishEntry10 " );
|
||||
d3.log.error("ENDE | hookWebpublishEntry10 " );
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_webpublish_entry_20" )
|
||||
public int hookWebpublishEntry20(D3Interface d3, Document doc, User user, DocumentType docType, Integer publish) {
|
||||
d3.log.error("START | hookWebpublishEntry20 " );
|
||||
d3.log.error("ENDE | hookWebpublishEntry20 " );
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_webpublish_entry_30" )
|
||||
public int hookWebpublishEntry30(D3Interface d3, Document doc, User user, DocumentType docType, Integer publish) {
|
||||
d3.log.error("START | hookWebpublishEntry30 " );
|
||||
d3.log.error("ENDE | hookWebpublishEntry30 " );
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_webpublish_exit_10" )
|
||||
public int hookWebpublishExit10(D3Interface d3, Document doc, User user, Integer errorCode, DocumentType docType, Integer publish) {
|
||||
d3.log.error("START | hookWebpublishExit10 " );
|
||||
d3.log.error("ENDE | hookWebpublishExit10 " );
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_webpublish_exit_20" )
|
||||
public int hookWebpublishExit20(D3Interface d3, Document doc, User user, Integer errorCode, DocumentType docType, Integer publish) {
|
||||
d3.log.error("START | hookWebpublishExit20 " );
|
||||
d3.log.error("ENDE | hookWebpublishExit20 " );
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Entrypoint( entrypoint = "hook_webpublish_exit_30" )
|
||||
public int hookWebpublishExit30(D3Interface d3, Document doc, User user, Integer errorCode, DocumentType docType, Integer publish) {
|
||||
d3.log.error("START | hookWebpublishExit30 " );
|
||||
d3.log.error("ENDE | hookWebpublishExit30 " );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Workflow
|
||||
*/
|
||||
|
||||
@Entrypoint( entrypoint = "hook_workflow_cancel_exit_20" )
|
||||
public int hookWorkflowCancelExit20(D3Interface d3, Document doc, String wflId, String stepId, User user) {
|
||||
d3.log.error("START | hookWorkflowCancelExit20 " );
|
||||
d3.log.error("ENDE | hookWorkflowCancelExit20 " );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
169
_Vorlagen/Skriptvorlage.groovy
Normal file
169
_Vorlagen/Skriptvorlage.groovy
Normal file
@@ -0,0 +1,169 @@
|
||||
import com.dvelop.d3.server.Document
|
||||
import com.dvelop.d3.server.core.D3Interface
|
||||
import com.dvelop.d3.server.exceptions.SQLException
|
||||
import com.dvelop.d3.server.exceptions.D3Exception
|
||||
import groovy.transform.Field
|
||||
|
||||
D3Interface d3 = getProperty("d3");
|
||||
|
||||
@Field prg = "migration_notizen.groovy";
|
||||
@Field version = "0.1";
|
||||
@Field kunde = "Dr. Kleeberg & Partner GmbH";
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// debug = 0 => es finden Änderungen am Datenbestand statt
|
||||
// debug = 1 => es finden keine Änderungen am Datenbestand statt
|
||||
@Field debug = 1;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
def debugtext;
|
||||
|
||||
switch (debug)
|
||||
{
|
||||
case 0:
|
||||
debugtext = "ausgeschaltet";
|
||||
break;
|
||||
default:
|
||||
debugtext = "eingeschaltet (keine Aenderungen am Datenbestand)";
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
xlog( d3, 4, "************************************************" );
|
||||
xlog( d3, 4, "* Programm : " + prg );
|
||||
xlog( d3, 4, "* Version : " + version );
|
||||
xlog( d3, 4, "* Kunde : " + kunde );
|
||||
xlog( d3, 4, "* geschrieben von : calb / d.velop AG" );
|
||||
xlog( d3, 4, "* (c) d.velop AG" );
|
||||
xlog( d3, 4, "************************************************" );
|
||||
|
||||
|
||||
xlog( d3, 4, "Parameter: " );
|
||||
xlog( d3, 4, "* DEBUG : " + debugtext );
|
||||
|
||||
|
||||
|
||||
|
||||
xlog( d3, 4, "************************************************" );
|
||||
|
||||
|
||||
|
||||
def sqlQuery = "select id,ddf1,ddf48,ddf10,ddf21,ddf22,ddf25,ddf37,ddf42,ddf60,ddf69 from mig_beratungsakte where fehler is null and doku_id is null";
|
||||
|
||||
resultRows = d3.sql.executeAndGet( (String) sqlQuery );
|
||||
|
||||
if ( resultRows.size() > 0 )
|
||||
{
|
||||
xlog( d3, 4, " Es wurden " + resultRows.size() + " Treffer gefunden." );
|
||||
xlog( d3, 4, "************************************************" );
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def xlog( D3Interface d3, int loglevel, String logtext )
|
||||
{
|
||||
def logdatei = "d:\\d3\\apps\\" + prg + ".txt";
|
||||
def g_loglevel = 5;
|
||||
def g_logdirect = "BEIDE"; // BEIDE oder D3LOG oder DATEI
|
||||
def date = new Date();
|
||||
def zeitstempel = date.format( "yyyy.MM.dd HH:mm:ss", TimeZone.getTimeZone('CET') );
|
||||
def loglevel_lang = "[INFO ]";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if ( loglevel <= g_loglevel )
|
||||
{
|
||||
switch ( loglevel )
|
||||
{
|
||||
case 1:
|
||||
loglevel_lang = "[FATAL]";
|
||||
|
||||
if ( ( g_logdirect == "D3LOG" ) || ( g_logdirect == "BEIDE" ) )
|
||||
{
|
||||
d3.log.critical( logtext );
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
loglevel_lang = "[ERROR]";
|
||||
|
||||
if ( ( g_logdirect == "D3LOG" ) || ( g_logdirect == "BEIDE" ) )
|
||||
{
|
||||
d3.log.error( logtext );
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
loglevel_lang = "[WARN ]";
|
||||
|
||||
if ( ( g_logdirect == "D3LOG" ) || ( g_logdirect == "BEIDE" ) )
|
||||
{
|
||||
d3.log.warn( logtext );
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
loglevel_lang = "[INFO ]";
|
||||
|
||||
if ( ( g_logdirect == "D3LOG" ) || ( g_logdirect == "BEIDE" ) )
|
||||
{
|
||||
d3.log.info( logtext );
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
loglevel_lang = "[DEBUG]";
|
||||
// Da die d.3 Server i.d.R. nicht im Debug-Modus laufen, erscheinen DEBUG-Meldungen nicht im Log.
|
||||
if ( ( g_logdirect == "D3LOG" ) || ( g_logdirect == "BEIDE" ) )
|
||||
{
|
||||
d3.log.debug( logtext );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ( ( g_logdirect == "DATEI" ) || ( g_logdirect == "BEIDE" ) )
|
||||
{
|
||||
new File( logdatei ).append( zeitstempel + " " + loglevel_lang + " " + logtext + "\n", "UTF8" );
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user