<commit_before>package com.angkorteam.ecommerce.page.color;

import com.angkorteam.framework.extension.wicket.markup.html.form.Button;
import com.angkorteam.framework.extension.wicket.markup.html.form.ColorTextField;
import com.angkorteam.framework.extension.wicket.markup.html.form.Form;
import com.angkorteam.framework.extension.wicket.markup.html.panel.TextFeedbackPanel;
import com.angkorteam.framework.jdbc.InsertQuery;
import com.angkorteam.platform.Platform;
import com.angkorteam.platform.page.MBaaSPage;
import com.angkorteam.platform.validator.UniqueRecordValidator;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.RandomStringUtils;
import org.apache.wicket.WicketRuntimeException;
import org.apache.wicket.markup.html.border.Border;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.markup.html.form.upload.FileUpload;
import org.apache.wicket.markup.html.form.upload.FileUploadField;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
import org.apache.wicket.model.PropertyModel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.util.List;

/**
 * Created by socheatkhauv on 22/1/17.
 */
public class ColorCreatePage extends MBaaSPage {

    private static final Logger LOGGER = LoggerFactory.getLogger(ColorCreatePage.class);

    private String code;
    private ColorTextField codeField;
    private TextFeedbackPanel codeFeedback;

    private String reference;
    private TextField<String> referenceField;
    private TextFeedbackPanel referenceFeedback;

    private String value;
    private TextField<String> valueField;
    private TextFeedbackPanel valueFeedback;

    private List<FileUpload> img;
    private FileUploadField imgField;
    private TextFeedbackPanel imgFeedback;

    private Button saveButton;
    private BookmarkablePageLink<Void> closeButton;
    private Form<Void> form;

    @Override
    protected void doInitialize(Border layout) {
        add(layout);

        this.form = new Form<>("form");
        layout.add(this.form);

        this.reference = String.valueOf(RandomStringUtils.randomAlphabetic(6));
        this.referenceField = new TextField<>("referenceField", new PropertyModel<>(this, "reference"));
        this.referenceField.add(new UniqueRecordValidator<>("ecommerce_color", "reference"));
        this.referenceField.setRequired(true);
        this.form.add(this.referenceField);
        this.referenceFeedback = new TextFeedbackPanel("referenceFeedback", this.referenceField);
        this.form.add(this.referenceFeedback);

        this.codeField = new ColorTextField("codeField", new PropertyModel<>(this, "code"));
        this.form.add(this.codeField);
        this.codeFeedback = new TextFeedbackPanel("codeFeedback", this.codeField);
        this.form.add(this.codeFeedback);

        this.valueField = new TextField<>("valueField", new PropertyModel<>(this, "value"));
        this.form.add(this.valueField);
        this.valueFeedback = new TextFeedbackPanel("valueFeedback", this.valueField);
        this.form.add(this.valueFeedback);

        this.imgField = new FileUploadField("imgField", new PropertyModel<>(this, "img"));
        this.form.add(this.imgField);
        this.imgFeedback = new TextFeedbackPanel("imgFeedback", this.imgField);
        this.form.add(this.imgFeedback);

        this.saveButton = new Button("saveButton");
        this.saveButton.setOnSubmit(this::saveButtonOnSubmit);
        this.form.add(this.saveButton);

        this.closeButton = new BookmarkablePageLink<>("closeButton", ColorBrowsePage.class);
        this.form.add(this.closeButton);<commit_msg>color code upper case<commit_after>package com.angkorteam.ecommerce.page.color;

import com.angkorteam.framework.extension.wicket.markup.html.form.Button;
import com.angkorteam.framework.extension.wicket.markup.html.form.ColorTextField;
import com.angkorteam.framework.extension.wicket.markup.html.form.Form;
import com.angkorteam.framework.extension.wicket.markup.html.panel.TextFeedbackPanel;
import com.angkorteam.framework.jdbc.InsertQuery;
import com.angkorteam.platform.Platform;
import com.angkorteam.platform.page.MBaaSPage;
import com.angkorteam.platform.validator.UniqueRecordValidator;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.wicket.WicketRuntimeException;
import org.apache.wicket.markup.html.border.Border;
import org.apache.wicket.markup.html.form.TextField;
import org.apache.wicket.markup.html.form.upload.FileUpload;
import org.apache.wicket.markup.html.form.upload.FileUploadField;
import org.apache.wicket.markup.html.link.BookmarkablePageLink;
import org.apache.wicket.model.PropertyModel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.File;
import java.util.List;

/**
 * Created by socheatkhauv on 22/1/17.
 */
public class ColorCreatePage extends MBaaSPage {

    private static final Logger LOGGER = LoggerFactory.getLogger(ColorCreatePage.class);

    private String code;
    private ColorTextField codeField;
    private TextFeedbackPanel codeFeedback;

    private String reference;
    private TextField<String> referenceField;
    private TextFeedbackPanel referenceFeedback;

    private String value;
    private TextField<String> valueField;
    private TextFeedbackPanel valueFeedback;

    private List<FileUpload> img;
    private FileUploadField imgField;
    private TextFeedbackPanel imgFeedback;

    private Button saveButton;
    private BookmarkablePageLink<Void> closeButton;
    private Form<Void> form;

    @Override
    protected void doInitialize(Border layout) {
        add(layout);

        this.form = new Form<>("form");
        layout.add(this.form);

        this.reference = StringUtils.upperCase(org.apache.commons.lang3.RandomStringUtils.randomAlphabetic(6));
        this.referenceField = new TextField<>("referenceField", new PropertyModel<>(this, "reference"));
        this.referenceField.add(new UniqueRecordValidator<>("ecommerce_color", "reference"));
        this.referenceField.setRequired(true);
        this.form.add(this.referenceField);
        this.referenceFeedback = new TextFeedbackPanel("referenceFeedback", this.referenceField);
        this.form.add(this.referenceFeedback);

        this.codeField = new ColorTextField("codeField", new PropertyModel<>(this, "code"));
        this.form.add(this.codeField);
        this.codeFeedback = new TextFeedbackPanel("codeFeedback", this.codeField);
        this.form.add(this.codeFeedback);

        this.valueField = new TextField<>("valueField", new PropertyModel<>(this, "value"));
        this.form.add(this.valueField);
        this.valueFeedback = new TextFeedbackPanel("valueFeedback", this.valueField);
        this.form.add(this.valueFeedback);

        this.imgField = new FileUploadField("imgField", new PropertyModel<>(this, "img"));
        this.form.add(this.imgField);
        this.imgFeedback = new TextFeedbackPanel("imgFeedback", this.imgField);
        this.form.add(this.imgFeedback);

        this.saveButton = new Button("saveButton");
        this.saveButton.setOnSubmit(this::saveButtonOnSubmit);
        this.form.add(this.saveButton);

        this.closeButton = new BookmarkablePageLink<>("closeButton", ColorBrowsePage.class);
        this.form.add(this.closeButton);
{'fraction_non_alphanumeric': 0.11061407076047174, 'fraction_numerical': 0.0024400162667751117, 'mean_word_length': 4.44903988183161, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4267477', 'n_tokens_mistral': 2177, 'n_tokens_neox': 2152, 'n_words': 360}