Examples of Article


Examples of org.blueoxygen.aconix.entity.Article

      addActionError("Status is required");
    }
    if(hasActionErrors()){
      return INPUT;
    }
    Article article;
    LogInformation logInfo;
    if("".equalsIgnoreCase(getArticle().getId())){
      logInfo = new LogInformation();
      article = new Article();
      logInfo.setCreateBy(sess.getCurrentUser().getId());
      logInfo.setCreateDate(new Timestamp(System.currentTimeMillis()));
      setMsg("Add");
    }else {
      article = (Article) getManager().getById(Article.class, getArticle().getId());
      logInfo = article.getLogInformation();
      setMsg("update");
     
    }
    if(getCategoryId() != null && !"".equalsIgnoreCase(getCategoryId())){
      ACategory = (ArticleCategory) getManager().getById(ArticleCategory.class, getCategoryId());
    }else{
      ACategory = null;
    }
   
    logInfo.setActiveFlag(getStatus());
    logInfo.setLastUpdateDate(new Timestamp(System.currentTimeMillis()));
   
    article.setName(getArticle().getName());
    article.setAbstrak(getArticle().getAbstrak());
    article.setDescription(getArticle().getDescription());
    article.setCategoryId(ACategory);
    article.setLogInformation(logInfo);
    getManager().save(article);
   
   
    return SUCCESS;
  }
View Full Code Here

Examples of org.j2cms.model.article.Article

  @Actions({
    @Action("save")
  })
  public String save(){
    this.entity.setArticle (new Article(articleID));
    this.entity.setUser(new User(userID));
    entityService.save(this.entity);
    return SUCCESS;
  }
View Full Code Here

Examples of org.jabusuite.article.Article

    /* (non-Javadoc)
     * @see org.jabusuite.article.session.ArticlesRemote#findDataset(long)
     */
    public Article findDataset(long id, boolean withAdditionalData) {
        logger.debug("Looking for article " + id);
        Article article = (Article) manager.find(Article.class, (long) id);
        if ((withAdditionalData) && (article != null)) {
            //Retrieve the prices and groups
            if (article.getPrices() == null) {
                article.setPrices(new LinkedHashSet<ArticlePrice>());
            }
            logger.debug("Prices: " + article.getPrices().size());
            if (article.getArticleGroups() == null) {
                article.setArticleGroups(new LinkedHashSet<ArticleGroup>());
            }
            logger.debug("Groups: " + article.getArticleGroups());
        }
        return article;
    }
View Full Code Here

Examples of org.javalite.activejdbc.test_models.Article

    }

    @Test
    public void shouldAddPolymorphicChild() {
        deleteAndPopulateTables("articles", "posts", "comments");
        Article a = Article.findById(1);
        a.add(Comment.create("author", "ipolevoy", "content", "this is just a test comment text"));
        a(Comment.findAll().get(0).get("author")).shouldBeEqual("ipolevoy");
    }
View Full Code Here

Examples of org.milyn.javabean.performance.model.Article

      Order order = new Order();
      order.number = nmb + "-" + 1;
      order.price = 10.20;
      order.size = 4;
     
      order.article = new Article();
      order.article.id = "1235467";
      order.article.name = "article" + nmb;
      order.article.price = 2.30;
     
      c.orders.add(order);
     
      order = new Order();
      order.number = nmb + "-" + 2;
      order.price = 10.20;
      order.size = 4;
     
      order.article = new Article();
      order.article.id = "1235467";
      order.article.name = "article" + nmb;
      order.article.price = 2.30;
     
      c.orders.add(order);
View Full Code Here

