From f44c2ceddeb3fa7b092671e667d9194369e77c06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?James=20Pether=20S=C3=B6rling?= Date: Sun, 19 Jan 2025 15:39:58 +0100 Subject: [PATCH] feat(constants): add committee and document view constants for improved readability --- ...BallotChartsPageModContentFactoryImpl.java | 14 +-- ...llotOverviewPageModContentFactoryImpl.java | 62 ++++++----- .../ballot/pagemode/BallotViewConstants.java | 41 +++++++ .../pagemode/CommitteeActionConstants.java | 21 ++++ .../pagemode/CommitteeBallotConstants.java | 21 ++++ ...isionSummaryPageModContentFactoryImpl.java | 5 +- ...mbersHistoryPageModContentFactoryImpl.java | 18 ++- ...DecisionFlowPageModContentFactoryImpl.java | 8 +- ...ailySummaryPageModContentFactoryImpl2.java | 5 +- ...mentActivityPageModContentFactoryImpl.java | 5 +- ...umentHistoryPageModContentFactoryImpl.java | 31 +++--- .../pagemode/CommitteeGridConstants.java | 32 ++++++ ...emberHistoryPageModContentFactoryImpl.java | 15 +-- ...tteeOverviewPageModContentFactoryImpl.java | 12 +- .../pagemode/CommitteePageTitleConstants.java | 43 ++++++++ ...VisitHistoryPageModContentFactoryImpl.java | 5 +- ...itteesChartsPageModContentFactoryImpl.java | 5 +- ...yPartyChartsPageModContentFactoryImpl.java | 7 +- .../pagemode/CommitteeRankingConstants.java | 38 +++++++ ...artiesChartsPageModContentFactoryImpl.java | 6 +- ...itteesChartsPageModContentFactoryImpl.java | 6 +- ...kingDataGridPageModContentFactoryImpl.java | 5 +- ...kingOverviewPageModContentFactoryImpl.java | 5 +- ...VisitHistoryPageModContentFactoryImpl.java | 6 +- ...teeRoleGhantPageModContentFactoryImpl.java | 5 +- .../pagemode/CommitteeSectionConstants.java | 7 ++ .../pagemode/CommitteeViewConstants.java | 14 +++ ...mentActivityPageModContentFactoryImpl.java | 7 +- ...AttachementsPageModContentFactoryImpl.java | 5 +- ...DocumentDataPageModContentFactoryImpl.java | 5 +- ...mentDecisionPageModContentFactoryImpl.java | 7 +- ...umentDetailsPageModContentFactoryImpl.java | 5 +- .../pagemode/DocumentFieldConstants.java | 27 +++++ .../pagemode/DocumentGridConstants.java | 18 +++ ...mentOverviewPageModContentFactoryImpl.java | 103 ++++++++++++------ .../pagemode/DocumentPageTitleConstants.java | 57 ++++++++++ ...VisitHistoryPageModContentFactoryImpl.java | 6 +- ...onReferencesPageModContentFactoryImpl.java | 5 +- ...ntReferencesPageModContentFactoryImpl.java | 5 +- .../pagemode/DocumentViewConstants.java | 12 ++ ...entsOverviewPageModContentFactoryImpl.java | 79 ++++++++++++++ .../DocumentsOverviewPageModeConstants.java | 16 +++ 42 files changed, 657 insertions(+), 142 deletions(-) create mode 100644 citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/ballot/pagemode/BallotViewConstants.java create mode 100644 citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeActionConstants.java create mode 100644 citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeBallotConstants.java create mode 100644 citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeGridConstants.java create mode 100644 citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteePageTitleConstants.java create mode 100644 citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingConstants.java create mode 100644 citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeSectionConstants.java create mode 100644 citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeViewConstants.java create mode 100644 citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentFieldConstants.java create mode 100644 citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentGridConstants.java create mode 100644 citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentPageTitleConstants.java create mode 100644 citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentViewConstants.java create mode 100644 citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentsOverviewPageModeConstants.java diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/ballot/pagemode/BallotChartsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/ballot/pagemode/BallotChartsPageModContentFactoryImpl.java index 1f382a844a..7b2672fe27 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/ballot/pagemode/BallotChartsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/ballot/pagemode/BallotChartsPageModContentFactoryImpl.java @@ -119,15 +119,15 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina if (!decisionSummaries.isEmpty()) { CardInfoRowUtil.createPageHeader(panel, panelContent, - "Ballot Charts : " + decisionSummaries.get(0).getTitle() + " - " + BallotViewConstants.CHARTS_TITLE_PREFIX + decisionSummaries.get(0).getTitle() + " - " + decisionSummaries.get(0).getSubTitle(), - "Ballot Trends and Visualizations", - "Provides insights into election trends by visualizing ballot data, assisting in strategic decision-making and voter engagement analysis."); + BallotViewConstants.CHARTS_SUBTITLE, + BallotViewConstants.CHARTS_DESCRIPTION); } else { - CardInfoRowUtil.createPageHeader(panel, panelContent, "Ballot Charts : " + ballots.get(0).getEmbeddedId().getConcern(), - "Ballot Trends and Visualizations", - "Provides insights into election trends by visualizing ballot data, assisting in strategic decision-making and voter engagement analysis."); - + CardInfoRowUtil.createPageHeader(panel, panelContent, + BallotViewConstants.CHARTS_TITLE_PREFIX + ballots.get(0).getEmbeddedId().getConcern(), + BallotViewConstants.CHARTS_SUBTITLE, + BallotViewConstants.CHARTS_DESCRIPTION); } final TabSheet tabsheet = new TabSheet(); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/ballot/pagemode/BallotOverviewPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/ballot/pagemode/BallotOverviewPageModContentFactoryImpl.java index 3530f9cd7c..0df4a8b556 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/ballot/pagemode/BallotOverviewPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/ballot/pagemode/BallotOverviewPageModContentFactoryImpl.java @@ -134,16 +134,16 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina String mainTitle; String subTitle; if (useDecisionSummaries) { - mainTitle = "Ballot Overview " + decisionSummaries.get(0).getTitle() + " - " + mainTitle = BallotViewConstants.OVERVIEW_MAIN_TITLE_PREFIX + decisionSummaries.get(0).getTitle() + " - " + decisionSummaries.get(0).getSubTitle(); } else { final ViewRiksdagenVoteDataBallotSummary firstBallot = ballots.get(FIRST_OBJECT); - mainTitle = "Ballot Overview " + firstBallot.getEmbeddedId().getConcern(); + mainTitle = BallotViewConstants.OVERVIEW_MAIN_TITLE_PREFIX + firstBallot.getEmbeddedId().getConcern(); } - subTitle = "Ballot Details"; + subTitle = BallotViewConstants.OVERVIEW_CARD_BALLOT_INFO; CardInfoRowUtil.createPageHeader(panel, panelContent, mainTitle, subTitle, - "Explore and analyze ballot results and voting statistics."); + BallotViewConstants.OVERVIEW_PAGE_DESCRIPTION); // Card panel final Panel cardPanel = new Panel(); @@ -161,7 +161,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina panelContent.addComponent(cardPanel); panelContent.setExpandRatio(cardPanel, ContentRatio.GRID); - CardInfoRowUtil.createCardHeader(cardContent,"Ballot Information"); + CardInfoRowUtil.createCardHeader(cardContent, BallotViewConstants.OVERVIEW_CARD_BALLOT_INFO); // Two-column layout final HorizontalLayout attributesLayout = new HorizontalLayout(); @@ -170,10 +170,10 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina cardContent.addComponent(attributesLayout); // Left column: Ballot Profile (Textual and identifying attributes) - final VerticalLayout profileDetailsLayout = CardInfoRowUtil.createSectionLayout("Ballot Profile"); + final VerticalLayout profileDetailsLayout = CardInfoRowUtil.createSectionLayout(BallotViewConstants.OVERVIEW_CARD_BALLOT_PROFILE); // Right column: Voting Statistics (Numeric and outcome attributes) - final VerticalLayout serviceStatsLayout = CardInfoRowUtil.createSectionLayout("Voting Statistics"); + final VerticalLayout serviceStatsLayout = CardInfoRowUtil.createSectionLayout(BallotViewConstants.OVERVIEW_CARD_VOTING_STATS); attributesLayout.addComponents(profileDetailsLayout, serviceStatsLayout); @@ -181,16 +181,16 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina if (useDecisionSummaries) { final ViewRiksdagenCommitteeBallotDecisionSummary ds = decisionSummaries.get(FIRST_OBJECT); // Show essential profile fields - profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("Vote Date:", String.valueOf(ds.getVoteDate()), VaadinIcons.CALENDAR, "Date of the vote")); - profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("Title:", ds.getTitle(), VaadinIcons.FILE_TEXT_O, "Title of the ballot")); - profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("SubTitle:", ds.getSubTitle(), VaadinIcons.FILE_TEXT, "Subtitle of the ballot")); - profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("Decision Type:", ds.getDecisionType(), VaadinIcons.QUESTION_CIRCLE, "Type of decision")); + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow(BallotViewConstants.FIELD_VOTE_DATE, String.valueOf(ds.getVoteDate()), VaadinIcons.CALENDAR, "Date of the vote")); + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow(BallotViewConstants.FIELD_TITLE, ds.getTitle(), VaadinIcons.FILE_TEXT_O, "Title of the ballot")); + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow(BallotViewConstants.FIELD_SUBTITLE, ds.getSubTitle(), VaadinIcons.FILE_TEXT, "Subtitle of the ballot")); + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow(BallotViewConstants.FIELD_DECISION_TYPE, ds.getDecisionType(), VaadinIcons.QUESTION_CIRCLE, "Type of decision")); // Stats fields - serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Concern:", ds.getEmbeddedId().getConcern(), VaadinIcons.CLIPBOARD, "Concern or topic of the ballot")); - serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Ballot Type:", ds.getBallotType(), VaadinIcons.BULLETS, "Type of ballot")); - serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Winner:", ds.getWinner(), VaadinIcons.TROPHY, "Winner or outcome")); - serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Approved:", String.valueOf(ds.isApproved()), VaadinIcons.CHECK, "Whether the proposal was approved")); + serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow(BallotViewConstants.FIELD_CONCERN, ds.getEmbeddedId().getConcern(), VaadinIcons.CLIPBOARD, "Concern or topic of the ballot")); + serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow(BallotViewConstants.FIELD_BALLOT_TYPE, ds.getBallotType(), VaadinIcons.BULLETS, "Type of ballot")); + serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow(BallotViewConstants.FIELD_WINNER, ds.getWinner(), VaadinIcons.TROPHY, "Winner or outcome")); + serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow(BallotViewConstants.FIELD_APPROVED, String.valueOf(ds.isApproved()), VaadinIcons.CHECK, "Whether the proposal was approved")); // Optional: If still too crowded, remove againstProposal fields // serviceStatsLayout.addComponent(createInfoRow("Against Proposal Parties:", ds.getAgainstProposalParties(), VaadinIcons.WARNING, "Parties against the proposal")); @@ -199,21 +199,21 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina // Non-decision scenario final ViewRiksdagenVoteDataBallotSummary bs = ballots.get(FIRST_OBJECT); // Profile fields - profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("Ballot ID:", bs.getEmbeddedId().getBallotId(), VaadinIcons.CLIPBOARD_USER, "Ballot identification")); - profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("RM:", bs.getRm(), VaadinIcons.CALENDAR, "Session (RM) identifier")); - profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("Vote Date:", String.valueOf(bs.getVoteDate()), VaadinIcons.CALENDAR, "Date of the vote")); - profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("Issue:", bs.getEmbeddedId().getIssue(), VaadinIcons.CLIPBOARD_TEXT, "The specific issue voted upon")); - profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("Concern:", bs.getEmbeddedId().getConcern(), VaadinIcons.CLIPBOARD, "Concern or topic of the ballot")); - profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("Ballot Type:", bs.getBallotType(), VaadinIcons.BULLETS, "Type of ballot")); - profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("Label:", bs.getLabel(), VaadinIcons.FILE_TEXT, "Short label or description")); + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow(BallotViewConstants.FIELD_BALLOT_ID, bs.getEmbeddedId().getBallotId(), VaadinIcons.CLIPBOARD_USER, "Ballot identification")); + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow(BallotViewConstants.FIELD_RM, bs.getRm(), VaadinIcons.CALENDAR, "Session (RM) identifier")); + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow(BallotViewConstants.FIELD_VOTE_DATE, String.valueOf(bs.getVoteDate()), VaadinIcons.CALENDAR, "Date of the vote")); + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow(BallotViewConstants.FIELD_ISSUE, bs.getEmbeddedId().getIssue(), VaadinIcons.CLIPBOARD_TEXT, "The specific issue voted upon")); + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow(BallotViewConstants.FIELD_CONCERN, bs.getEmbeddedId().getConcern(), VaadinIcons.CLIPBOARD, "Concern or topic of the ballot")); + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow(BallotViewConstants.FIELD_BALLOT_TYPE, bs.getBallotType(), VaadinIcons.BULLETS, "Type of ballot")); + profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow(BallotViewConstants.FIELD_LABEL, bs.getLabel(), VaadinIcons.FILE_TEXT, "Short label or description")); // Stats fields - serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Total Votes:", String.valueOf(bs.getTotalVotes()), VaadinIcons.GROUP, "Total number of votes cast")); - serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Yes Votes:", String.valueOf(bs.getYesVotes()), VaadinIcons.THUMBS_UP, "Number of 'yes' votes")); - serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("No Votes:", String.valueOf(bs.getNoVotes()), VaadinIcons.THUMBS_DOWN, "Number of 'no' votes")); - serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Abstain Votes:", String.valueOf(bs.getAbstainVotes()), VaadinIcons.SPLIT, "Number of abstentions")); - serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Absent Votes:", String.valueOf(bs.getAbsentVotes()), VaadinIcons.EXIT_O, "Number of absent voters")); - serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Approved:", String.valueOf(bs.isApproved()), VaadinIcons.CHECK, "Whether the proposal was approved")); + serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow(BallotViewConstants.FIELD_TOTAL_VOTES, String.valueOf(bs.getTotalVotes()), VaadinIcons.GROUP, "Total number of votes cast")); + serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow(BallotViewConstants.FIELD_YES_VOTES, String.valueOf(bs.getYesVotes()), VaadinIcons.THUMBS_UP, "Number of 'yes' votes")); + serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow(BallotViewConstants.FIELD_NO_VOTES, String.valueOf(bs.getNoVotes()), VaadinIcons.THUMBS_DOWN, "Number of 'no' votes")); + serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow(BallotViewConstants.FIELD_ABSTAIN_VOTES, String.valueOf(bs.getAbstainVotes()), VaadinIcons.SPLIT, "Number of abstentions")); + serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow(BallotViewConstants.FIELD_ABSENT_VOTES, String.valueOf(bs.getAbsentVotes()), VaadinIcons.EXIT_O, "Number of absent voters")); + serviceStatsLayout.addComponent(CardInfoRowUtil.createInfoRow(BallotViewConstants.FIELD_APPROVED, String.valueOf(bs.isApproved()), VaadinIcons.CHECK, "Whether the proposal was approved")); } // Spacer before Party Ballot Summary @@ -224,8 +224,10 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina // Party Ballot Summary table getGridFactory().createBasicBeanItemNestedPropertiesGrid(panelContent, - ViewRiksdagenVoteDataBallotPartySummary.class, partyBallotList, PARTY_BALLOT_SUMMARY, - NESTED_PROPERTIES, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, EMBEDDED_ID_PARTY, null); + ViewRiksdagenVoteDataBallotPartySummary.class, partyBallotList, + BallotViewConstants.GRID_PARTY_BALLOT_SUMMARY, + NESTED_PROPERTIES, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, + BallotViewConstants.GRID_EMBEDDED_ID_PARTY, null); // Overview layout after table final VerticalLayout overviewLayout = new VerticalLayout(); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/ballot/pagemode/BallotViewConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/ballot/pagemode/BallotViewConstants.java new file mode 100644 index 0000000000..7cc9309344 --- /dev/null +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/ballot/pagemode/BallotViewConstants.java @@ -0,0 +1,41 @@ +package com.hack23.cia.web.impl.ui.application.views.user.ballot.pagemode; + +/** + * Constants for the ballot view pages. + */ +public interface BallotViewConstants { + // Overview page constants + String OVERVIEW_MAIN_TITLE_PREFIX = "Ballot Overview "; + String OVERVIEW_PAGE_DESCRIPTION = "Explore and analyze ballot results and voting statistics."; + String OVERVIEW_CARD_BALLOT_INFO = "Ballot Information"; + String OVERVIEW_CARD_BALLOT_PROFILE = "Ballot Profile"; + String OVERVIEW_CARD_VOTING_STATS = "Voting Statistics"; + + // Grid constants + String GRID_PARTY_BALLOT_SUMMARY = "Party Ballot Summary"; + String GRID_EMBEDDED_ID_PARTY = "embeddedId.party"; + + // Field labels + String FIELD_VOTE_DATE = "Vote Date:"; + String FIELD_TITLE = "Title:"; + String FIELD_SUBTITLE = "Subtitle:"; // Fixed: Added missing constant + String FIELD_DECISION_TYPE = "Decision Type:"; + String FIELD_CONCERN = "Concern:"; + String FIELD_BALLOT_TYPE = "Ballot Type:"; + String FIELD_WINNER = "Winner:"; + String FIELD_APPROVED = "Approved:"; + String FIELD_BALLOT_ID = "Ballot ID:"; + String FIELD_RM = "RM:"; + String FIELD_ISSUE = "Issue:"; + String FIELD_LABEL = "Label:"; + String FIELD_TOTAL_VOTES = "Total Votes:"; + String FIELD_YES_VOTES = "Yes Votes:"; + String FIELD_NO_VOTES = "No Votes:"; + String FIELD_ABSTAIN_VOTES = "Abstain Votes:"; + String FIELD_ABSENT_VOTES = "Absent Votes:"; + + // Charts page constants + String CHARTS_TITLE_PREFIX = "Ballot Charts : "; + String CHARTS_SUBTITLE = "Ballot Trends and Visualizations"; + String CHARTS_DESCRIPTION = "Provides insights into election trends by visualizing ballot data, assisting in strategic decision-making and voter engagement analysis."; +} diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeActionConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeActionConstants.java new file mode 100644 index 0000000000..2e5a91757e --- /dev/null +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeActionConstants.java @@ -0,0 +1,21 @@ +package com.hack23.cia.web.impl.ui.application.views.user.committee.pagemode; + +public interface CommitteeActionConstants { + // Decision Flow + String DF_YEAR_SELECTOR = "Select year"; + + // Decision Data + String DD_TITLE_HEADER = "Daily Committee Decisions "; + String DD_TITLE = "Summary of Decision Types"; + String DD_DESCRIPTION = "Displays a summary of daily committee decision-making activity."; + + // Decision Summary + String DS_TITLE_HEADER = "Committee Decision Summary"; + String DS_TITLE = "Decision Summary"; + String DS_DESCRIPTION = "Overview of decisions made by the committee."; + + // Ballot Decision + String BD_TITLE_HEADER = "Committee Ballot Decision Summary "; + String BD_TITLE = "Ballot Decision Summary"; + String BD_DESCRIPTION = "Summary of ballot decisions made by the specified committee."; +} diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeBallotConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeBallotConstants.java new file mode 100644 index 0000000000..c5694e174f --- /dev/null +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeBallotConstants.java @@ -0,0 +1,21 @@ +package com.hack23.cia.web.impl.ui.application.views.user.committee.pagemode; + +public interface CommitteeBallotConstants { + String BALLOT_ID = "ballotId"; + String COMMITTEE_BALLOT_DECISION_SUMMARY = "Committee Ballot Decision Summary"; + + String[] BALLOT_COLUMN_ORDER = { "voteDate", "embeddedId.concern", "embeddedId.id", + "committeeReport", "embeddedId.issue", "rm", "title", "subTitle", "endNumber", "org", "createdDate", + "publicDate", "ballotId", "decisionType", "againstProposalParties", "againstProposalNumber", "winner", + "ballotType", "label", "avgBornYear", "totalVotes", "yesVotes", "noVotes", "abstainVotes", "absentVotes", + "approved", "noWinner", "percentageYes", "percentageNo", "percentageAbsent", "percentageAbstain", + "percentageMale" }; + + String[] BALLOT_HIDE_COLUMNS = { "embeddedId", "embeddedId.id", "endNumber", "org", + "createdDate", "publicDate", "ballotId", "decisionType", "label", "againstProposalNumber", "avgBornYear", + "percentageMale", "approved", "noWinner", "ballotType", "percentageYes", "percentageNo", "percentageAbsent", + "percentageAbstain" }; + + String[] BALLOT_NESTED_PROPERTIES = { "embeddedId.concern", "embeddedId.issue", + "embeddedId.id" }; +} diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeBallotDecisionSummaryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeBallotDecisionSummaryPageModContentFactoryImpl.java index 8069cd9e44..6e16ab0e41 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeBallotDecisionSummaryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeBallotDecisionSummaryPageModContentFactoryImpl.java @@ -88,7 +88,10 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenCommittee viewRiksdagenCommittee = getItem(parameters); getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId); - CardInfoRowUtil.createPageHeader(panel, panelContent, "Committee Ballot Decision Summary " + viewRiksdagenCommittee.getEmbeddedId().getDetail(), "Ballot Decision Summary", "Summary of ballot decisions made by the specified committee."); + CardInfoRowUtil.createPageHeader(panel, panelContent, + CommitteeViewConstants.BD_TITLE_HEADER + viewRiksdagenCommittee.getEmbeddedId().getDetail(), + CommitteeViewConstants.BD_TITLE, + CommitteeViewConstants.BD_DESCRIPTION); final DataContainer committeeBallotDecisionPartyDataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenCommitteeBallotDecisionSummary.class); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeCurrentMembersHistoryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeCurrentMembersHistoryPageModContentFactoryImpl.java index 6bc46efa12..087866ffb8 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeCurrentMembersHistoryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeCurrentMembersHistoryPageModContentFactoryImpl.java @@ -44,14 +44,6 @@ public final class CommitteeCurrentMembersHistoryPageModContentFactoryImpl extends AbstractCommitteePageModContentFactoryImpl { - private static final String[] COLUMN_ORDER = { "roleCode", "roleId", "personId", "firstName", - "lastName", "party", "active", "totalDaysServed", "detail", "fromDate", "toDate" }; - - /** The Constant CURRENT_MEMBERS. */ - private static final String CURRENT_MEMBERS = "Current Members"; - - private static final String[] HIDE_COLUMNS = { "roleId", "personId", "detail", "active" }; - private static final PageItemPropertyClickListener LISTENER = new PageItemPropertyClickListener( UserViews.POLITICIAN_VIEW_NAME, "personId"); @@ -74,7 +66,10 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenCommittee viewRiksdagenCommittee = getItem(parameters); getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId); - CardInfoRowUtil.createPageHeader(panel, panelContent, "Committee History " + viewRiksdagenCommittee.getEmbeddedId().getDetail(), "Current Members History", "Tracks and presents historical data about committee members' participation."); + CardInfoRowUtil.createPageHeader(panel, panelContent, + CommitteeViewConstants.CM_TITLE_HEADER + viewRiksdagenCommittee.getEmbeddedId().getDetail(), + CommitteeViewConstants.CM_TITLE, + CommitteeViewConstants.CM_DESCRIPTION); final DataContainer committeeRoleMemberDataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenCommitteeRoleMember.class); @@ -83,7 +78,10 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina committeeRoleMemberDataContainer.findListByProperty( new Object[] { viewRiksdagenCommittee.getEmbeddedId().getDetail(), Boolean.TRUE }, ViewRiksdagenCommitteeRoleMember_.detail, ViewRiksdagenCommitteeRoleMember_.active), - CURRENT_MEMBERS, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, null, null); + CommitteeGridConstants.CURRENT_MEMBERS_GRID_NAME, + CommitteeGridConstants.MEMBER_HISTORY_COLUMN_ORDER, + CommitteeGridConstants.CURRENT_MEMBERS_HIDDEN_COLUMNS, + LISTENER, null, null); getPageActionEventHelper().createPageEvent(ViewAction.VISIT_COMMITTEE_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDecisionFlowPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDecisionFlowPageModContentFactoryImpl.java index 3cab7e5fe8..b83ff23789 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDecisionFlowPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDecisionFlowPageModContentFactoryImpl.java @@ -125,9 +125,9 @@ private void setupMenuAndHeader(MenuBar menuBar, Panel panel, VerticalLayout pan String pageId, ViewRiksdagenCommittee committee) { getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId); CardInfoRowUtil.createPageHeader(panel, panelContent, - "Committee Decision Flow " + committee.getEmbeddedId().getDetail(), - "Decision Flow", - "Analyze decision-making processes within committees." + CommitteeViewConstants.DF_TITLE_HEADER + committee.getEmbeddedId().getDetail(), + CommitteeViewConstants.DF_TITLE, + CommitteeViewConstants.DF_DESCRIPTION ); } @@ -170,7 +170,7 @@ private Map> loadCommitteeMap() { * @param pageId the page id */ private void addYearSelector(VerticalLayout panelContent, String selectedYear, String pageId) { - final ComboBox yearSelector = new ComboBox<>(YEAR_SELECTOR_LABEL, createAvailableYears()); + final ComboBox yearSelector = new ComboBox<>(CommitteeViewConstants.DF_YEAR_SELECTOR, createAvailableYears()); yearSelector.setWidth("200px"); yearSelector.setEmptySelectionAllowed(false); yearSelector.setSelectedItem(selectedYear); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDecisionTypeDailySummaryPageModContentFactoryImpl2.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDecisionTypeDailySummaryPageModContentFactoryImpl2.java index 5add29ab73..86a3feb753 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDecisionTypeDailySummaryPageModContentFactoryImpl2.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDecisionTypeDailySummaryPageModContentFactoryImpl2.java @@ -63,7 +63,10 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenCommittee viewRiksdagenCommittee = getItem(parameters); getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId); - CardInfoRowUtil.createPageHeader(panel, panelContent, "Daily Committee Decisions " + viewRiksdagenCommittee.getEmbeddedId().getDetail() , "Summary of Decision Types", "Displays a summary of daily committee decision-making activity."); + CardInfoRowUtil.createPageHeader(panel, panelContent, + CommitteeViewConstants.DD_TITLE_HEADER + viewRiksdagenCommittee.getEmbeddedId().getDetail(), + CommitteeViewConstants.DD_TITLE, + CommitteeViewConstants.DD_DESCRIPTION); chartDataManager.createDecisionTypeChart(panelContent, viewRiksdagenCommittee.getEmbeddedId().getOrgCode()); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDocumentActivityPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDocumentActivityPageModContentFactoryImpl.java index 096fda93b5..f1a595e29f 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDocumentActivityPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDocumentActivityPageModContentFactoryImpl.java @@ -63,7 +63,10 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenCommittee viewRiksdagenCommittee = getItem(parameters); getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId); - CardInfoRowUtil.createPageHeader(panel, panelContent, "Committee Documents " + viewRiksdagenCommittee.getEmbeddedId().getDetail() , "Document Activity Overview", "Tracks and visualizes the activity associated with committee documents."); + CardInfoRowUtil.createPageHeader(panel, panelContent, + CommitteeViewConstants.DA_TITLE_HEADER + viewRiksdagenCommittee.getEmbeddedId().getDetail(), + CommitteeViewConstants.DA_TITLE, + CommitteeViewConstants.DA_DESCRIPTION); chartDataManager.createDocumentHistoryChartByOrg(panelContent, viewRiksdagenCommittee.getEmbeddedId().getOrgCode()); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDocumentHistoryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDocumentHistoryPageModContentFactoryImpl.java index e5534eef33..27e9ece239 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDocumentHistoryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeDocumentHistoryPageModContentFactoryImpl.java @@ -44,15 +44,6 @@ public final class CommitteeDocumentHistoryPageModContentFactoryImpl extends AbstractCommitteePageModContentFactoryImpl { - private static final String[] COLUMN_ORDER = { "rm", "madePublicDate", "id", "docId", - "personReferenceId", "roleDescription", "title", "subTitle", "documentType", "subType", "org", "label", - "numberValue", "status", "tempLabel", "orderNumber", "referenceName", "partyShortCode" }; - - private static final String DOCUMENTS = "Documents"; - - private static final String[] HIDE_COLUMNS = { "id", "numberValue", "orderNumber", "tempLabel", - "personReferenceId", "org", "docId", "label", "roleDescription" }; - private static final PageItemPropertyClickListener LISTENER = new PageItemPropertyClickListener( UserViews.DOCUMENT_VIEW_NAME, "docId", true); @@ -75,18 +66,24 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId); - CardInfoRowUtil.createPageHeader(panel, panelContent, "Document History " + viewRiksdagenCommittee.getEmbeddedId().getDetail(), "Committee Document History", "Displays the historical progression of documents managed by committees."); + CardInfoRowUtil.createPageHeader(panel, panelContent, + CommitteeViewConstants.DH_TITLE_HEADER + viewRiksdagenCommittee.getEmbeddedId().getDetail(), + CommitteeViewConstants.DH_TITLE, + CommitteeViewConstants.DH_DESCRIPTION); final DataContainer politicianDocumentDataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenPoliticianDocument.class); - getGridFactory() - .createBasicBeanItemGrid(panelContent, ViewRiksdagenPoliticianDocument.class, - politicianDocumentDataContainer.findOrderedListByProperty(ViewRiksdagenPoliticianDocument_.org, - viewRiksdagenCommittee.getEmbeddedId().getOrgCode().replace(" ", "").replace("_", "") - .trim(), - ViewRiksdagenPoliticianDocument_.madePublicDate), - DOCUMENTS, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, null, null); + getGridFactory().createBasicBeanItemGrid(panelContent, + ViewRiksdagenPoliticianDocument.class, + politicianDocumentDataContainer.findOrderedListByProperty(ViewRiksdagenPoliticianDocument_.org, + viewRiksdagenCommittee.getEmbeddedId().getOrgCode().replace(" ", "").replace("_", "") + .trim(), + ViewRiksdagenPoliticianDocument_.madePublicDate), + CommitteeGridConstants.DOCUMENT_HISTORY_GRID_NAME, + CommitteeGridConstants.DOCUMENT_HISTORY_COLUMN_ORDER, + CommitteeGridConstants.DOCUMENT_HISTORY_HIDDEN_COLUMNS, + LISTENER, null, null); getPageActionEventHelper().createPageEvent(ViewAction.VISIT_COMMITTEE_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeGridConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeGridConstants.java new file mode 100644 index 0000000000..0a158c36ba --- /dev/null +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeGridConstants.java @@ -0,0 +1,32 @@ +package com.hack23.cia.web.impl.ui.application.views.user.committee.pagemode; + +public interface CommitteeGridConstants { + // Member History Grid + String MEMBER_HISTORY_GRID_NAME = "Member History"; + String[] MEMBER_HISTORY_COLUMN_ORDER = { "roleCode", "roleId", "personId", "firstName", + "lastName", "party", "active", "totalDaysServed", "detail", "fromDate", "toDate" }; + String[] MEMBER_HISTORY_HIDDEN_COLUMNS = { "roleId", "personId", "detail" }; + + // Current Members Grid + String CURRENT_MEMBERS_GRID_NAME = "Current Members"; + String[] CURRENT_MEMBERS_HIDDEN_COLUMNS = { "roleId", "personId", "detail", "active" }; + + // Document History Grid + String DOCUMENT_HISTORY_GRID_NAME = "Documents"; + String[] DOCUMENT_HISTORY_COLUMN_ORDER = { "rm", "madePublicDate", "id", "docId", + "personReferenceId", "roleDescription", "title", "subTitle", "documentType", "subType", + "org", "label", "numberValue", "status", "tempLabel", "orderNumber", "referenceName", + "partyShortCode" }; + String[] DOCUMENT_HISTORY_HIDDEN_COLUMNS = { "id", "numberValue", "orderNumber", "tempLabel", + "personReferenceId", "org", "docId", "label", "roleDescription" }; + + // Decision Summary Grid + String DECISION_SUMMARY_GRID_NAME = "Decision Summary"; + String[] DECISION_SUMMARY_COLUMN_ORDER = { "createdDate", "publicDate", "committeeReport", + "embeddedId.hangarId", "embeddedId.id", "embeddedId.issueNummer", "rm", "decisionType", + "winner", "title", "header", "endNumber", "org", "committeeProposalUrlXml", "ballotId", + "againstProposalParties", "againstProposalNumber" }; + String[] DECISION_SUMMARY_HIDDEN_COLUMNS = { "embeddedId", "embeddedId.hangarId", "embeddedId.id", + "endNumber", "org", "committeeProposalUrlXml", "ballotId", "againstProposalParties", + "againstProposalNumber", "createdDate" }; +} diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeMemberHistoryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeMemberHistoryPageModContentFactoryImpl.java index 5eb2245613..69e21590b7 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeMemberHistoryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeMemberHistoryPageModContentFactoryImpl.java @@ -43,11 +43,6 @@ @Component public final class CommitteeMemberHistoryPageModContentFactoryImpl extends AbstractCommitteePageModContentFactoryImpl { - private static final String[] COLUMN_ORDER = { "roleCode", "roleId", "personId", "firstName", - "lastName", "party", "active", "totalDaysServed", "detail", "fromDate", "toDate" }; - - private static final String[] HIDE_COLUMNS = { "roleId", "personId", "detail" }; - private static final PageItemPropertyClickListener LISTENER = new PageItemPropertyClickListener( UserViews.POLITICIAN_VIEW_NAME, "personId"); @@ -73,7 +68,10 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId); - CardInfoRowUtil.createPageHeader(panel, panelContent, "Member History " + viewRiksdagenCommittee.getEmbeddedId().getDetail(), "Committee Member Participation History", "Analyzes and presents participation trends for committee members."); + CardInfoRowUtil.createPageHeader(panel, panelContent, + CommitteeViewConstants.MH_TITLE_HEADER + viewRiksdagenCommittee.getEmbeddedId().getDetail(), + CommitteeViewConstants.MH_TITLE, + CommitteeViewConstants.MH_DESCRIPTION); final DataContainer committeeRoleMemberDataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenCommitteeRoleMember.class); @@ -81,7 +79,10 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getGridFactory().createBasicBeanItemGrid(panelContent, ViewRiksdagenCommitteeRoleMember.class, committeeRoleMemberDataContainer.getAllBy(ViewRiksdagenCommitteeRoleMember_.detail, viewRiksdagenCommittee.getEmbeddedId().getDetail()), - MEMBER_HISTORY, COLUMN_ORDER, HIDE_COLUMNS, LISTENER, null, null); + CommitteeGridConstants.MEMBER_HISTORY_GRID_NAME, + CommitteeGridConstants.MEMBER_HISTORY_COLUMN_ORDER, + CommitteeGridConstants.MEMBER_HISTORY_HIDDEN_COLUMNS, + LISTENER, null, null); getPageActionEventHelper().createPageEvent(ViewAction.VISIT_COMMITTEE_VIEW, ApplicationEventGroup.USER, NAME, parameters, pageId); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeOverviewPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeOverviewPageModContentFactoryImpl.java index 6090f240ad..8cf06b7af0 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeOverviewPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeOverviewPageModContentFactoryImpl.java @@ -72,9 +72,9 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId); CardInfoRowUtil.createPageHeader(panel, panelContent, - "Committee Overview " + viewRiksdagenCommittee.getEmbeddedId().getDetail(), - "Committee Details", - "Detailed insights into parliamentary committees and their activities."); + CommitteeViewConstants.OV_TITLE_HEADER + viewRiksdagenCommittee.getEmbeddedId().getDetail(), + CommitteeViewConstants.OV_TITLE, + CommitteeViewConstants.OV_DESCRIPTION); final Link addCommitteePageLink = getPageLinkFactory().addCommitteePageLink(viewRiksdagenCommittee); panelContent.addComponent(addCommitteePageLink); @@ -105,7 +105,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina cardContent.addComponent(attributesLayout); // First column: Committee Profile (keep existing, but add activity level) - final VerticalLayout profileDetailsLayout = CardInfoRowUtil.createSectionLayout("Committee Profile"); + final VerticalLayout profileDetailsLayout = CardInfoRowUtil.createSectionLayout(CommitteeViewConstants.OV_SECTION_PROFILE); profileDetailsLayout.addComponent(CardInfoRowUtil.createInfoRow("Detail:", viewRiksdagenCommittee.getEmbeddedId().getDetail(), VaadinIcons.INFO_CIRCLE, "Internal identifier detail for the committee")); @@ -119,7 +119,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina VaadinIcons.CALENDAR_CLOCK, "Date of the committee's most recent assignment")); // Second column: Membership Statistics - final VerticalLayout membershipStatsLayout = CardInfoRowUtil.createSectionLayout("Membership Statistics"); + final VerticalLayout membershipStatsLayout = CardInfoRowUtil.createSectionLayout(CommitteeViewConstants.OV_SECTION_MEMBERSHIP); membershipStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Current Members:", String.valueOf(viewRiksdagenCommittee.getCurrentMemberSize()), VaadinIcons.GROUP, "Total current committee members")); @@ -135,7 +135,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina VaadinIcons.USERS, "Historical total of substitute positions")); // Third column: Document Statistics - final VerticalLayout documentStatsLayout = CardInfoRowUtil.createSectionLayout("Document Statistics"); + final VerticalLayout documentStatsLayout = CardInfoRowUtil.createSectionLayout(CommitteeViewConstants.OV_SECTION_DOCUMENT); documentStatsLayout.addComponent(CardInfoRowUtil.createInfoRow("Total Documents:", String.valueOf(viewRiksdagenCommittee.getTotalDocuments()), VaadinIcons.FILE_TEXT, "Total number of documents produced")); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteePageTitleConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteePageTitleConstants.java new file mode 100644 index 0000000000..f4de3911ce --- /dev/null +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteePageTitleConstants.java @@ -0,0 +1,43 @@ +package com.hack23.cia.web.impl.ui.application.views.user.committee.pagemode; + +public interface CommitteePageTitleConstants { + // Role Ghant + String RG_TITLE_HEADER = "Committee Role Gantt Chart "; + String RG_TITLE = "Role Timeline"; + String RG_DESCRIPTION = "Visualize the timeline and duration of roles within the committee, highlighting key assignments and transitions."; + + // Overview + String OV_TITLE_HEADER = "Committee Overview "; + String OV_TITLE = "Committee Details"; + String OV_DESCRIPTION = "Detailed insights into parliamentary committees and their activities."; + + // Member History + String MH_TITLE_HEADER = "Member History "; + String MH_TITLE = "Committee Member Participation History"; + String MH_DESCRIPTION = "Analyzes and presents participation trends for committee members."; + + // Document History + String DH_TITLE_HEADER = "Document History "; + String DH_TITLE = "Committee Document History"; + String DH_DESCRIPTION = "Displays the historical progression of documents managed by committees."; + + // Current Members + String CM_TITLE_HEADER = "Committee History "; + String CM_TITLE = "Current Members History"; + String CM_DESCRIPTION = "Tracks and presents historical data about committee members' participation."; + + // Decision Flow + String DF_TITLE_HEADER = "Committee Decision Flow "; + String DF_TITLE = "Decision Flow"; + String DF_DESCRIPTION = "Analyze decision-making processes within committees."; + + // Document Activity + String DA_TITLE_HEADER = "Committee Documents "; + String DA_TITLE = "Document Activity Overview"; + String DA_DESCRIPTION = "Tracks and visualizes the activity associated with committee documents."; + + // Page Visit History + String PV_TITLE_HEADER = "Committee Visits"; + String PV_TITLE = "Page Visit History for Committees"; + String PV_DESCRIPTION = "Tracks user interaction with committee pages for analytical purposes."; +} diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteePageVisitHistoryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteePageVisitHistoryPageModContentFactoryImpl.java index 7c72578e66..08fbbd8a12 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteePageVisitHistoryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteePageVisitHistoryPageModContentFactoryImpl.java @@ -56,7 +56,10 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getItem(parameters); getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId); - CardInfoRowUtil.createPageHeader(panel, panelContent, "Committee Visits", "Page Visit History for Committees", "Tracks user interaction with committee pages for analytical purposes."); + CardInfoRowUtil.createPageHeader(panel, panelContent, + CommitteeViewConstants.PV_TITLE_HEADER, + CommitteeViewConstants.PV_TITLE, + CommitteeViewConstants.PV_DESCRIPTION); createPageVisitHistory(NAME, pageId, panelContent); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingAllCommitteesChartsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingAllCommitteesChartsPageModContentFactoryImpl.java index 76a9a87353..9f0359aa57 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingAllCommitteesChartsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingAllCommitteesChartsPageModContentFactoryImpl.java @@ -73,7 +73,10 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final String pageId = getPageId(parameters); - CardInfoRowUtil.createPageHeader(panel, panelContent, "Committee Rankings", "Ranking of All Committees", "Provides comparative rankings for committees based on performance or metrics."); + CardInfoRowUtil.createPageHeader(panel, panelContent, + CommitteeViewConstants.CR_ALL_TITLE_HEADER, + CommitteeViewConstants.CR_ALL_TITLE, + CommitteeViewConstants.CR_ALL_DESCRIPTION); final HorizontalLayout chartLayout = new HorizontalLayout(); chartLayout.setSizeFull(); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingCommitteeByPartyChartsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingCommitteeByPartyChartsPageModContentFactoryImpl.java index 88c8d00194..f8c9eadd93 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingCommitteeByPartyChartsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingCommitteeByPartyChartsPageModContentFactoryImpl.java @@ -73,9 +73,10 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final VerticalLayout panelContent = createPanelContent(); getCommitteeRankingMenuItemFactory().createCommitteeeRankingMenuBar(menuBar); - - CardInfoRowUtil.createPageHeader(panel, panelContent, "Committee Rankings", "Committee by Party Charts Overview", "Provides comparative rankings for committees based on performance or metrics."); - + CardInfoRowUtil.createPageHeader(panel, panelContent, + CommitteeViewConstants.CR_PARTY_TITLE_HEADER, + CommitteeViewConstants.CR_PARTY_TITLE, + CommitteeViewConstants.CR_PARTY_DESCRIPTION); final String pageId = getPageId(parameters); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingConstants.java new file mode 100644 index 0000000000..b9d143ac33 --- /dev/null +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingConstants.java @@ -0,0 +1,38 @@ +package com.hack23.cia.web.impl.ui.application.views.user.committee.pagemode; + +public interface CommitteeRankingConstants { + // Committee Ranking Overview + String CR_OVERVIEW_TITLE_HEADER = "Committee Rankings"; + String CR_OVERVIEW_TITLE = "Ranking Details"; + String CR_OVERVIEW_DESCRIPTION = "Analyze and compare rankings of parliamentary committees based on performance."; + + // Committee Ranking Data Grid + String CR_GRID_TITLE_HEADER = "Committee Ranking Overview"; + String CR_GRID_TITLE = "Committee Rankings"; + String CR_GRID_DESCRIPTION = "Analyze committee rankings with a focus on membership, performance, and activity metrics."; + + // Committee Ranking Visit History + String CR_VISIT_TITLE_HEADER = "Committee Rankings"; + String CR_VISIT_TITLE = "Page Visit History"; + String CR_VISIT_DESCRIPTION = "Tracks and visualizes the history of page visits for committee rankings."; + + // All Committees Charts + String CR_ALL_TITLE_HEADER = "Committee Rankings"; + String CR_ALL_TITLE = "Ranking of All Committees"; + String CR_ALL_DESCRIPTION = "Provides comparative rankings for committees based on performance or metrics."; + + // Current Committees Charts + String CR_CURRENT_TITLE_HEADER = "Committee Rankings"; + String CR_CURRENT_TITLE = "Current Committees"; + String CR_CURRENT_DESCRIPTION = "Provides comparative rankings for committees based on performance or metrics."; + + // Committee by Party Charts + String CR_PARTY_TITLE_HEADER = "Committee Rankings"; + String CR_PARTY_TITLE = "Committee by Party Charts Overview"; + String CR_PARTY_DESCRIPTION = "Provides comparative rankings for committees based on performance or metrics."; + + // Current Committee Parties Charts + String CR_CURRENT_PARTY_TITLE_HEADER = "Committee Rankings"; + String CR_CURRENT_PARTY_TITLE = "Current Committee Parties Charts Overview"; + String CR_CURRENT_PARTY_DESCRIPTION = "Provides comparative rankings for committees based on performance or metrics."; +} diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingCurrentCommitteePartiesChartsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingCurrentCommitteePartiesChartsPageModContentFactoryImpl.java index 210688ff3c..9fe75448ec 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingCurrentCommitteePartiesChartsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingCurrentCommitteePartiesChartsPageModContentFactoryImpl.java @@ -74,8 +74,10 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final VerticalLayout panelContent = createPanelContent(); getCommitteeRankingMenuItemFactory().createCommitteeeRankingMenuBar(menuBar); - CardInfoRowUtil.createPageHeader(panel, panelContent, "Committee Rankings", "Current Committee Parties Charts Overview", "Provides comparative rankings for committees based on performance or metrics."); - + CardInfoRowUtil.createPageHeader(panel, panelContent, + CommitteeViewConstants.CR_CURRENT_PARTY_TITLE_HEADER, + CommitteeViewConstants.CR_CURRENT_PARTY_TITLE, + CommitteeViewConstants.CR_CURRENT_PARTY_DESCRIPTION); final String pageId = getPageId(parameters); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingCurrentCommitteesChartsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingCurrentCommitteesChartsPageModContentFactoryImpl.java index 70030af3d6..fe346d4842 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingCurrentCommitteesChartsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingCurrentCommitteesChartsPageModContentFactoryImpl.java @@ -70,8 +70,10 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final VerticalLayout panelContent = createPanelContent(); getCommitteeRankingMenuItemFactory().createCommitteeeRankingMenuBar(menuBar); - CardInfoRowUtil.createPageHeader(panel, panelContent, "Committee Rankings", "Current Committees", "Provides comparative rankings for committees based on performance or metrics."); - + CardInfoRowUtil.createPageHeader(panel, panelContent, + CommitteeViewConstants.CR_CURRENT_TITLE_HEADER, + CommitteeViewConstants.CR_CURRENT_TITLE, + CommitteeViewConstants.CR_CURRENT_DESCRIPTION); final String pageId = getPageId(parameters); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingDataGridPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingDataGridPageModContentFactoryImpl.java index 5070d1cfda..1c50914bff 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingDataGridPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingDataGridPageModContentFactoryImpl.java @@ -98,7 +98,10 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final VerticalLayout panelContent = createPanelContent(); getCommitteeRankingMenuItemFactory().createCommitteeeRankingMenuBar(menuBar); - CardInfoRowUtil.createPageHeader(panel, panelContent, "Committee Ranking Overview", "Committee Rankings", "Analyze committee rankings with a focus on membership, performance, and activity metrics."); + CardInfoRowUtil.createPageHeader(panel, panelContent, + CommitteeViewConstants.CR_GRID_TITLE_HEADER, + CommitteeViewConstants.CR_GRID_TITLE, + CommitteeViewConstants.CR_GRID_DESCRIPTION); final String pageId = getPageId(parameters); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingOverviewPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingOverviewPageModContentFactoryImpl.java index f1fdb1dba0..0f4b1b9365 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingOverviewPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingOverviewPageModContentFactoryImpl.java @@ -58,7 +58,10 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final VerticalLayout panelContent = createPanelContent(); getCommitteeRankingMenuItemFactory().createCommitteeeRankingMenuBar(menuBar); - CardInfoRowUtil.createPageHeader(panel, panelContent, "Committee Rankings", "Ranking Details", "Analyze and compare rankings of parliamentary committees based on performance."); + CardInfoRowUtil.createPageHeader(panel, panelContent, + CommitteeViewConstants.CR_OVERVIEW_TITLE_HEADER, + CommitteeViewConstants.CR_OVERVIEW_TITLE, + CommitteeViewConstants.CR_OVERVIEW_DESCRIPTION); final String pageId = getPageId(parameters); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingPageVisitHistoryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingPageVisitHistoryPageModContentFactoryImpl.java index ad59dbdb52..f8c15266f9 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingPageVisitHistoryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRankingPageVisitHistoryPageModContentFactoryImpl.java @@ -56,8 +56,10 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final VerticalLayout panelContent = createPanelContent(); getCommitteeRankingMenuItemFactory().createCommitteeeRankingMenuBar(menuBar); - CardInfoRowUtil.createPageHeader(panel, panelContent, "Committee Rankings", "Page Visit History", "Tracks and visualizes the history of page visits for committee rankings."); - + CardInfoRowUtil.createPageHeader(panel, panelContent, + CommitteeViewConstants.CR_VISIT_TITLE_HEADER, + CommitteeViewConstants.CR_VISIT_TITLE, + CommitteeViewConstants.CR_VISIT_DESCRIPTION); final String pageId = getPageId(parameters); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRoleGhantPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRoleGhantPageModContentFactoryImpl.java index 52d01588f7..d04d433c9b 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRoleGhantPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeRoleGhantPageModContentFactoryImpl.java @@ -64,7 +64,10 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final ViewRiksdagenCommittee viewRiksdagenCommittee = getItem(parameters); getCommitteeMenuItemFactory().createCommitteeeMenuBar(menuBar, pageId); - CardInfoRowUtil.createPageHeader(panel, panelContent, "Committee Role Gantt Chart " + viewRiksdagenCommittee.getEmbeddedId().getDetail(), "Role Timeline", "Visualize the timeline and duration of roles within the committee, highlighting key assignments and transitions."); + CardInfoRowUtil.createPageHeader(panel, panelContent, + CommitteeViewConstants.RG_TITLE_HEADER + viewRiksdagenCommittee.getEmbeddedId().getDetail(), + CommitteeViewConstants.RG_TITLE, + CommitteeViewConstants.RG_DESCRIPTION); final DataContainer committeeRoleMemberDataContainer = getApplicationManager() .getDataContainer(ViewRiksdagenCommitteeRoleMember.class); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeSectionConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeSectionConstants.java new file mode 100644 index 0000000000..25618e215f --- /dev/null +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeSectionConstants.java @@ -0,0 +1,7 @@ +package com.hack23.cia.web.impl.ui.application.views.user.committee.pagemode; + +public interface CommitteeSectionConstants { + String OV_SECTION_PROFILE = "Committee Profile"; + String OV_SECTION_MEMBERSHIP = "Membership Statistics"; + String OV_SECTION_DOCUMENT = "Document Statistics"; +} diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeViewConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeViewConstants.java new file mode 100644 index 0000000000..fa822b2e0b --- /dev/null +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/committee/pagemode/CommitteeViewConstants.java @@ -0,0 +1,14 @@ +package com.hack23.cia.web.impl.ui.application.views.user.committee.pagemode; + +/** + * Constants for the committee view pages. + */ +public interface CommitteeViewConstants extends + CommitteePageTitleConstants, + CommitteeSectionConstants, + CommitteeActionConstants, + CommitteeGridConstants, + CommitteeBallotConstants, + CommitteeRankingConstants { + // Interface is now complete through its extensions +} diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentActivityPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentActivityPageModContentFactoryImpl.java index e9965a778b..5c2362ec4e 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentActivityPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentActivityPageModContentFactoryImpl.java @@ -64,6 +64,11 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getDocumentMenuItemFactory().createDocumentMenuBar(menuBar, pageId); + CardInfoRowUtil.createPageHeader(panel, panelContent, + DocumentViewConstants.ACTIVITY_TITLE, + DocumentViewConstants.ACTIVITY_SUBTITLE, + DocumentViewConstants.ACTIVITY_DESC); + final DataContainer documentStatusContainerDataContainer = getApplicationManager() .getDataContainer(DocumentStatusContainer.class); @@ -71,8 +76,6 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina .findByQueryProperty(DocumentStatusContainer.class, DocumentStatusContainer_.document, DocumentData.class, DocumentData_.id, pageId); - CardInfoRowUtil.createPageHeader(panel, panelContent, "Document Activity", "Activity Overview", "Analyze document activities, including modifications, approvals, and related events."); - if (documentStatusContainer != null && documentStatusContainer.getDocumentActivityContainer() != null && documentStatusContainer.getDocumentActivityContainer().getDocumentActivities() != null) { diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentAttachementsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentAttachementsPageModContentFactoryImpl.java index e1dd7cbf85..fa8a27b1a6 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentAttachementsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentAttachementsPageModContentFactoryImpl.java @@ -115,7 +115,10 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina .findByQueryProperty(DocumentStatusContainer.class, DocumentStatusContainer_.document, DocumentData.class, DocumentData_.id, pageId); - CardInfoRowUtil.createPageHeader(panel, panelContent, "Document Attachments", "Attachments Overview", "Explore and manage attachments associated with the document."); + CardInfoRowUtil.createPageHeader(panel, panelContent, + DocumentViewConstants.ATTACHMENTS_TITLE, + DocumentViewConstants.ATTACHMENTS_SUBTITLE, + DocumentViewConstants.ATTACHMENTS_DESC); if (documentStatusContainer != null && documentStatusContainer.getDocumentAttachmentContainer() != null && documentStatusContainer.getDocumentAttachmentContainer().getDocumentAttachmentList() != null) { diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentDataPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentDataPageModContentFactoryImpl.java index e2caf05539..484940eada 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentDataPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentDataPageModContentFactoryImpl.java @@ -66,7 +66,10 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina getDocumentMenuItemFactory().createDocumentMenuBar(menuBar, pageId); - CardInfoRowUtil.createPageHeader(panel, panelContent, "Document Data", "Data Overview", "Detailed view of the document's core data and metadata."); + CardInfoRowUtil.createPageHeader(panel, panelContent, + DocumentViewConstants.DATA_TITLE, + DocumentViewConstants.DATA_SUBTITLE, + DocumentViewConstants.DATA_DESC); final DataContainer documentContentDataDataContainer = getApplicationManager() diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentDecisionPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentDecisionPageModContentFactoryImpl.java index 29af4a7513..62258d35a2 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentDecisionPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentDecisionPageModContentFactoryImpl.java @@ -71,7 +71,12 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina .findByQueryProperty(DocumentStatusContainer.class, DocumentStatusContainer_.document, DocumentData.class, DocumentData_.id, pageId); - CardInfoRowUtil.createPageHeader(panel, panelContent, "Document Decision", "Decision Overview", "Review decisions made regarding the document and their implications."); +// ...existing code... + CardInfoRowUtil.createPageHeader(panel, panelContent, + DocumentViewConstants.DECISION_TITLE, + DocumentViewConstants.DECISION_SUBTITLE, + DocumentViewConstants.DECISION_DESC); +// ...existing code... if (documentStatusContainer != null && documentStatusContainer.getDocumentProposal() != null && documentStatusContainer.getDocumentProposal().getProposal() != null) { diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentDetailsPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentDetailsPageModContentFactoryImpl.java index efd0dedbb8..75454aacc2 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentDetailsPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentDetailsPageModContentFactoryImpl.java @@ -70,7 +70,10 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina .findByQueryProperty(DocumentStatusContainer.class, DocumentStatusContainer_.document, DocumentData.class, DocumentData_.id, pageId); - CardInfoRowUtil.createPageHeader(panel, panelContent, "Document Details", "Details Overview", "Comprehensive details about the document, including key attributes and content."); + CardInfoRowUtil.createPageHeader(panel, panelContent, + DocumentViewConstants.DETAILS_TITLE, + DocumentViewConstants.DETAILS_SUBTITLE, + DocumentViewConstants.DETAILS_DESC); if (documentStatusContainer != null && documentStatusContainer.getDocumentDetailContainer() != null && documentStatusContainer.getDocumentDetailContainer().getDocumentDetailList() != null) { diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentFieldConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentFieldConstants.java new file mode 100644 index 0000000000..3421e5cf54 --- /dev/null +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentFieldConstants.java @@ -0,0 +1,27 @@ +package com.hack23.cia.web.impl.ui.application.views.user.document.pagemode; + +public interface DocumentFieldConstants { + String FIELD_TITLE = "Title:"; + String FIELD_SUBTITLE = "SubTitle:"; + String FIELD_ORGANIZATION = "Organization (Org):"; + String FIELD_DOC_TYPE = "Document Type:"; + String FIELD_STATUS = "Status:"; + String FIELD_MADE_PUBLIC = "Made Public Date:"; + String FIELD_CATEGORY = "Document Category:"; + String FIELD_LABEL = "Label:"; + String FIELD_TEMP_LABEL = "Temp Label:"; + String FIELD_HANGAR_ID = "Hangar ID:"; + String FIELD_NUMBER_VALUE = "Number Value:"; + + String TOOLTIP_TITLE = "Main title of the document"; + String TOOLTIP_SUBTITLE = "Subtitle or complementary title"; + String TOOLTIP_ORGANIZATION = "Originating organization or entity"; + String TOOLTIP_DOC_TYPE = "Type of the document"; + String TOOLTIP_STATUS = "Current status of the document"; + String TOOLTIP_MADE_PUBLIC = "Date when the document was made public"; + String TOOLTIP_CATEGORY = "Category of this document"; + String TOOLTIP_LABEL = "Short identifying label"; + String TOOLTIP_TEMP_LABEL = "Temporary label or note"; + String TOOLTIP_HANGAR_ID = "Storage or reference ID"; + String TOOLTIP_NUMBER_VALUE = "Numeric value associated with the document"; +} diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentGridConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentGridConstants.java new file mode 100644 index 0000000000..1ef5d81fed --- /dev/null +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentGridConstants.java @@ -0,0 +1,18 @@ +package com.hack23.cia.web.impl.ui.application.views.user.document.pagemode; + +public interface DocumentGridConstants { + String GRID_TITLE = "Document"; + String GRID_COLUMN_RM = "rm"; + String GRID_COLUMN_CREATED_DATE = "createdDate"; + String GRID_COLUMN_DOCUMENT_NAME = "documentName"; + String GRID_COLUMN_SUB_TYPE = "subType"; + String GRID_COLUMN_TITLE = "title"; + String GRID_COLUMN_SUB_TITLE = "subTitle"; + String GRID_COLUMN_STATUS = "status"; + + String[] GRID_HIDDEN_COLUMNS = { "rm", "lang", "noteTitle", "origin", "subType", "note", "subTitle", "status", "label", + "id", "hit", "madePublicDate", "databaseSource", "domainOrg", "relatedId", "org", + "documentType", "docType", "debateName", "tempLabel", "numberValue", "systemDate", "kallId", + "documentFormat", "documentUrlText", "documentUrlHtml", "documentStatusUrlXml", + "committeeReportUrlXml" }; +} diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentOverviewPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentOverviewPageModContentFactoryImpl.java index 83a04fec29..ca9bbed5e3 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentOverviewPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentOverviewPageModContentFactoryImpl.java @@ -72,8 +72,9 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina DocumentData.class, DocumentData_.id, pageId); CardInfoRowUtil.createPageHeader(panel, panelContent, - "Document Overview " + documentElement.getTitle() + " " + documentElement.getSubTitle(), - "Document Details", "Access and explore official documents and reports."); + DocumentViewConstants.OVERVIEW_TITLE + " " + documentElement.getTitle() + " " + documentElement.getSubTitle(), + DocumentViewConstants.OVERVIEW_SUBTITLE, + DocumentViewConstants.OVERVIEW_DESC); // Create a card panel for document info final Panel cardPanel = new Panel(); @@ -91,7 +92,7 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina panelContent.addComponent(cardPanel); panelContent.setExpandRatio(cardPanel, ContentRatio.SMALL_GRID); - CardInfoRowUtil.createCardHeader(cardContent,"Document Information"); + CardInfoRowUtil.createCardHeader(cardContent, DocumentViewConstants.OVERVIEW_SECTION_DOC_INFO); // Two-column layout final HorizontalLayout attributesLayout = new HorizontalLayout(); @@ -100,36 +101,61 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina cardContent.addComponent(attributesLayout); // Left column: Document Profile (from DocumentElement) - final VerticalLayout profileLayout = CardInfoRowUtil.createSectionLayout("Document Profile"); + final VerticalLayout profileLayout = CardInfoRowUtil.createSectionLayout( + DocumentViewConstants.OVERVIEW_SECTION_DOC_PROFILE); // Display a selection of DocumentElement fields - // Choose key fields: title, subTitle, org, documentType, status, rm, - // madePublicDate, createdDate - profileLayout.addComponent(CardInfoRowUtil.createInfoRow("Title:", documentElement.getTitle(), VaadinIcons.FILE_TEXT_O, - "Main title of the document")); - if (!StringUtils.isEmpty(documentElement.getSubTitle())) { - profileLayout.addComponent(CardInfoRowUtil.createInfoRow("SubTitle:", documentElement.getSubTitle(), VaadinIcons.FILE_TEXT, - "Subtitle or complementary title")); - } - profileLayout.addComponent(CardInfoRowUtil.createInfoRow("Organization (Org):", documentElement.getOrg(), - VaadinIcons.INSTITUTION, "Originating organization or entity")); - profileLayout.addComponent(CardInfoRowUtil.createInfoRow("Document Type:", documentElement.getDocumentType(), - VaadinIcons.FILE_CODE, "Type of the document")); - profileLayout.addComponent(CardInfoRowUtil.createInfoRow("Status:", documentElement.getStatus(), VaadinIcons.QUESTION_CIRCLE, - "Current status of the document")); - profileLayout - .addComponent(CardInfoRowUtil.createInfoRow("Made Public Date:", String.valueOf(documentElement.getMadePublicDate()), - VaadinIcons.CALENDAR_USER, "Date when the document was made public")); + profileLayout.addComponent(CardInfoRowUtil.createInfoRow( + DocumentViewConstants.FIELD_TITLE, + documentElement.getTitle(), + VaadinIcons.FILE_TEXT_O, + DocumentViewConstants.TOOLTIP_TITLE)); + + if (!StringUtils.isEmpty(documentElement.getSubTitle())) { + profileLayout.addComponent(CardInfoRowUtil.createInfoRow( + DocumentViewConstants.FIELD_SUBTITLE, + documentElement.getSubTitle(), + VaadinIcons.FILE_TEXT, + DocumentViewConstants.TOOLTIP_SUBTITLE)); + } + + profileLayout.addComponent(CardInfoRowUtil.createInfoRow( + DocumentViewConstants.FIELD_ORGANIZATION, + documentElement.getOrg(), + VaadinIcons.INSTITUTION, + DocumentViewConstants.TOOLTIP_ORGANIZATION)); + + profileLayout.addComponent(CardInfoRowUtil.createInfoRow( + DocumentViewConstants.FIELD_DOC_TYPE, + documentElement.getDocumentType(), + VaadinIcons.FILE_CODE, + DocumentViewConstants.TOOLTIP_DOC_TYPE)); + + profileLayout.addComponent(CardInfoRowUtil.createInfoRow( + DocumentViewConstants.FIELD_STATUS, + documentElement.getStatus(), + VaadinIcons.QUESTION_CIRCLE, + DocumentViewConstants.TOOLTIP_STATUS)); + + profileLayout.addComponent(CardInfoRowUtil.createInfoRow( + DocumentViewConstants.FIELD_MADE_PUBLIC, + String.valueOf(documentElement.getMadePublicDate()), + VaadinIcons.CALENDAR_USER, + DocumentViewConstants.TOOLTIP_MADE_PUBLIC)); // Right column: Metadata & Status (from DocumentStatusContainer and // DocumentData) - final VerticalLayout metadataLayout = CardInfoRowUtil.createSectionLayout("Metadata & Status"); + final VerticalLayout metadataLayout = CardInfoRowUtil.createSectionLayout( + DocumentViewConstants.OVERVIEW_SECTION_METADATA); if (documentStatusContainer != null) { // DocumentCategory (from DocumentStatusContainer) if (!StringUtils.isEmpty(documentStatusContainer.getDocumentCategory())) { - metadataLayout.addComponent(CardInfoRowUtil.createInfoRow("Document Category:", - documentStatusContainer.getDocumentCategory(), VaadinIcons.BOOK, "Category of this document")); + metadataLayout.addComponent(CardInfoRowUtil.createInfoRow( + DocumentViewConstants.FIELD_CATEGORY, + documentStatusContainer.getDocumentCategory(), + VaadinIcons.BOOK, + DocumentViewConstants.TOOLTIP_CATEGORY)); } // DocumentData fields (AS_LIST2) @@ -137,21 +163,32 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina if (documentData != null) { // Choose a few key fields from DocumentData if (!StringUtils.isEmpty(documentData.getLabel())) { - metadataLayout.addComponent(CardInfoRowUtil.createInfoRow("Label:", documentData.getLabel(), VaadinIcons.TAG, - "Short identifying label")); + metadataLayout.addComponent(CardInfoRowUtil.createInfoRow( + DocumentViewConstants.FIELD_LABEL, + documentData.getLabel(), + VaadinIcons.TAG, + DocumentViewConstants.TOOLTIP_LABEL)); } if (!StringUtils.isEmpty(documentData.getTempLabel())) { - metadataLayout.addComponent(CardInfoRowUtil.createInfoRow("Temp Label:", documentData.getTempLabel(), - VaadinIcons.EDIT, "Temporary label or note")); + metadataLayout.addComponent(CardInfoRowUtil.createInfoRow( + DocumentViewConstants.FIELD_TEMP_LABEL, + documentData.getTempLabel(), + VaadinIcons.EDIT, + DocumentViewConstants.TOOLTIP_TEMP_LABEL)); } if (!StringUtils.isEmpty(documentData.getHangarId())) { - metadataLayout.addComponent(CardInfoRowUtil.createInfoRow("Hangar ID:", documentData.getHangarId(), - VaadinIcons.CLIPBOARD, "Storage or reference ID")); + metadataLayout.addComponent(CardInfoRowUtil.createInfoRow( + DocumentViewConstants.FIELD_HANGAR_ID, + documentData.getHangarId(), + VaadinIcons.CLIPBOARD, + DocumentViewConstants.TOOLTIP_HANGAR_ID)); } if (documentData.getNumberValue() != null) { - metadataLayout - .addComponent(CardInfoRowUtil.createInfoRow("Number Value:", String.valueOf(documentData.getNumberValue()), - VaadinIcons.BAR_CHART, "Numeric value associated with the document")); + metadataLayout.addComponent(CardInfoRowUtil.createInfoRow( + DocumentViewConstants.FIELD_NUMBER_VALUE, + String.valueOf(documentData.getNumberValue()), + VaadinIcons.BAR_CHART, + DocumentViewConstants.TOOLTIP_NUMBER_VALUE)); } } } diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentPageTitleConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentPageTitleConstants.java new file mode 100644 index 0000000000..2b7e01d3bd --- /dev/null +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentPageTitleConstants.java @@ -0,0 +1,57 @@ +package com.hack23.cia.web.impl.ui.application.views.user.document.pagemode; + +public interface DocumentPageTitleConstants { + // Activity + String ACTIVITY_TITLE = "Document Activity"; + String ACTIVITY_SUBTITLE = "Activity Overview"; + String ACTIVITY_DESC = "Analyze document activities, including modifications, approvals, and related events."; + + // Overview + String OVERVIEW_TITLE = "Document Overview"; + String OVERVIEW_SUBTITLE = "Document Details"; + String OVERVIEW_DESC = "Access and explore official documents and reports."; + String OVERVIEW_SECTION_DOC_INFO = "Document Information"; + String OVERVIEW_SECTION_DOC_PROFILE = "Document Profile"; + String OVERVIEW_SECTION_METADATA = "Metadata & Status"; + + // Details + String DETAILS_TITLE = "Document Details"; + String DETAILS_SUBTITLE = "Details Overview"; + String DETAILS_DESC = "Comprehensive details about the document, including key attributes and content."; + + // References + String REFERENCES_TITLE = "Document References"; + String REFERENCES_SUBTITLE = "References Overview"; + String REFERENCES_DESC = "Analyze and review references within the document, including cross-references."; + + // Person References + String PERSON_REFERENCES_TITLE = "Document Person References"; + String PERSON_REFERENCES_SUBTITLE = "Person References"; + String PERSON_REFERENCES_DESC = "Identify and explore references to individuals within the document."; + + // Visit History + String VISIT_HISTORY_TITLE = "Documents - Page Visit History"; + String VISIT_HISTORY_SUBTITLE = "Engagement Insights"; + String VISIT_HISTORY_DESC = "Tracking how interest in policy materials evolves."; + + // Data + String DATA_TITLE = "Document Data"; + String DATA_SUBTITLE = "Data Overview"; + String DATA_DESC = "Detailed view of the document's core data and metadata."; + + // Decision + String DECISION_TITLE = "Document Decision"; + String DECISION_SUBTITLE = "Decision Overview"; + String DECISION_DESC = "Review decisions made regarding the document and their implications."; + + // Attachments + String ATTACHMENTS_TITLE = "Document Attachments"; + String ATTACHMENTS_SUBTITLE = "Attachments Overview"; + String ATTACHMENTS_DESC = "Explore and manage attachments associated with the document."; + + // Documents Overview + String DOCUMENTS_TITLE = "Documents Overview"; + String DOCUMENTS_SUBTITLE = "Documents Repository"; + String DOCUMENTS_DESC = "Comprehensive repository of Swedish Parliament(Riksdagen) documents."; +} + diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentPageVisitHistoryPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentPageVisitHistoryPageModContentFactoryImpl.java index 00e31238f1..7b061c5a44 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentPageVisitHistoryPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentPageVisitHistoryPageModContentFactoryImpl.java @@ -53,9 +53,9 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina final String pageId = getPageId(parameters); getDocumentMenuItemFactory().createDocumentMenuBar(menuBar, pageId); CardInfoRowUtil.createPageHeader(panel, panelContent, - "Documents - Page Visit History", - "Engagement Insights", - "Tracking how interest in policy materials evolves."); + DocumentViewConstants.VISIT_HISTORY_TITLE, + DocumentViewConstants.VISIT_HISTORY_SUBTITLE, + DocumentViewConstants.VISIT_HISTORY_DESC); createPageVisitHistory(NAME, pageId, panelContent); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentPersonReferencesPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentPersonReferencesPageModContentFactoryImpl.java index d67791e80e..1996692811 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentPersonReferencesPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentPersonReferencesPageModContentFactoryImpl.java @@ -74,7 +74,10 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina .findByQueryProperty(DocumentStatusContainer.class, DocumentStatusContainer_.document, DocumentData.class, DocumentData_.id, pageId); - CardInfoRowUtil.createPageHeader(panel, panelContent, "Document Person References", "Person References", "Identify and explore references to individuals within the document."); + CardInfoRowUtil.createPageHeader(panel, panelContent, + DocumentViewConstants.PERSON_REFERENCES_TITLE, + DocumentViewConstants.PERSON_REFERENCES_SUBTITLE, + DocumentViewConstants.PERSON_REFERENCES_DESC); if (documentStatusContainer != null && documentStatusContainer.getDocumentPersonReferenceContainer() != null && documentStatusContainer.getDocumentPersonReferenceContainer() diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentReferencesPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentReferencesPageModContentFactoryImpl.java index 7d44203565..ce54a67a2a 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentReferencesPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentReferencesPageModContentFactoryImpl.java @@ -70,7 +70,10 @@ public Layout createContent(final String parameters, final MenuBar menuBar, fina .findByQueryProperty(DocumentStatusContainer.class, DocumentStatusContainer_.document, DocumentData.class, DocumentData_.id, pageId); - CardInfoRowUtil.createPageHeader(panel, panelContent, "Document References", "References Overview", "Analyze and review references within the document, including cross-references."); + CardInfoRowUtil.createPageHeader(panel, panelContent, + DocumentViewConstants.REFERENCES_TITLE, + DocumentViewConstants.REFERENCES_SUBTITLE, + DocumentViewConstants.REFERENCES_DESC); if (documentStatusContainer != null && documentStatusContainer.getDocumentReferenceContainer() != null && documentStatusContainer.getDocumentReferenceContainer().getDocumentReferenceList() != null) { diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentViewConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentViewConstants.java new file mode 100644 index 0000000000..3c29b087e7 --- /dev/null +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentViewConstants.java @@ -0,0 +1,12 @@ +package com.hack23.cia.web.impl.ui.application.views.user.document.pagemode; + +/** + * Constants for the document view pages. + */ +public interface DocumentViewConstants extends + DocumentGridConstants, + DocumentFieldConstants, + DocumentPageTitleConstants, + DocumentsOverviewPageModeConstants { + // Interface is now complete through its extensions +} diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentsOverviewPageModContentFactoryImpl.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentsOverviewPageModContentFactoryImpl.java index 3d0b1b758b..b58b77bea0 100644 --- a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentsOverviewPageModContentFactoryImpl.java +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentsOverviewPageModContentFactoryImpl.java @@ -1,4 +1,83 @@ /* +package com.hack23.cia.web.impl.ui.application.views.user.document.pagemode; + +import com.vaadin.ui.Component; +import com.vaadin.ui.HorizontalLayout; +import com.vaadin.ui.MenuBar; +import com.vaadin.ui.Panel; +import org.springframework.stereotype.Component; + +@Component +public final class DocumentsOverviewPageModContentFactoryImpl extends AbstractPageModContentFactoryImpl { + + @Override + public Component createContent(final String parameters, final MenuBar menuBar, final Panel panel) { + final VerticalLayout panelContent = createPanelContent(); + panel.setContent(panelContent); + + getGridFactory().createBasicChart(panelContent, + DocumentViewConstants.ACTIVITY_TITLE, + DocumentViewConstants.ACTIVITY_DESC, + createDocumentActivityChart(documentChartDataManager)); + + final HorizontalLayout horizontalLayout = new HorizontalLayout(); + horizontalLayout.setSizeFull(); + + final Chart documentTypeChart = createDocumentTypeChart(documentChartDataManager); + getGridFactory().createBasicChart(horizontalLayout, + DocumentViewConstants.OVERVIEW_SECTION_DOC_PROFILE, + DocumentViewConstants.OVERVIEW_DESC, + documentTypeChart); + + final Chart statusChart = createDocumentStatusChart(documentChartDataManager); + getGridFactory().createBasicChart(horizontalLayout, + DocumentViewConstants.OVERVIEW_SECTION_METADATA, + DocumentViewConstants.OVERVIEW_DESC, + statusChart); + + panelContent.addComponent(horizontalLayout); + + return panelContent; + } + + private Chart createDocumentTypeChart(final DocumentChartDataManager documentChartDataManager) { + final Chart chart = new Chart(ChartType.PIE); + final Configuration conf = chart.getConfiguration(); + conf.setTitle(DocumentViewConstants.FIELD_DOC_TYPE); + + final DataSeries series = new DataSeries(); + series.setName(DocumentViewConstants.FIELD_DOC_TYPE); + series.setData(documentChartDataManager.getDocumentTypeData()); + conf.addSeries(series); + + final PlotOptionsPie plotOptions = new PlotOptionsPie(); + plotOptions.setAllowPointSelect(true); + plotOptions.setCursor(Cursor.POINTER); + plotOptions.setDataLabels(new DataLabels(true)); + conf.setPlotOptions(plotOptions); + + return chart; + } + + private Chart createDocumentStatusChart(final DocumentChartDataManager documentChartDataManager) { + final Chart chart = new Chart(ChartType.PIE); + final Configuration conf = chart.getConfiguration(); + conf.setTitle(DocumentViewConstants.FIELD_STATUS); + + final DataSeries series = new DataSeries(); + series.setName(DocumentViewConstants.FIELD_STATUS); + series.setData(documentChartDataManager.getDocumentStatusData()); + conf.addSeries(series); + + final PlotOptionsPie plotOptions = new PlotOptionsPie(); + plotOptions.setAllowPointSelect(true); + plotOptions.setCursor(Cursor.POINTER); + plotOptions.setDataLabels(new DataLabels(true)); + conf.setPlotOptions(plotOptions); + + return chart; + } +} * Copyright 2010-2025 James Pether Sörling * * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentsOverviewPageModeConstants.java b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentsOverviewPageModeConstants.java new file mode 100644 index 0000000000..9de535cc64 --- /dev/null +++ b/citizen-intelligence-agency/src/main/java/com/hack23/cia/web/impl/ui/application/views/user/document/pagemode/DocumentsOverviewPageModeConstants.java @@ -0,0 +1,16 @@ +package com.hack23.cia.web.impl.ui.application.views.user.document.pagemode; + +public interface DocumentsOverviewPageModeConstants { + String DOCUMENT_TYPE_TEXT = "Document Type"; + String DOCUMENT_STATUS_TEXT = "Document Status"; + String DOCUMENT_SIZE_TEXT = "Size"; + String[] DOCUMENT_CHART_COLORS = { "#FF9900", "#109618", "#990099", "#3366CC", "#DC3912" }; + + String DOCUMENT_ACTIVITY_CHART_DESCRIPTION = "Document activity over time"; + String DOCUMENT_TYPE_CHART_DESCRIPTION = "Document type distribution"; + String DOCUMENT_STATUS_CHART_DESCRIPTION = "Document status distribution"; + + String DOCUMENT_ACTIVITY_HEADING = "Document activity"; + String DOCUMENT_TYPE_DISTRIBUTION_HEADING = "Document type distribution"; + String DOCUMENT_STATUS_DISTRIBUTION_HEADING = "Document status distribution"; +}