Проектирование и разработка информационно-поисковой системы

Разработка web-приложения для оперирования данными с помощью базы данных и web-браузера в качестве клиента пользователя. Основные преимущества языка программирования Java. Осуществление редактирования, добавления информации и поиска по архивам данных.

Рубрика Программирование, компьютеры и кибернетика
Вид дипломная работа
Язык русский
Дата добавления 30.09.2016
Размер файла 2,1 M

Отправить свою хорошую работу в базу знаний просто. Используйте форму, расположенную ниже

Студенты, аспиранты, молодые ученые, использующие базу знаний в своей учебе и работе, будут вам очень благодарны.

if (o == null || getClass ()! = o. getClass ()) return false;

Group group = (Group) o;

if (idGroup! = group. idGroup) return false;

if (groupName! = null?! groupName. equals (group. groupName): group. groupName! = null) return false;

return true;

} @Override public int hashCode () { int result = idGroup;

result = 31 * result + (groupName! = null? groupName. hashCode (): 0);

return result;

} }

JournalCovers. java

package wps. newsrussia. entities;

public class JournalCovers { private long id;

private String img;

/* Getters and setters

*/

@Override public boolean equals (Object o) { if (this == o) return true;

if (o == null || getClass ()! = o. getClass ()) return false;

JournalCovers that = (JournalCovers) o;

if (id! = that. id) return false;

if (img! = null?! img. equals (that. img): that. img! = null) return false;

return true;

} @Override public int hashCode () { int result = (int) (id ^ (id >>> 32));

result = 31 * result + (img! = null? img. hashCode (): 0);

return result;

} }

JournalIssues. java

package wps. newsrussia. entities;

import java. sql. Date;

public class JournalIssues { private long id;

private long issue;

private String title;

private Date date;

private String linkToPdf;

private String linkToTxt;

private String keywords;

private Journals journalsId;

/* Getters and setters

*/

@Override public boolean equals (Object o) { if (this == o) return true;

if (o == null || getClass ()! = o. getClass ()) return false;

JournalIssues that = (JournalIssues) o;

if (id! = that. id) return false;

if (issue! = that. issue) return false;

if (title! = null?! title. equals (that. title): that. title! = null) return false;

if (date! = null?! date. equals (that. date): that. date! = null) return false;

if (linkToPdf! = null?! linkToPdf. equals (that. linkToPdf): that. linkToPdf! = null) return false;

if (linkToTxt! = null?! linkToTxt. equals (that. linkToTxt): that. linkToTxt! = null) return false;

if (keywords! = null?! keywords. equals (that. keywords): that. keywords! = null) return false;

return journalsId! = null? journalsId. equals (that. journalsId): that. journalsId == null;

} @Override public int hashCode () { int result = (int) (id ^ (id >>> 32));

result = 31 * result + (int) (issue ^ (issue >>> 32));

result = 31 * result + (title! = null? title. hashCode (): 0);

result = 31 * result + (date! = null? date. hashCode (): 0);

result = 31 * result + (linkToPdf! = null? linkToPdf. hashCode (): 0);

result = 31 * result + (linkToTxt! = null? linkToTxt. hashCode (): 0);

result = 31 * result + (keywords! = null? keywords. hashCode (): 0);

result = 31 * result + (journalsId! = null? journalsId. hashCode (): 0);

return result;

} }

Journals. java

package wps. newsrussia. entities;

import java. sql. Date;

public class Journals { private long id;

private String name;

private Date startDate;

private Storage storageId;

private Date lastmodify;

private Genre genreId;

private JournalCovers journalCoversId;

/* Getters and setters

*/

@Override public boolean equals (Object o) { if (this == o) return true;

if (o == null || getClass ()! = o. getClass ()) return false;

Journals journals = (Journals) o;

if (id! = journals. id) return false;

if (name! = null?! name. equals (journals. name): journals. name! = null) return false;

if (startDate! = null?! startDate. equals (journals. startDate): journals. startDate! = null) return false;

if (storageId! = null?! storageId. equals (journals. storageId): journals. storageId! = null) return false;

if (lastmodify! = null?! lastmodify. equals (journals. lastmodify): journals. lastmodify! = null) return false;

if (genreId! = null?! genreId. equals (journals. genreId): journals. genreId! = null) return false;

return journalCoversId! = null? journalCoversId. equals (journals. journalCoversId): journals. journalCoversId == null;

} @Override public int hashCode () { int result = (int) (id ^ (id >>> 32));

result = 31 * result + (name! = null? name. hashCode (): 0);

result = 31 * result + (startDate! = null? startDate. hashCode (): 0);

result = 31 * result + (storageId! = null? storageId. hashCode (): 0);

result = 31 * result + (lastmodify! = null? lastmodify. hashCode (): 0);

result = 31 * result + (genreId! = null? genreId. hashCode (): 0);

result = 31 * result + (journalCoversId! = null? journalCoversId. hashCode (): 0);

return result;

} }

Storage. java

package wps. newsrussia. entities;

public class Storage { private int id;

private String name;

private String path;

/* Getters and setters

*/

@Override public String toString () { return name;

} @Override public boolean equals (Object o) { if (this == o) return true;

if (o == null || getClass ()! = o. getClass ()) return false;

Storage storage = (Storage) o;

if (id! = storage. id) return false;

if (name! = null?! name. equals (storage. name): storage. name! = null) return false;

if (path! = null?! path. equals (storage. path): storage. path! = null) return false;

return true;

} @Override public int hashCode () { int result = id;

result = 31 * result + (name! = null? name. hashCode (): 0);

result = 31 * result + (path! = null? path. hashCode (): 0);

return result;

} }

Users. java

package wps. newsrussia. entities;

import java. sql. Date;

public class Users { private long id;

private String userLogin;

private String userPass;

private String userNickname;

private String userEmail;

private Group groupIdGroup;

private Date userRegistered;

private int userStatus;

private String displayName;

/* Getters and setters

*/

@Override public boolean equals (Object o) { if (this == o) return true;

if (o == null || getClass ()! = o. getClass ()) return false;

Users users = (Users) o;

if (id! = users. id) return false;

if (userStatus! = users. userStatus) return false;

if (userLogin! = null?! userLogin. equals (users. userLogin): users. userLogin! = null) return false;

if (userPass! = null?! userPass. equals (users. userPass): users. userPass! = null) return false;

if (userNickname! = null?! userNickname. equals (users. userNickname): users. userNickname! = null) return false;

if (userEmail! = null?! userEmail. equals (users. userEmail): users. userEmail! = null) return false;

if (groupIdGroup! = null?! groupIdGroup. equals (users. groupIdGroup): users. groupIdGroup! = null) return false;

if (userRegistered! = null?! userRegistered. equals (users. userRegistered): users. userRegistered! = null) return false;

return displayName! = null? displayName. equals (users. displayName): users. displayName == null;

} @Override public int hashCode () { int result = (int) (id ^ (id >>> 32));

result = 31 * result + (userLogin! = null? userLogin. hashCode (): 0);

result = 31 * result + (userPass! = null? userPass. hashCode (): 0);

result = 31 * result + (userNickname! = null? userNickname. hashCode (): 0);

result = 31 * result + (userEmail! = null? userEmail. hashCode (): 0);

result = 31 * result + (groupIdGroup! = null? groupIdGroup. hashCode (): 0);

result = 31 * result + (userRegistered! = null? userRegistered. hashCode (): 0);

result = 31 * result + userStatus;

result = 31 * result + (displayName! = null? displayName. hashCode (): 0);

return result;

} }

Video. java

package wps. newsrussia. entities;

import java. sql. Date;

public class Video { private long id;

private String title;

private Date date;

private String type;

private String description;

private String annotation;

private String path;

private Genre genreId;

private Storage storageId;

/* Getters and setters

*/

@Override public boolean equals (Object o) { if (this == o) return true;

if (o == null || getClass ()! = o. getClass ()) return false;

Video video = (Video) o;

if (id! = video. id) return false;

if (title! = null?! title. equals (video. title): video. title! = null) return false;

if (date! = null?! date. equals (video. date): video. date! = null) return false;

if (type! = null?! type. equals (video. type): video. type! = null) return false;

if (description! = null?! description. equals (video. description): video. description! = null) return false;

if (annotation! = null?! annotation. equals (video. annotation): video. annotation! = null) return false;

if (path! = null?! path. equals (video. path): video. path! = null) return false;

if (genreId! = null?! genreId. equals (video. genreId): video. genreId! = null) return false;

return storageId! = null? storageId. equals (video. storageId): video. storageId == null;

} @Override public int hashCode () { int result = (int) (id ^ (id >>> 32));

result = 31 * result + (title! = null? title. hashCode (): 0);

result = 31 * result + (date! = null? date. hashCode (): 0);

result = 31 * result + (type! = null? type. hashCode (): 0);

result = 31 * result + (description! = null? description. hashCode (): 0);

result = 31 * result + (annotation! = null? annotation. hashCode (): 0);

result = 31 * result + (path! = null? path. hashCode (): 0);

result = 31 * result + (genreId! = null? genreId. hashCode (): 0);

result = 31 * result + (storageId! = null? storageId. hashCode (): 0);

return result;

} }

Приложение Б. Используемые настройки сущностей

Приложение В. Реализация шаблона DAO

JouranalDAOImpl. java

package wps. newsrussia. dao. impl;

import org. hibernate. Criteria;

import org. hibernate. SessionFactory;

import org. hibernate. criterion. *;

import org. hibernate. transform. Transformers;

import org. springframework. beans. factory. annotation. Autowired;

import org. springframework. stereotype.component;

import org. springframework. transaction. annotation. Transactional;

