Hallo Marcus,
hier nun ein kleines Beispiel wie du mit den Klassen und den FirstSpirit Eingabekomponenten so etwas ansastzweise lösen kannst:
final OperationAgent operationAgent = context.requireSpecialist(OperationAgent.TYPE);
final ShowFormDialogOperation showFormDialogOperation = operationAgent.getOperation(ShowFormDialogOperation.TYPE);
showFormDialogOperation.setMultiLanguage(false);
final FormsAgent formsAgent = context.requireSpecialist(FormsAgent.TYPE);
String gomForm = getGomForm();
Form form = formsAgent.getForm(gomForm);
showFormDialogOperation.setTitle(title);
FormData newFormData = form.createFormData();
fillFormData(newFormData);
showFormDialogOperation.setFormData(newFormData);
showFormDialogOperation.setRuleset(getRuleset());
LanguageAgent languageAgent = context.requireSpecialist(LanguageAgent.TYPE);
Language masterLanguage = languageAgent.getMasterLanguage();
FormData formDataResult = showFormDialogOperation.perform(form, Arrays.asList(languageAgent.getMasterLanguage()));
Dein gomForm könnte dann zum Beispiel wie folgt aussehen:
<CMS_MODULE>
<FS_CATALOG name="wf_images" height="4" useLanguages="no" viewMode="symbols">
<LANGINFOS>
<LANGINFO lang="*" label="Images to check"/>
</LANGINFOS>
<TEMPLATES type="section">
<TEMPLATE uid="wf_image"/>
</TEMPLATES>
</FS_CATALOG>
</CMS_MODULE>
Die dazu gehörigen Regeln ( getRuleset() 😞
<RULES>
<RULE when="ONLOCK">
<WITH>
<FALSE/>
</WITH>
<DO>
<PROPERTY name="NEW" source="wf_images"/>
<PROPERTY name="EDIT" source="wf_images"/>
<PROPERTY name="REMOVE" source="wf_images"/>
</DO>
</RULE>
</RULES>
Und das SectionTemplate:
<CMS_MODULE>
<FS_REFERENCE name="wf_image" hFill="yes" imagePreview="yes" upload="no" useLanguages="no">
<FILTER>
<HIDE type="all"/>
<ALLOW type="media"/>
</FILTER>
<LANGINFOS>
<LANGINFO lang="*" label="Image"/>
</LANGINFOS>
<PROJECTS>
<LOCAL name=".">
<SOURCES>
<FOLDER name="root" store="MEDIASTORE"/>
</SOURCES>
</LOCAL>
</PROJECTS>
</FS_REFERENCE>
</CMS_MODULE>
Um das FormData zu befüllen kannst du nun die normalen Methoden eines FormData und der FormFields benutzen.
Da musst natürlich die Bilder erst mal als Media im MediaStore abgelegt haben. Wenn die Medien durch den Redakteur abgelehnt werden musst du sie nur noch im Anschluss entfernen.
Viele Grüße
Benjamin