Package org.apdplat.module.info.model

Examples of org.apdplat.module.info.model.InfoType


    @Resource(name="serviceFacade")
    private ServiceFacade serviceFacade;

   
    public String toRootJson(String lang){
        InfoType infoType=getRootInfoType();
        infoType.setLang(lang);
       
        if(infoType==null){
            LOG.error("获取根新闻类别失败!");
            return "";
        }
        StringBuilder json=new StringBuilder();
        json.append("[");

        json.append("{'text':'")
            .append(infoType.getInfoTypeName())
            .append("','id':'")
            .append(infoType.getId());
            if(infoType.getChild().isEmpty()){
                json.append("','leaf':true,'cls':'file'");
            }else{
                json.append("','leaf':false,'cls':'folder'");
            }
        json.append("}");
View Full Code Here


        json.append("]");
       
        return json.toString();
    }
    public String toJson(int infoTypeId, String lang){
        InfoType infoType=serviceFacade.retrieve(InfoType.class, infoTypeId);
        if(infoType==null){
            LOG.error("获取ID为 "+infoType+" 的新闻类别失败!");
            return "";
        }
        List<InfoType> child=infoType.getChild();
        if(child.isEmpty()){
            return "";
        }
        StringBuilder json=new StringBuilder();
        json.append("[");
View Full Code Here

    //方式二:使用IN语句
    @Override
    public PropertyCriteria buildPropertyCriteria(){
        PropertyCriteria propertyCriteria=new PropertyCriteria();
        if(infoTypeId>0){
            InfoType obj=getService().retrieve(InfoType.class, infoTypeId);
            //获取orgId的所有子机构的ID
            List<Integer> infoTypeIds=InfoTypeService.getChildIds(obj);
            //加上orgId
            infoTypeIds.add(obj.getId());
           
            PropertyEditor pe=new PropertyEditor("infoType.id", Operator.in, PropertyType.List, infoTypeIds);
            propertyCriteria.addPropertyEditor(pe);
           
            return propertyCriteria;
View Full Code Here

TOP

Related Classes of org.apdplat.module.info.model.InfoType

Copyright © 2018 www.massapicom. 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.