Examples of GlossaryTerm


Examples of org.zanata.rest.dto.GlossaryTerm

            glossaryEntry.setSrcLang(hGlossaryEntry.getSrcLocale()
                    .getLocaleId());

            for (HGlossaryTerm hGlossaryTerm : hGlossaryEntry
                    .getGlossaryTerms().values()) {
                GlossaryTerm glossaryTerm = new GlossaryTerm();
                glossaryTerm.setContent(hGlossaryTerm.getContent());
                glossaryTerm.setLocale(hGlossaryTerm.getLocale().getLocaleId());

                for (HTermComment hTermComment : hGlossaryTerm.getComments()) {
                    glossaryTerm.getComments().add(hTermComment.getComment());
                }
                glossaryEntry.getGlossaryTerms().add(glossaryTerm);
            }
            glossary.getGlossaryEntries().add(glossaryEntry);
        }
View Full Code Here

Examples of org.zanata.rest.dto.GlossaryTerm

                    .getLocaleId());
            glossaryEntry.setSourcereference(hGlossaryEntry.getSourceRef());
            for (HGlossaryTerm hGlossaryTerm : hGlossaryEntry
                    .getGlossaryTerms().values()) {
                if (hGlossaryTerm.getLocale().getLocaleId().equals(locale)) {
                    GlossaryTerm glossaryTerm = new GlossaryTerm();
                    glossaryTerm.setContent(hGlossaryTerm.getContent());
                    glossaryTerm.setLocale(hGlossaryTerm.getLocale()
                            .getLocaleId());

                    for (HTermComment hTermComment : hGlossaryTerm
                            .getComments()) {
                        glossaryTerm.getComments().add(
                                hTermComment.getComment());
                    }
                    glossaryEntry.getGlossaryTerms().add(glossaryTerm);
                }
            }
View Full Code Here

Examples of org.zanata.rest.dto.GlossaryTerm

        Glossary glossary = new Glossary();
        GlossaryEntry glossaryEntry1 = new GlossaryEntry();
        glossaryEntry1.setSrcLang(LocaleId.EN_US);
        glossaryEntry1.setSourcereference("TEST SOURCE REF DATA");

        GlossaryTerm glossaryTerm1 = new GlossaryTerm();
        glossaryTerm1.setLocale(LocaleId.EN_US);
        glossaryTerm1.setContent("TEST DATA 1 EN_US");
        glossaryTerm1.getComments().add("COMMENT 1");

        GlossaryTerm glossaryTerm2 = new GlossaryTerm();
        glossaryTerm2.setLocale(LocaleId.DE);
        glossaryTerm2.setContent("TEST DATA 2 DE");
        glossaryTerm2.getComments().add("COMMENT 2");

        glossaryEntry1.getGlossaryTerms().add(glossaryTerm1);
        glossaryEntry1.getGlossaryTerms().add(glossaryTerm2);

        GlossaryEntry glossaryEntry2 = new GlossaryEntry();
        glossaryEntry2.setSrcLang(LocaleId.EN_US);
        glossaryEntry2.setSourcereference("TEST SOURCE REF DATA2");

        GlossaryTerm glossaryTerm3 = new GlossaryTerm();
        glossaryTerm3.setLocale(LocaleId.EN_US);
        glossaryTerm3.setContent("TEST DATA 3 EN_US");
        glossaryTerm3.getComments().add("COMMENT 3");

        GlossaryTerm glossaryTerm4 = new GlossaryTerm();
        glossaryTerm4.setLocale(LocaleId.DE);
        glossaryTerm4.setContent("TEST DATA 4 DE");
        glossaryTerm4.getComments().add("COMMENT 4");

        glossaryEntry2.getGlossaryTerms().add(glossaryTerm3);
        glossaryEntry2.getGlossaryTerms().add(glossaryTerm4);

        glossary.getGlossaryEntries().add(glossaryEntry1);
View Full Code Here

Examples of org.zanata.rest.dto.GlossaryTerm

        Glossary glossary = new Glossary();
        GlossaryEntry glossaryEntry1 = new GlossaryEntry();
        glossaryEntry1.setSrcLang(LocaleId.EN_US);
        glossaryEntry1.setSourcereference("TEST SOURCE REF DATA");

        GlossaryTerm glossaryTerm1 = new GlossaryTerm();
        glossaryTerm1.setLocale(LocaleId.EN_US);
        glossaryTerm1.setContent("test data content 1 (source lang)");
        glossaryTerm1.getComments().add("COMMENT 1");

        glossaryEntry1.getGlossaryTerms().add(glossaryTerm1);

        glossary.getGlossaryEntries().add(glossaryEntry1);