import wps. newsrussia. entities. Genre;

import wps. newsrussia. dao. interfaces. JournalDAO;

import wps. newsrussia. entities. Journals;

import java. util. Date;

import java. util. List;

@Component public class JournalDAOImpl implements JournalDAO { @Autowired private SessionFactory sessionFactory;

private ProjectionList journalProjection;

public JournalDAOImpl () { journalProjection = Projections. projectionList ();

journalProjection. add (Projections. property ("id"), "id");

journalProjection. add (Projections. property ("genreId"), "genreId");

journalProjection. add (Projections. property ("journalCoversId"), "journalCoversId");

journalProjection. add (Projections. property ("name"), "name");

journalProjection. add (Projections. property ("startDate"), "startDate");

journalProjection. add (Projections. property ("lastmodify"), "lastmodify");

} private DetachedCriteria createJournalCriteria () { DetachedCriteria journalListCriteria = DetachedCriteria. forClass (Journals. class, "b");

createAliases (journalListCriteria);

return journalListCriteria;

} @Transactional @Override public List<Journals> getJournal () { List<Journals> journals = createJournalList (createJournalCriteria ());

return journals;

} @Transactional @Override public List<Journals> getJournal (String name) { List<Journals> journals = createJournalList (createJournalCriteria (). add (Restrictions. ilike ("b. name",name, MatchMode. ANYWHERE)));

return journals;

} @Transactional @Override public List<Journals> getJournal (Date date_upload) { return null;

} @Transactional @Override public List<Journals> getJournal (Genre genre) { List<Journals> journals = createJournalList (createJournalCriteria (). add (Restrictions. ilike ("genre. name", genre. getName (), MatchMode. ANYWHERE)));

return journals;

} private void createAliases (DetachedCriteria criteria) { criteria. createAlias ("b. genreId", "genreId");

criteria. createAlias ("b. storageId", "storageId");

} private List<Journals> createJournalList (DetachedCriteria bookListCriteria) { Criteria criteria = bookListCriteria. getExecutableCriteria (sessionFactory. getCurrentSession ());

criteria. addOrder (Order. asc ("b. name")). setProjection (journalProjection). setResultTransformer (Transformers. aliasToBean (Journals. class));

return criteria. list ();

} }

JouranalIssueDAOImpl. java

package wps. newsrussia. dao. impl;

public class JournalIssueDAOImpl implements JournalissueDAO{ @Autowired private SessionFactory sessionFactory;

private DetachedCriteria createJournalCriteria () { DetachedCriteria journalListCriteria = DetachedCriteria. forClass (JournalIssues. class, "b");

return journalListCriteria;

} @Transactional @Override public List<JournalIssues> getJournalIssues () { List<JournalIssues> journalIssues = createJournalList (createJournalCriteria ());

return journalIssues;

} @Transactional @Override public List<JournalIssues> getJournalIssues (int journalsId) { List<JournalIssues> journals = createJournalList (createJournalCriteria (). add (Restrictions. eq ("b. id",journalsId)));

return journals;

} private List<JournalIssues> createJournalList (DetachedCriteria bookListCriteria) { Criteria criteria = bookListCriteria. getExecutableCriteria (sessionFactory. getCurrentSession ());

criteria. addOrder (Order. asc ("b. name")). setResultTransformer (Transformers. aliasToBean (JournalIssues. class));

return criteria. list ();

} }

Приложение Г. Вспомогательные классы

NewsrussiaFacade. java

package wps. newsrussia. objects;

@Component @Scope ("singleton") public class NewsrussiaFacade { @Autowired private JournalDAO journalDAO;

@Autowired private SearchCriteria searchCriteria;

private List<Journals> journals;

public List<Journals> getJournals () { if (journals == null) { journals = journalDAO. getJournal ();

} return journals;

} public void searchJournalsByText () { journals = journalDAO. getJournal (searchCriteria. getName ());

} }

SearchCriteria. java

package wps. newsrussia. objects;

import java. io. Serializable;

@Component @Scope ("singleton") public class SearchCriteria implements Serializable { private String name;

private SearchType searchType = SearchType. TEXT;

private String title;

private Genre genre;

public String getName () { return name;

} public void setName (String name) { this. name = name;

} public SearchType getSearchType () { return searchType;

} public void setSearchType (SearchType searchType) { this. searchType = searchType;

} public String getTitle () { return title;

} public void setTitle (String title) { this. title = title;

} public Genre getGenre () { return genre;

} public void setGenre (Genre genre) { this. genre = genre;

} }

Utils. java

package wps. newsrussia. objects;

