Search in sources :

Example 6 with CfClasscontent

use of io.clownfish.clownfish.dbentities.CfClasscontent in project Clownfish by rawdog71.

the class CfClasscontentDAOImpl method findByMaintenance.

@Override
public List<CfClasscontent> findByMaintenance(boolean maintenance) {
    Session session = this.sessionFactory.getCurrentSession();
    TypedQuery query = (TypedQuery) session.getNamedQuery("CfClasscontent.findByMaintenance");
    query.setParameter("maintenance", maintenance);
    List<CfClasscontent> cfclasscontentlist = query.getResultList();
    return cfclasscontentlist;
}
Also used : TypedQuery(javax.persistence.TypedQuery) CfClasscontent(io.clownfish.clownfish.dbentities.CfClasscontent) Session(org.hibernate.Session)

Example 7 with CfClasscontent

use of io.clownfish.clownfish.dbentities.CfClasscontent in project Clownfish by rawdog71.

the class CfClasscontentDAOImpl method findAll.

@Override
public List<CfClasscontent> findAll() {
    Session session = this.sessionFactory.getCurrentSession();
    TypedQuery query = (TypedQuery) session.getNamedQuery("CfClasscontent.findAll");
    List<CfClasscontent> cfclasscontentlist = query.getResultList();
    return cfclasscontentlist;
}
Also used : TypedQuery(javax.persistence.TypedQuery) CfClasscontent(io.clownfish.clownfish.dbentities.CfClasscontent) Session(org.hibernate.Session)

Example 8 with CfClasscontent

use of io.clownfish.clownfish.dbentities.CfClasscontent in project Clownfish by rawdog71.

the class CfClasscontentDAOImpl method findByScrapped.

@Override
public List<CfClasscontent> findByScrapped(boolean scrapped) {
    Session session = this.sessionFactory.getCurrentSession();
    TypedQuery query = (TypedQuery) session.getNamedQuery("CfClasscontent.findByScrapped");
    query.setParameter("scrapped", scrapped);
    List<CfClasscontent> cfclasscontentlist = query.getResultList();
    return cfclasscontentlist;
}
Also used : TypedQuery(javax.persistence.TypedQuery) CfClasscontent(io.clownfish.clownfish.dbentities.CfClasscontent) Session(org.hibernate.Session)

Example 9 with CfClasscontent

use of io.clownfish.clownfish.dbentities.CfClasscontent in project Clownfish by rawdog71.

the class CfClasscontentDAOImpl method findById.

@Override
public CfClasscontent findById(Long id) {
    Session session = this.sessionFactory.getCurrentSession();
    TypedQuery query = (TypedQuery) session.getNamedQuery("CfClasscontent.findById");
    query.setParameter("id", id);
    CfClasscontent cfclasscontent = (CfClasscontent) query.getSingleResult();
    if (!cfclasscontent.isScrapped()) {
        return cfclasscontent;
    } else {
        return null;
    }
}
Also used : TypedQuery(javax.persistence.TypedQuery) CfClasscontent(io.clownfish.clownfish.dbentities.CfClasscontent) Session(org.hibernate.Session)

Example 10 with CfClasscontent

use of io.clownfish.clownfish.dbentities.CfClasscontent in project Clownfish by rawdog71.

the class SiteTreeBean method onSelectLayoutDatalist.

/**
 * Selects a Datalist
 * @param event
 */
public void onSelectLayoutDatalist(SelectEvent event) {
    CfList selected_datalist = (CfList) event.getObject();
    previewDatalistOutput = "";
    for (CfListcontent datalistcontent : cflistcontentService.findByListref(selected_datalist.getId())) {
        CfClasscontent cc = cfclasscontentService.findById(datalistcontent.getCfListcontentPK().getClasscontentref());
        String template = templateUtility.getVersion(cc.getClassref().getTemplateref().getId(), cftemplateversionService.findMaxVersion(cc.getClassref().getTemplateref().getId()));
        if (null != cc) {
            attributcontentlist = cfattributcontentService.findByClasscontentref(cc);
            // String output = cc.getClassref().getTemplateref().getContent();
            for (CfAttributcontent attributcontent : attributcontentlist) {
                template = template.replaceAll("#" + attributcontent.getAttributref().getName() + "#", attributcontent.toString());
            }
            previewDatalistOutput += template;
        }
    }
}
Also used : CfList(io.clownfish.clownfish.dbentities.CfList) CfAttributcontent(io.clownfish.clownfish.dbentities.CfAttributcontent) CfListcontent(io.clownfish.clownfish.dbentities.CfListcontent) CfClasscontent(io.clownfish.clownfish.dbentities.CfClasscontent)

Aggregations

CfClasscontent (io.clownfish.clownfish.dbentities.CfClasscontent)45 CfAttributcontent (io.clownfish.clownfish.dbentities.CfAttributcontent)24 CfListcontent (io.clownfish.clownfish.dbentities.CfListcontent)22 CfList (io.clownfish.clownfish.dbentities.CfList)21 Map (java.util.Map)16 ArrayList (java.util.ArrayList)15 HashMap (java.util.HashMap)15 Gson (com.google.gson.Gson)13 CfClass (io.clownfish.clownfish.dbentities.CfClass)13 IOException (java.io.IOException)13 List (java.util.List)12 CfAttributService (io.clownfish.clownfish.serviceinterface.CfAttributService)9 CfAttributcontentService (io.clownfish.clownfish.serviceinterface.CfAttributcontentService)9 CfClassService (io.clownfish.clownfish.serviceinterface.CfClassService)9 CfClasscontentService (io.clownfish.clownfish.serviceinterface.CfClasscontentService)9 Autowired (org.springframework.beans.factory.annotation.Autowired)9 CfAttributetypeService (io.clownfish.clownfish.serviceinterface.CfAttributetypeService)8 CfListService (io.clownfish.clownfish.serviceinterface.CfListService)8 Session (org.hibernate.Session)8 Logger (org.slf4j.Logger)8