Examples of CodeType


Examples of com.iisigroup.cap.base.model.CodeType

    return dao.find(oid);
  }

  @Override
  public void deleteById(String oid) {
    CodeType codeType = dao.find(oid);
    if (codeType != null) {
      dao.delete(codeType);
    }
  }
View Full Code Here

Examples of com.iisigroup.cap.base.model.CodeType

  @CapAuditLogAction(functionCode=CapFunctionCode.F101, actionType = CapActionTypeEnum.Update)
  public IResult modify(IRequest request) {
    AjaxFormResult result = new AjaxFormResult();
    String type = request.get("type");
    String locale = CapSecurityContext.getLocale().toString();
    CodeType code = codeTypeService.getByCodeTypeAndValue(
        request.get("codeType"), request.get("codeValue"), locale);

    if ("A".equals(type)) {
      if (code != null) {
        // codetype.0001 代碼重覆!
        throw new CapMessageException(
            CapAppContext.getMessage("codetype.0001"), getClass());
      }
      code = new CodeType();
    } else {
      if (code != null && !code.getOid().equals(request.get("oid"))) {
        // codetype.0001 代碼重覆!
        throw new CapMessageException(
            CapAppContext.getMessage("codetype.0001"), getClass());
      } else if (code == null) {
        code = codeTypeService.getById(request.get("oid"));
      }
    }
    CapBeanUtil.map2Bean(request, code, CodeType.class);
    if ("A".equals(type)) {
      code.setOid(null);
    }
    code.setUpdater(CapSecurityContext.getUserId());
    code.setUpdateTime(CapDate.getCurrentTimestamp());
    codeTypeService.saveCodeType(code);
    return result;
  }
View Full Code Here

Examples of com.iisigroup.cap.base.model.CodeType

        int minLen = Integer.parseInt(parmPwdMinLen.getParmValue());
        int maxHistory = Integer.parseInt(parmPwdMaxHistory.getParmValue());
        int changeInteval = Integer.parseInt(parmPwdChangeInteval
                .getParmValue());
        String ruleType = parmPwdRule.getParmValue();
        CodeType rule = codeTypeDao.findByCodeTypeAndCodeValue("pwdrule",
                ruleType, CapSecurityContext.getLocale().toString());
        if (StringUtils.isBlank(password) || StringUtils.isBlank(password2)) {
            throw new CapMessageException(CapAppContext.getMessage("error.001",
                    new Object[] {}), getClass());
        }
        if (!password.equals(password2) || password.length() < minLen) {
            throw new CapMessageException(CapAppContext.getMessage("error.002",
                    new Object[] { minLen }), getClass());
        }
        if (userId.equalsIgnoreCase(password)) {
            throw new CapMessageException(CapAppContext.getMessage("error.004",
                    new Object[] { minLen }), getClass());
        }
        // pwd history validate
        User user = userDao.findByCode(userId);
        if (user != null) {
            List<PwdLog> list = userPwdHistoryDao.findByUserCode(
                    user.getOid(), maxHistory);
            int i = 0;
            PasswordEncoder passwordEncoder = new StandardPasswordEncoder(
                    userId);
            for (PwdLog h : list) {
                // user status 不為 1 時,check change interval: 最近一次變更不得小於間隔
                if (i == 0 && !"1".equals(user.getStatus()) && !forcePwdChange) {
                    if (CapDate.calculateDays(Calendar.getInstance().getTime(),
                            h.getUpdateTime()) <= changeInteval) {
                        throw new CapMessageException(CapAppContext.getMessage(
                                "error.005", new Object[] { changeInteval }),
                                getClass());
                    }
                }
                if (passwordEncoder.matches(password, h.getPassword())) {
                    throw new CapMessageException(CapAppContext.getMessage(
                            "error.003", new Object[] { maxHistory }),
                            getClass());
                }
                i++;
            }
        }
        String pattern = null;
        switch (Integer.parseInt(ruleType)) {
        case 1:
            pattern = "^(?=.*[0-9])(?=.*[a-zA-Z])(?=\\S+$).{" + minLen + ",}$";
            break;
        case 2:
            pattern = "^(?=.*[0-9])(?=.*[a-zA-Z])(?=.*[!@#$%^&()_-])(?=\\S+$).{"
                    + minLen + ",}$";
            break;
        case 3:
            pattern = "^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=\\S+$).{" + minLen
                    + ",}$";
            break;
        case 4:
            pattern = "^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[!@#$%^&()_-])(?=\\S+$).{"
                    + minLen + ",}$";
            break;
        }
        if (pattern != null && !password.matches(pattern)) {
            throw new CapMessageException(CapAppContext.getMessage("error.008",
                    new Object[] { rule.getCodeDesc() }), getClass());
        }
        return true;
    }// ;
View Full Code Here

Examples of net.opengis.gml.CodeType

  
   * @generated modifiable
   */ 
  public Object parse(ElementInstance instance, Node node, Object value)
    throws Exception {
    CodeType code = Gml4wcsFactory.eINSTANCE.createCodeType();
   
    code.setValue((String)value);
   
    return code;
  }
View Full Code Here

Examples of net.opengis.gml.CodeType

   * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
   * @generated
   */
    public NotificationChain basicSetType(CodeType newType, NotificationChain msgs) {
    CodeType oldType = type;
    type = newType;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Wcs10Package.KEYWORDS_TYPE__TYPE, oldType, newType);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here

Examples of net.opengis.gml.CodeType

   * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
   * @generated
   */
    public NotificationChain basicSetCrs(CodeType newCrs, NotificationChain msgs) {
    CodeType oldCrs = crs;
    crs = newCrs;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Wcs10Package.OUTPUT_TYPE__CRS, oldCrs, newCrs);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here

Examples of net.opengis.gml.CodeType

   * <!-- begin-user-doc -->
     * <!-- end-user-doc -->
   * @generated
   */
    public NotificationChain basicSetFormat(CodeType newFormat, NotificationChain msgs) {
    CodeType oldFormat = format;
    format = newFormat;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Wcs10Package.OUTPUT_TYPE__FORMAT, oldFormat, newFormat);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here

Examples of net.opengis.gml.CodeType

        }
    }

    private OutputType parseOutputElement(final Map<String,String> kvp) throws Exception {
        final OutputType output = Wcs10Factory.eINSTANCE.createOutputType();
        final CodeType crsType = Gml4wcsFactory.eINSTANCE.createCodeType();
        final CodeType formatType = Gml4wcsFactory.eINSTANCE.createCodeType();

        // check and set format
        String format = (String) kvp.get("format");
        if (format == null)
            throw new WcsException("format parameter is mandatory", MissingParameterValue, "format");

        final String crsName = (String) (kvp.get("response_crs") != null ? kvp.get("response_crs") : kvp.get("crs"));
        CoordinateReferenceSystem crs = null;
        if (crsName != null) {
            crs = decodeCRS100(crsName);

            crsType.setValue(CRS.lookupIdentifier(crs, true));

            output.setCrs(crsType);
        }

        formatType.setValue(format);

        output.setFormat(formatType);

        return output;
    }
View Full Code Here

Examples of net.opengis.ows10.CodeType

        String abstract_ = (String) node.getChildValue("Abstract");
        String accessConstraints = (String) node.getChildValue("AccessConstraints");
        String fees = (String) node.getChildValue("Fees");
        // OnlineResource

        CodeType serviceType = ows10Factory.createCodeType();
        serviceType.setValue(name);
        service.setServiceType(serviceType);
       
        service.setServiceTypeVersion("1.0.0");
       
        service.setTitle(title);
View Full Code Here

Examples of net.opengis.ows10.CodeType

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetRole(CodeType newRole, NotificationChain msgs) {
    CodeType oldRole = role;
    role = newRole;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, Ows10Package.RESPONSIBLE_PARTY_SUBSET_TYPE__ROLE, oldRole, newRole);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
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.