Skip to content

XML agenda export - #6461

Open
Borreg0 wants to merge 8 commits into
OpenSlides:mainfrom
Borreg0:6323-xml-agenda-export
Open

XML agenda export#6461
Borreg0 wants to merge 8 commits into
OpenSlides:mainfrom
Borreg0:6323-xml-agenda-export

Conversation

@Borreg0

@Borreg0 Borreg0 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Resolves half of #6323

@Borreg0 Borreg0 added this to the 4.4 milestone Jul 31, 2026
@Borreg0 Borreg0 self-assigned this Jul 31, 2026
@Borreg0 Borreg0 added the Schrödinger projectname label Jul 31, 2026
@Borreg0
Borreg0 requested review from Elblinator and bspekker July 31, 2026 10:57
@Borreg0 Borreg0 assigned bspekker and Elblinator and unassigned Borreg0 Jul 31, 2026
@Borreg0
Borreg0 marked this pull request as ready for review July 31, 2026 10:57
@Borreg0 Borreg0 assigned bspekker and Elblinator and unassigned Borreg0 Aug 3, 2026
@Elblinator Elblinator linked an issue Aug 3, 2026 that may be closed by this pull request
2 tasks
itemMap: Map<number, ViewAgendaItem<any>>,
isNested = false
): HTMLElement {
const agendaItem = doc.createElement(isNested ? 'Sub-Agenda-Item' : 'Agenda-Item');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dislike the upper camel case and kebab case together. (and sometimes also snake_case)
Change it to kebab case only
Also apply to everything below too

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please state why the string still has upper camel case and kebab case.

Comment thread client/src/app/site/pages/meetings/services/export/meeting-xml-export.service.ts Outdated
Comment thread client/src/app/site/pages/meetings/services/export/meeting-xml-export.service.ts Outdated
Comment thread client/src/app/site/pages/meetings/services/export/meeting-xml-export.service.ts Outdated
@Elblinator Elblinator assigned Borreg0 and unassigned bspekker and Elblinator Aug 3, 2026
@Borreg0 Borreg0 assigned Elblinator and unassigned Borreg0 Aug 5, 2026
@Borreg0
Borreg0 requested a review from Elblinator August 5, 2026 07:05
metaInfo: [`duration`]
};

private xmlDefaults = this.csvDefaults;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

either
A) copy line 115 and 116 directly and fill xmlDefault like that
B) unify csv and XML default, so it's usable at the same time as the same variable
C) create a new variable to reference the content and lett all default call this new variable


export type csvMetaInfo = `duration` | `tags` | `agenda_visibility` | `done`;

export type xmlMetaInfo = csvMetaInfo;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make the content explicit or rename to represent both (CSV and XML)

Comment on lines +41 to +47
const addContentNode = (name: InfoToExport | xmlMetaInfo, value: unknown): void => {
if (config.includes(name) && this.isEmpty(value)) {
const node = doc.createElement(name.replaceAll('_', '-'));
node.textContent = String(value);
agendaItem.appendChild(node);
}
};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. this needs to be it's own function
  2. we do not use : unknown. use : any if nothing other is possible
    for here use : string | number | boolean
  3. check the type of value. if value is a string just fill node.textContent, if value is no string use .toString()

itemMap: Map<number, ViewAgendaItem<any>>,
isNested = false
): HTMLElement {
const agendaItem = doc.createElement(isNested ? 'Sub-Agenda-Item' : 'Agenda-Item');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please state why the string still has upper camel case and kebab case.

Comment on lines +59 to +66
if (item.tags?.length && config.includes('tags')) {
const tags = doc.createElement('tags');
item.tags.filter(tagName => {
const tag = doc.createElement('tag');
tag.textContent = tagName.tag.name;
tags.appendChild(tag);
});
agendaItem.appendChild(tags);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use your own function addContentNode


public exportAsXML(source: ViewAgendaItem[], info: InfoToExport[], xmlMeta: xmlMetaInfo[]): void {
const filename = this.translate.instant(`Agenda`) + `.xml`;
const config: (InfoToExport | csvMetaInfo)[] = [...info, ...xmlMeta];

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

csvMetaInfo wrong type


import { ViewAgendaItem } from '../../pages/agenda';
import {
csvMetaInfo,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll say it here once:
using csvMetaInfo is wrong.
either fix the naming convention (see comment above) or exchange the csv with xml.
you won't be needing the csvMetaInfo in the xml-export

export class MeetingXmlExportService {
private exporter = inject(FileExportService);
private serializer = new XMLSerializer();
private itemMap;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
private itemMap;
private itemMap: Map<number, ViewAgendaItem<any>>;

return agendaItem;
}

private isEmpty(value: any): boolean {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this function returns true if the value is NOT empty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Schrödinger projectname

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add xml export option for motion vote results and agenda

4 participants