/*
 * Copyright 2010-2019 James Pether Sörling
 *
 * 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.
 *
 *	$Id$
 *  $HeadURL$
 */
package com.hack23.cia.web.impl.ui.application.views.common.chartfactory.impl;

import org.dussan.vaadin.dcharts.base.elements.XYaxis;
import org.dussan.vaadin.dcharts.metadata.DataLabels;
import org.dussan.vaadin.dcharts.metadata.LegendPlacements;
import org.dussan.vaadin.dcharts.metadata.SeriesToggles;
import org.dussan.vaadin.dcharts.metadata.TooltipAxes;
import org.dussan.vaadin.dcharts.metadata.XYaxes;
import org.dussan.vaadin.dcharts.metadata.locations.LegendLocations;
import org.dussan.vaadin.dcharts.metadata.locations.TooltipLocations;
import org.dussan.vaadin.dcharts.metadata.renderers.AxisRenderers;
import org.dussan.vaadin.dcharts.metadata.renderers.LegendRenderers;
import org.dussan.vaadin.dcharts.metadata.renderers.SeriesRenderers;
import org.dussan.vaadin.dcharts.options.Axes;
import org.dussan.vaadin.dcharts.options.Cursor;
import org.dussan.vaadin.dcharts.options.Grid;
import org.dussan.vaadin.dcharts.options.Highlighter;
import org.dussan.vaadin.dcharts.options.Legend;
import org.dussan.vaadin.dcharts.options.Options;
import org.dussan.vaadin.dcharts.options.Series;
import org.dussan.vaadin.dcharts.options.SeriesDefaults;
import org.dussan.vaadin.dcharts.renderers.legend.EnhancedLegendRenderer;
import org.dussan.vaadin.dcharts.renderers.series.DonutRenderer;
import org.dussan.vaadin.dcharts.renderers.series.PieRenderer;
import org.dussan.vaadin.dcharts.renderers.tick.AxisTickRenderer;
import org.springframework.stereotype.Component;

import com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.ChartOptions;

/**
 * The Class ChartOptionsImpl.
 */
@Component
public final class ChartOptionsImpl implements ChartOptions {

	/** The Constant ONE_COLUMN_NUMBER_OF_ROWS. */
	private static final int ONE_COLUMN_NUMBER_OF_ROWS = 12;

	/** The Constant ONE_COLUMN_NUMBER_OF_COLUMNS. */
	private static final int ONE_COLUMN_NUMBER_OF_COLUMNS = 1;

	/** The Constant ONE_ROW_NUMBER_OF_ROWS. */
	private static final int ONE_ROW_NUMBER_OF_ROWS = 1;

	/** The Constant ONE_ROW_NUMBER_OF_COLUMNS. */
	private static final int ONE_ROW_NUMBER_OF_COLUMNS = 10;

	/** The Constant SLICE_MARGIN. */
	private static final int SLICE_MARGIN = 3;

	/** The Constant START_ANGLE. */
	private static final int START_ANGLE = -90;

	/** The Constant FLOAT_FORMAT. */
	private static final String FLOAT_FORMAT = "%.2f";

	/** The Constant NUMBER_TICKS. */
	private static final int NUMBER_TICKS = 5;

	/** The Constant LEGEND_COLUMNS. */
	private static final int LEGEND_COLUMNS = 3;

	/** The Constant LEGEND_ROWS. */
	private static final int LEGEND_ROWS = 20;

	/** The Constant LEGEND_FONT_SIZE. */
	private static final String LEGEND_FONT_SIZE = "10px";

	/** The Constant BORDER_COLOR. */
	private static final String BORDER_COLOR = "#83898c";

	/** The Constant GRIDLINE_COLOR. */
	private static final String GRIDLINE_COLOR = "#213f49";

	/** The Constant BACKGROUND_COLOR. */
	private static final String BACKGROUND_COLOR = "#13303f";

	/** The Constant TEXT_COLOR. */
	private static final String TEXT_COLOR = "#ffffff";

	/** The Constant FONT_SIZE. */
	private static final String FONT_SIZE = "8px";

	/** The Constant FONT_FAMILY. */
	private static final String FONT_FAMILY = "Inconsolata";

	/** The Constant NUMBER_TICKS_DATE. */
	public static final int NUMBER_TICKS_DATE = 8;

	/** The Constant YEAR_MONTH_DAY_FORMAT. */
	public static final String YEAR_MONTH_DAY_FORMAT = "%F";

	/**
	 * Instantiates a new chart options impl.
	 */
	private ChartOptionsImpl() {
		super();
	}

	/**
	 * Creates the axes XY date float.
	 *
	 * @return the axes
	 */
	private static Axes createAxesXYDateFloat() {
		return new Axes()
				.addAxis(new XYaxis().setRenderer(AxisRenderers.DATE)
						.setTickOptions(new AxisTickRenderer().setFormatString(YEAR_MONTH_DAY_FORMAT).setFontFamily(FONT_FAMILY).setTextColor(TEXT_COLOR).setFontSize(FONT_SIZE))
						.setNumberTicks(NUMBER_TICKS_DATE))
				.addAxis(new XYaxis(XYaxes.Y).setRenderer(AxisRenderers.LINEAR).setTickOptions(new AxisTickRenderer().setFormatString(FLOAT_FORMAT).setFontFamily(FONT_FAMILY).setTextColor(TEXT_COLOR).setFontSize(FONT_SIZE)).setNumberTicks(NUMBER_TICKS));
	}

	/**
	 * Creates the axes XY date float log.
	 *
	 * @return the axes
	 */
	private static Axes createAxesXYDateFloatLog() {
		return new Axes()
				.addAxis(new XYaxis().setRenderer(AxisRenderers.DATE)
						.setTickOptions(new AxisTickRenderer().setFormatString(YEAR_MONTH_DAY_FORMAT).setFontFamily(FONT_FAMILY).setTextColor(TEXT_COLOR).setFontSize(FONT_SIZE))
						.setNumberTicks(NUMBER_TICKS_DATE))
				.addAxis(new XYaxis(XYaxes.Y).setRenderer(AxisRenderers.LOG).setTickOptions(new AxisTickRenderer().setFormatString(FLOAT_FORMAT).setFontFamily(FONT_FAMILY).setTextColor(TEXT_COLOR).setFontSize(FONT_SIZE)).setNumberTicks(NUMBER_TICKS));
	}

	/**
	 * Creates the default grid.
	 *
	 * @return the grid
	 */
	private static Grid createDefaultGrid() {
		final Grid grid = new Grid();
		grid.setBackground(BACKGROUND_COLOR);
		grid.setGridLineColor(GRIDLINE_COLOR);
		grid.setBorderColor(BORDER_COLOR);
		return grid;
	}

	/**
	 * Created legend enhanced inside north west.
	 *
	 * @return the legend
	 */
	private static Legend createdLegendEnhancedInsideNorthWest() {
		return setLegendStyling(new Legend().setShow(true)
				.setRendererOptions(
						new EnhancedLegendRenderer().setSeriesToggle(SeriesToggles.NORMAL).setSeriesToggleReplot(true).setNumberColumns(LEGEND_COLUMNS).setNumberRows(LEGEND_ROWS))
				.setPlacement(LegendPlacements.INSIDE_GRID).setLocation(LegendLocations.NORTH_WEST));
	}

	/**
	 * Created legend enhanced inside west.
	 *
	 * @return the legend
	 */
	private static Legend createdLegendEnhancedInsideWest() {
		return setLegendStyling(
				new Legend().setShow(true).setPlacement(LegendPlacements.INSIDE_GRID).setLocation(LegendLocations.WEST)
						.setRenderer(LegendRenderers.ENHANCED).setRendererOptions(new EnhancedLegendRenderer()
								.setSeriesToggle(SeriesToggles.NORMAL).setSeriesToggleReplot(true).setNumberColumns(LEGEND_COLUMNS).setNumberRows(LEGEND_ROWS)));
	}

	/**
	 * Creates the legend outside.
	 *
	 * @return the legend
	 */
	private static Legend createLegendOutside() {
		return setLegendStyling(new Legend().setShow(true)
				.setRendererOptions(
						new EnhancedLegendRenderer().setSeriesToggle(SeriesToggles.NORMAL).setSeriesToggleReplot(true).setNumberColumns(LEGEND_COLUMNS).setNumberRows(LEGEND_ROWS))
				.setPlacement(LegendPlacements.OUTSIDE_GRID));
	}

	/**
	 * Creates the legend outside one column.
	 *
	 * @return the legend
	 */
	private static Legend createLegendOutsideOneColumn() {
		return setLegendStyling(new Legend().setShow(true)
				.setRendererOptions(
						new EnhancedLegendRenderer().setSeriesToggle(SeriesToggles.NORMAL).setSeriesToggleReplot(true).setNumberColumns(ONE_COLUMN_NUMBER_OF_COLUMNS).setNumberRows(ONE_COLUMN_NUMBER_OF_ROWS))
				.setPlacement(LegendPlacements.OUTSIDE_GRID));
	}

	/**
	 * Creates the legend outside.
	 *
	 * @return the legend
	 */
	private static Legend createLegendInsideOneRow() {
		return setLegendStyling(new Legend().setShow(true)
				.setRendererOptions(
						new EnhancedLegendRenderer().setSeriesToggle(SeriesToggles.NORMAL).setSeriesToggleReplot(true).setNumberColumns(ONE_ROW_NUMBER_OF_COLUMNS).setNumberRows(ONE_ROW_NUMBER_OF_ROWS))
				.setPlacement(LegendPlacements.INSIDE_GRID));
	}

	/**
	 * Sets the legend styling.
	 *
	 * @param legend
	 *            the legend
	 * @return the legend
	 */
	private static Legend setLegendStyling(final Legend legend) {
		legend.setBackground(BACKGROUND_COLOR).setFontFamily(FONT_FAMILY).setTextColor(TEXT_COLOR).setFontSize(LEGEND_FONT_SIZE);
		return legend;
	}

	/**
	 * Creates the high lighter.
	 *
	 * @return the highlighter
	 */
	private static Highlighter createHighLighter() {
		return new Highlighter().setShow(true).setShowTooltip(true).setTooltipAlwaysVisible(true)
				.setKeepTooltipInsideChart(true);
	}

	/**
	 * Creates the high lighter north.
	 *
	 * @return the highlighter
	 */
	private static Highlighter createHighLighterNorth() {
		return new Highlighter().setShow(true).setShowTooltip(true).setTooltipAlwaysVisible(true)
				.setKeepTooltipInsideChart(true).setTooltipLocation(TooltipLocations.NORTH)
				.setTooltipAxes(TooltipAxes.XY_BAR).setShowMarker(true).setBringSeriesToFront(true);
	}

	/**
	 * Creates the series default pie chart.
	 *
	 * @return the series defaults
	 */
	private static SeriesDefaults createSeriesDefaultPieChart() {
		return new SeriesDefaults().setRenderer(SeriesRenderers.PIE)
				.setRendererOptions(new PieRenderer().setShowDataLabels(true)).setShadow(true);
	}

	/**
	 * Creates the cursor.
	 *
	 * @return the cursor
	 */
	private static Cursor createCursor() {
		return new Cursor().setZoom(true).setLooseZoom(true).setShow(true);
	}

	@Override
	public Options createOptionsCountryLineChart(final Series series) {
		final Axes axes = new Axes().addAxis(new XYaxis().setRenderer(AxisRenderers.DATE)
				.setTickOptions(new AxisTickRenderer().setFormatString(YEAR_MONTH_DAY_FORMAT).setFontFamily(FONT_FAMILY).setTextColor(TEXT_COLOR).setFontSize(FONT_SIZE))
				.setNumberTicks(NUMBER_TICKS_DATE)).addAxis(new XYaxis(XYaxes.Y).setTickOptions(new AxisTickRenderer().setFontFamily(FONT_FAMILY).setTextColor(TEXT_COLOR).setFontSize(FONT_SIZE)).setNumberTicks(NUMBER_TICKS));

		return new Options().addOption(new SeriesDefaults()).addOption(axes)
				.addOption(createHighLighterNorth()).addOption(series).addOption(createLegendInsideOneRow())
				.addOption(createDefaultGrid()).addOption(createCursor());
	}

	@Override
	public Options createOptionsDonoutChart() {
		return new Options().setSeriesDefaults(createDonoutSeriesDefault()).setLegend(createdLegendEnhancedInsideNorthWest())
				.setHighlighter(createHighLighter()).addOption(createDefaultGrid()).addOption(createCursor());
	}

	@Override
	public Options createOptionsDonoutChartWithSeries(final Series series) {
		return new Options().setSeriesDefaults(createDonoutSeriesDefault()).setLegend(createdLegendEnhancedInsideNorthWest())
				.setHighlighter(createHighLighter()).addOption(series).addOption(createDefaultGrid()).addOption(createCursor());
	}

	/**
	 * Creates the donout series default.
	 *
	 * @return the series defaults
	 */
	private static SeriesDefaults createDonoutSeriesDefault() {
		return new SeriesDefaults().setRenderer(SeriesRenderers.DONUT)
				.setRendererOptions(new DonutRenderer().setSliceMargin(SLICE_MARGIN).setStartAngle(START_ANGLE).setShowDataLabels(true)
						.setDataLabels(DataLabels.VALUE));
	}

	@Override
	public Options createOptionsPartyLineChart(final Series series) {
		return new Options().addOption(new SeriesDefaults()).addOption(createAxesXYDateFloat())
				.addOption(createHighLighterNorth()).addOption(createCursor()).addOption(series)
				.addOption(createLegendOutside()).addOption(createDefaultGrid());
	}

	@Override
	public Options createOptionsPersonLineChart(final Series series) {
		return new Options().addOption(new SeriesDefaults()).addOption(createAxesXYDateFloat())
				.addOption(createHighLighterNorth()).addOption(createCursor()).addOption(series)
				.addOption(createLegendOutside()).addOption(createDefaultGrid());
	}

	@Override
	public Options createOptionsPieChart() {
		return new Options().setSeriesDefaults(createSeriesDefaultPieChart())
				.setLegend(createdLegendEnhancedInsideWest()).setHighlighter(createHighLighter())
				.addOption(createDefaultGrid()).addOption(createCursor());
	}

	@Override
	public Options createOptionsXYDateFloatLegendInsideOneColumn(final Series series) {
		return new Options().addOption(new SeriesDefaults()).addOption(createAxesXYDateFloat())
				.addOption(createHighLighterNorth()).addOption(series).addOption(createLegendOutsideOneColumn())
				.addOption(createDefaultGrid()).addOption(createCursor());
	}

	@Override
	public Options createOptionsXYDateFloatLogYAxisLegendOutside(final Series series) {
		return new Options().addOption(new SeriesDefaults()).addOption(series).addOption(createAxesXYDateFloatLog())
				.addOption(createHighLighterNorth()).addOption(createLegendOutside())
				.addOption(createDefaultGrid()).addOption(createCursor());
	}

}


/*
 * Copyright 2010 James Pether Sörling
 *
 * 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.
 *
 *	$Id$
 *  $HeadURL$
*/
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2019.02.24 at 11:40:07 PM CET
//

package com.hack23.cia.model.external.riksdagen.dokumentstatus.impl;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.hack23.cia.model.common.api.ModelObject;

/**
 * The Class DocumentAttachmentContainer.
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "DocumentAttachmentContainer", propOrder = {
    "documentAttachmentList"
})
@Entity(name = "DocumentAttachmentContainer")
@Table(name = "DOCUMENT_ATTACHMENT_CONTAINER")
@Inheritance(strategy = InheritanceType.JOINED)
public class DocumentAttachmentContainer
    implements ModelObject
{

    /**
	 *
	 */
	private static final long serialVersionUID = 1L;

	/** The document attachment list. */
    @XmlElement(name = "bilaga", required = true)
    protected List<DocumentAttachment> documentAttachmentList = new ArrayList<>();

    /** The hjid. */
    @XmlAttribute(name = "Hjid")
    protected Long hjid;

    /**
	 * Gets the document attachment list.
	 *
	 * @return the document attachment list
	 */
    @OneToMany(targetEntity = DocumentAttachment.class, cascade = {
        CascadeType.ALL
    })
    @JoinColumn(name = "DOCUMENT_ATTACHMENT_LIST_DOC_0")
    public List<DocumentAttachment> getDocumentAttachmentList() {
        return this.documentAttachmentList;
    }

    /**
	 * Sets the document attachment list.
	 *
	 * @param documentAttachmentList the new document attachment list
	 */
    public void setDocumentAttachmentList(final List<DocumentAttachment> documentAttachmentList) {
        this.documentAttachmentList = documentAttachmentList;
    }

    /**
	 * With document attachment list.
	 *
	 * @param documentAttachmentList the document attachment list
	 * @return the document attachment container
	 */
    public DocumentAttachmentContainer withDocumentAttachmentList(final List<DocumentAttachment> documentAttachmentList) {
        setDocumentAttachmentList(documentAttachmentList);
        return this;
    }

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public final String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
	}

    /**
	 * Gets the hjid.
	 *
	 * @return the hjid
	 */
    @Id
    @Column(name = "HJID")
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getHjid() {
        return hjid;
    }

    /**
	 * Sets the hjid.
	 *
	 * @param value the new hjid
	 */
    public void setHjid(final Long value) {
        this.hjid = value;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#equals(java.lang.Object)
     */
    public boolean equals(final Object object) {
    	return EqualsBuilder.reflectionEquals(this,object,"hjid");
    }

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public final int hashCode() {
		return HashCodeBuilder.reflectionHashCode(this);
	}

}


/*
 * Copyright 2010-2019 James Pether Sörling
 *
 * 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.
 *
 *	$Id$
 *  $HeadURL$
*/
package com.hack23.cia.web.impl.ui.application.views.common.menufactory.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hack23.cia.web.impl.ui.application.views.common.menufactory.api.ApplicationMenuItemFactory;
import com.hack23.cia.web.impl.ui.application.views.common.menufactory.api.CommitteeRankingMenuItemFactory;
import com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api.PageModeMenuCommand;
import com.hack23.cia.web.impl.ui.application.views.common.rows.RowUtil;
import com.hack23.cia.web.impl.ui.application.views.common.viewnames.ChartIndicators;
import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode;
import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews;
import com.jarektoro.responsivelayout.ResponsiveRow;
import com.vaadin.icons.VaadinIcons;
import com.vaadin.ui.MenuBar;
import com.vaadin.ui.MenuBar.MenuItem;
import com.vaadin.ui.VerticalLayout;

/**
 * The Class CommitteeRankingMenuItemFactoryImpl.
 */