@Component public class Utils { private Map<String, SearchType> searchTypeList = new HashMap<String, SearchType> ();

private SearchType selectedSearchType = SearchType. TITLE; // значение по-умолчанию @Autowired private MessageSource msg;

private Character [] letters = new Character [] {'А', 'Б', 'В', 'Г', 'Д', 'Е', 'Ё', 'Ж', 'З', 'И', 'Й', 'К', 'Л', 'М', 'Н', 'О', 'П', 'Р', 'С', 'Т', 'У', 'Ф', 'Х', 'Ц', 'Ч', 'Ш', 'Щ', 'Ъ', 'Ы', 'Ь', 'Э', 'Ю', 'Я'};

public Character [] getLetters () { return letters;

} public Map<String, SearchType> getSearchTypeList () { searchTypeList. clear ();

searchTypeList. put (msg. getMessage ("title", null, FacesContext. getCurrentInstance (). getViewRoot (). getLocale ()), SearchType. TITLE);

searchTypeList. put (msg. getMessage ("text", null, FacesContext. getCurrentInstance (). getViewRoot (). getLocale ()), SearchType. TEXT);

return searchTypeList;

} public SearchType getSelectedSearchType () { return selectedSearchType;

} public void setSearchTypeList (Map<String, SearchType> searchTypeList) { this. searchTypeList = searchTypeList;

} public void setSelectedSearchType (SearchType selectedSearchType) { this. selectedSearchType = selectedSearchType;

} }

Приложение Д. Servlets

ShowImage. java

package wps. newsrussia. servlets;

@WebServlet (name = "ShowImage", urlPatterns = {"/ShowImage"}) public class ShowImage extends HttpServlet { // private static Map<Long, Byte [] > imageMap = new HashMap ();

protected void processRequest (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response. setContentType ("image/jpeg");

OutputStream out = response. getOutputStream ();

try { int index = Integer. valueOf (request. getParameter ("index"));

NewsrussiaFacade newsrussiaFacade = (NewsrussiaFacade) getServletContext (). getAttribute ("newsrussiaFacade");

JournalCovers image = newsrussiaFacade. getJournals (). get (index). getJournalCoversId ();

FileInputStream fis = new FileInputStream (new File (image. getImg ()));

byte [] img = new byte [fis. available ()];

fis. read (img, 0, fis. available ());

response. setContentLength (img. length);

out. write (img);

} catch (Exception ex) { ex. printStackTrace ();

} finally { out. close ();

} } }

PdfContent. java

@WebServlet (name = "PdfContent", urlPatterns = {"/PdfContent"}) public class PdfContent extends HttpServlet { protected void processRequest (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response. setContentType ("application/pdf; charset=UTF-8");

OutputStream out = response. getOutputStream ();

try { long id = Long. valueOf (request. getParameter ("id"));

Boolean save = Boolean. valueOf (request. getParameter ("save"));

NewsrussiaFacade libraryFacade = (NewsrussiaFacade) getServletContext (). getAttribute ("libraryFacade");

byte [] content = null; // libraryFacade. getContent (id);

response. setContentLength (content. length);

if (save) { String filename = request. getParameter ("filename");

response. setHeader ("Content-Disposition", "attachment; filename=" + URLEncoder. encode (filename, "UTF-8") +". pdf");

} out. write (content);

} catch (Exception ex) { ex. printStackTrace ();

} finally { out. close ();

} } }

Приложение Е. Шаблоны JSF

main. xhtml

<? xml version="1.0" encoding="UTF-8"? >

<! DOCTYPE html PUBLIC "- // W3C // DTD XHTML 1.0 Transitional // EN"

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional. dtd">

<html xmlns="http://www.w3.org/1999/xhtml"

xmlns: h="http://xmlns. jcp.org/jsf/html"

xmlns: ui="http://xmlns. jcp.org/jsf/facelets"

xmlns: f="http://xmlns. jcp.org/jsf/core"

xmlns: p="http://primefaces.org/ui">

<f: view>

<ui: composition template="/WEB-INF/templates/journals. xhtml">

<ui: define name="title">

#{msg. journal_list}

</ui: define>

<ui: define name="content">

<h: form id="journals_form">

<p: dataGrid rowIndexVar="rowIndex" columns="3" lazy="true" var="b" value="${newsrussiaFacade. journals}" id="journalsList"

styleClass="list-results list-results-underlined" paginator="true" rows="4" paginatorPosition="bottom"

rowsPerPageTemplate="12,24,80" paginatorTemplate="{RowsPerPageDropdown} {PageLinks}" paginatorAlwaysVisible="true"

emptyMessage="">

<div class="col-md-12">

<div class="item">

<div class="col-xs-10 journal_image" >

<h: outputLink styleClass="content_link" value="${flowExecutionUrl}&amp; _eventId=showissues&amp; _index=${rowIndex}">

<p: graphicImage value="/ShowImage? index=#{rowIndex}" width="100%"/>

</h: outputLink>

</div>

<div class="col-xs-2 action-list">

<div class="action-list-hover">

<a href="#"><i class="fa fa-eye"/></a>

</div>

<div class="action-list-hover">

<a href="#"><i class="fa fa-download"/></a>

</div>

<div class="action-list-hover">

