⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ecspecbean.java

📁 一个开源的rfid middleware 资料
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
        } catch (RemoteException e1) {
            log.error(e1);
        } catch (Exception e1) {
            log.error(e1);
        }

    }

   

    /**
     * 
     * @hibernate.property
     * @return Returns the duration.
     */
    public long getDuration() {
        return duration;
    }

    /**
     * @param duration
     *            The duration to set.
     */
    public void setDuration(long duration) {
        this.duration = duration;
    }

    /**
     * 
     * @hibernate.property
     * @return Returns the notificationURI.
     */
    public String getNotificationURI() {
        return notificationURI;
    }

    /**
     * @param notificationURI
     *            The notificationURI to set.
     */
    public void setNotificationURI(String notificationURI) {
        this.notificationURI = notificationURI;
    }

    public Document generateDocFromXML(String xml)

    {

        InputSource inputSource = new InputSource(new StringReader(xml));
        DOMParser parser = new DOMParser();
        try {
            parser.parse(inputSource);
        } catch (SAXException e) {
            log.error("exception to do: ", e);
        } catch (IOException e) {
            log.error("exception to do: ", e);
        }

        return parser.getDocument();
    }

    public void getDetail(ActionEvent e) {

        currentRow = (org.firstopen.singularity.ale.ECSpec) uiTable
                .getRowData();
        ECSpecDAO ecSpecDAO = ECSpecDAOFactory.create();
        try {
            currentRow = ecSpecDAO.get(currentRow);
            currentRow.getXml();

            createLogicalDeviceSelectList(currentRow.getLogicalReaders());
            setEcSpecGenName(currentRow.getSpecName());
            org.firstopen.singularity.ale.ECBoundarySpec boundarySpec = currentRow
                    .getBoundaries();
            setDuration(boundarySpec.getDuration().getDuration());

            createSubscriberSelectList();
        } catch (InfrastructureException e1) {
            log.error("unable to reteive most recent version of ECSpec");
        } finally {
            DAOUtilFactory.close();
        }

    }

    /**
     * 
     */
   
    private void createSubscriberSelectList() {

        if (subscribers != null) {
            subscribers.clear();
        }
        if (subscriberNames != null) {
            subscriberNames.clear();
        }

        Set<String> subscriberSet = currentRow.getSubscribers();
        for (String subscriber : subscriberSet) {
            subscribers.add(new SelectItem(subscriber));
        }

    }

    public void create(ActionEvent e) {
        createLogicalDeviceSelectList();
        createSubscriberSelectList();
        ecSpecGenName = null;
        duration = 0;
    }

    public void update(ActionEvent e) {
        ECSpecDAO ecSpecDAO = ECSpecDAOFactory.create();
        try {
            ecSpecDAO.update(getCurrentRow());

        } catch (InfrastructureException e1) {
            log.error("unable to update ECSpec", e1);
        } finally {
            DAOUtilFactory.close();
        }

        // ecSpecDAO.update(this.getCurrentECSpec());
    }

    /*
     * 
     * public String next() {
     * 
     * ECSpecDocument specDoc = ECSpecDocument.Factory.newInstance();
     * 
     * ECSpec ecSpecDoc = specDoc.addNewECSpec();
     * ecSpecDoc.setSpecName(currentECSpecName); ECLogicalReaders logicalReader =
     * ecSpecDoc.addNewLogicalReaders();
     * logicalReader.addLogicalReader("MPR2010_AWID_01"); ECBoundarySpec
     * boundarySpec = ecSpecDoc.addNewBoundarySpec(); ECTime ecTime =
     * boundarySpec.addNewDuration(); ecTime.setLongValue(duration);
     * ecTime.setUnit(ECTimeUnit.MS); ECReportSpecs reportSpecs =
     * ecSpecDoc.addNewReportSpecs(); ECReportSpec reportSpec =
     * reportSpecs.addNewReportSpec(); reportSpec.setReportName("Report1");
     * ECReportSetSpec reportSetSpec = reportSpec.addNewReportSet();
     * reportSetSpec.setSet(ECReportSetEnum.CURRENT); ECReportOutputSpec
     * outputSpec = reportSpec.addNewOutput(); outputSpec.setIncludeTag(true);
     * outputSpec.setIncludeList(true); ECFilterSpec filterSpec =
     * reportSpec.addNewFilterSpec(); ECIncludePatterns includePatterns =
     * filterSpec.addNewIncludePatterns();
     * includePatterns.addIncludePattern("*");
     * 
     * log.debug(specDoc.xmlText());
     * 
     * return "success";
     *  }
     */
    /**
     * @return Returns the selectItemList.
     */
    public List<SelectItem> getSelectItemList() {
        return selectItemList;
    }

    /**
     * @param selectItemList
     *            The selectItemList to set.
     */
    public void setSelectItemList(List<SelectItem> logicalReaderList) {
        this.selectItemList = logicalReaderList;
    }

    /**
     * @return Returns the logicalECSpecList.
     */
    public List<SelectItem> getLogicalECSpecList() {
        return logicalECSpecList;
    }

    /**
     * @param logicalECSpecList
     *            The logicalECSpecList to set.
     */
    public void setLogicalECSpecList(List<SelectItem> logicalECSpecList) {
        this.logicalECSpecList = logicalECSpecList;
    }

    /**
     * @return Returns the ecSpecGenName.
     */
    public String getEcSpecGenName() {
        return ecSpecGenName;
    }

    /**
     * @param ecSpecGenName
     *            The ecSpecGenName to set.
     */
    public void setEcSpecGenName(String ecSpecGenName) {
        this.ecSpecGenName = ecSpecGenName;
    }

    /**
     * @return Returns the selected.
     */
    public List<String> getSelected() {
        return selected;
    }

    /**
     * @param selected
     *            The selected to set.
     */
    public void setSelected(List<String> logicalReaderNames) {
        this.selected = logicalReaderNames;
    }

    /**
     * @return Returns the uiTable.
     */
    public UIData getUiTable() {
        return uiTable;
    }

    /**
     * @param uiTable
     *            The uiTable to set.
     */
    public void setUiTable(UIData uiTable) {
        this.uiTable = uiTable;
    }

    public org.firstopen.singularity.ale.ECSpec getCurrentRow() {
        return currentRow;
    }

    public void setCurrentRow(org.firstopen.singularity.ale.ECSpec currentECSpec) {
        this.currentRow = currentECSpec;
    }

    public String getCurrentECSpecName() {
        return currentECSpecName;
    }

    public void setCurrentECSpecName(String currentECSpecName) {
        this.currentECSpecName = currentECSpecName;
    }

    /**
     * @return Returns the list.
     */
    public List<org.firstopen.singularity.ale.ECSpec> getList() {
        return list;
    }

    /**
     * @param list
     *            The list to set.
     */
    public void setList(List<org.firstopen.singularity.ale.ECSpec> list) {
        this.list = list;
    }

    /**
     * @return Returns the subscriberNames.
     */
    public List<String> getSubscriberNames() {
        return subscriberNames;
    }

    /**
     * @param subscriberNames
     *            The subscriberNames to set.
     */
    public void setSubscriberNames(List<String> subscribers) {
        this.subscriberNames = subscribers;
    }

    /**
     * @return Returns the subscribers.
     */
    public List<SelectItem> getSubscribers() {
        return subscribers;
    }

    /**
     * @param subscribers
     *            The subscribers to set.
     */
    public void setSubscribers(List<SelectItem> subscribers) {
        this.subscribers = subscribers;
    }

    public void scrollerAction(ActionEvent event) {
        ScrollerActionEvent scrollerEvent = (ScrollerActionEvent) event;
        FacesContext.getCurrentInstance().getExternalContext().log(
                "scrollerAction: facet: " + scrollerEvent.getScrollerfacet()
                        + ", pageindex: " + scrollerEvent.getPageIndex());
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -