Examples of Syndication


Examples of com.jada.jpa.entity.Syndication

        query.setParameter("siteId", siteId);
        Vector<SyndicationDisplayForm> vector = new Vector<SyndicationDisplayForm>();
        Iterator<?> iterator = query.getResultList().iterator();
        int count = 0;
        while (iterator.hasNext()) {
          Syndication syndication = (Syndication) iterator.next();
          SyndicationDisplayForm displayForm = new SyndicationDisplayForm();
          displayForm.setIndex(Format.getInt(count));
          displayForm.setSynId(Format.getLong(syndication.getSynId()));
          displayForm.setSynUrl(syndication.getSynUrl());
          displayForm.setActive(syndication.getActive().equals(Constants.VALUE_YES));
          vector.add(displayForm);
          count++;
        }
        for (int i = vector.size(); i < SYNDICATION_COUNT; i++) {
          SyndicationDisplayForm displayForm = new SyndicationDisplayForm();
View Full Code Here

Examples of com.jada.jpa.entity.Syndication

        SyndicationDisplayForm displayForms[] = form.getSyns();
        for (int i = 0; i < displayForms.length; i++) {
          SyndicationDisplayForm displayForm = displayForms[i];
          if (displayForm.getSynId().length() > 0) {
          Syndication syndication = SyndicationDAO.load(site.getSiteId(), Format.getLong(displayForm.getSynId()));
            if (displayForm.getSynUrl().trim().length() == 0) {
              displayForm.setSynId("");
              em.remove(syndication);
            }
            else {
              syndication.setSeqNum(i);
              syndication.setSynUrl(displayForm.getSynUrl().trim());
              syndication.setActive(displayForm.isActive() ? Constants.ACTIVE_YES : Constants.ACTIVE_NO);
              syndication.setRecUpdateBy(adminBean.getUser().getUserId());
              syndication.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
              // em.update(syndication);
            }
          }
          else {
            if (displayForm.getSynUrl().trim().length() > 0) {
              Syndication syndication = new Syndication();
              syndication.setSite(site);
              syndication.setSeqNum(i);
                 syndication.setSynUrl(displayForm.getSynUrl().trim());
              syndication.setActive(displayForm.isActive() ? Constants.ACTIVE_YES : Constants.ACTIVE_NO);
              syndication.setRecUpdateBy(adminBean.getUser().getUserId());
              syndication.setRecUpdateDatetime(new Date(System.currentTimeMillis()));
              syndication.setRecCreateBy(adminBean.getUser().getUserId());
              syndication.setRecCreateDatetime(new Date(System.currentTimeMillis()));
              em.persist(syndication);
            }
          }
        }
        if (SyndReader.hasInstance(site.getSiteId())) {
View Full Code Here

Examples of com.jada.jpa.entity.Syndication

    query.setParameter("siteId", siteId);
    query.setParameter("active", String.valueOf(Constants.VALUE_YES));
    Iterator<?> it = query.getResultList().iterator();
    Vector<String> urls = new Vector<String>();
    while (it.hasNext()) {
      Syndication syndication = (Syndication) it.next();
      urls.add(syndication.getSynUrl());
    }

    // TODO read proxy information from database
    String proxyHost = null;
    String proxyPort = "8080";
View Full Code Here

Examples of com.jada.jpa.entity.Syndication

public class SyndicationDAO extends Syndication {
  private static final long serialVersionUID = -4489010877809947109L;
  public static Syndication load(String siteId, Long syndicationId) throws SecurityException, Exception {
      EntityManager em = JpaConnection.getInstance().getCurrentEntityManager();
    Syndication syndication = (Syndication) em.find(Syndication.class, syndicationId);
    if (!syndication.getSiteId().equals(siteId)) {
      throw new SecurityException();
    }
    return syndication;
  }
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.