View Full Code Here

Examples of org.zanata.rest.dto.GlossaryTerm

                // Expected / Actual glossary terms
                Set<GlossaryTerm> actualTerms =
                        new HashSet<GlossaryTerm>(entry.getGlossaryTerms());

                Set<GlossaryTerm> expectedTerms = new HashSet<GlossaryTerm>();
                GlossaryTerm expTerm = new GlossaryTerm();
                expTerm.setLocale(LocaleId.EN_US);
                expTerm.setContent("test data content 1 (source lang)");
                expTerm.getComments().add("test data comment 1");
                expectedTerms.add(expTerm);

                expTerm = new GlossaryTerm();
                expTerm.setLocale(LocaleId.DE);
                expTerm.setContent("test data content 2");
                expTerm.getComments().add("test data comment 2");
                expectedTerms.add(expTerm);

                expTerm = new GlossaryTerm();
                expTerm.setLocale(LocaleId.ES);
                expTerm.setContent("test data content 3");
                expTerm.getComments().add("test data comment 3");
                expectedTerms.add(expTerm);

                assertThat(actualTerms, is(expectedTerms));
            }
        }.run();
View Full Code Here

Examples of org.zanata.rest.dto.GlossaryTerm

                // Expected / Actual glossary terms
                Set<GlossaryTerm> actualTerms =
                        new HashSet<GlossaryTerm>(entry.getGlossaryTerms());

                Set<GlossaryTerm> expectedTerms = new HashSet<GlossaryTerm>();
                GlossaryTerm expTerm = new GlossaryTerm();
                expTerm.setLocale(LocaleId.EN_US);
                expTerm.setContent("test data content 1 (source lang)");
                expTerm.getComments().add("test data comment 1");
                expectedTerms.add(expTerm);

                expTerm = new GlossaryTerm();
                expTerm.setLocale(LocaleId.DE);
                expTerm.setContent("test data content 2");
                expTerm.getComments().add("test data comment 2");
                expectedTerms.add(expTerm);

                expTerm = new GlossaryTerm();
                expTerm.setLocale(LocaleId.ES);
                expTerm.setContent("test data content 3");
                expTerm.getComments().add("test data comment 3");
                expectedTerms.add(expTerm);

                assertThat(actualTerms, is(expectedTerms));
            }
        }.run();
View Full Code Here

Examples of org.zanata.rest.dto.GlossaryTerm

        Glossary glossary = new Glossary();
        GlossaryEntry glossaryEntry1 = new GlossaryEntry();
        glossaryEntry1.setSrcLang(LocaleId.EN_US);
        glossaryEntry1.setSourcereference("TEST SOURCE REF DATA");

        GlossaryTerm glossaryTerm1 = new GlossaryTerm();
        glossaryTerm1.setLocale(LocaleId.EN_US);
        glossaryTerm1.setContent("TEST DATA 1 EN_US");
        glossaryTerm1.getComments().add("COMMENT 1");

        GlossaryTerm glossaryTerm2 = new GlossaryTerm();
        glossaryTerm2.setLocale(LocaleId.DE);
        glossaryTerm2.setContent("TEST DATA 2 DE");
        glossaryTerm2.getComments().add("COMMENT 2");

        glossaryEntry1.getGlossaryTerms().add(glossaryTerm1);
        glossaryEntry1.getGlossaryTerms().add(glossaryTerm2);

        GlossaryEntry glossaryEntry2 = new GlossaryEntry();
        glossaryEntry2.setSrcLang(LocaleId.EN_US);
        glossaryEntry2.setSourcereference("TEST SOURCE REF DATA2");

        GlossaryTerm glossaryTerm3 = new GlossaryTerm();
        glossaryTerm3.setLocale(LocaleId.EN_US);
        glossaryTerm3.setContent("TEST DATA 3 EN_US");
        glossaryTerm3.getComments().add("COMMENT 3");

        GlossaryTerm glossaryTerm4 = new GlossaryTerm();
        glossaryTerm4.setLocale(LocaleId.DE);
        glossaryTerm4.setContent("TEST DATA 4 DE");
        glossaryTerm4.getComments().add("COMMENT 4");

        glossaryEntry2.getGlossaryTerms().add(glossaryTerm3);
        glossaryEntry2.getGlossaryTerms().add(glossaryTerm4);

        glossary.getGlossaryEntries().add(glossaryEntry1);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.