use of org.openecard.gui.definition.ToggleText in project open-ecard by ecsec.
the class RunGUI method identityCheckStep.
private Step identityCheckStep() {
// ("Identitätsnachweis wird gestartet");
Step identityCheck_ServerConnection_Step = new Step("Start");
Text serverConnectionText = new Text();
serverConnectionText.setText("Verbindung zum Server wird aufgebaut");
identityCheck_ServerConnection_Step.getInputInfoUnits().add(serverConnectionText);
ToggleText providerName_Text1 = new ToggleText();
providerName_Text1.setTitle("Name");
providerName_Text1.setText("Frauenhofer FOKUS\n\n");
return identityCheck_ServerConnection_Step;
}
use of org.openecard.gui.definition.ToggleText in project open-ecard by ecsec.
the class RunGUI method requestedDataStep.
private Step requestedDataStep() throws Exception {
Step requestedData_Step1 = new Step("Angefragte Daten");
requestedData_Step1.setAction(new RequestedDataAction(requestedData_Step1));
Text requestedDataDescription = new Text();
requestedDataDescription.setText("Der Anbieter \"Test-Diensteanbieter\" fordert zum Zweck \"Entwicklung und Test von Software\" die folgenden Daten von Ihnen an:");
requestedData_Step1.getInputInfoUnits().add(requestedDataDescription);
// Hyperlink dataPrivacyDescriptionLink = new Hyperlink();
// dataPrivacyDescriptionLink.setHref("http://www.dataprivacy.eu");
// pinInputStep.getInputInfoUnits().add(dataPrivacyDescriptionLink);
Checkbox dataToSendSelection = new Checkbox("c1");
BoxItem vornameBoxItem = new BoxItem();
vornameBoxItem.setName("vornameBoxItem");
vornameBoxItem.setChecked(true);
vornameBoxItem.setDisabled(false);
vornameBoxItem.setText("Vorname");
BoxItem nameBoxItem = new BoxItem();
nameBoxItem.setName("nameBoxItem");
nameBoxItem.setChecked(true);
nameBoxItem.setDisabled(false);
nameBoxItem.setText("Name");
BoxItem doctordegreeBoxItem = new BoxItem();
doctordegreeBoxItem.setName("doctordegreeBoxItem");
doctordegreeBoxItem.setChecked(true);
doctordegreeBoxItem.setDisabled(true);
doctordegreeBoxItem.setText("Doktorgrad");
BoxItem addressBoxItem = new BoxItem();
addressBoxItem.setName("addressBoxItem");
addressBoxItem.setChecked(true);
addressBoxItem.setDisabled(false);
addressBoxItem.setText("Anschrift");
BoxItem birthdayBoxItem = new BoxItem();
birthdayBoxItem.setName("birthdayBoxItem");
birthdayBoxItem.setChecked(false);
birthdayBoxItem.setDisabled(false);
birthdayBoxItem.setText("Geburtstag");
BoxItem birthplaceBoxItem = new BoxItem();
birthplaceBoxItem.setName("birthplaceBoxItem");
birthplaceBoxItem.setChecked(false);
birthplaceBoxItem.setDisabled(false);
birthplaceBoxItem.setText("Geburtsort");
// BoxItem pseudonymBoxItem = new BoxItem();
// pseudonymBoxItem.setName("pseudonymBoxItem");
// pseudonymBoxItem.setChecked(false);
// pseudonymBoxItem.setDisabled(true);
// pseudonymBoxItem.setText("Ordens-oder Künstlername");
BoxItem identiycardtypeBoxItem = new BoxItem();
identiycardtypeBoxItem.setName("identiycardtypeBoxItem");
identiycardtypeBoxItem.setChecked(false);
identiycardtypeBoxItem.setDisabled(true);
identiycardtypeBoxItem.setText("Ausweistyp");
BoxItem certificationcountryBoxItem = new BoxItem();
certificationcountryBoxItem.setName("certificationcountryBoxItem");
certificationcountryBoxItem.setChecked(false);
certificationcountryBoxItem.setDisabled(true);
certificationcountryBoxItem.setText("Ausstellendes Land");
BoxItem habitationBoxItem = new BoxItem();
habitationBoxItem.setName("habitationBoxItem");
habitationBoxItem.setChecked(false);
habitationBoxItem.setDisabled(true);
habitationBoxItem.setText("Wohnort");
BoxItem ageverificationBoxItem = new BoxItem();
ageverificationBoxItem.setName("ageverificationBoxItem");
ageverificationBoxItem.setChecked(false);
ageverificationBoxItem.setDisabled(true);
//
// Text sendAgreement_Text = new Text ();
// sendAgreement_Text.setText("Wenn Sie mit der Übermittlung der ausgewählten Daten einverstanden sind , geben Sie bitte Ihre 6/stellige PIN ein.");
// ageverificationBoxItem.setText("Alterverifikation");
// Passwordfield p1 = new Passwordfield();
// p1.setName("pass input1");
// p1.setText("PIN:");
dataToSendSelection.getBoxItems().add(vornameBoxItem);
dataToSendSelection.getBoxItems().add(nameBoxItem);
dataToSendSelection.getBoxItems().add(doctordegreeBoxItem);
// dataToSendSelection.getBoxItems().add(addressBoxItem);
// dataToSendSelection.getBoxItems().add(birthdayBoxItem);
// dataToSendSelection.getBoxItems().add(birthplaceBoxItem);
// dataToSendSelection.getBoxItems().add(identiycardtypeBoxItem);
// dataToSendSelection.getBoxItems().add(certificationcountryBoxItem);
// dataToSendSelection.getBoxItems().add(habitationBoxItem);
// dataToSendSelection.getBoxItems().add(ageverificationBoxItem);
requestedData_Step1.getInputInfoUnits().add(dataToSendSelection);
ToggleText requestedDataDescription1 = new ToggleText();
requestedDataDescription1.setTitle("Hinweis");
requestedDataDescription1.setText("Die markierten Elemente benötigt der Anbieter zur Durchführung seiner Dienstleistung. Optionale Daten können Sie hinzufügen.");
requestedDataDescription1.setCollapsed(!true);
requestedData_Step1.getInputInfoUnits().add(requestedDataDescription1);
return requestedData_Step1;
}
use of org.openecard.gui.definition.ToggleText in project open-ecard by ecsec.
the class EacGuiImpl method loadValuesFromSteps.
public void loadValuesFromSteps(Step step1, Step step2) {
String subject = "", subjectUrl = "";
TermsOfUsage termsOfUsage = new TermsOfUsage("text/plain", new byte[0]);
String validity = "";
String issuer = "", issuerUrl = "";
for (InputInfoUnit next : step1.getInputInfoUnits()) {
if ("SubjectName".equals(next.getID()) && next instanceof ToggleText) {
ToggleText tt = (ToggleText) next;
subject = tt.getText();
} else if ("SubjectURL".equals(next.getID()) && next instanceof ToggleText) {
ToggleText tt = (ToggleText) next;
subjectUrl = tt.getText();
} else if ("TermsOfUsage".equals(next.getID()) && next instanceof ToggleText) {
ToggleText tt = (ToggleText) next;
Document d = tt.getDocument();
termsOfUsage = new TermsOfUsage(d.getMimeType(), d.getValue());
} else if ("Validity".equals(next.getID()) && next instanceof ToggleText) {
ToggleText tt = (ToggleText) next;
validity = tt.getText();
} else if ("IssuerName".equals(next.getID()) && next instanceof ToggleText) {
ToggleText tt = (ToggleText) next;
issuer = tt.getText();
} else if ("IssuerURL".equals(next.getID()) && next instanceof ToggleText) {
ToggleText tt = (ToggleText) next;
issuerUrl = tt.getText();
}
}
ArrayList<BoxItem> readAccess = new ArrayList<>();
ArrayList<BoxItem> writeAccess = new ArrayList<>();
for (InputInfoUnit next : step2.getInputInfoUnits()) {
if ("ReadCHATCheckBoxes".equals(next.getID()) && next instanceof Checkbox) {
Checkbox cb = (Checkbox) next;
this.readAccessBox = cb;
for (org.openecard.gui.definition.BoxItem nb : cb.getBoxItems()) {
BoxItem bi = new BoxItem(nb.getName(), nb.isChecked(), nb.isDisabled(), nb.getText());
readAccess.add(bi);
}
} else if ("WriteCHATCheckBoxes".equals(next.getID()) && next instanceof Checkbox) {
Checkbox cb = (Checkbox) next;
this.writeAccessBox = cb;
for (org.openecard.gui.definition.BoxItem nb : cb.getBoxItems()) {
BoxItem bi = new BoxItem(nb.getName(), nb.isChecked(), nb.isDisabled(), nb.getText());
writeAccess.add(bi);
}
}
}
ServerData sd = new ServerData(subject, subjectUrl, termsOfUsage, validity, issuer, issuerUrl, readAccess, writeAccess);
serverData.deliver(sd);
}
use of org.openecard.gui.definition.ToggleText in project open-ecard by ecsec.
the class EacGuiImplTest method createInitialSteps.
private List<Step> createInitialSteps() {
Step step1 = new Step("PROTOCOL_EAC_GUI_STEP_CVC", "CVC");
ToggleText sub = new ToggleText();
sub.setID("SubjectName");
sub.setText("Test Subject");
step1.getInputInfoUnits().add(sub);
final Step step2 = new Step("PROTOCOL_EAC_GUI_STEP_CHAT", "CHAT");
Checkbox readBox = new Checkbox("ReadCHATCheckBoxes");
readBox.getBoxItems().add(makeBoxItem("DG04", false, false));
readBox.getBoxItems().add(makeBoxItem("RESTRICTED_IDENTIFICATION", true, true));
step2.getInputInfoUnits().add(readBox);
step1.setAction(new StepAction(step1) {
@Override
public StepActionResult perform(Map<String, ExecutionResults> oldResults, StepResult result) {
return new StepActionResult(StepActionResultStatus.NEXT, step2);
}
});
final Step step3 = new PINStep(eacData, true, paceMarker, EacPinStatus.RC3);
step2.setAction(new StepAction(step2) {
@Override
public StepActionResult perform(Map<String, ExecutionResults> oldResults, StepResult result) {
return new StepActionResult(StepActionResultStatus.NEXT, step3);
}
});
final Step step4 = new Step("PROTOCOL_GUI_STEP_PROCESSING", "Finished");
return Arrays.asList(step1, step2, step3, step4);
}
use of org.openecard.gui.definition.ToggleText in project open-ecard by ecsec.
the class RunGUI method providerInfoStep.
private Step providerInfoStep() {
Step step = new Step("Anbieter");
Text decription = new Text();
decription.setText("Zu dem Dienstanbieter und seiner Berechtigung liegen folgende Information vor.");
step.getInputInfoUnits().add(decription);
ToggleText name = new ToggleText();
name.setTitle("Name");
name.setText("Fraunhofer FOKUS");
step.getInputInfoUnits().add(name);
ToggleText url = new ToggleText();
url.setTitle("Internetadresse");
url.setText("http://www.fraunhofer.de");
// url.setCollapsed(true);
step.getInputInfoUnits().add(url);
ToggleText termsofUsage = new ToggleText();
termsofUsage.setTitle("Nutzungsbestimmungen");
termsofUsage.setText("Anschrift:\nTest-Diensteanbieter\nTest-Strasse 1\n12345 Test-Ort\n\n" + "E-Mail-Adresse:\ninfo@test-diensteanbieter.de\n\n" + "Zweck des Auslesevorgangs:\nEntwicklung und Test von Software\n\n" + "Zuständige Datenschutzbehörde:\nTest-Datenschutzbehörde\nTest-Strasse 1\n12345 Test-Ort");
termsofUsage.setCollapsed(true);
step.getInputInfoUnits().add(termsofUsage);
ToggleText validation = new ToggleText();
validation.setTitle("Gültigkeit");
validation.setText("Von 01.01.2012 bis zum 02.01.2012");
validation.setCollapsed(true);
step.getInputInfoUnits().add(validation);
ToggleText subjectName = new ToggleText();
subjectName.setTitle("Aussteller des Berechtigung");
subjectName.setText("D-Trust GmbH");
subjectName.setCollapsed(true);
step.getInputInfoUnits().add(subjectName);
ToggleText subjectURL = new ToggleText();
subjectURL.setTitle("Internetadresse des Ausstellers");
subjectURL.setText("http://www.dtrust.de");
subjectURL.setCollapsed(true);
step.getInputInfoUnits().add(subjectURL);
return step;
}
Aggregations