private void setRealProfileCondition( RealProfilePerson realPerson, StringBuffer query, List<Object> params) { if (realPerson.getProfile() != null) { if (StringUtils.isNotEmpty(realPerson.getProfile().getTitle())) { query.append(" AND UPPER(realPerson.profile.title) LIKE ?"); params.add("%" + realPerson.getProfile().getTitle().toUpperCase() + "%"); } if (realPerson.getProfile().getNationality() != null) { query.append(" AND realPerson.profile.nationality = ?"); params.add(realPerson.getProfile().getNationality()); } if (StringUtils.isNotEmpty(realPerson.getProfile().getUserName())) { query.append(" AND UPPER(realPerson.profile.userName) LIKE ?"); params.add("%" + realPerson.getProfile().getUserName().toUpperCase() + "%"); } if (realPerson.getProfile().getStatus() != 0) { query.append(" AND realPerson.profile.status = ?"); params.add(realPerson.getProfile().getStatus()); } if (realPerson.getProfile().getUserType() != 0) { query.append(" AND realPerson.profile.userType = ?"); params.add(realPerson.getProfile().getUserType()); } if (realPerson.getProfile().getRegisterType() != 0) { query.append(" AND realPerson.profile.registerType = ?"); params.add(realPerson.getProfile().getRegisterType()); } if (realPerson.getProfile().getMembershipNo() != null) { query.append(" AND realPerson.profile.membershipNo = ?"); params.add(realPerson.getProfile().getMembershipNo()); } if (realPerson.getProfile().getActivationDate() != null) { query.append(" AND realPerson.profile.activationDate = ?"); params.add(realPerson.getProfile().getActivationDate()); } if (realPerson.getProfile().getExpirationDate() != null) { query.append(" AND realPerson.profile.expirationDate = ?"); params.add(realPerson.getProfile().getExpirationDate()); } if (realPerson.getProfile().getRfidTag() != null) { query.append(" AND realPerson.profile.rfidTag = ?"); params.add(realPerson.getProfile().getRfidTag()); } if (realPerson.getProfile().getRegisterDate() != null) { query.append(" AND realPerson.profile.registerDate = ?"); params.add(realPerson.getProfile().getRegisterDate()); } } }
@Override @SuppressWarnings("unchecked") protected void _populate() { _tableModel = (List<TermDataEntryBean>) (JsfUtils.getFromPageFlow(panelName)); if (_tableModel == null || _tableModel.size() == 0) { super._populate(); TreeNodeWrapper subField2 = null; /*QUALIFIER ELEMENT - $9*/ for (int i = 0; i < fieldList.size(); i++) { TreeModelWrapper fld = fieldList.get(i); subField = WorksheetWebUtils.findTreeNodeWrapperSubFieldByTag( fld, Tags.Subfields.AUTH_ENTRY_ELEMENT); subField2 = WorksheetWebUtils.findTreeNodeWrapperSubFieldByTag(fld, Tags.Subfields.AUTH_QUALIFIER); // subFielc3 = WorksheetWebUtils.findTreeNodeWrapperSubFieldByTag(fld, // Tags.Subfields.AUTH_INSTRUCTION_PHRASE); if (StringUtils.isNotEmpty(subField.getData())) { TermDataEntryBean row = new TermDataEntryBean( i, subField.getData(), subField2.getData(), false, fld.getField().getTreeNode()); _tableModel.add(row); } } _postPopulate(); } }
/** <code>print()</code> defines for showing print or print preview of results. */ private void printActionPerformed() { Hashtable parameters = new Hashtable(); parameters.put(props.getProperty("printHeader.name"), radioValue); if (StringUtils.isNotEmpty(previewHeaderText)) parameters.put(props.getProperty("header1.name"), previewHeaderText); ReportData reportData = new ReportData(grid, new HashMap(), grid.getLocale()); java.util.List itemList = new ArrayList(); itemList = grid.getDataModel().getData().getDataList(); reportData.setTitle(getTitle()); reportData.setConditionMap(parameters); reportData.setSelectedRows(itemList); PrintSetupScreen.showPrintSetupScreen(this.getSubsystemApp(), screenLocale, reportData); }
public SearchQueryBuilder getCriteriaBuilder() { BibliographicSearchLimitQueryBuilder qb = new BibliographicSearchLimitQueryBuilder(this.schema); Object tmp; tmp = cmCodingLevel.getSelectedItem(); // ldr 17 if (tmp != null && tmp instanceof ConstantTableItem) { qb.setCodingLevel(((ConstantTableItem) tmp).getCode()); } tmp = cmCataloguingForm.getSelectedItem(); // ldr 18 if (tmp != null && tmp instanceof ConstantTableItem) { qb.setCataloguingForm(((ConstantTableItem) tmp).getCode()); } tmp = cmBiblevel.getSelectedItem(); // ldr 07 if (tmp != null && tmp instanceof ConstantTableItem) { qb.setBibLevel(((ConstantTableItem) tmp).getCode()); } tmp = cmHierarchicalLevel.getSelectedItem(); // ldr 08 if (tmp != null && tmp instanceof ConstantTableItem) { qb.setHierarchicalLevel(((ConstantTableItem) tmp).getCode()); } tmp = cmDoctype.getSelectedItem(); if (tmp != null && tmp instanceof ConstantTableItem) { qb.setBiblioDocType(((ConstantTableItem) tmp).getCode()); } tmp = cmLanguage.getSelectedItem(); if (tmp != null && tmp instanceof ConstantTableItem) { qb.setLanguage(((ConstantTableItem) tmp).getCode()); } tmp = cmLocation.getSelectedItem(); if (tmp != null && tmp instanceof ConstantTableItem) { qb.setLocation(((ConstantTableItem) tmp).getCode()); } tmp = cmRecType.getSelectedItem(); // ldr 06 if (tmp != null && tmp instanceof ConstantTableItem) { qb.setRecordType(((ConstantTableItem) tmp).getCode()); } tmp = cmRecStatus.getSelectedItem(); // ldr 05 if (tmp != null && tmp instanceof ConstantTableItem) { qb.setRecordStatus(((ConstantTableItem) tmp).getCode()); } tmp = cmDescriptionLevel.getSelectedItem(); if (tmp != null && tmp instanceof ConstantTableItem) { qb.setLevelOfDescription(((ConstantTableItem) tmp).getCode()); } tmp = cmGMD.getSelectedItem(); if (tmp != null && tmp instanceof ConstantTableItem) { ConstantTableItem item = (ConstantTableItem) tmp; String s = null; if (language == LocaleUtils.PERSIAN) { s = item.getFarsiItemName(); } if (StringUtils.isEmpty(s)) { s = item.getEnglishItemName(); } if (StringUtils.isNotEmpty(s)) { qb.setGmd(s); } } tmp = txfRetriveNo.getText(); if (tmp != null && tmp instanceof String && ((String) tmp).length() != 0) { qb.setRetriveNo((String) tmp); } if (rDateRange.isSelected()) { qb.setUseDateRange(Boolean.TRUE); tmp = cmCalendar.getSelectedItem(); if (tmp != null && tmp instanceof ConstantTableItem) { qb.setCalendar(((ConstantTableItem) tmp).getCode()); } if (rGt.isSelected()) { qb.setDateComparisonOperator(BibliographicSearchLimitQueryBuilder.GT); qb.setFrom(txfFrom.getText()); } if (rLt.isSelected()) { qb.setDateComparisonOperator(BibliographicSearchLimitQueryBuilder.LT); qb.setTo(txfTo.getText()); } if (rBetween.isSelected()) { qb.setDateComparisonOperator(BibliographicSearchLimitQueryBuilder.BETWEEN); qb.setFrom(txfFrom.getText()); qb.setTo(txfTo.getText()); } } if (rYear.isSelected()) { qb.setUseDateRange(Boolean.FALSE); tmp = cmCalendar.getSelectedItem(); if (tmp != null && tmp instanceof ConstantTableItem) { qb.setCalendar(((ConstantTableItem) tmp).getCode()); } qb.setYear(txfYear.getText()); } if (cbHasAttachment.isSelected()) { qb.setAttachment(Boolean.TRUE); } if (cbIsOpenShelf.isSelected()) { qb.setIsOpenShelf(Boolean.TRUE); } if (cbIsLendable.isSelected()) { qb.setIsLendable(Boolean.TRUE); } String tt = txfLCClass.getText(); qb.setLcRangeStart(tt); return qb; }
public void onPoll(PollEvent event) { try { final boolean isLeftToRight = registerBean.isLeftToRight(); final Register currentRecord = registerBean.getCurrentRecord(); final String servicePolicy = registerBean.getServicePolicy(); final String acquisitionStatus = registerBean.getAcquisitionStatus(); final StorageContainer.NodeIterator regList = registerBean.getRegList(); if (regList.hasNext()) { String registerNo = (String) regList.next(); registerNo = (isLeftToRight) ? StringUtils.extendedArabicToLatinDigit(registerNo) : StringUtils.latinToExtendedArabicDigit(registerNo); currentRecord.setSubfieldData(Tags.HOL_INFO_SERVICE_POLICY, 'a', servicePolicy); currentRecord.setSubfieldRangeData( Tags.HOL_ACQUISITION_STATUS, 'a', acquisitionStatus, 1, 1); currentRecord.setSubfieldData( Tags.HOL_LOC_CALL_NO, 'b', registerBean.getLocationItem().getCode()); currentRecord.setSubfieldData(Tags.HOL_LOC_CALL_NO, 'm', registerNo); // regsList.getIndex() started of 1 final int index = regList.getIndex() - 1; String volume = registerBean.getVolume(); if (registerBean.isHasCounterVolume()) { volume = String.valueOf(Integer.valueOf(volume) + index); } volume = (isLeftToRight) ? StringUtils.extendedArabicToLatinDigit(volume) : StringUtils.latinToExtendedArabicDigit(volume); currentRecord.setSubfieldData(Tags.HOL_COPY_VOL_INFO, 'a', volume); String copy = registerBean.getCopy(); if (registerBean.isHasCounterCopy()) { copy = String.valueOf(Integer.valueOf(copy) + index); } copy = (isLeftToRight) ? StringUtils.extendedArabicToLatinDigit(copy) : StringUtils.latinToExtendedArabicDigit(copy); currentRecord.setSubfieldData(Tags.HOL_COPY_VOL_INFO, 'b', copy); String address = registerBean.getAddress(); if (registerBean.isHasCounterAddress()) { address = String.valueOf(Integer.valueOf(address) + index); } address = (isLeftToRight) ? StringUtils.extendedArabicToLatinDigit(address) : StringUtils.latinToExtendedArabicDigit(address); currentRecord.setSubfieldData(Tags.HOL_COPY_VOL_INFO, 'c', address); String section = registerBean.getSection(); if (registerBean.isHasCounterSection()) { section = String.valueOf(Integer.valueOf(section) + index); } section = (isLeftToRight) ? StringUtils.extendedArabicToLatinDigit(section) : StringUtils.latinToExtendedArabicDigit(section); currentRecord.setSubfieldData(Tags.HOL_COPY_VOL_INFO, 'd', section); String date = registerBean.getDate(); if (StringUtils.isNotEmpty(date)) { date = (isLeftToRight) ? StringUtils.extendedArabicToLatinDigit(date) : StringUtils.latinToExtendedArabicDigit(date); currentRecord.setSubfieldData(Tags.HOL_COPY_VOL_INFO, 'e', date); } String print = registerBean.getPrint(); if (StringUtils.isNotEmpty(print)) { print = (isLeftToRight) ? StringUtils.extendedArabicToLatinDigit(print) : StringUtils.latinToExtendedArabicDigit(print); currentRecord.setSubfieldData(Tags.HOL_LOC_CALL_NO, '9', print); } String ref = registerBean.isReferences() ? "1" : "0"; ref = (isLeftToRight) ? StringUtils.extendedArabicToLatinDigit(ref) : StringUtils.latinToExtendedArabicDigit(ref); currentRecord.setSubfieldData(Tags.HOL_COPY_VOL_INFO, 'r', ref); DataEntryModel dataEntryModel = registerBean.getDataEntryModel(); try { StorageWebUtils.getInstance() .tryToPost( dataEntryModel, currentRecord.getBibliographicRecord(), currentRecord, registerNo, registerBean.getLocationItem(), JsfUtils.getInstance().getLocale()); } catch (DuplicateRegisterRecordException e) { JsfUtils.getInstance().addFormattedError(e.getMessage()); regList.next(); } dataEntryModel.cancel(); StorageWebUtils.getInstance() .releaseRecordLock(currentRecord.getClass(), currentRecord.getId(), true); dataEntryModel = StorageWebUtils.getInstance() .createDataEntryModel( Register.class, null, 0, currentRecord.getBibliographicRecord(), true); registerBean.setDataEntryModel(dataEntryModel); } } catch (Exception e) { } }
public ResultPage findRealProfilePersonBySearchCriteria( RealProfilePerson realPerson, AbstractWorkGroup workGroup, Role roles, UserGroup userGroup, boolean checkChildren, int offset, int fetchSize, GridFilter gridFilter) { StringBuffer query = new StringBuffer( "SELECT realPerson.id FROM " + getPersistentClass().getName() + " realPerson"); java.util.List<Object> params = new ArrayList<Object>(); // if (userGroup != null) { // query.append(" JOIN realPerson.profile.userGroups userUserGroup" // + " JOIN userUserGroup.userGroup userGroup "); // } // if (roles != null) { // query.append(" JOIN realPerson.profile.userRoles as userRole " // + " JOIN userRole.role role "); // } // if (workGroup != null) { // query.append(", RegisterationUnit unit "); // } query.append(" WHERE 1=1 "); setRealProfileCondition(realPerson, query, params); if (workGroup != null) { // query.append("AND unit.profilePerson = realPerson.profile AND "); // if(checkChildren){ // query.append("(unit.workGroup = ? or unit.workGroup.parent= ?)"); // params.add(workGroup); // }else{ // query.append("unit.workGroup = ?"); // } query.append( " AND realPerson.profile in ( select unit.profilePerson from RegisterationUnit unit where "); if (checkChildren) { query.append("(unit.workGroup = ? or unit.workGroup.parent= ?)) "); params.add(workGroup); } else { query.append("unit.workGroup = ?) "); } params.add(workGroup); } if (roles != null) { // query.append(" AND role = ?"); query.append( " AND realPerson.profile in (select r.profilePerson from UserRole r where r.role = ?) "); params.add(roles); } if (userGroup != null) { // query.append(" AND userGroup = ?"); query.append( " AND realPerson.profile in (select g.profilePerson from UserUserGroup g where g.userGroup = ?) "); params.add(userGroup); } if (StringUtils.isNotEmpty(realPerson.getFirstName())) { query.append(" AND UPPER(realPerson.firstName) LIKE ?"); params.add("%" + realPerson.getFirstName() + "%"); } if (StringUtils.isNotEmpty(realPerson.getLastName())) { query.append(" AND UPPER(realPerson.lastName) LIKE ?"); params.add("%" + realPerson.getLastName() + "%"); } if (StringUtils.isNotEmpty(realPerson.getNationalCode())) { query.append(" AND realPerson.nationalCode = ?"); params.add(realPerson.getNationalCode()); } if (StringUtils.isNotEmpty(realPerson.getStudentNumber())) { query.append(" AND realPerson.studentNumber = ?"); params.add(realPerson.getStudentNumber()); } if (StringUtils.isNotEmpty(realPerson.getCollegeName())) { query.append(" AND realPerson.collegeName LIKE ?"); params.add("%" + realPerson.getCollegeName() + "%"); } if (StringUtils.isNotEmpty(realPerson.getPersonelNumber())) { query.append(" AND realPerson.personelNumber = ?"); params.add(realPerson.getPersonelNumber()); } if (StringUtils.isNotEmpty(realPerson.getParent())) { query.append(" AND UPPER(realPerson.parent) LIKE ?"); params.add("%" + realPerson.getParent() + "%"); } if (StringUtils.isNotEmpty(realPerson.getRealNo())) { query.append(" AND realPerson.realNo = ?"); params.add(realPerson.getRealNo()); } query.append(" ORDER bY realPerson.id"); ResultPage pageByCriteria = findPageByCriteria( query.toString(), params.toArray(), offset, fetchSize, gridFilter, "realPerson"); return new ResultPage( getByIdList(getPersistentClass(), pageByCriteria.getResult()), pageByCriteria.getCount()); }