<a href="#"><i class="fa fa-pencil"/></a>

</div>

<div class="action-list-hover">

<a href="#"><i class="fa fa-trash-o"/></a>

</div>

</div>

<div class="info col-xs-12">

<div class="journal_name">

<a id="journals_form: journalsList: 0: journalName"

name="journals_form: journalsList: 0: journalName" href="" target="_blank" class="title">#{b. name}</a>

</div>

<div class="journal_info">

<p><span>#{msg. genre}: </span>#{b. genreId}</p>

<p><span>#{msg. last_publication}: </span>#{b. lastmodify}</p>

</div>

</div>

</div>

</div>

</p: dataGrid>

</h: form>

</ui: define>

</ui: composition>

</f: view>

</html>

issues. xhtml

<html xmlns="http://www.w3.org/1999/xhtml"

xmlns: h="http://xmlns. jcp.org/jsf/html"

xmlns: ui="http://xmlns. jcp.org/jsf/facelets"

xmlns: f="http://xmlns. jcp.org/jsf/core">

<f: view>

<h: head>

<title><ui: insert name="title"/></title>

<link href='http://fonts. googleapis.com/css? family=Roboto: 300italic,400italic,300,400,500,700,900' rel='stylesheet' type='text/css'/>

</h: head>

<h: body styleClass="menubar-hoverable header-fixed ">

<f: facet name="last">

<! - -<h: outputScript library="js" name="theme-default/bootstrap. css? 1422792965" target="head"/>-->

<h: outputStylesheet library="css" name="theme-default/bootstrap. css" />

<h: outputStylesheet library="css" name="theme-default/materialadmin. css" />

<h: outputStylesheet library="css" name="theme-default/font-awesome. min. css" />

<h: outputStylesheet library="css" name="theme-default/material-design-iconic-font. min. css" />

<h: outputStylesheet library="css" name="theme-default/main. css" />

</f: facet>

<! - HTML5 shim and Respond. js IE8 support of HTML5 elements and media queries - ->

<! - [if lt IE 9] >

<h: outputScript library="js" name="libs/utils/html5shiv. js" target="head"/>

<h: outputScript library="js" name="libs/utils/respond. min. js" target="head"/>

<! [endif] - ->

<header id="header">

<ui: include src="/WEB-INF/templates/header. xhtml"/>

</header>

<div id="base">

<! - BEGIN OFFCANVAS LEFT - ->

<div class="offcanvas">

</div><! - -end. offcanvas-->

<! - END OFFCANVAS LEFT - ->

<ui: include src="/WEB-INF/templates/searchTextImg. xhtml">

<ui: param name="issue" value="#{index}"/>

</ui: include>

<ui: include src="/WEB-INF/templates/rightbar. xhtml"/>

<ui: include src="/WEB-INF/templates/menubar. xhtml"/>

</div>

<! - BEGIN JAVASCRIPT - ->

<h: outputScript library="js" name="libs/jquery/jquery-1.11.2 min. js" target="head" />

<h: outputScript library="js" name="libs/jquery/jquery-migrate-1.2.1 min. js" target="head"/>

<h: outputScript library="js" name="libs/bootstrap/bootstrap. min. js" target="head"/>

<h: outputScript library="js" name="libs/spin. js/spin. min. js" target="head"/>

<h: outputScript library="js" name="libs/autosize/jquery. autosize. min. js" target="head"/>

<h: outputScript library="js" name="libs/nanoscroller/jquery. nanoscroller. min. js" target="head" />

<h: outputScript library="js" name="core/source/App. js" target="head"/>

<h: outputScript library="js" name="core/source/AppNavigation. js" target="head"/>

<h: outputScript library="js" name="core/source/AppOffcanvas. js" target="head"/>

<h: outputScript library="js" name="core/source/AppCard. js" target="head"/>

<h: outputScript library="js" name="core/source/AppForm. js" target="head"/>

<h: outputScript library="js" name="core/source/AppNavSearch. js" target="head"/>

<h: outputScript library="js" name="core/source/AppVendor. js" target="head"/>

<h: outputScript library="js" name="core/demo/Demo. js" target="head"/>

<! - END JAVASCRIPT - ->

</h: body>

</f: view>

</html>

journals. xhtml

<html xmlns="http://www.w3.org/1999/xhtml"

xmlns: h="http://xmlns. jcp.org/jsf/html"

xmlns: ui="http://xmlns. jcp.org/jsf/facelets"

xmlns: f="http://xmlns. jcp.org/jsf/core">

<f: view>

<h: head>

<title><ui: insert name="title"/></title>

<link href='http://fonts. googleapis.com/css? family=Roboto: 300italic,400italic,300,400,500,700,900' rel='stylesheet' type='text/css'/>

</h: head>

<h: body styleClass="menubar-hoverable header-fixed ">

<f: facet name="last">

<! - -<h: outputScript library="js" name="theme-default/bootstrap. css? 1422792965" target="head"/>-->

<h: outputStylesheet library="css" name="theme-default/bootstrap. css" />

<h: outputStylesheet library="css" name="theme-default/materialadmin. css" />

<h: outputStylesheet library="css" name="theme-default/font-awesome. min. css" />

<h: outputStylesheet library="css" name="theme-default/material-design-iconic-font. min. css" />

<h: outputStylesheet library="css" name="theme-default/main. css" />

</f: facet>

<! - HTML5 shim and Respond. js IE8 support of HTML5 elements and media queries - ->

<! - [if lt IE 9] >

<h: outputScript library="js" name="libs/utils/html5shiv. js" target="head"/>

<h: outputScript library="js" name="libs/utils/respond. min. js" target="head"/>

<! [endif] - ->

<header id="header">

<ui: include src="/WEB-INF/templates/header. xhtml"/>

</header>

<div id="base">

<! - BEGIN OFFCANVAS LEFT - ->

<div class="offcanvas">

</div><! - -end. offcanvas-->

<! - END OFFCANVAS LEFT - ->

<ui: include src="/WEB-INF/templates/searchTextImg. xhtml"/>

<ui: include src="/WEB-INF/templates/rightbar. xhtml"/>

<ui: include src="/WEB-INF/templates/menubar. xhtml"/>

</div>

<! - BEGIN JAVASCRIPT - ->

<h: outputScript library="js" name="libs/jquery/jquery-1.11.2 min. js" target="head" />

<h: outputScript library="js" name="libs/jquery/jquery-migrate-1.2.1 min. js" target="head"/>

<h: outputScript library="js" name="libs/bootstrap/bootstrap. min. js" target="head"/>

<h: outputScript library="js" name="libs/spin. js/spin. min. js" target="head"/>

<h: outputScript library="js" name="libs/autosize/jquery. autosize. min. js" target="head"/>

<h: outputScript library="js" name="libs/nanoscroller/jquery. nanoscroller. min. js" target="head" />

<h: outputScript library="js" name="core/source/App. js" target="head"/>

<h: outputScript library="js" name="core/source/AppNavigation. js" target="head"/>

<h: outputScript library="js" name="core/source/AppOffcanvas. js" target="head"/>

<h: outputScript library="js" name="core/source/AppCard. js" target="head"/>

<h: outputScript library="js" name="core/source/AppForm. js" target="head"/>

<h: outputScript library="js" name="core/source/AppNavSearch. js" target="head"/>

<h: outputScript library="js" name="core/source/AppVendor. js" target="head"/>

<h: outputScript library="js" name="core/demo/Demo. js" target="head"/>

<! - END JAVASCRIPT - ->

</h: body>

</f: view>

</html>

locales. xhtml

<html xmlns="http://www.w3.org/1999/xhtml"

xmlns: h="http://java. sun.com/jsf/html"

xmlns: ui="http://java. sun.com/jsf/facelets"

xmlns: f="http://java. sun.com/jsf/core"

xmlns: p="http://primefaces.org/ui">

<h: head>

<title>Facelet Title</title>

</h: head>

<h: body>

<ui: composition>

<div class="lang">

<h: form>

<h: outputLink value="? lang=ru">

<h: graphicImage library="images" name="rus. png" title="#{msg.russian}" width="21" height="20" style="margin-right: 10px"/>

</h: outputLink>

<h: outputLink value="? lang=en">

<h: graphicImage library="images" name="usa. png" title="#{msg. english}" width="21" height="15"/>

</h: outputLink>

</h: form>

</div>

</ui: composition>

</h: body>

</html>

search. xhtml

<html xmlns="http://www.w3.org/1999/xhtml"

xmlns: h="http://java. sun.com/jsf/html"

xmlns: ui="http://java. sun.com/jsf/facelets"

xmlns: f="http://java. sun.com/jsf/core"

xmlns: p="http://primefaces.org/ui">

<h: head>

<title>Facelet Title</title>

</h: head>

<h: body>

<ui: composition>

<! - BEGIN SEARCH BAR - ->

<div class="card-body style-primary no-y-padding">

<h: form class="form form-inverse" id="search_form">

<div class="form-group">

<div class="input-group input-group-lg">

<div class="input-group-content">

<! - -<input type="text" class="form-control" id="searchInput" placeholder="Enter your search here"/>-->

<div class="search">

<h: inputText id="searchInput" styleClass="form-control" value="#{searchCriteria. name}"/>

<script language="javascript">

document. getElementById ("search_form: searchInput"). setAttribute ("placeholder","#{msg. search}");

</script>

<div class="clear"></div>

</div>

<div class="form-control-line"></div>

</div>

<div class="input-group-btn">

<p: commandButton styleClass="btn btn-floating-action btn-default-bright fa fa-search" style="padding-top: 10px" icon=""

action="_eventId_searchByText">

<p: ajax execute="@form" render=": journals_form: journalsList"/>