@Service
public final class CommitteeRankingMenuItemFactoryImpl extends AbstractMenuItemFactoryImpl
		implements CommitteeRankingMenuItemFactory {

	/** The Constant COMMAND_PAGEVISIT_HISTORY. */
	private static final PageModeMenuCommand COMMAND_PAGEVISIT_HISTORY = new PageModeMenuCommand(UserViews.COMMITTEE_RANKING_VIEW_NAME,
			PageMode.PAGEVISITHISTORY);

	/** The Constant COMMAND_ALL_COMMITTEES_BY_HEADCOUNT. */
	private static final PageModeMenuCommand COMMAND_ALL_COMMITTEES_BY_HEADCOUNT = new PageModeMenuCommand(UserViews.COMMITTEE_RANKING_VIEW_NAME,
			PageMode.CHARTS,ChartIndicators.ALLCOMMITTEESBYHEADCOUNT.toString());

	/** The Constant COMMAND_COMMITTEES_BY_PARTY. */
	private static final PageModeMenuCommand COMMAND_COMMITTEES_BY_PARTY = new PageModeMenuCommand(UserViews.COMMITTEE_RANKING_VIEW_NAME,
			PageMode.CHARTS,ChartIndicators.COMMITTEESBYPARTY.toString());

	/** The Constant COMMAND_CURRENT_COMMITTEES_BY_HEADCOUNT. */
	private static final PageModeMenuCommand COMMAND_CURRENT_COMMITTEES_BY_HEADCOUNT = new PageModeMenuCommand(UserViews.COMMITTEE_RANKING_VIEW_NAME,
			PageMode.CHARTS,ChartIndicators.CURRENTCOMMITTEESBYHEADCOUNT.toString());

	/** The Constant COMMAND_CURRENT_COMMITTEES_BY_PARTY_HEADCOUNT. */
	private static final PageModeMenuCommand COMMAND_CURRENT_COMMITTEES_BY_PARTY_DAYS_SERVED = new PageModeMenuCommand(UserViews.COMMITTEE_RANKING_VIEW_NAME,
			PageMode.CHARTS,ChartIndicators.CURRENTCOMMITTEESBYPARTYDAYSSERVED.toString());

	/** The Constant COMMAND_OVERVIEW. */
	private static final PageModeMenuCommand COMMAND_OVERVIEW = new PageModeMenuCommand(UserViews.COMMITTEE_RANKING_VIEW_NAME,
			PageMode.OVERVIEW);

	/** The Constant COMMAND_DATAGRID. */
	private static final PageModeMenuCommand COMMAND_DATAGRID = new PageModeMenuCommand(UserViews.COMMITTEE_RANKING_VIEW_NAME,
			PageMode.DATAGRID);

	/** The Constant ALL_COMMITTEES_TOTAL_MEMBERS. */
	private static final String ALL_COMMITTEES_TOTAL_MEMBERS = "All committees, total members";

	/**
	 * The Constant
	 * CURRENT_PARTIES_ACTIVE_IN_COMMITTEES_TOTAL_DAYS_SERVED_IN_COMMITTEES.
	 */
	private static final String CURRENT_PARTIES_ACTIVE_IN_COMMITTEES_TOTAL_DAYS_SERVED_IN_COMMITTEES = "Current parties active in committees, total days served in committees";

	/**
	 * The Constant CURRENT_PARTIES_ACTIVE_IN_COMMITTEES_CURRENT_ASSIGNMENTS.
	 */
	private static final String CURRENT_PARTIES_ACTIVE_IN_COMMITTEES_CURRENT_ASSIGNMENTS = "Current parties active in committees, current assignments";

	/** The Constant CURRENT_AND_PAST_MEMBER_AND_SUMMARY_OF_POLTICIAL_DAYS. */
	private static final String CURRENT_AND_PAST_MEMBER_AND_SUMMARY_OF_POLTICIAL_DAYS = "Current and past member and summary of polticial days ";

	/** The Constant CURRENT_COMMITTEES_CURRENT_MEMBERS_TEXT. */
	private static final String CURRENT_COMMITTEES_CURRENT_MEMBERS_TEXT = "Current committees, current members";

	/** The Constant POLITICAL_WORK_SUMMARY_TEXT. */
	private static final String POLITICAL_WORK_SUMMARY_TEXT = "Political Work Summary";

	/** The Constant COMMITTEE_RANKING_TEXT. */
	private static final String COMMITTEE_RANKING_TEXT = "Committee Ranking";

	/** The Constant RANKING_LIST_BY_TOPIC_TEXT. */
	private static final String RANKING_LIST_BY_TOPIC_TEXT = "Ranking list by topic";

	/** The Constant CHART_BY_TOPIC_TEXT. */
	private static final String CHART_BY_TOPIC_TEXT = "Chart by topic";

	/** The Constant OVERVIEW_TEXT. */
	private static final String OVERVIEW_TEXT = "Overview";

	/** The Constant PAGE_VISIT_HISTORY_TEXT. */
	private static final String PAGE_VISIT_HISTORY_TEXT = "Page Visit History";

	/** The application menu item factory. */
	@Autowired
	private ApplicationMenuItemFactory applicationMenuItemFactory;

	/**
	 * Instantiates a new committee ranking menu item factory impl.
	 */
	public CommitteeRankingMenuItemFactoryImpl() {
		super();
	}

	/**
	 * Creates the committeee ranking menu bar.
	 *
	 * @param menuBar
	 *            the menu bar
	 */
	@Override
	public void createCommitteeeRankingMenuBar(final MenuBar menuBar) {
		initApplicationMenuBar(menuBar);

		applicationMenuItemFactory.addRankingMenu(menuBar);

		createCommitteeRankingTopics(menuBar.addItem(COMMITTEE_RANKING_TEXT, null, null));
	}

	/**
	 * Creates the committee ranking topics.
	 *
	 * @param committeeMenuItem
	 *            the committee menu item
	 */
	@Override
	public void createCommitteeRankingTopics(final MenuItem committeeMenuItem) {
		committeeMenuItem.addItem(OVERVIEW_TEXT, VaadinIcons.GROUP, COMMAND_OVERVIEW);

		final MenuItem listByTopic = committeeMenuItem.addItem(RANKING_LIST_BY_TOPIC_TEXT, VaadinIcons.GROUP, null);

		final MenuItem listItem = listByTopic.addItem(POLITICAL_WORK_SUMMARY_TEXT,VaadinIcons.GROUP, COMMAND_DATAGRID);
		listItem.setDescription(CURRENT_AND_PAST_MEMBER_AND_SUMMARY_OF_POLTICIAL_DAYS);

		final MenuItem chartByTopic = committeeMenuItem.addItem(CHART_BY_TOPIC_TEXT, VaadinIcons.GROUP, null);

		chartByTopic.addItem(CURRENT_COMMITTEES_CURRENT_MEMBERS_TEXT,VaadinIcons.GROUP, COMMAND_CURRENT_COMMITTEES_BY_HEADCOUNT);
		chartByTopic.addItem(CURRENT_PARTIES_ACTIVE_IN_COMMITTEES_CURRENT_ASSIGNMENTS,VaadinIcons.GROUP, COMMAND_COMMITTEES_BY_PARTY);
		chartByTopic.addItem(CURRENT_PARTIES_ACTIVE_IN_COMMITTEES_TOTAL_DAYS_SERVED_IN_COMMITTEES,VaadinIcons.GROUP, COMMAND_CURRENT_COMMITTEES_BY_PARTY_DAYS_SERVED);

		chartByTopic.addItem(ALL_COMMITTEES_TOTAL_MEMBERS,VaadinIcons.GROUP, COMMAND_ALL_COMMITTEES_BY_HEADCOUNT);

		committeeMenuItem.addItem(PAGE_VISIT_HISTORY_TEXT, VaadinIcons.GROUP, COMMAND_PAGEVISIT_HISTORY);

	}

	/**
	 * Creates the overview page.
	 *
	 * @param panelContent
	 *            the panel content
	 */
	@Override
	public void createOverviewPage(final VerticalLayout panelContent) {
		final ResponsiveRow grid = RowUtil.createGridLayout(panelContent);

		createButtonLink(grid,POLITICAL_WORK_SUMMARY_TEXT,VaadinIcons.GROUP, COMMAND_DATAGRID, "Scoreboard over current member size, political days served and total assignments");
		createButtonLink(grid,CURRENT_COMMITTEES_CURRENT_MEMBERS_TEXT,VaadinIcons.GROUP, COMMAND_CURRENT_COMMITTEES_BY_HEADCOUNT, "Chart over current committees and member size");

		createButtonLink(grid,CURRENT_PARTIES_ACTIVE_IN_COMMITTEES_CURRENT_ASSIGNMENTS,VaadinIcons.GROUP, COMMAND_COMMITTEES_BY_PARTY, "Chart over current parties active in committees and member size");
		createButtonLink(grid,CURRENT_PARTIES_ACTIVE_IN_COMMITTEES_TOTAL_DAYS_SERVED_IN_COMMITTEES,VaadinIcons.GROUP, COMMAND_CURRENT_COMMITTEES_BY_PARTY_DAYS_SERVED, "Chart over current parties active in committees days served");
		createButtonLink(grid,ALL_COMMITTEES_TOTAL_MEMBERS,VaadinIcons.GROUP, COMMAND_ALL_COMMITTEES_BY_HEADCOUNT, "Chart over all committees and member size");

		createButtonLink(grid,PAGE_VISIT_HISTORY_TEXT, VaadinIcons.GROUP, COMMAND_PAGEVISIT_HISTORY, "View history of page visit for this page.");

	}

}


/*
 * Copyright 2010-2019 James Pether Sörling
 *
 * 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.
 *
 *	$Id$
 *  $HeadURL$
*/
package com.hack23.cia.web.impl.ui.application.views.user.politician.pagemode;

import java.util.Arrays;
import java.util.List;

import org.apache.commons.lang3.StringUtils;
import org.springframework.security.access.annotation.Secured;
import org.springframework.stereotype.Component;

import com.hack23.cia.model.external.riksdagen.person.impl.PersonData;
import com.hack23.cia.model.internal.application.data.politician.impl.ViewRiksdagenPolitician;
import com.hack23.cia.web.impl.ui.application.views.common.labelfactory.LabelFactory;
import com.hack23.cia.web.impl.ui.application.views.common.sizing.ContentRatio;
import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode;
import com.vaadin.server.ExternalResource;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Image;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Link;
import com.vaadin.ui.MenuBar;
import com.vaadin.ui.Panel;
import com.vaadin.ui.VerticalLayout;

/**
 * The Class OverviewPageModContentFactoryImpl.
 */
@Component
public final class PoliticianOverviewPageModContentFactoryImpl extends AbstractPoliticianPageModContentFactoryImpl {

	private static final List<String> AS_LIST = Arrays.asList("firstName", "lastName", "gender", "bornYear", "party",
			"active", "firstAssignmentDate", "lastAssignmentDate", "currentAssignments", "currentMinistryAssignments",
			"currentSpeakerAssignments", "currentCommitteeAssignments", "currentPartyAssignments",
			"totalMinistryAssignments", "totalCommitteeAssignments", "totalSpeakerAssignments", "totalPartyAssignments",
			"totalAssignments", "totalDaysServed", "activeEu", "totalDaysServedEu", "activeGovernment",
			"totalDaysServedGovernment", "activeSpeaker", "totalDaysServedSpeaker", "activeCommittee",
			"totalDaysServedCommittee", "activeParliament", "totalDaysServedParliament", "activeParty",
			"totalDaysServedParty");
	/** The Constant OVERVIEW. */
	private static final String OVERVIEW = "overview";

	/**
	 * Instantiates a new politician overview page mod content factory impl.
	 */
	public PoliticianOverviewPageModContentFactoryImpl() {
		super();
	}

	@Override
	public boolean matches(final String page, final String parameters) {
		final String pageId = getPageId(parameters);
		return NAME.equals(page) && (StringUtils.isEmpty(parameters) || parameters.equals(pageId)
				|| parameters.contains(PageMode.OVERVIEW.toString()));
	}

	@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
	@Override
	public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
		final VerticalLayout panelContent = createPanelContent();

		final String pageId = getPageId(parameters);

		final ViewRiksdagenPolitician viewRiksdagenPolitician = getItem(parameters);
		getPoliticianMenuItemFactory().createPoliticianMenuBar(menuBar, pageId);

		final PersonData personData = getApplicationManager().getDataContainer(PersonData.class)
				.load(viewRiksdagenPolitician.getPersonId());

		createOverviewContent(panelContent, personData, viewRiksdagenPolitician, pageId);

		pageCompleted(parameters, panel, pageId, viewRiksdagenPolitician);
		return panelContent;

	}

	/**
	 * Creates the overview content.
	 *
	 * @param panelContent the panel content
	 * @param personData the person data
	 * @param viewRiksdagenPolitician the view riksdagen politician
	 * @param pageId the page id
	 */
	private void createOverviewContent(final VerticalLayout panelContent, final PersonData personData,
			final ViewRiksdagenPolitician viewRiksdagenPolitician, final String pageId) {
		LabelFactory.createHeader2Label(panelContent, OVERVIEW);

		final Link createPoliticianPageLink = getPageLinkFactory().createPoliticianPageLink(personData);
		panelContent.addComponent(createPoliticianPageLink);

		final Image image = new Image("",
				new ExternalResource(personData.getImageUrl192().replace("http://", "https://")));

		final HorizontalLayout horizontalLayout = new HorizontalLayout();
		horizontalLayout.setSizeFull();

		panelContent.addComponent(horizontalLayout);

		horizontalLayout.addComponent(image);

		getFormFactory().addFormPanelTextFields(horizontalLayout, viewRiksdagenPolitician,
				ViewRiksdagenPolitician.class, AS_LIST);

		final VerticalLayout overviewLayout = new VerticalLayout();
		overviewLayout.setSizeFull();

		panelContent.addComponent(overviewLayout);
		panelContent.setExpandRatio(overviewLayout, ContentRatio.LARGE_FORM);

		getPoliticianMenuItemFactory().createOverviewPage(overviewLayout, pageId);

		panelContent.setExpandRatio(createPoliticianPageLink, ContentRatio.SMALL);
		panelContent.setExpandRatio(horizontalLayout, ContentRatio.GRID);

	}

}


/*
 * Copyright 2010 James Pether Sörling
 *
 * 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.
 *
 *	$Id$
 *  $HeadURL$
*/
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2019.02.24 at 11:40:02 PM CET
//

package com.hack23.cia.model.external.riksdagen.dokumentlista.impl;

import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.bind.annotation.XmlRegistry;
import javax.xml.namespace.QName;

/**
 * A factory for creating Object objects.
 */
@XmlRegistry
public class ObjectFactory {

    /** The Constant _Dokumentlista_QNAME. */
    private static final QName _Dokumentlista_QNAME = new QName("http://dokumentlista.riksdagen.external.model.cia.hack23.com/impl", "dokumentlista");

    /**
	 * Instantiates a new object factory.
	 */
    public ObjectFactory() {
    }

    /**
	 * Creates a new Object object.
	 *
	 * @return the document container element
	 */
    public DocumentContainerElement createDocumentContainerElement() {
        return new DocumentContainerElement();
    }

    /**
	 * Creates a new Object object.
	 *
	 * @return the document element
	 */
    public DocumentElement createDocumentElement() {
        return new DocumentElement();
    }

    /**
	 * Creates a new Object object.
	 *
	 * @param value the value
	 * @return the JAXB element< document container element>
	 */
    @XmlElementDecl(namespace = "http://dokumentlista.riksdagen.external.model.cia.hack23.com/impl", name = "dokumentlista")
    public JAXBElement<DocumentContainerElement> createDokumentlista(final DocumentContainerElement value) {
        return new JAXBElement<>(_Dokumentlista_QNAME, DocumentContainerElement.class, null, value);
    }

}


/*
 * Copyright 2010 James Pether Sörling
 *
 * 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.
 *
 *	$Id$
 *  $HeadURL$
*/
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2019.02.24 at 11:39:54 PM CET
//

package com.hack23.cia.model.external.val.kommunvalkrets.impl;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.hack23.cia.model.common.api.ModelObject;

/**
 * The Class SwedenMunicipalityData.
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SwedenMunicipalityData", propOrder = {
    "code",
    "municipalName",
    "kommunvalkrets"
})
@Entity(name = "SwedenMunicipalityData")
@Table(name = "SWEDEN_MUNICIPALITY_DATA")
@Inheritance(strategy = InheritanceType.JOINED)
public class SwedenMunicipalityData
    implements ModelObject
{

    /**
	 *
	 */
	private static final long serialVersionUID = 1L;

	/** The code. */
    @XmlElement(name = "kommunkod", required = true)
    protected BigInteger code;

    /** The municipal name. */
    @XmlElement(name = "kommunnamn", required = true)
    protected String municipalName;

    /** The kommunvalkrets. */
    @XmlElement(required = true)
    protected List<SwedenMunicipalityElectionRegionData> kommunvalkrets = new ArrayList<>();

    /** The hjid. */
    @XmlAttribute(name = "Hjid")
    protected Long hjid;

    /**
	 * Gets the code.
	 *
	 * @return the code
	 */
    @Basic
    @Column(name = "CODE", precision = 20)
    public BigInteger getCode() {
        return code;
    }

    /**
	 * Sets the code.
	 *
	 * @param value the new code
	 */
    public void setCode(final BigInteger value) {
        this.code = value;
    }

    /**
	 * Gets the municipal name.
	 *
	 * @return the municipal name
	 */
    @Basic
    @Column(name = "MUNICIPAL_NAME")
    public String getMunicipalName() {
        return municipalName;
    }

    /**
	 * Sets the municipal name.
	 *
	 * @param value the new municipal name
	 */
    public void setMunicipalName(final String value) {
        this.municipalName = value;
    }

    /**
	 * Gets the kommunvalkrets.
	 *
	 * @return the kommunvalkrets
	 */
    @OneToMany(targetEntity = SwedenMunicipalityElectionRegionData.class, cascade = {
        CascadeType.ALL
    })
    @JoinColumn(name = "KOMMUNVALKRETS_SWEDEN_MUNICI_0")
    public List<SwedenMunicipalityElectionRegionData> getKommunvalkrets() {
        return this.kommunvalkrets;
    }

    /**
	 * Sets the kommunvalkrets.
	 *
	 * @param kommunvalkrets the new kommunvalkrets
	 */
    public void setKommunvalkrets(final List<SwedenMunicipalityElectionRegionData> kommunvalkrets) {
        this.kommunvalkrets = kommunvalkrets;
    }

    /**
	 * Gets the hjid.
	 *
	 * @return the hjid
	 */
    @Id
    @Column(name = "HJID")
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getHjid() {
        return hjid;
    }

    /**
	 * Sets the hjid.
	 *
	 * @param value the new hjid
	 */
    public void setHjid(final Long value) {
        this.hjid = value;
    }

	@Override
	public final boolean equals(final Object obj) {
		return EqualsBuilder.reflectionEquals(this, obj,"hjid");
	}

	@Override
	public final String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
	}

	@Override
	public final int hashCode() {
		return HashCodeBuilder.reflectionHashCode(this);
	}

}


/*
 * Copyright 2010 James Pether Sörling
 *
 * 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.
 *
 *	$Id$
 *  $HeadURL$
*/
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2019.02.24 at 11:39:39 PM CET
//

package com.hack23.cia.model.external.worldbank.data.impl;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.hack23.cia.model.common.api.ModelObject;

