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;
}
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;
}
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;
}
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;
}
}
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;
}
}
}
Aggregations