</p: commandButton>

</div>

</div>

</div><! - -end. form-group - ->

</h: form>

</div><! - -end. card-body - ->

<! - END SEARCH BAR - ->

</ui: composition>

</h: body>

</html>

Приложение Ж. Конфигурация Spring

Webflow. xml

<? xml version="1.0" encoding="UTF-8"? >

<beans: beans

xmlns="http://www.springframework.org/schema/webflow-config"

xmlns: beans="http://www.springframework.org/schema/beans"

xmlns: xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns: faces="http://www.springframework.org/schema/faces"

xsi: schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans. xsd

http://www.springframework.org/schema/faces http://www.springframework.org/schema/faces/spring-faces. xsd

http://www.springframework.org/schema/webflow-config http://www.springframework.org/schema/webflow-config/spring-webflow-config. xsd

">

<flow-executor id="loginFlowExecutor"

flow-registry="flowRegistry" />

<flow-registry id="flowRegistry" flow-builder-services="flowBuilderServices" base-path="/WEB-INF/flows">

<flow-location-pattern value="*. xml" />

</flow-registry>

<faces: flow-builder-services id="flowBuilderServices" development="true" view-factory-creator="flowViewResolver" />

<! - A listener to create and release a FacesContext - ->

<beans: bean id="facesContextListener" class="org. springframework. faces. webflow. FlowFacesContextLifecycleListener"/>

<flow-executor id="flowExecutor">

<flow-execution-listeners>

<listener ref="facesContextListener"/>

</flow-execution-listeners>

</flow-executor>

<beans: bean id="flowViewResolver"

class="org. springframework. webflow. mvc. builder. MvcViewFactoryCreator">

<beans: property name="viewResolvers">

<beans: list>

<beans: ref bean="viewResolver" />

</beans: list>

</beans: property>

</beans: bean>

</beans: beans>

DispatcherServlet. xml

<? xml version="1.0" encoding="UTF-8"? >

<beans xmlns="http://www.springframework.org/schema/beans"

xmlns: xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns: mvc="http://www.springframework.org/schema/mvc"

xmlns: context="http://www.springframework.org/schema/context"

xmlns: tx="http://www.springframework.org/schema/tx"

xsi: schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans. xsd

http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc. xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context. xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx. xsd">

<import resource="webflow. xml"/>

<context: component-scan base-package="wps. newsrussia"/>

<mvc: resources location="/" mapping="/resources/**"/>

<bean class="org. springframework. webflow. mvc. servlet. FlowHandlerMapping">

<property name="flowRegistry" ref="flowRegistry"/>

</bean>

<bean name="resourceHandlerJSF" class="org. springframework. faces. webflow. JsfResourceRequestHandler" />

<bean class="org. springframework. web. servlet. handler. SimpleUrlHandlerMapping">

<property name="order" value="1" />

<property name="mappings">

<value>

/javax. faces. resource/**=resourceHandlerJSF

</value>

</property>

</bean>

<bean class="org. springframework. faces. webflow. JsfFlowHandlerAdapter">

<property name="flowExecutor" ref="flowExecutor"/>

</bean>

<bean id="viewResolver" class="org. springframework. web. servlet. view. UrlBasedViewResolver">

<property name="viewClass" value="org. springframework. faces. mvc. JsfView"/>

<property name="prefix" value="/WEB-INF/views/"/>

<property name="suffix" value=". xhtml"/>

</bean>

<bean id="msg" class="org. springframework. context. support. ReloadableResourceBundleMessageSource">

<property name="basename" value="WEB-INF/locales/messages"/>

<property name="defaultEncoding" value="UTF-8"/>

</bean>

<bean id="dataSource" class="org. springframework. jndi. JndiObjectFactoryBean">

<property name="jndiName" value="jdbc/newsrussia"/>

</bean>

<bean id="sessionFactory" class="org. springframework. orm. hibernate4. LocalSessionFactoryBean">

<property name="dataSource" ref="dataSource"/>

<property name="configLocation" value="classpath: hibernate. cfg. xml"/>

</bean>

<tx: annotation-driven />

<bean id="transactionManager"

class="org. springframework. orm. hibernate4. HibernateTransactionManager">

<property name="sessionFactory" ref="sessionFactory" />

</bean>

<bean class="org. springframework. web. context. support. ServletContextAttributeExporter">

<property name="attributes">

<map>

<entry key="newsrussiaFacade" value-ref="newsrussiaFacade"/>

</map>

</property>

</bean>

<bean id="localeResolver" class="org. springframework. web. servlet. i18n. SessionLocaleResolver">

<property name="defaultLocale" value="ru"/>

</bean>

<mvc: interceptors>

<mvc: interceptor>

<mvc: mapping path="/**/"/>

<bean class="org. springframework. web. servlet. i18n. LocaleChangeInterceptor">

<property name="paramName" value="lang"/>

</bean>

</mvc: interceptor>

</mvc: interceptors>

</beans>

hibernate. cfg. xml

<? xml version='1.0' encoding='utf-8'? >

<! DOCTYPE hibernate-configuration PUBLIC

"- // Hibernate/Hibernate Configuration DTD // EN"

"http://www.hibernate.org/dtd/hibernate-configuration-3.0. dtd">

<hibernate-configuration>

<session-factory>

<property name="hibernate. dialect">org. hibernate. dialect. MySQLDialect</property>

<property name="hibernate. show_sql">true</property>

<property name="connection. url">jdbc: mysql: // localhost: 3306/newsrussia</property>

<property name="connection. driver_class">com. mysql. jdbc. Driver</property>

<mapping resource="wps/newsrussia/entities/Group. hbm. xml"/>

<mapping resource="wps/newsrussia/entities/Users. hbm. xml"/>

<mapping resource="wps/newsrussia/entities/Genre. hbm. xml"/>

<mapping resource="wps/newsrussia/entities/Storage. hbm. xml"/>

<mapping resource="wps/newsrussia/entities/Audio. hbm. xml"/>

<mapping resource="wps/newsrussia/entities/Digest. hbm. xml"/>

<mapping resource="wps/newsrussia/entities/DigestCover. hbm. xml"/>

<mapping resource="wps/newsrussia/entities/DigestIssues. hbm. xml"/>

<mapping resource="wps/newsrussia/entities/JournalCovers. hbm. xml"/>

<mapping resource="wps/newsrussia/entities/JournalIssues. hbm. xml"/>

<mapping resource="wps/newsrussia/entities/Journals. hbm. xml"/>

<mapping resource="wps/newsrussia/entities/Video. hbm. xml"/>

</session-factory>

</hibernate-configuration>

Размещено на Allbest.ru


Подобные документы

  • Разработка информационной базы данных "Поликлиника" с возможностью просмотра, редактирования, добавления сведений и получения результатов запросов. Создание механизмов управления данными при помощи триггеров. Проектирование пользовательского приложения.

    курсовая работа [2,0 M], добавлен 21.06.2011

  • Разработка логической схемы базы данных автомобилестроительного предприятия. Инфологическое моделирование системы. Создание графического интерфейса пользователя для базы данных средствами языка программирования Java. Тестирование программных средств.

    курсовая работа [2,3 M], добавлен 16.12.2013

  • Проектирование базы данных для библиотеки и разработка программы для её удобного использования. Пример работы приложения на примере поиска статей по заданным условиям, а также основных операций с данными – добавления в базу, редактирования и удаления.

    курсовая работа [2,5 M], добавлен 23.02.2014

  • Разработка приложения для работы с базой данных с использованием объектно-ориентированного и визуального программирования. Обзор языка элементов языка программирования Delphi. Проектирование базы данных автозаправки. Клиентская система приложения.

    курсовая работа [2,3 M], добавлен 31.01.2016

  • Разработка базы данных "Тюрьма" для управления информацией, повышение оперативности выдачи информации, добавления и хранения информации о заключенных, охранниках и обслуживающем персонале. Использование языка Java, среды разработки NetBeans и СУБД Derby.

    курсовая работа [996,8 K], добавлен 31.01.2016

  • Разработка и анализ интерфейса пользователя базы данных. Ознакомление с процессом поэтапного создания проекта и добавления файла локальной базы данных. Исследование и характеристика главных принципов программирования функциональной части интерфейса.

    дипломная работа [3,0 M], добавлен 27.09.2017

  • Возможности программы DBDesigner. Проектирование и реализация информационно-поисковой системы с помощью CASE-средства DBDesigner в среде Intranet. Этапы проектирования базы данных, установление соединения с базой данных на сервере, синхронизация.

    лабораторная работа [1,5 M], добавлен 18.08.2009

  • Основы работы с прикладным программным обеспечением, содержащим составляющие для работы с данными. Составление исходного кода скриптов для сортировки, добавления, редактирования и удаления информации в базу данных. Особенности работы операции поиска.

    курсовая работа [610,7 K], добавлен 20.01.2012

  • Разработка приложения, позволяющего автоматизировать документооборот предприятия по списанию основных средств. Мероприятия по защите и обеспечению целостности базы данных. Разработка клиентского приложения. Запросы к базе данных, руководство пользователя.

    курсовая работа [700,0 K], добавлен 14.01.2015

  • Проектирование концептуальной, логической и физической модели базы данных. Формирование сущностей и связей между ними. Создание форм с функциями добавления, редактирования, удаления, поиска, печати. Разработка клиентской части БД с помощью среды Lazarus.

    курсовая работа [1,3 M], добавлен 05.04.2015

Работы в архивах красиво оформлены согласно требованиям ВУЗов и содержат рисунки, диаграммы, формулы и т.д.
PPT, PPTX и PDF-файлы представлены только в архивах.
Рекомендуем скачать работу.