/**
 * The Class DataElement.
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "data"
})
@XmlRootElement(name = "data")
@Entity(name = "DataElement")
@Table(name = "DATA_ELEMENT")
@Inheritance(strategy = InheritanceType.JOINED)
public class DataElement
    implements ModelObject
{

    /**
	 *
	 */
	private static final long serialVersionUID = 1L;

	/** The data. */
    @XmlElement(required = true)
    protected List<WorldBankData> data = new ArrayList<>();

    /** The page. */
    @XmlAttribute(name = "page")
    protected BigInteger page;

    /** The pages. */
    @XmlAttribute(name = "pages")
    protected BigInteger pages;

    /** The per page. */
    @XmlAttribute(name = "per_page")
    protected BigInteger perPage;

    /** The total. */
    @XmlAttribute(name = "total")
    protected BigInteger total;

    /** The hjid. */
    @XmlAttribute(name = "Hjid")
    protected Long hjid;

    /**
	 * Gets the data.
	 *
	 * @return the data
	 */
    @OneToMany(targetEntity = WorldBankData.class, cascade = {
        CascadeType.ALL
    })
    @JoinColumn(name = "DATA__DATA_ELEMENT_HJID")
    public List<WorldBankData> getData() {
        return this.data;
    }

    /**
	 * Sets the data.
	 *
	 * @param data the new data
	 */
    public void setData(final List<WorldBankData> data) {
        this.data = data;
    }

    /**
	 * Gets the page.
	 *
	 * @return the page
	 */
    @Basic
    @Column(name = "PAGE", precision = 20)
    public BigInteger getPage() {
        return page;
    }

    /**
	 * Sets the page.
	 *
	 * @param value the new page
	 */
    public void setPage(final BigInteger value) {
        this.page = value;
    }

    /**
	 * Gets the pages.
	 *
	 * @return the pages
	 */
    @Basic
    @Column(name = "PAGES", precision = 20)
    public BigInteger getPages() {
        return pages;
    }

    /**
	 * Sets the pages.
	 *
	 * @param value the new pages
	 */
    public void setPages(final BigInteger value) {
        this.pages = value;
    }

    /**
	 * Gets the per page.
	 *
	 * @return the per page
	 */
    @Basic
    @Column(name = "PER_PAGE", precision = 20)
    public BigInteger getPerPage() {
        return perPage;
    }

    /**
	 * Sets the per page.
	 *
	 * @param value the new per page
	 */
    public void setPerPage(final BigInteger value) {
        this.perPage = value;
    }

    /**
	 * Gets the total.
	 *
	 * @return the total
	 */
    @Basic
    @Column(name = "TOTAL", precision = 20)
    public BigInteger getTotal() {
        return total;
    }

    /**
	 * Sets the total.
	 *
	 * @param value the new total
	 */
    public void setTotal(final BigInteger value) {
        this.total = value;
    }

    /**
	 * With data.
	 *
	 * @param data the data
	 * @return the data element
	 */
    public DataElement withData(final List<WorldBankData> data) {
        setData(data);
        return this;
    }

    /**
	 * With page.
	 *
	 * @param value the value
	 * @return the data element
	 */
    public DataElement withPage(final BigInteger value) {
        setPage(value);
        return this;
    }

    /**
	 * With pages.
	 *
	 * @param value the value
	 * @return the data element
	 */
    public DataElement withPages(final BigInteger value) {
        setPages(value);
        return this;
    }

    /**
	 * With per page.
	 *
	 * @param value the value
	 * @return the data element
	 */
    public DataElement withPerPage(final BigInteger value) {
        setPerPage(value);
        return this;
    }

    /**
	 * With total.
	 *
	 * @param value the value
	 * @return the data element
	 */
    public DataElement withTotal(final BigInteger value) {
        setTotal(value);
        return this;
    }

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public final String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
	}

    /**
	 * Gets the hjid.
	 *
	 * @return the hjid
	 */
    @Id
    @Column(name = "HJID")
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getHjid() {
        return hjid;
    }

    /**
	 * Sets the hjid.
	 *
	 * @param value the new hjid
	 */
    public void setHjid(final Long value) {
        this.hjid = value;
    }

	public boolean equals(final Object obj) {
		if (obj == null) {
			return false;
		}
		if (obj == this) {
			return true;
		}
		if (obj.getClass() != getClass()) {
			return false;
		}
		return new EqualsBuilder().append(getData().toArray(), ((DataElement) obj).getData().toArray()).isEquals();
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public final int hashCode() {
		return HashCodeBuilder.reflectionHashCode(this);
	}

}


/*
 * Copyright 2010-2019 James Pether Sörling
 *
 * 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.
 *
 *	$Id$
 *  $HeadURL$
*/
package com.hack23.cia.service.impl;

import java.util.Collection;

import javax.annotation.PostConstruct;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.AuthorityUtils;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Component;

import com.hack23.cia.service.api.ConfigurationManager;

/**
 * The Class BootstrapDefaultConfig.
 */
@Component
public final class BootstrapDefaultConfig {

	/** The configuration manager. */
	@Autowired
	private ConfigurationManager configurationManager;

	/**
	 * Instantiates a new bootstrap default config.
	 */
	public BootstrapDefaultConfig() {
		super();
	}

	/**
	 * Creates the default configuration.
	 */
	@PostConstruct
	public void createDefaultConfiguration() {
		configureAuthentication("ROLE_ADMIN");
		configurationManager.createDefaultConfigIfEmpty();
		configurationManager.createDefaultLanguagesIfEmpty();
		clearAuthentication();
	}

	/**
	 * Clear authentication.
	 */
	private static void clearAuthentication() {
		SecurityContextHolder.getContext().setAuthentication(null);
	}

	/**
	 * Configure authentication.
	 *
	 * @param role
	 *            the role
	 */
	private static void configureAuthentication(final String role) {
		final Collection<GrantedAuthority> authorities = AuthorityUtils.createAuthorityList(role);
		final Authentication authentication = new UsernamePasswordAuthenticationToken("service.impl.BootstrapDefaultConfig", "n/a", authorities);
		SecurityContextHolder.getContext().setAuthentication(authentication);
	}

}


/*
 * Copyright 2010-2019 James Pether Sörling
 *
 * 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.
 *
 *	$Id$
 *  $HeadURL$
*/
package com.hack23.cia.service.api.action.kpi;

import java.util.ArrayList;
import java.util.Collections;
import java.util.EnumMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.collections4.ListUtils;
import org.apache.commons.collections4.MapUtils;

import com.hack23.cia.service.api.action.common.AbstractResponse;

/**
 * The Class ComplianceCheckResponse.
 */
public final class ComplianceCheckResponse extends AbstractResponse {

	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = 1L;

	/** The list. */
	private List<ComplianceCheck> list = new ArrayList<>();

	/** The status map. */
	private Map<Status, List<RuleViolation>> statusMap = new EnumMap<>(Status.class);

	/** The resource type map. */
	private Map<ResourceType, List<RuleViolation>> resourceTypeMap = new EnumMap<>(ResourceType.class);

	/**
	 * Instantiates a new compliance check response.
	 *
	 * @param result
	 *            the result
	 */
	public ComplianceCheckResponse(final ServiceResult result) {
		super(result);
	}

	/**
	 * Gets the list.
	 *
	 * @return the list
	 */
	public List<ComplianceCheck> getList() {
		return Collections.unmodifiableList(list);
	}

	/**
	 * Sets the list.
	 *
	 * @param list
	 *            the new list
	 */
	public void setList(final List<ComplianceCheck> list) {
		this.list = Collections.unmodifiableList(ListUtils.emptyIfNull(list));
	}

	/**
	 * Gets the status map.
	 *
	 * @return the status map
	 */
	public Map<Status, List<RuleViolation>> getStatusMap() {
		return Collections.unmodifiableMap(statusMap);
	}

	/**
	 * Sets the status map.
	 *
	 * @param statusMap
	 *            the new status map
	 */
	public void setStatusMap(final Map<Status, List<RuleViolation>> statusMap) {
		this.statusMap = Collections.unmodifiableMap(MapUtils.emptyIfNull(statusMap));
	}

	/**
	 * Gets the resource type map.
	 *
	 * @return the resource type map
	 */
	public Map<ResourceType, List<RuleViolation>> getResourceTypeMap() {
		return Collections.unmodifiableMap(resourceTypeMap);
	}

	/**
	 * Sets the resource type map.
	 *
	 * @param resourceTypeMap
	 *            the new resource type map
	 */
	public void setResourceTypeMap(final Map<ResourceType, List<RuleViolation>> resourceTypeMap) {
		this.resourceTypeMap = Collections.unmodifiableMap(MapUtils.emptyIfNull(resourceTypeMap));
	}

}


/*
 * Copyright 2010-2019 James Pether Sörling
 *
 * 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.
 *
 *	$Id$
 *  $HeadURL$
 */
package com.hack23.cia.web.impl.ui.application.views.common.chartfactory.impl;

import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import java.util.stream.Collectors;

import org.dussan.vaadin.dcharts.DCharts;
import org.dussan.vaadin.dcharts.base.elements.XYseries;
import org.dussan.vaadin.dcharts.data.DataSeries;
import org.dussan.vaadin.dcharts.options.Series;
import org.springframework.stereotype.Service;

import com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenPartyCoalationAgainstAnnualSummary;
import com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenPartyCoalationAgainstAnnualSummaryEmbeddedId;
import com.hack23.cia.service.api.DataContainer;
import com.hack23.cia.web.impl.ui.application.views.common.chartfactory.api.PartyCoalationChartDataManager;
import com.vaadin.ui.AbstractOrderedLayout;

/**
 * The Class PartyCoalationChartDataManagerImpl.
 */
@Service
public final class PartyCoalationChartDataManagerImpl extends AbstractChartDataManagerImpl
		implements PartyCoalationChartDataManager {

	/** The Constant FILTER_LOW_VALUES. */
	private static final int FILTER_LOW_VALUES = 2;

	/**
	 * Instantiates a new party coalation chart data manager impl.
	 */
	public PartyCoalationChartDataManagerImpl() {
		super();
	}

	@Override
	public void createPartyChart(final AbstractOrderedLayout content, final String partyId) {

		final DataContainer<ViewRiksdagenPartyCoalationAgainstAnnualSummary, ViewRiksdagenPartyCoalationAgainstAnnualSummaryEmbeddedId> dataContainer = getApplicationManager()
				.getDataContainer(ViewRiksdagenPartyCoalationAgainstAnnualSummary.class);

		final Map<String, List<ViewRiksdagenPartyCoalationAgainstAnnualSummary>> map = dataContainer.getAll().parallelStream()
				.filter(t -> t.getEmbeddedId().getGroupAgainst().contains(partyId) && t.getTotal() > FILTER_LOW_VALUES)
				.collect(Collectors.groupingBy(t -> t.getEmbeddedId().getGroupAgainst()));

		final Series series = new Series();
		final DataSeries dataSeries = new DataSeries();

		addData(map, series, dataSeries);

		addChart(content, "Part of coalations against committee proposal in ballot more than twice", new DCharts()
				.setDataSeries(dataSeries).setOptions(getChartOptions().createOptionsCountryLineChart(series)).show(),
				true);
	}

	/**
	 * Adds the data.
	 *
	 * @param map the map
	 * @param series the series
	 * @param dataSeries the data series
	 */
	private static void addData(final Map<String, List<ViewRiksdagenPartyCoalationAgainstAnnualSummary>> map,
			final Series series, final DataSeries dataSeries) {
		final Set<Entry<String, List<ViewRiksdagenPartyCoalationAgainstAnnualSummary>>> entryMap = map.entrySet();

		for (final Entry<String, List<ViewRiksdagenPartyCoalationAgainstAnnualSummary>> entry : entryMap) {
			if (!entry.getValue().isEmpty()) {
				series.addSeries(new XYseries().setLabel(entry.getKey()));

				dataSeries.newSeries();
				for (final ViewRiksdagenPartyCoalationAgainstAnnualSummary data : entry.getValue()) {
					dataSeries.add(data.getEmbeddedId().getYear() + "-01-01", data.getTotal());
				}
			}
		}
	}

}


/*
 * Copyright 2010 James Pether Sörling
 *
 * 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.
 *
 *	$Id$
 *  $HeadURL$
*/
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2019.02.24 at 11:39:54 PM CET
//

package com.hack23.cia.model.external.val.kommunvalkrets.impl;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.hack23.cia.model.common.api.ModelObject;

/**
 * The Class SwedenCountyData.
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SwedenCountyData", propOrder = {
    "code",
    "countyName",
    "kommun"
})
@Entity(name = "SwedenCountyData")
@Table(name = "SWEDEN_COUNTY_DATA")
@Inheritance(strategy = InheritanceType.JOINED)
public class SwedenCountyData
    implements ModelObject
{

    /**
	 *
	 */
	private static final long serialVersionUID = 1L;

	/** The code. */
    @XmlElement(name = "l\u00e4nskod", required = true)
    protected BigInteger code;

    /** The county name. */
    @XmlElement(name = "l\u00e4nsnamn", required = true)
    protected String countyName;

    /** The kommun. */
    @XmlElement(required = true)
    protected List<SwedenMunicipalityData> kommun = new ArrayList<>();

    /** The hjid. */
    @XmlAttribute(name = "Hjid")
    protected Long hjid;

    /**
	 * Gets the code.
	 *
	 * @return the code
	 */
    @Basic
    @Column(name = "CODE", precision = 20)
    public BigInteger getCode() {
        return code;
    }

    /**
	 * Sets the code.
	 *
	 * @param value the new code
	 */
    public void setCode(final BigInteger value) {
        this.code = value;
    }

    /**
	 * Gets the county name.
	 *
	 * @return the county name
	 */
    @Basic
    @Column(name = "COUNTY_NAME")
    public String getCountyName() {
        return countyName;
    }

    /**
	 * Sets the county name.
	 *
	 * @param value the new county name
	 */
    public void setCountyName(final String value) {
        this.countyName = value;
    }

    /**
	 * Gets the kommun.
	 *
	 * @return the kommun
	 */
    @OneToMany(targetEntity = SwedenMunicipalityData.class, cascade = {
        CascadeType.ALL
    })
    @JoinColumn(name = "KOMMUN_SWEDEN_COUNTY_DATA_HJ_0")
    public List<SwedenMunicipalityData> getKommun() {
        return this.kommun;
    }

    /**
	 * Sets the kommun.
	 *
	 * @param kommun the new kommun
	 */
    public void setKommun(final List<SwedenMunicipalityData> kommun) {
        this.kommun = kommun;
    }

    /**
	 * Gets the hjid.
	 *
	 * @return the hjid
	 */
    @Id
    @Column(name = "HJID")
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getHjid() {
        return hjid;
    }

    /**
	 * Sets the hjid.
	 *
	 * @param value the new hjid
	 */
    public void setHjid(final Long value) {
        this.hjid = value;
    }

	@Override
	public final boolean equals(final Object obj) {
		return EqualsBuilder.reflectionEquals(this, obj,"hjid");
	}

	@Override
	public final String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
	}

	@Override
	public final int hashCode() {
		return HashCodeBuilder.reflectionHashCode(this);
	}

}


/*
 * Copyright 2010 James Pether Sörling
 *
 * 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.
 *
 *	$Id$
 *  $HeadURL$
*/
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2019.02.24 at 11:39:59 PM CET
//

package com.hack23.cia.model.external.riksdagen.personlista.impl;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.hack23.cia.model.common.api.ModelObject;

/**
 * The Class PersonAssignmentElement.
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "PersonAssignmentElement", propOrder = {
    "uppdrag"
})
@Entity(name = "PersonAssignmentElement")
@Table(name = "PERSON_ASSIGNMENT_ELEMENT")
@Inheritance(strategy = InheritanceType.JOINED)
public class PersonAssignmentElement
    implements ModelObject
{

    /**
	 *
	 */
	private static final long serialVersionUID = 1L;

	/** The uppdrag. */
    @XmlElement(required = true)
    protected List<AssignmentElement> uppdrag = new ArrayList<>();

    /** The hjid. */
    @XmlAttribute(name = "Hjid")
    protected Long hjid;

    /**
	 * Gets the uppdrag.
	 *
	 * @return the uppdrag
	 */
    @OneToMany(targetEntity = AssignmentElement.class, cascade = {
        CascadeType.ALL
    })
    @JoinColumn(name = "UPPDRAG_PERSON_ASSIGNMENT_EL_0")
    public List<AssignmentElement> getUppdrag() {
        return this.uppdrag;
    }

    /**
	 * Sets the uppdrag.
	 *
	 * @param uppdrag the new uppdrag
	 */
    public void setUppdrag(final List<AssignmentElement> uppdrag) {
        this.uppdrag = uppdrag;
    }

    /**
	 * With uppdrag.
	 *
	 * @param uppdrag the uppdrag
	 * @return the person assignment element
	 */
    public PersonAssignmentElement withUppdrag(final List<AssignmentElement> uppdrag) {
        setUppdrag(uppdrag);
        return this;
    }

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public final String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
	}

    /**
	 * Gets the hjid.
	 *
	 * @return the hjid
	 */
    @Id
    @Column(name = "HJID")
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getHjid() {
        return hjid;
    }

    /**
	 * Sets the hjid.
	 *
	 * @param value the new hjid
	 */
    public void setHjid(final Long value) {
        this.hjid = value;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#equals(java.lang.Object)
     */
    public boolean equals(final Object object) {
    	return EqualsBuilder.reflectionEquals(this,object,"hjid");
    }

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public final int hashCode() {
		return HashCodeBuilder.reflectionHashCode(this);
	}

}


/*
 * Copyright 2010 James Pether Sörling
 *
 * 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.
 *
 *	$Id$
 *  $HeadURL$
*/
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2019.02.24 at 11:40:07 PM CET
//

package com.hack23.cia.model.external.riksdagen.dokumentstatus.impl;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.hack23.cia.model.common.api.ModelObject;

/**
 * The Class DocumentProposalContainer.
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "DocumentProposalContainer", propOrder = {
    "proposal"
})
@Entity(name = "DocumentProposalContainer")
@Table(name = "DOCUMENT_PROPOSAL_CONTAINER")
@Inheritance(strategy = InheritanceType.JOINED)
public class DocumentProposalContainer
    implements ModelObject
{

    /**
	 *
	 */
	private static final long serialVersionUID = 1L;

	/** The proposal. */
    @XmlElement(name = "forslag", required = true)
    protected DocumentProposalData proposal;

    /** The hjid. */
    @XmlAttribute(name = "Hjid")
    protected Long hjid;

    /**
	 * Gets the proposal.
	 *
	 * @return the proposal
	 */
    @ManyToOne(targetEntity = DocumentProposalData.class, cascade = {
        CascadeType.ALL
    })
    @JoinColumn(name = "PROPOSAL_DOCUMENT_PROPOSAL_C_0")
    public DocumentProposalData getProposal() {
        return proposal;
    }

    /**
	 * Sets the proposal.
	 *
	 * @param value the new proposal
	 */
    public void setProposal(final DocumentProposalData value) {
        this.proposal = value;
    }

    /**
	 * With proposal.
	 *
	 * @param value the value
	 * @return the document proposal container
	 */
    public DocumentProposalContainer withProposal(final DocumentProposalData value) {
        setProposal(value);
        return this;
    }

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public final String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
	}

    /**
	 * Gets the hjid.
	 *
	 * @return the hjid
	 */
    @Id
    @Column(name = "HJID")
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getHjid() {
        return hjid;
    }

    /**
	 * Sets the hjid.
	 *
	 * @param value the new hjid
	 */
    public void setHjid(final Long value) {
        this.hjid = value;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#equals(java.lang.Object)
     */
    public boolean equals(final Object object) {
    	return EqualsBuilder.reflectionEquals(this,object,"hjid");
    }

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public final int hashCode() {
		return HashCodeBuilder.reflectionHashCode(this);
	}

}


/*
 * Copyright 2010-2019 James Pether Sörling
 *
 * 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.
 *
 *	$Id$
 *  $HeadURL$
*/
package com.hack23.cia.web.impl.ui.application.views.common.pagelinks.api;

import com.hack23.cia.web.impl.ui.application.views.common.viewnames.PageMode;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.MenuBar.Command;
import com.vaadin.ui.MenuBar.MenuItem;
import com.vaadin.ui.UI;

/**
 * The Class PageModeMenuCommand.
 */
public final class PageModeMenuCommand implements Command, ClickListener {

	/** The Constant PAGE_SEPARATOR. */
	private static final Character PAGE_SEPARATOR = '/';

	/** The Constant serialVersionUID. */
	private static final long serialVersionUID = 1L;

	/** The page reference. */
	private final String pageReference;

	/** The page. */
	private final String page;

	/**
	 * Instantiates a new page mode menu command.
	 *
	 * @param page
	 *            the page
	 * @param pageMode
	 *            the page mode
	 */
	public PageModeMenuCommand(final String page, final PageMode pageMode) {
		super();
		this.page = page;
		pageReference = pageMode.toString();
	}

	/**
	 * Instantiates a new page mode menu command.
	 *
	 * @param page
	 *            the page
	 * @param part
	 *            the part
	 */
	public PageModeMenuCommand(final String page, final String part) {
		super();
		this.page = page;
		pageReference = part;
	}

	/**
	 * Instantiates a new page mode menu command.
	 *
	 * @param page
	 *            the page
	 * @param pageMode
	 *            the page mode
	 * @param part
	 *            the part
	 */
	public PageModeMenuCommand(final String page, final PageMode pageMode,final String part) {
		super();
		this.page = page;
		pageReference = new StringBuilder().append(pageMode).append(PAGE_SEPARATOR).append(part).toString();
	}

	/**
	 * Instantiates a new page mode menu command.
	 *
	 * @param page
	 *            the page
	 * @param pageMode
	 *            the page mode
	 * @param part
	 *            the part
	 */
	public PageModeMenuCommand(final String page, final String pageMode, final String part) {
		this.page = page;
		pageReference = pageMode + PAGE_SEPARATOR + part;
	}

	/**
	 * Gets the page path.
	 *
	 * @return the page path
	 */
	public String getPagePath() {
		if (pageReference != null && !pageReference.isEmpty()) {
			return page + PAGE_SEPARATOR + pageReference;
		} else {
			return page;
		}
	}

	@Override
	public void menuSelected(final MenuItem selectedItem) {
		UI.getCurrent().getNavigator().navigateTo(page + PAGE_SEPARATOR + pageReference);
	}

	@Override
	public void buttonClick(final ClickEvent event) {
		UI.getCurrent().getNavigator().navigateTo(page + PAGE_SEPARATOR + pageReference);
	}

}


//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2019.02.25 at 12:05:09 AM CET
//

package com.hack23.cia.model.internal.application.data.party.impl;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.hack23.cia.model.common.api.ModelObject;

/**
 *
Java class for ViewRiksdagenPartyCoalationAgainstAnnualSummary complex type.
 *
 *
The following schema fragment specifies the expected content contained within this class.
 *
 *

 * <complexType name="ViewRiksdagenPartyCoalationAgainstAnnualSummary">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <sequence>
 *         <element name="embeddedId" type="{http://party.data.application.internal.model.cia.hack23.com/impl}ViewRiksdagenPartyCoalationAgainstAnnualSummaryEmbeddedId"/>
 *         <element name="total" type="{http://www.w3.org/2001/XMLSchema}long"/>
 *       </sequence>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ViewRiksdagenPartyCoalationAgainstAnnualSummary", propOrder = {
    "embeddedId",
    "total"
})
@Entity(name = "ViewRiksdagenPartyCoalationAgainstAnnualSummary")
@Table(name = "view_riksdagen_party_coalation_against_annual_summary")
@Inheritance(strategy = InheritanceType.JOINED)
public class ViewRiksdagenPartyCoalationAgainstAnnualSummary
    implements ModelObject
{

    /**
	 *
	 */
	private static final long serialVersionUID = 1L;
	@XmlElement(required = true)
    protected ViewRiksdagenPartyCoalationAgainstAnnualSummaryEmbeddedId embeddedId;
    protected long total;

    /**
     * Gets the value of the embeddedId property.
     *
     * @return
     *     possible object is
     *     {@link ViewRiksdagenPartyCoalationAgainstAnnualSummaryEmbeddedId }
     *
     */
    @EmbeddedId
    @AttributeOverrides({
        @AttributeOverride(name = "year", column = @Column(name = "EMBEDDED_ID_YEAR", precision = 10, scale = 0)),
        @AttributeOverride(name = "groupAgainst", column = @Column(name = "EMBEDDED_ID_GROUP_AGAINST"))
    })
    public ViewRiksdagenPartyCoalationAgainstAnnualSummaryEmbeddedId getEmbeddedId() {
        return embeddedId;
    }

    /**
     * Sets the value of the embeddedId property.
     *
     * @param value
     *     allowed object is
     *     {@link ViewRiksdagenPartyCoalationAgainstAnnualSummaryEmbeddedId }
     *
     */
    public void setEmbeddedId(final ViewRiksdagenPartyCoalationAgainstAnnualSummaryEmbeddedId value) {
        this.embeddedId = value;
    }

    /**
     * Gets the value of the total property.
     *
     */
    @Basic
    @Column(name = "TOTAL", precision = 20)
    public long getTotal() {
        return total;
    }

    /**
     * Sets the value of the total property.
     *
     */
    public void setTotal(final long value) {
        this.total = value;
    }

    public ViewRiksdagenPartyCoalationAgainstAnnualSummary withEmbeddedId(final ViewRiksdagenPartyCoalationAgainstAnnualSummaryEmbeddedId value) {
        setEmbeddedId(value);
        return this;
    }

    public ViewRiksdagenPartyCoalationAgainstAnnualSummary withTotal(final long value) {
        setTotal(value);
        return this;
    }

	@Override
	public final String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
	}

	@Override
	public final boolean equals(final Object obj) {
		return EqualsBuilder.reflectionEquals(this, obj);
	}

	@Override
	public final int hashCode() {
		return HashCodeBuilder.reflectionHashCode(this);
	}

}


/*
 * Copyright 2010-2019 James Pether Sörling
 *
 * 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.
 *
 *	$Id$
 *  $HeadURL$
*/
package com.hack23.cia.web.impl.ui.application.views.user.party.pagemode;

import org.springframework.beans.factory.annotation.Autowired;

import com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenParty;
import com.hack23.cia.model.internal.application.system.impl.ApplicationEventGroup;
import com.hack23.cia.web.impl.ui.application.action.ViewAction;
import com.hack23.cia.web.impl.ui.application.views.common.menufactory.api.PartyMenuItemFactory;
import com.hack23.cia.web.impl.ui.application.views.common.pagemode.AbstractItemPageModContentFactoryImpl;
import com.hack23.cia.web.impl.ui.application.views.common.viewnames.UserViews;
import com.vaadin.ui.Component;

/**
 * The Class AbstractPoliticianPageModContentFactoryImpl.
 */
abstract class AbstractPartyPageModContentFactoryImpl extends AbstractItemPageModContentFactoryImpl<ViewRiksdagenParty> {

	/** The Constant CAPTION_SEPARATOR. */
	private static final String CAPTION_SEPARATOR = "::";

	/** The Constant PARTY. */
	private static final String PARTY = "Party:";

	/** The Constant NAME. */
	public static final String NAME = UserViews.PARTY_VIEW_NAME;

	/** The party menu item factory. */
	@Autowired
	private PartyMenuItemFactory partyMenuItemFactory;

	/**
	 * Instantiates a new abstract party page mod content factory impl.
	 */
	AbstractPartyPageModContentFactoryImpl() {
		super();
	}

	/**
	 * Page completed.
	 *
	 * @param parameters
	 *            the parameters
	 * @param panel
	 *            the panel
	 * @param pageId
	 *            the page id
	 * @param viewRiksdagenParty
	 *            the view riksdagen party
	 */
	protected final void pageCompleted(final String parameters, final Component panel, final String pageId,
			final ViewRiksdagenParty viewRiksdagenParty) {
		panel.setCaption(new StringBuilder().append(NAME).append(CAPTION_SEPARATOR).append(PARTY).append(viewRiksdagenParty.getPartyName()).toString());

		getPageActionEventHelper().createPageEvent(ViewAction.VISIT_PARTY_VIEW, ApplicationEventGroup.USER, NAME, parameters,
				pageId);
	}

	/**
	 * Gets the party menu item factory.
	 *
	 * @return the party menu item factory
	 */
	protected final PartyMenuItemFactory getPartyMenuItemFactory() {
		return partyMenuItemFactory;
	}

	@Override
	protected ViewRiksdagenParty getItem(final String parameters) {
		return getApplicationManager().getDataContainer(ViewRiksdagenParty.class).load(getPageId(parameters));
	}

}


/*
 * Copyright 2010-2019 James Pether Sörling
 *
 * 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.
 *
 *	$Id$
 *  $HeadURL$
*/
package com.hack23.cia.service.component.agent.impl.riksdagen.workers;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.ObjectMessage;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hack23.cia.service.component.agent.impl.common.jms.AbstractMessageListener;
import com.hack23.cia.service.component.agent.impl.riksdagen.workers.data.RiksdagenUpdateService;
import com.hack23.cia.service.external.riksdagen.api.DataFailureException;
import com.hack23.cia.service.external.riksdagen.api.RiksdagenBallotApi;

