Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xhtml visualization #497

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Xhtml visualization #497

wants to merge 3 commits into from

Conversation

celuchmarek
Copy link
Member

No description provided.

@celuchmarek
Copy link
Member Author

pri pridaní podpory XHTML som aj trochu refactorol vyberanie XSLT z internetu. Nie úplne všetky XHTML budú fungovať, ale ak sa niektorá používa iba na zobrazenie alebo podpisovanie, nemá v sebe také špeci fičúrky, ktoré by nefungovali. Logicky by nefungovala editácia podania.

Comment on lines 496 to 505
filterIfExist(entries, e -> e.mediaDestination().equals("sign"));
filterIfExist(entries, e -> List.of("HTML", "XHTML").contains(e.destinationType()));
filterIfExist(entries, e -> e.mediaDestination().equals("view"));
filterIfExist(entries, e -> e.destinationType().equals("XHTML"));

if (entries.stream().filter(entry -> entry.mediaDesination().equals("sign")).count() > 0)
entries.removeIf(entry -> !entry.mediaDesination().equals("sign"));
filterIfExist(entries, e -> e.language().equals("sk"));
filterIfExist(entries, e -> e.language().equals("en"));

if (entries.stream().filter(entry -> entry.destinationType().equals("XHTML")).count() > 0)
entries.removeIf(entry -> !entry.destinationType().equals("XHTML"));

else if (entries.stream().filter(entry -> entry.destinationType().equals("HTML")).count() > 0)
entries.removeIf(entry -> !entry.destinationType().equals("HTML"));

else if (entries.stream().filter(entry -> entry.destinationType().equals("TXT")).count() > 0)
entries.removeIf(entry -> !entry.destinationType().equals("TXT"));

if (entries.stream().filter(entry -> entry.language().equals("sk")).count() > 0)
entries.removeIf(entry -> !entry.language().equals("sk"));

else if (entries.stream().filter(entry -> entry.language().equals("en")).count() > 0)
entries.removeIf(entry -> !entry.language().equals("en"));
return entries.stream().findFirst().orElse(null);
}
Copy link
Member

Choose a reason for hiding this comment

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

Toto pre mna je trosku zle citatelne kedze ta metoda "mutuje" entries. Predtym som videl, ze najprv sa hlada sign potom xhtml potom html a potom txt. Tu to nevidim.

Copy link
Member Author

Choose a reason for hiding this comment

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

mne tam vadilo, že sa príliš veľa opakovalo. Rozumiem, že metódy, ktoré menia parametre sú nešťastné. Ako kompromis by som metóde filterIfExist dal return type entries a nebude meniť tie entries v parametri ale ich kópiu.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants