Skip to content

Commit

Permalink
update db to final db
Browse files Browse the repository at this point in the history
  • Loading branch information
tuansu2021998 committed May 7, 2020
1 parent 54cf41e commit 0cfdd2d
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,10 @@ public Page<CrawledNews> findAllByAttribute(Map<String, Object> listAttribute, P
for (Map.Entry meta : listAttribute.entrySet()) {
String key = (String) meta.getKey();
String value = (String) meta.getValue();
if (key.equals("crawledNewsStatus")) {
listSpec.add(new CrawledNewsSpecifications(new SearchCriteria(key, ":=", value)));
if (key.equals("crawledNewsTitle")) {
listSpec.add(new CrawledNewsSpecifications(new SearchCriteria(key, ":", value)));
}else {
listSpec.add(new CrawledNewsSpecifications(new SearchCriteria(key, ":=", value)));;
}
}
}
Expand Down Expand Up @@ -307,8 +309,10 @@ public long countByAttribute(Map<String, Object> listAttribute) {
for (Map.Entry meta : listAttribute.entrySet()) {
String key = (String) meta.getKey();
String value = (String) meta.getValue();
if (key.equals("crawledNewsStatus")) {
listSpec.add(new CrawledNewsSpecifications(new SearchCriteria(key, ":=", value)));
if (key.equals("crawledNewsTitle")) {
listSpec.add(new CrawledNewsSpecifications(new SearchCriteria(key, ":", value)));
}else {
listSpec.add(new CrawledNewsSpecifications(new SearchCriteria(key, ":=", value)));;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ service.predictor.url=http://18.136.196.159/predictor/
service.token=Token b491e6a7c69eb9ea9a8237f19a8fc607606d83db

#PostgreSQL online
spring.datasource.url=jdbc:postgresql://database-1.c4dxodf0guqt.ap-southeast-1.rds.amazonaws.com:5432/LIP_System_New
spring.datasource.url=jdbc:postgresql://database-1.c4dxodf0guqt.ap-southeast-1.rds.amazonaws.com:5432/LIP_System_Final
spring.datasource.username=postgres
spring.datasource.password=homersimpson
#server.port=5000
Expand Down
14 changes: 10 additions & 4 deletions src/main/webapp/admin/managecrawlnews.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<p:dataTable value="#{manageCrawlNewsBean.lazyNews}" var="element"
rows="10" paginator="true"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"
currentPageReportTemplate="{startRecord}-{endRecord} of {totalRecords} records"
currentPageReportTemplate="{startRecord}-{endRecord} của {totalRecords} bản ghi"
lazy="true" widgetVar="wgtable"
selection="#{manageCrawlNewsBean.listNewsSelected}" rowKey="#{element.crawledNewsID}"
resizableColumns="true">
Expand All @@ -77,7 +77,7 @@

<p:column selectionMode="multiple" style="width:7%;text-align:center">
</p:column>
<p:column width="60%">
<p:column width="50%" filterBy="#{element.crawledNewsTitle}" filterMatchMode="contains">
<f:facet name="header">Tiêu đề</f:facet>
<a href="#{element.crawledNewsLink}" target="_blank">#{element.crawledNewsTitle}</a>
</p:column>
Expand All @@ -95,8 +95,14 @@
</f:facet>
<h:outputText value="#{element.crawledNewsStatus}" />
</p:column>
<p:column>
<f:facet name="header">Nguồn tin</f:facet>
<p:column filterBy="#{element.crawledNewsWebsite}" filterMatchMode="exact" >
<f:facet name="filter">
<p:selectOneMenu id="cbb-Source" onchange="PF('wgtable').filter()" styleClass="custom-filter">
<f:selectItem itemLabel="Nguồn tin" itemValue="#{null}" noSelectionOption="true" />
<f:selectItem itemLabel="batdongsan.com.vn" itemValue="batdongsan.com.vn" />
<f:selectItem itemLabel="dantri.com.vn" itemValue="dantri.com.vn" />
</p:selectOneMenu>
</f:facet>
<h:outputText value="#{element.crawledNewsWebsite}"></h:outputText>
</p:column>
</p:dataTable>
Expand Down
2 changes: 1 addition & 1 deletion src/main/webapp/admin/managecrawlrealestate.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<p:dataTable value="#{manageCrawlRealEstateBean.lazyReo}" var="element" id="table"
rows="10" paginator="true" lazy="true" rowIndexVar="index"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"
currentPageReportTemplate="{startRecord}-{endRecord} of {totalRecords} records">
currentPageReportTemplate="{startRecord}-{endRecord} của {totalRecords} bản ghi">

<f:facet name="paginatorTopLeft">
<p:commandButton icon="pi pi-refresh" update="tabledata"
Expand Down
4 changes: 2 additions & 2 deletions src/main/webapp/admin/managefeedback.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<p:dataTable value="#{manageFeedbackBean.lazyFeedback}" var="element"
rows="10" paginator="true" lazy="true"
paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}"
currentPageReportTemplate="{startRecord}-{endRecord} of {totalRecords} records"
currentPageReportTemplate="{startRecord}-{endRecord} của {totalRecords} bản ghi"
rowKey="#{element.feedBackID}"
widgetVar="table-feedback"
resizableColumns="true">
Expand All @@ -40,7 +40,7 @@
</p:column>

<p:column>
<f:facet name="header">User</f:facet>
<f:facet name="header">Tên đăng nhập</f:facet>
<h:outputText value="#{element.user.username}"></h:outputText>
</p:column>
<p:column>
Expand Down

0 comments on commit 0cfdd2d

Please sign in to comment.