Esempio n. 1
0
 static void clearRevs(TranslationsResource doc) {
   doc.setRevision(null);
   for (TextFlowTarget tft : doc.getTextFlowTargets()) {
     tft.setRevision(null);
     tft.setTextFlowRevision(null);
   }
 }
 private static void addSampleTranslation(TranslationsResource translations, String resId) {
   TextFlowTarget target = new TextFlowTarget(resId);
   target.setRevision(1);
   target.setState(ContentState.Translated);
   target.setContents("translated " + resId);
   translations.getTextFlowTargets().add(target);
 }
  public TranslationsResource getAllExtension() {
    TranslationsResource sr = getPoTargetHeaderTextFlowTargetTest();
    TextFlowTarget stf = sr.getTextFlowTargets().get(0);

    SimpleComment simpleComment = new SimpleComment("textflowtarget comment");

    stf.getExtensions(true).add(simpleComment);
    return sr;
  }
 public TranslationsResource getTestObject() {
   TranslationsResource entity = new TranslationsResource();
   TextFlowTarget target = new TextFlowTarget("rest1");
   target.setContents("hello world");
   target.setState(ContentState.Approved);
   target.setTranslator(new Person("root@localhost", "Administrator"));
   // for the convenience of test
   target.getExtensions(true);
   entity.getTextFlowTargets().add(target);
   entity.getExtensions(true);
   return entity;
 }
 public TranslationsResource getTestObject2() {
   TranslationsResource entity = new TranslationsResource();
   TextFlowTarget target = new TextFlowTarget("rest1");
   target.setContents("hello world");
   target.setState(ContentState.Approved);
   target.setTranslator(new Person("root@localhost", "Administrator"));
   target.getExtensions(true);
   TextFlowTarget target2 = new TextFlowTarget("rest2");
   target2.setContents("greeting world");
   target2.setState(ContentState.Approved);
   target2.setTranslator(new Person("root@localhost", "Administrator"));
   target2.getExtensions(true);
   entity.getTextFlowTargets().add(target2);
   entity.getExtensions(true);
   log.debug(entity.toString());
   return entity;
 }