Search in sources :

Example 1 with TbSysIcon

use of com.netsteadfast.greenstep.po.hbm.TbSysIcon in project bamboobsc by billchen198318.

the class IconUtils method getUrl.

public static String getUrl(String basePath, String iconId) throws ServiceException, Exception {
    String url = "";
    if (StringUtils.isBlank(iconId)) {
        return url;
    }
    TbSysIcon sysIcon = new TbSysIcon();
    sysIcon.setIconId(iconId);
    sysIcon = sysIconService.findByEntityUK(sysIcon);
    if (sysIcon != null && StringUtils.defaultString(sysIcon.getFileName()).trim().length() > 0) {
        url = basePath + "/" + ICON_FOLDER + StringUtils.defaultString(sysIcon.getFileName());
    }
    return url;
}
Also used : TbSysIcon(com.netsteadfast.greenstep.po.hbm.TbSysIcon)

Example 2 with TbSysIcon

use of com.netsteadfast.greenstep.po.hbm.TbSysIcon in project bamboobsc by billchen198318.

the class IconUtils method getIconsSelectData.

public static Map<String, String> getIconsSelectData() throws ServiceException, Exception {
    Map<String, String> dataMap = new LinkedHashMap<String, String>();
    List<TbSysIcon> iconList = sysIconService.findListByParams(null);
    if (null == iconList || iconList.size() < 1) {
        return dataMap;
    }
    for (TbSysIcon entity : iconList) {
        String label = "<img src='./icons/" + entity.getFileName() + "' border='0'/>&nbsp;" + entity.getIconId();
        dataMap.put(entity.getOid(), label);
    }
    return dataMap;
}
Also used : TbSysIcon(com.netsteadfast.greenstep.po.hbm.TbSysIcon) LinkedHashMap(java.util.LinkedHashMap)

Example 3 with TbSysIcon

use of com.netsteadfast.greenstep.po.hbm.TbSysIcon in project bamboobsc by billchen198318.

the class ConfigJsAction method putImagePreload.

private void putImagePreload(StringBuilder sb) throws Exception {
    List<TbSysIcon> searchList = sysIconService.findListByParams(null);
    sb.append("var _coreIconsList = [");
    for (int i = 0; searchList != null && i < searchList.size(); i++) {
        TbSysIcon sysIcon = searchList.get(i);
        sb.append("\"./icons/").append(sysIcon.getFileName()).append("\"");
        if ((i + 1) < searchList.size()) {
            sb.append(",");
        }
    }
    sb.append("];");
    sb.append("\n");
    sb.append("var _coreIconsIdList = [");
    for (int i = 0; searchList != null && i < searchList.size(); i++) {
        TbSysIcon sysIcon = searchList.get(i);
        sb.append("\"").append(sysIcon.getIconId()).append("\"");
        if ((i + 1) < searchList.size()) {
            sb.append(",");
        }
    }
    sb.append("];");
    sb.append("\n");
}
Also used : TbSysIcon(com.netsteadfast.greenstep.po.hbm.TbSysIcon)

Example 4 with TbSysIcon

use of com.netsteadfast.greenstep.po.hbm.TbSysIcon in project bamboobsc by billchen198318.

the class ApplicationSystemManagementAction method loadSysData.

private void loadSysData() throws ServiceException, Exception {
    this.transformFields2ValueObject(this.sys, new String[] { "oid" });
    DefaultResult<SysVO> result = this.sysService.findObjectByOid(this.sys);
    if (result.getValue() == null) {
        throw new ServiceException(result.getSystemMessage().getValue());
    }
    this.sys = result.getValue();
    TbSysIcon sysIcon = new TbSysIcon();
    sysIcon.setIconId(sys.getIcon());
    sysIcon = this.sysIconService.findByEntityUK(sysIcon);
    if (sysIcon != null) {
        this.editIconValue = super.defaultString(sysIcon.getOid());
    }
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) TbSysIcon(com.netsteadfast.greenstep.po.hbm.TbSysIcon) SysVO(com.netsteadfast.greenstep.vo.SysVO)

Example 5 with TbSysIcon

use of com.netsteadfast.greenstep.po.hbm.TbSysIcon in project bamboobsc by billchen198318.

the class SystemProgramManagementAction method loadSysProgData.

/**
	 * 修改模式載入 TB_SYS_PROG 資料
	 * 
	 * @throws ServiceException
	 * @throws Exception
	 */
private void loadSysProgData() throws ServiceException, Exception {
    this.transformFields2ValueObject(this.sysProg, new String[] { "oid" });
    DefaultResult<SysProgVO> result = this.sysProgService.findObjectByOid(this.sysProg);
    if (result.getValue() == null) {
        throw new ServiceException(result.getSystemMessage().getValue());
    }
    this.sysProg = result.getValue();
    TbSysIcon sysIcon = new TbSysIcon();
    sysIcon.setIconId(sysProg.getIcon());
    sysIcon = this.sysIconService.findByEntityUK(sysIcon);
    if (sysIcon != null) {
        this.editIconValue = sysIcon.getOid();
    }
    TbSys sys = new TbSys();
    sys.setSysId(this.sysProg.getProgSystem());
    sys = this.sysService.findByEntityUK(sys);
    if (sys != null) {
        this.editProgSystemValue = sys.getOid();
    }
}
Also used : TbSys(com.netsteadfast.greenstep.po.hbm.TbSys) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) TbSysIcon(com.netsteadfast.greenstep.po.hbm.TbSysIcon) SysProgVO(com.netsteadfast.greenstep.vo.SysProgVO)

Aggregations

TbSysIcon (com.netsteadfast.greenstep.po.hbm.TbSysIcon)5 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)2 TbSys (com.netsteadfast.greenstep.po.hbm.TbSys)1 SysProgVO (com.netsteadfast.greenstep.vo.SysProgVO)1 SysVO (com.netsteadfast.greenstep.vo.SysVO)1 LinkedHashMap (java.util.LinkedHashMap)1