Examples of org.mizartools.system.Article

        progressBarMML.setValue(0);
        progressBarMML.setIndeterminate(false);
        progressBarExecutable.setMaximum(100);
        progressBarExecutable.setValue(0);
      progressBarExecutable.setIndeterminate(false);
        Article article = null;
        String articleName = null;
        String fileName = null;
        int progress = 0;
      try {
        boolean error = false;
          for (String aid : articleList){
            if (!error){
              temporaryDirectory.clear();
              article = ArticleFactory.getInstance().getArticle(aid);
              articleName = article.getAid().toLowerCase();
            textArea.append((articleName+"        ").substring(0,10)+" : ");
              textArea.repaint();
              textArea.setCaretPosition(textArea.getText().length()-1);
            File sourceFile = new File(mmlPath, articleName+".miz");
            File destinationFile = new File(workDirectory, articleName+".miz");
View Full Code Here

Examples of org.mongodb.morphia.testmodel.Article

    @Test
    public void testMaps() throws Exception {
        final DBCollection articles = getDb().getCollection("articles");
        getMorphia().map(Article.class).map(Translation.class).map(Circle.class);

        final Article related = new Article();
        final BasicDBObject relatedDbObj = (BasicDBObject) getMorphia().toDBObject(related);
        articles.save(relatedDbObj);

        final Article relatedLoaded = getMorphia().fromDBObject(Article.class,
                                                                articles.findOne(new BasicDBObject(Mapper.ID_KEY,
                                                                                                   relatedDbObj.get(Mapper.ID_KEY))),
                                                                new DefaultEntityCache());

        final Article article = new Article();
        article.setTranslation("en", new Translation("Hello World", "Just a test"));
        article.setTranslation("is", new Translation("Halló heimur", "Bara að prófa"));

        article.setAttribute("myDate", new Date());
        article.setAttribute("myString", "Test");
        article.setAttribute("myInt", 123);

        article.putRelated("test", relatedLoaded);

        final BasicDBObject articleDbObj = (BasicDBObject) getMorphia().toDBObject(article);
        articles.save(articleDbObj);

        final Article articleLoaded = getMorphia().fromDBObject(Article.class,
                                                                articles.findOne(
                                                                                    new BasicDBObject(Mapper.ID_KEY,
                                                                                                      articleDbObj.get(Mapper.ID_KEY))),
                                                                new DefaultEntityCache());

        assertEquals(article.getTranslations().size(), articleLoaded.getTranslations().size());
        assertEquals(article.getTranslation("en").getTitle(), articleLoaded.getTranslation("en").getTitle());
        assertEquals(article.getTranslation("is").getBody(), articleLoaded.getTranslation("is").getBody());
        assertEquals(article.getAttributes().size(), articleLoaded.getAttributes().size());
        assertEquals(article.getAttribute("myDate"), articleLoaded.getAttribute("myDate"));
        assertEquals(article.getAttribute("myString"), articleLoaded.getAttribute("myString"));
        assertEquals(article.getAttribute("myInt"), articleLoaded.getAttribute("myInt"));
        assertEquals(article.getRelated().size(), articleLoaded.getRelated().size());
        assertEquals(article.getRelated("test").getId(), articleLoaded.getRelated("test").getId());
    }
View Full Code Here

Examples of org.nightlabs.jfire.trade.Article

    Collection<DirtyObjectID> res = null;
    PersistenceManager pm = event.getPersistenceManager();
    iterateDirtyObjectIDs: for (DirtyObjectID dirtyObjectID : event.getDirtyObjectIDs()) {
      boolean add = false;

      Article article = null;
      try {
        article = (Article) pm.getObjectById(dirtyObjectID.getObjectID());
      } catch (JDOObjectNotFoundException x) {
        // the object has already been deleted => we ignore it if this filter isn't for deleted objects (which it should never be as deletion should tracked using implicit listeners as best practice)
        for (JDOLifecycleState state : jdoLifecycleStates) {
          if (JDOLifecycleState.DELETED.equals(state))
            add = true;
          else
            continue iterateDirtyObjectIDs;
        }
      }

      if (articleContainerID instanceof OrderID) {
        if (articleContainerID.equals(article.getOrderID()))
          add = true;
      }
      else if (articleContainerID instanceof OfferID) {
        if (articleContainerID.equals(article.getOfferID()))
          add = true;
      }
      else if (articleContainerID instanceof InvoiceID) {
        if (articleContainerID.equals(article.getInvoiceID()))
          add = true;
      }
      else if (articleContainerID instanceof DeliveryNoteID) {
        if (articleContainerID.equals(article.getDeliveryNoteID()))
          add = true;
      }
      else
        throw new IllegalStateException("articleContainerID is an instance of an unsupported class: " + articleContainerID);
View Full Code Here

Examples of org.nuxeo.ecm.social.workspace.adapters.Article

                ARTICLE_TYPE);
        assertNotNull(article);
        article = session.createDocument(article);
        session.save();

        Article adapter = article.getAdapter(Article.class);
        assertNotNull(adapter);
        assertNotNull(adapter.getCreated());
    }
View Full Code Here

Examples of org.objectweb.speedo.pobjects.inheritance.ejboo.Article

    pm.currentTransaction().begin();
    Catalogue cat = null;
    int nbCat = 0;
    Marche mar= null;
    int nbMar = 0;
    Article a;
    for(int idArt=0; idArt<NB_ARTICLE; idArt++) {
      if ((idArt / CATLAOGUE_SIZE) == nbCat) {
        cat = new Catalogue();
        pm.makePersistent(cat);
        nbCat ++;
      }
      if ((idArt / MARCHE_SIZE) == nbMar) {
        mar = new Marche();
        pm.makePersistent(mar);
        nbMar ++;
      }
      if ((idArt % 2) == 0) { //pair
        a = new Service(idArt);
      } else { //impair
        a = new Materiel(idArt);
      }
      pm.makePersistent(a);
      a.setCatalogue(cat);
      mar.getArticles().add(a);
    }
    pm.currentTransaction().commit();

    a = null;
    cat = null;
    mar = null;
    pm.evictAll();

    Article a2 = null;
   
    Extent extent = pm.getExtent(Catalogue.class, true);
    Iterator it = extent.iterator();
    while(it.hasNext()) {
      cat = (Catalogue) it.next();
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.