/**
 * The Class RiksdagenVoteDataWorkConsumerImpl.
 */
@Service("riksdagenVoteDataWorkConsumerImpl")
final class RiksdagenVoteDataWorkConsumerImpl extends AbstractMessageListener implements MessageListener {

	/** The Constant LOGGER. */
	private static final Logger LOGGER = LoggerFactory.getLogger(RiksdagenVoteDataWorkConsumerImpl.class);

	/** The update service. */
	private final RiksdagenUpdateService updateService;

	/** The riksdagen api. */
	private final RiksdagenBallotApi riksdagenApi;

	/**
	 * Instantiates a new riksdagen vote data work consumer impl.
	 *
	 * @param updateService
	 *            the update service
	 * @param riksdagenApi
	 *            the riksdagen api
	 */
	@Autowired
	public RiksdagenVoteDataWorkConsumerImpl(final RiksdagenUpdateService updateService, final RiksdagenBallotApi riksdagenApi) {
		super();
		this.updateService = updateService;
		this.riksdagenApi = riksdagenApi;
	}

	@Override
	public void onMessage(final Message message) {
		try {
			updateBallot((String) ((ObjectMessage) message).getObject());
		} catch (final JMSException e) {
			LOGGER.warn("No Valid input", e);
		}
	}

	/**
	 * Update ballot.
	 *
	 * @param ballotId
	 *            the ballot id
	 */
	private void updateBallot(final String ballotId) {
		try {
			configureAuthentication();
			updateService.updateVoteDataData(riksdagenApi.getBallot(ballotId));
		} catch (final DataFailureException e) {
			LOGGER.warn("Eror loading riksdagen voteData:" + ballotId + " errorMessage:", e);
		} finally {
			clearAuthentication();
		}
	}
}


/*
 * Copyright 2010 James Pether Sörling
 *
 * 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.
 *
 *	$Id$
 *  $HeadURL$
*/
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2019.02.24 at 11:39:42 PM CET
//

package com.hack23.cia.model.external.worldbank.indicators.impl;

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.hack23.cia.model.common.api.ModelObject;

/**
 * The Class IndicatorsElement.
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
    "indicator"
})
@XmlRootElement(name = "indicators")
@Entity(name = "IndicatorsElement")
@Table(name = "INDICATORS_ELEMENT")
@Inheritance(strategy = InheritanceType.JOINED)
public class IndicatorsElement
    implements ModelObject
{

    /**
	 *
	 */
	private static final long serialVersionUID = 1L;

	/** The indicator. */
    @XmlElement(required = true)
    protected List<IndicatorElement> indicator = new ArrayList<>();

    /** The page. */
    @XmlAttribute(name = "page")
    protected BigInteger page;

    /** The pages. */
    @XmlAttribute(name = "pages")
    protected BigInteger pages;

    /** The per page. */
    @XmlAttribute(name = "per_page")
    protected BigInteger perPage;

    /** The total. */
    @XmlAttribute(name = "total")
    protected BigInteger total;

    /** The hjid. */
    @XmlAttribute(name = "Hjid")
    protected Long hjid;

    /**
	 * Gets the indicator.
	 *
	 * @return the indicator
	 */
    @OneToMany(targetEntity = IndicatorElement.class, cascade = {
        CascadeType.ALL
    })
    @JoinColumn(name = "INDICATOR__INDICATORS_ELEMEN_0")
    public List<IndicatorElement> getIndicator() {
        return this.indicator;
    }

    /**
	 * Sets the indicator.
	 *
	 * @param indicator the new indicator
	 */
    public void setIndicator(final List<IndicatorElement> indicator) {
        this.indicator = indicator;
    }

    /**
	 * Gets the page.
	 *
	 * @return the page
	 */
    @Basic
    @Column(name = "PAGE", precision = 20)
    public BigInteger getPage() {
        return page;
    }

    /**
	 * Sets the page.
	 *
	 * @param value the new page
	 */
    public void setPage(final BigInteger value) {
        this.page = value;
    }

    /**
	 * Gets the pages.
	 *
	 * @return the pages
	 */
    @Basic
    @Column(name = "PAGES", precision = 20)
    public BigInteger getPages() {
        return pages;
    }

    /**
	 * Sets the pages.
	 *
	 * @param value the new pages
	 */
    public void setPages(final BigInteger value) {
        this.pages = value;
    }

    /**
	 * Gets the per page.
	 *
	 * @return the per page
	 */
    @Basic
    @Column(name = "PER_PAGE", precision = 20)
    public BigInteger getPerPage() {
        return perPage;
    }

    /**
	 * Sets the per page.
	 *
	 * @param value the new per page
	 */
    public void setPerPage(final BigInteger value) {
        this.perPage = value;
    }

    /**
	 * Gets the total.
	 *
	 * @return the total
	 */
    @Basic
    @Column(name = "TOTAL", precision = 20)
    public BigInteger getTotal() {
        return total;
    }

    /**
	 * Sets the total.
	 *
	 * @param value the new total
	 */
    public void setTotal(final BigInteger value) {
        this.total = value;
    }

    /**
	 * With indicator.
	 *
	 * @param indicator the indicator
	 * @return the indicators element
	 */
    public IndicatorsElement withIndicator(final List<IndicatorElement> indicator) {
        setIndicator(indicator);
        return this;
    }

    /**
	 * With page.
	 *
	 * @param value the value
	 * @return the indicators element
	 */
    public IndicatorsElement withPage(final BigInteger value) {
        setPage(value);
        return this;
    }

    /**
	 * With pages.
	 *
	 * @param value the value
	 * @return the indicators element
	 */
    public IndicatorsElement withPages(final BigInteger value) {
        setPages(value);
        return this;
    }

    /**
	 * With per page.
	 *
	 * @param value the value
	 * @return the indicators element
	 */
    public IndicatorsElement withPerPage(final BigInteger value) {
        setPerPage(value);
        return this;
    }

    /**
	 * With total.
	 *
	 * @param value the value
	 * @return the indicators element
	 */
    public IndicatorsElement withTotal(final BigInteger value) {
        setTotal(value);
        return this;
    }

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public final String toString() {
		return ToStringBuilder.reflectionToString(this, ToStringStyle.SHORT_PREFIX_STYLE);
	}

    /**
	 * Gets the hjid.
	 *
	 * @return the hjid
	 */
    @Id
    @Column(name = "HJID")
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getHjid() {
        return hjid;
    }

    /**
	 * Sets the hjid.
	 *
	 * @param value the new hjid
	 */
    public void setHjid(final Long value) {
        this.hjid = value;
    }

	public boolean equals(final Object obj) {
		if (obj == null) {
			return false;
		}
		if (obj == this) {
			return true;
		}
		if (obj.getClass() != getClass()) {
			return false;
		}
		return new EqualsBuilder().append(getIndicator().toArray(), ((IndicatorsElement) obj).getIndicator().toArray()).isEquals();
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public final int hashCode() {
		return HashCodeBuilder.reflectionHashCode(this);
	}

}


/*
 * Copyright 2010 James Pether Sörling
 *
 * 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.
 *
 *	$Id$
 *  $HeadURL$
*/
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.11
// See http://java.sun.com/xml/jaxb
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2019.02.24 at 11:40:10 PM CET
//

package com.hack23.cia.model.external.riksdagen.utskottsforslag.impl;

import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.bind.annotation.XmlRegistry;
import javax.xml.namespace.QName;

/**
 * A factory for creating Object objects.
 */
@XmlRegistry
public class ObjectFactory {

    /** The Constant _Utskottsforslag_QNAME. */
    private static final QName _Utskottsforslag_QNAME = new QName("http://utskottsforslag.riksdagen.external.model.cia.hack23.com/impl", "utskottsforslag");

    /**
	 * Instantiates a new object factory.
	 */
    public ObjectFactory() {
    }

    /**
	 * Creates a new Object object.
	 *
	 * @return the committee proposal component data
	 */
    public CommitteeProposalComponentData createCommitteeProposalComponentData() {
        return new CommitteeProposalComponentData();
    }

    /**
	 * Creates a new Object object.
	 *
	 * @return the committee document data
	 */
    public CommitteeDocumentData createCommitteeDocumentData() {
        return new CommitteeDocumentData();
    }

    /**
	 * Creates a new Object object.
	 *
	 * @return the against proposal container
	 */
    public AgainstProposalContainer createAgainstProposalContainer() {
        return new AgainstProposalContainer();
    }

    /**
	 * Creates a new Object object.
	 *
	 * @return the against proposal data
	 */
    public AgainstProposalData createAgainstProposalData() {
        return new AgainstProposalData();
    }

    /**
	 * Creates a new Object object.
	 *
	 * @return the committee proposal container
	 */
    public CommitteeProposalContainer createCommitteeProposalContainer() {
        return new CommitteeProposalContainer();
    }

    /**
	 * Creates a new Object object.
	 *
	 * @return the committee proposal data
	 */
    public CommitteeProposalData createCommitteeProposalData() {
        return new CommitteeProposalData();
    }

    /**
	 * Creates a new Object object.
	 *
	 * @param value the value
	 * @return the JAXB element< committee proposal component data>
	 */
    @XmlElementDecl(namespace = "http://utskottsforslag.riksdagen.external.model.cia.hack23.com/impl", name = "utskottsforslag")
    public JAXBElement<CommitteeProposalComponentData> createUtskottsforslag(final CommitteeProposalComponentData value) {
        return new JAXBElement<>(_Utskottsforslag_QNAME, CommitteeProposalComponentData.class, null, value);
    }

}