/*
 * Copyright 2012 s_wolff.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.aegee.runanddine.archive;

import java.util.LinkedList;
import java.util.List;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.list.ListItem;
import org.apache.wicket.markup.html.list.ListView;
import org.apache.wicket.request.mapper.parameter.PageParameters;

/**
 *
 * @author s_wolff
 */
public class ArchiveExportPage extends WebPage {

    public ArchiveExportPage(PageParameters parameters) {
        List<ArchiveEntry> all = ArchiveEntryManager.getInstance().getAll();
        List<ArchiveEntry> aegee = new LinkedList<ArchiveEntry>();
        for (ArchiveEntry entry : all) {
            if (entry.isAegeeMailFlag()) {
                aegee.add(entry);
            }
        }
        
        this.add(new ListView<ArchiveEntry>("list", aegee) {

            @Override
            protected void populateItem(ListItem<ArchiveEntry> li) {
                li.add(new Label("mail", li.getModelObject().getEmail()));
            }
        });
    }
}
