Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagephp
titlePost request content example

{
    "username": "myusername",
    "password": "mypass",
    "task": {
        "id": 1919,
        "entityVersion": "124",
        "modified": "2022-06-08 11:35:10",
        "taskGuid": "{876c2173-58aa-4220-865b-8454a5470fd6}",
        "taskNr": "",
        "foreignId": "",
        "taskName": "Task-de-en.html - de \/ en",
        "foreignName": "",
        "sourceLang": "4",
        "targetLang": "5",
        "relaisLang": "0",
        "locked": null,
        "lockingUser": null,
        "state": "open",
        "workflow": "default",
        "workflowStep": "14",
        "workflowStepName": "reviewing",
        "pmGuid": "{e6828cdf-2ee0-4a25-af0a-92e6f060e9eb}",
        "pmName": "Manager, Project (manager)",
        "wordCount": "11",
        "userCount": "1",
        "orderdate": "2022-06-07 00:00:00",
        "enddate": null,
        "referenceFiles": "0",
        "terminologie": "0",
        "enableSourceEditing": "0",
        "edit100PercentMatch": "0",
        "lockLocked": "1",
        "qmSubsegmentFlags": "{\"qmSubsegmentFlags\":[{\"text\":\"Accuracy\",\"id\":1,\"children\":[{\"text\":\"Mistranslation\",\"id\":2,\"children\":[{\"text\":\"Terminology\",\"id\":3}]},{\"text\":\"Omission\",\"id\":4},{\"text\":\"Addition\",\"id\":5},{\"text\":\"Untranslated\",\"id\":6}]},{\"text\":\"Fluency\",\"id\":7,\"children\":[{\"text\":\"Register\",\"id\":8},{\"text\":\"Style\",\"id\":9},{\"text\":\"Inconsistency\",\"id\":10},{\"text\":\"Spelling\",\"id\":11},{\"text\":\"Typography\",\"id\":12},{\"text\":\"Grammar\",\"id\":13},{\"text\":\"Locale violation\",\"id\":14},{\"text\":\"Unintelligible\",\"id\":15}]},{\"text\":\"Verity\",\"id\":16,\"children\":[{\"text\":\"Completeness\",\"id\":17},{\"text\":\"Legal requirements\",\"id\":18},{\"text\":\"Locale applicability\",\"id\":19}]}],\"severities\":{\"critical\":\"Critical\",\"major\":\"Major\",\"minor\":\"Minor\"}}",
        "emptyTargets": "0",
        "importAppVersion": "development",
        "customerId": "1",
        "usageMode": "simultaneous",
        "segmentCount": "3",
        "segmentFinishCount": "3",
        "taskType": "projectTask",
        "projectId": "1918",
        "diffExportUsable": "0",
        "description": "",
        "created": "2022-06-07 14:23:02"
    },
    "tua": {
        "id": "1492",
        "taskGuid": "{876c2173-58aa-4220-865b-8454a5470fd6}",
        "userGuid": "{e6828cdf-2ee0-4a25-af0a-92e6f060e9eb}",
        "state": "finished",
        "role": "reviewer",
        "workflowStepName": "reviewing",
        "workflow": "default",
        "segmentrange": "",
        "usedState": null,
        "isPmOverride": "0",
        "deadlineDate": "2022-06-10 19:55:12",
        "assignmentDate": "2022-06-07 14:24:07",
        "finishedDate": "2022-06-07 17:12:29",
        "trackchangesShow": "1",
        "trackchangesShowAll": "1",
        "trackchangesAcceptReject": "1"
    }
}

...

In order to use the periodically triggered actions (cronjobs) via URL the following configuration has to be done:

  • Setup a cronjob or scheduled task which calls the URL https://YOURINSTALLATION/editor/cron/daily/ (under linux for example with wget)
  • The IP Adress of the caller must configured in the Zf_configuration table for security reasons

Alternatively the Cron Jobs can be triggered via CLI command: "t5 cron" triggers the periodical entries, "t5 cron --daily" triggers the daily actions.

After setting up the cron job, the workflow trigger "doCronDaily" is fired on each call of the above URL .
By default no actions are bound to the "doCronDaily" trigger, so no daily actions are activated./ CLI command call.

Useful actions for this trigger are: 

triggeractionClassactionparameters description
doCronDailyeditor_Workflow_ActionsfinishOverduedTaskUserAssoc/Checks the deadine dates of a task assoc, if it is overdued, it'll be finished for all lectors, triggers normal workflow handlers if needed.
doCronDailydoCronPeriodicaleditor_Workflow_ActionsdeleteOldEndedTasksempty

Optional:

{"limit": 5}

Delete all tasks where the task status is 'end', and the last modified date for this task is older than x days (where x is Zf_configuration property taskLifetimeDays)

Only X tasks are deleted at once. X defaults to 5 and can be set as parameter.

doCronPeriodicaldoCronDailyeditor_Workflow_ActionsdeleteOldEndedTasks{"filesystem": "local", "targetPath": "/backup/task-{id}-{taskNr}-{taskName}.zip"}

Same as above deleteOldEndedTasks BUT makes an export (original format and XLF2 + task metadata as JSON file) to the location given in targetPath. Basically all values given in {curly braces} are replaced with the same named value from the task json, so the naming of the zip files can be controlled.

SFTP is implemented as target too, example:

Code Block
{
    "filesystem": "sftp", 
    "targetPath": "/backup/task-{id}-{taskNr}-{taskName}.zip",
    "host": "HOSTNAME_OR_IP",
	"port": 1234,
    "username": "USERNAME", 
    "password": "PASSWORD"
}

Apart from the local filesystem and SFTP, WebDAV and several cloud services can be addressed. Get in contact with MittagQI to get more information here.

Port is optional, must be given as integer.

targetPath must contain the whole absolute path on the server. You get that after logging in with an ordinary sftp tool to your sftp server.

Only X tasks are deleted/backuped at once. X defaults to 5 and can be set as optional parameter limit in the config JSON.


doCronDailyeditor_Workflow_NotificationnotifyOverdueDeadline{"receiverUser":"aleksandar10","daysOffset": 2,"template":"notifyOverdueTasks_MasterPM"}

Notify the users of a task when the delivery date is over the defined days in the parameters config daysOffset. Available config fields:

receiverUser: the user login to which all of the reminders will be send. If not configured, email reminder to the actual task-associated user

daysOffset: how many days after the deadline date a reminder email will be send

template: template used for the reminder email

doCronDaily

notifyDeadlineApproaching


notifyDeadlineApproaching{"receiverUser":"aleksandar10","daysOffset": 2,"template":"notifyOverdueTasks_MasterPM"}

Notify the the associated users when the deadlineDate is approaching.

receiverUser: the user login to which all of the reminders will be send. If not configured,  email reminder to the actual task-associated user

daysOffset: how many days before the deadline date a reminder email will be send

template: template used for the reminder email

...