From: gotty
Date: Fri, 2 Jun 2017 13:01:00 +0000 (+0000)
Subject: [LIB-5] Site sources of snooker-score-api
X-Git-Url: https://git.hedgecode.org/?a=commitdiff_plain;h=5249634fbece93b8481cd7f1dc9bb7e55194e3d4;p=snooker-score-api.git
[LIB-5] Site sources of snooker-score-api
git-svn-id: https://svn.hedgecode.org/lib/snooker-score-api/trunk@120 fb0bcced-7025-49ed-a12f-f98bce993226
---
diff --git a/sample.txt b/sample.txt
new file mode 100644
index 0000000..2786210
--- /dev/null
+++ b/sample.txt
@@ -0,0 +1,159 @@
+Event
+[
+{
+"ID": 398,
+"Name": "Shanghai Masters Qualifiers",
+"StartDate": "2015-08-05",
+"EndDate": "2015-08-09",
+"Sponsor": "Bank of Communications OTO",
+"Season": 2015,
+"Type": "Qualifying",
+"Num": 0,
+"Venue": "Barnsley Metrodome",
+"City": "Barnsley",
+"Country": "England",
+"Discipline": "snooker",
+"Main": 403,
+"Sex": "Both",
+"AgeGroup": "O",
+"Url": "",
+"Related": "shanghai",
+"Stage": "Q",
+"ValueType": "SM",
+"ShortName": "",
+"WorldSnookerId": 13850,
+"RankingType": "WR",
+"EventPredictionID": 0,
+"Team": false,
+"Format": 1,
+"Twitter": "",
+"HashTag": "SnookerShanghaiMasters",
+"ConversionRate": 1,
+"AllRoundsAdded": true,
+"PhotoURLs": "",
+"NumCompetitors": 96,
+"NumUpcoming": 0,
+"NumActive": 0,
+"NumResults": 96,
+"Note": "",
+"CommonNote": "Watch on World Snooker<\u002Fa> and selected betting sites",
+"DefendingChampion": 0,
+"PreviousEdition": 0
+}
+]
+
+*********************************************************
+Match
+[
+{
+"ID": 2240166,
+"EventID": 397,
+"Round": 1,
+"Number": 5,
+"Player1ID": 1730,
+"Score1": 1,
+"Walkover1": false,
+"Player2ID": 1590,
+"Score2": 4,
+"Walkover2": false,
+"WinnerID": 1590,
+"Unfinished": false,
+"OnBreak": false,
+"WorldSnookerID": 386706,
+"LiveUrl": "",
+"DetailsUrl": "",
+"PointsDropped": false,
+"ShowCommonNote": false,
+"Estimated": false,
+"Type": 1,
+"TableNo": 0,
+"VideoURL": "",
+"InitDate": "2015-07-08T13:36:14Z",
+"ModDate": "2015-07-29T14:14:35Z",
+"StartDate": "2015-07-29T14:14:35Z",
+"EndDate": "2015-07-29T17:25:14Z",
+"ScheduledDate": "2015-07-29T14:00:00Z",
+"FrameScores": "",
+"Sessions": "",
+"Note": "",
+"ExtendedNote": ""
+}
+]
+
+*********************************************************
+Player
+
+[
+{
+"ID": 1,
+"Type": 1,
+"FirstName": "Mark",
+"MiddleName": "J",
+"LastName": "Williams",
+"TeamName": "",
+"TeamNumber": 0,
+"TeamSeason": 0,
+"ShortName": "M J Williams",
+"Nationality": "Wales",
+"Sex": "M",
+"BioPage": "http:\u002F\u002Fsnooker.org\u002Fplr\u002Fbio\u002Fmwilliams.shtml",
+"Born": "1975-03-21",
+"Twitter": "markwil147",
+"SurnameFirst": false,
+"License": "",
+"Club": "",
+"URL": "",
+"Photo": "http:\u002F\u002Fsnooker.org\u002Fimg\u002Fplayers\u002FMarkWilliams.png",
+"Info": ""
+}
+]
+
+*********************************************************
+Ranking
+[
+{
+"ID": 10830258,
+"Position": 1,
+"PlayerID": 17,
+"Season": 2015,
+"Sum": 680041,
+"Type": "MoneyRankings"
+}
+]
+*********************************************************
+OngoingMatch
+[
+{
+"ID": 3352339,
+"EventID": 531,
+"Round": 7,
+"Number": 8,
+"Player1ID": 17,
+"Score1": 0,
+"Walkover1": false,
+"Player2ID": 1,
+"Score2": 1,
+"Walkover2": false,
+"WinnerID": 0,
+"Unfinished": true,
+"OnBreak": false,
+"WorldSnookerID": 434080,
+"LiveUrl": "",
+"DetailsUrl": "",
+"PointsDropped": false,
+"ShowCommonNote": true,
+"Estimated": false,
+"Type": 1,
+"TableNo": 0,
+"VideoURL": "",
+"InitDate": "2016-12-04T14:45:51Z",
+"ModDate": "2017-01-18T13:39:40Z",
+"StartDate": "2017-01-18T13:10:00Z",
+"EndDate": "",
+"ScheduledDate": "2017-01-18T13:00:00Z",
+"FrameScores": "",
+"Sessions": "",
+"Note": "",
+"ExtendedNote": ""
+}
+]
diff --git a/src/site/apt/examples/handle-the-api-exceptions.apt.vm b/src/site/apt/examples/handle-the-api-exceptions.apt.vm
new file mode 100644
index 0000000..45cbab6
--- /dev/null
+++ b/src/site/apt/examples/handle-the-api-exceptions.apt.vm
@@ -0,0 +1,68 @@
+ ------
+ Handling the API exceptions
+ ------
+ Dmitry Samoshin aka gotty
+ ------
+ 2017-01-27
+ ------
+
+~~ Copyright (c) 2017. Developed by Hedgecode.
+~~
+~~ Licensed under the Apache License, Version 2.0 (the "License");
+~~ you may not use this file except in compliance with the License.
+~~ You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing, software
+~~ distributed under the License is distributed on an "AS IS" BASIS,
+~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+~~ See the License for the specific language governing permissions and
+~~ limitations under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+Handling the API exceptions
+
+ This library provides the basic exception <<>> that in the event
+ of exceptional situations can inform the client application of the type of error
+ that occurred in the process of using library methods.\
+ This exception can notify you about two types of exception:
+
++-------
+public class APIException extends Exception {
+
+ public static enum Type {
+ INFO,
+ REQUEST
+ }
+ ...
+}
++-------
+
+ You can get the type of exception that was thrown by using the method <<>>.
+
+ The type <<>> tells the client application that the exception that that has occurred
+ is not critical and is not related to the inability to obtain useful information.
+ The work of the application can be continued after detection of this type of exception without
+ serious consequences but with some adjustments in the future working functionality.
+
+ The type <<>> tells the client application that the exception that has occurred is associated
+ with the process of obtaining useful information from the portal {{{http://snooker.org/}snooker.org}}
+ or with the inability to handle the received information.\
+ This type of exception can occur for several reasons:
+
+ <<1.>> The data passed to the API method is incorrect. This can occur in case of an incorrect
+ input ID (tournament, player, etc.) or a <> input parameter. In this case the application
+ can continue to work after correction the transmitted parameters.
+
+ <<2.>> Inaccessibility of the communication channel (access to the portal).
+ Information simply can not be obtained. In this case the client application can not continue
+ to work until an Internet connection is established.
+
+ <<3.>> The portal API has changed. Incoming data can not be processed correctly.
+ This case is the most significant. It means that the current version of the library
+ can no longer be considered workable. It is necessary to check the availability of
+ a more recent version of the library and if there is none then inform the developer about
+ of a detected nonconformity between API library and portal {{{http://api.snooker.org/}api.snooker.org}}.
diff --git a/src/site/apt/examples/use-sort-in-collections.apt.vm b/src/site/apt/examples/use-sort-in-collections.apt.vm
new file mode 100644
index 0000000..ec7f9b3
--- /dev/null
+++ b/src/site/apt/examples/use-sort-in-collections.apt.vm
@@ -0,0 +1,89 @@
+ ------
+ Using sorting of received data
+ ------
+ Dmitry Samoshin aka gotty
+ ------
+ 2017-01-27
+ ------
+
+~~ Copyright (c) 2017. Developed by Hedgecode.
+~~
+~~ Licensed under the Apache License, Version 2.0 (the "License");
+~~ you may not use this file except in compliance with the License.
+~~ You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing, software
+~~ distributed under the License is distributed on an "AS IS" BASIS,
+~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+~~ See the License for the specific language governing permissions and
+~~ limitations under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+Using sorting of received data
+
+ The data obtained from the API methods calls of the main interface of the library,
+ in most cases, represent collection classes (<<>>, <<>>, <<>>)
+ which can be sorted by certain parameters for convenience of further use in client applications.
+
+ The types of possible sorts for specific collection classes are listed below.
+
+===
+
+ <<>> - entity class which contains a selection of players on certain parameters.\
+ This class provides two types of sorting:
+
+ <<1.>> Sorting players by name.
+
+ <<2.>> Sorting players by age, both in descending order and in ascending order.
+
+ Java code that shows all the above sorting methods is presented below:
+
++-------
+Players players = Snooker.API().getPlayers(...);
+...
+players.sortByName();
+...
+players.sortByAge();
+players.sortByAgeDesc();
+...
++-------
+
+===
+
+ <<>> - entity class which contains a selection of tournaments for certain parameters.
+
+ Java code that shows the sorting of tournaments by date is presented below:
+
++-------
+Events events = Snooker.API().getSeasonEvents((...);
+...
+events.sortByDate();
+...
++-------
+
+===
+
+ <<>> - entity class which contains a selection of matches for certain parameters.\
+ This class provides two types of sorting:
+
+ <<1.>> Sorting matches by number.\
+ This sorting type will be useful when the selection contains all the matches of a single tournament.
+
+ <<2.>> Sorting matches by tournament.\
+ This sorting type will be useful when the selection contains all the matches
+ of an individual player for the season in different tournaments.
+
+ Java code that shows all the above sorting methods is presented below:
+
++-------
+Matches matches = Snooker.API().getEventMatches((...);
+...
+matches.sortByNumber();
+...
+matches.sortByEvent();
+...
++-------
diff --git a/src/site/apt/examples/work-with-the-cached-api.apt.vm b/src/site/apt/examples/work-with-the-cached-api.apt.vm
new file mode 100644
index 0000000..912a756
--- /dev/null
+++ b/src/site/apt/examples/work-with-the-cached-api.apt.vm
@@ -0,0 +1,85 @@
+ ------
+ Working with the cached version API
+ ------
+ Dmitry Samoshin aka gotty
+ ------
+ 2017-01-27
+ ------
+
+~~ Copyright (c) 2017. Developed by Hedgecode.
+~~
+~~ Licensed under the Apache License, Version 2.0 (the "License");
+~~ you may not use this file except in compliance with the License.
+~~ You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing, software
+~~ distributed under the License is distributed on an "AS IS" BASIS,
+~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+~~ See the License for the specific language governing permissions and
+~~ limitations under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+Working with the cached version API
+
+ When you first call the API method to get the main interface of the library
+
++-------
+SnookerScoreAPI api = Snooker.API();
++-------
+
+ by default we get the cached implementation of the API interface <<>>.\
+ What are its advantages?
+
+===
+
+ Firstly, when using the cached version of the interface for various queries, you get a full range
+ of useful information. For example, when requesting current matches, the sample will contain
+ links to the tournament (object <<>>) as well as to the players
+ participating in each match (objects <<>>) in addition to other information:
+
++-------
+SnookerScoreAPI api = Snooker.API();
+OngoingMatches matches = api.getOngoingMatches();
+for (OngoingMatch match : matches) {
+ Event event = match.event();
+ Player player1 = match.player1();
+ Player player2 = match.player2();
+}
++-------
+
+ Whereas when working with the noncached version of the interface, you will have to make
+ additional queries about the tournament and players in order to get full information
+ about the ongoing matches:
+
++-------
+SnookerScoreAPI api = Snooker.uncachedAPI();
+OngoingMatches matches = api.getOngoingMatches();
+for (OngoingMatch match : matches) {
+ Event event = api.getEvent(match.eventId());
+ Player player1 = api.getPlayer(match.player1Id());
+ Player player2 = api.getPlayer(match.player2Id());
+}
++-------
+
+===
+
+ Secondly, in the cached version of the interface, you are given the opportunity to specify
+ the current season, with the events of which in the future you are going to work
+ by requesting tournaments and matches:
+
++-------
+SnookerScoreAPI api = Snooker.API();
+api.setCurrentSeason(Season.getSeason(2015));
++-------
+
+===
+
+ P.S. If you need to use the noncached version of the API, you can get it as follows:
+
++-------
+SnookerScoreAPI uncachedApi = Snooker.uncachedAPI();
++-------
diff --git a/src/site/apt/index.apt.vm b/src/site/apt/index.apt.vm
new file mode 100644
index 0000000..5f23c23
--- /dev/null
+++ b/src/site/apt/index.apt.vm
@@ -0,0 +1,56 @@
+ ------
+ Introduction
+ ------
+ Dmitry Samoshin aka gotty
+ ------
+ 2017-01-22
+ ------
+
+~~ Copyright (c) 2017. Developed by Hedgecode.
+~~
+~~ Licensed under the Apache License, Version 2.0 (the "License");
+~~ you may not use this file except in compliance with the License.
+~~ You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing, software
+~~ distributed under the License is distributed on an "AS IS" BASIS,
+~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+~~ See the License for the specific language governing permissions and
+~~ limitations under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+${project.name}
+
+ ${project.description}
+
+ All useful information is downloaded via the HTTP protocol from the portal {{{http://snooker.org/}snooker.org}},
+ so for the functioning of applications that use this library Internet access is required.
+
+ The current version of the library:
+ {{{http://repo.hedgecode.org/content/repositories/releases/org/hedgecode/snooker/${project.artifactId}/${project.version}/${project.artifactId}-${project.version}.jar}${project.version}}}
+
+ <>:
+
+* Usage
+
+ General instructions on how to use this library can be found on the {{{./usage.html}usage page}}.
+
+ Description of the main methods of the library is in the section {{{./faq.html}FAQ}}.
+
+ Some more specific use cases are described in the examples given below.
+
+* Examples
+
+ To better understand the described library you can refer to the following examples:
+
+ * {{{./examples/work-with-the-cached-api.html}Working with the cached version API}}
+
+ * {{{./examples/use-sort-in-collections.html}Using sorting of received data}}
+
+ * {{{./examples/handle-the-api-exceptions.html}Handling the API exceptions}}
+
+ []
diff --git a/src/site/apt/usage.apt.vm b/src/site/apt/usage.apt.vm
new file mode 100644
index 0000000..15f62f4
--- /dev/null
+++ b/src/site/apt/usage.apt.vm
@@ -0,0 +1,119 @@
+ ------
+ Usage
+ ------
+ Dmitry Samoshin aka gotty
+ ------
+ 2017-01-22
+ ------
+
+~~ Copyright (c) 2017. Developed by Hedgecode.
+~~
+~~ Licensed under the Apache License, Version 2.0 (the "License");
+~~ you may not use this file except in compliance with the License.
+~~ You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing, software
+~~ distributed under the License is distributed on an "AS IS" BASIS,
+~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+~~ See the License for the specific language governing permissions and
+~~ limitations under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+Usage
+
+* Add the library for use in Java applications
+
+ The template for adding this library for developing Java applications
+ using the pom.xml configuration maven file is described below:
+
++-----
+
+ ...
+
+
+ ${project.groupId}
+ ${project.artifactId}
+ ${project.version}
+
+
+ ...
+
++-----
+
+ <>: Maven 3.0 will issue warnings if you do not specify the version of a plugin.
+
+* Work with the Java code of the library
+
+ After adding the library to the project you can start working with its code.\
+ To get an instance of the main library interface you need to add the following code:
+
++-----
+SnookerScoreAPI api = Snooker.API();
++-----
+
+ <<>> is an interface with a set of all main methods that allow to access information
+ about the seasons, tournaments, matches, players and their ratings through entity objects.
+
+ The library provides two implementations of the main interface:
+ with caching data for players and events (tournaments) inside and without caching.
+ Implementation of the interface with caching is "by default".\
+ Access to each of the two implementations of the interface can be obtained by the following method calls:
+
++-----
+SnookerScoreAPI cachedApi = Snooker.cachedAPI(); /* API with cache */
+...
+SnookerScoreAPI uncachedApi = Snooker.uncachedAPI(); /* API without cache */
++-----
+
+ Further work with the library is a sequence of calls to <<>> interface methods
+ to obtain lists of tournaments, players, current matches and other statistical information.\
+ For example, to get information on the matches currently underway,
+ it is enough to execute the following code:
+
++-----
+SnookerScoreAPI api = Snooker.API();
+OngoingMatches matches = api.getOngoingMatches();
++-----
+
+ Description of most interface methods can be found in the section {{{./faq.html}FAQ}},
+ and the most often encountered situations are considered on the pages with examples.
+ Signature of methods as well as information on other entities of the library is presented in
+ {{{./apidocs/}JavaDoc}}.
+
+* Run the library from the command line
+
+ You can run this library from the command line to check the correctness of the connection
+ to the information portal {{{http://snooker.org/}snooker.org}}.
+ Starting the library from the command line is as follows:
+
++-----
+java -jar ${project.artifactId}-${project.version}.jar
++-----
+
+ If the launch is working correctly, you can see a list of current and upcoming snooker tournaments.\
+ The sample output of the launching the library is shown below:
+
++-----
+********************************************************************************
+ Welcome to Hedgecode Snooker Score API!
+ -----------------------------------------------
+ It is an API library for portal snooker.org, which contains
+ the results of snooker competitions and other snooker information.
+ This library provides a set of entity objects that can be used in client
+ applications (to inform about the results of snooker), developed in Java.
+********************************************************************************
+ Current Snooker Events:
+ China Open Qualifiers [24.01.2017 - 27.01.2017] (England, Preston)
+********************************************************************************
+ Upcoming Snooker Events:
+ German Masters [01.02.2017 - 05.02.2017] (Germany, Berlin)
+ World Grand Prix [06.02.2017 - 12.02.2017] (England, Preston)
+ Welsh Open [13.02.2017 - 19.02.2017] (Wales, Cardiff)
+ Connie Gough Memorial Trophy [18.02.2017 - 18.02.2017] (England, Dunstable)
+ Championship League - Group 5 [20.02.2017 - 21.02.2017] (England, Coventry)
+********************************************************************************
++-----
diff --git a/src/site/fml/faq.fml b/src/site/fml/faq.fml
new file mode 100644
index 0000000..85077a7
--- /dev/null
+++ b/src/site/fml/faq.fml
@@ -0,0 +1,139 @@
+
+
+
+
+
+
+ General:
+
+
+ How to get full information on a specific tournament?
+
+
+ Event event = Snooker.API().getEvent(eventId);
+ where parameter eventId
is ID of the tournament.
+
+
+
+
+
+ How to get full information on a specific match?
+
+
+ Match match = Snooker.API().getMatch(eventId, roundId, matchNumber);
+ where parameter eventId
is ID of the tournament which the match is played;
+ roundId
is ID of the round of the tournament;
+ matchNumber
is number of the match in the round.
+
+
+
+
+
+ How to get full information on a specific player?
+
+
+ Player player = Snooker.API().getPlayer(int playerId);
+ where parameter playerId
is ID of the player.
+
+
+
+
+
+ How to get information on all tournaments in the season?
+
+
+ Events seasonEvents = Snooker.API().getSeasonEvents(season);
+ where parameter season
is object of class Season
+ that specify a season or Season.ALL
for all available seasons.
+
+
+
+
+
+ How to get information on all matches of a specific tournament?
+
+
+ Matches eventMatches = Snooker.API().getEventMatches(eventId);
+ where parameter eventId
is ID of the tournament.
+
+
+
+
+
+ How to get information on the matches which take place in this moment?
+
+
+ OngoingMatches matches = Snooker.API().getOngoingMatches();
+
+
+
+
+
+ How to get information on all matches of a specific player in the season?
+
+
+ Matches playerMatches = Snooker.API().getPlayerMatches(playerId, season);
+ where parameter playerId
is ID of the player
+ and season
is object of class Season
+ that specify a season or Season.ALL
for all available seasons.
+
+
+
+
+
+ How to get information on all players in a specific tournament?
+
+
+ Players eventPlayers = Snooker.API().getEventPlayers(eventId);
+ where parameter eventId
is ID of the tournament.
+
+
+
+
+
+ How to get information on all players in a specific season?
+
+
+ Players players = Snooker.API().getPlayers(season, category);
+ where parameter season
is object of class Season
+ that specify a season or Season.ALL
for all available seasons
+ and category
is object of class PlayerCategory
+ that specify a category of players (for example, PlayerCategory.PRO
).
+
+
+
+
+
+ Additional:
+
+
+ How to get information on the ratings/earnings of all players in the season?
+
+
+ Rankings rankings = Snooker.API().getRankings(season, rankingType);
+ where parameter season
is object of class Season
+ that specify a season or Season.ALL
for all available seasons
+ and rankingType
is object of class RankingType
+ that specify a rating type (for example, RankingType.MoneyRankings
).
+
+
+
+
+
diff --git a/src/site/ru/apt/examples/handle-the-api-exceptions.apt.vm b/src/site/ru/apt/examples/handle-the-api-exceptions.apt.vm
new file mode 100644
index 0000000..acaaa15
--- /dev/null
+++ b/src/site/ru/apt/examples/handle-the-api-exceptions.apt.vm
@@ -0,0 +1,68 @@
+ ------
+ ÐбÑабоÑка иÑклÑÑений, возникаÑÑиÑ
пÑи ÑабоÑе Ñ API
+ ------
+ Dmitry Samoshin aka gotty
+ ------
+ 2017-01-27
+ ------
+
+~~ Copyright (c) 2017. Developed by Hedgecode.
+~~
+~~ Licensed under the Apache License, Version 2.0 (the "License");
+~~ you may not use this file except in compliance with the License.
+~~ You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing, software
+~~ distributed under the License is distributed on an "AS IS" BASIS,
+~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+~~ See the License for the specific language governing permissions and
+~~ limitations under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+ÐбÑабоÑка иÑклÑÑений, возникаÑÑиÑ
пÑи ÑабоÑе Ñ API
+
+ Рданной библиоÑеке Ñеализовано оÑновное иÑклÑÑение <<>>, коÑоÑое
+ пÑи возникновении иÑклÑÑиÑелÑнÑÑ
ÑиÑÑаÑий Ð¼Ð¾Ð¶ÐµÑ ÑообÑаÑÑ ÐºÐ»Ð¸ÐµÐ½ÑÑÐºÐ¾Ð¼Ñ Ð¿ÑиложениÑ
+ о Ñипе возникÑей оÑибке в пÑоÑеÑÑе иÑполÑÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ Ð±Ð¸Ð±Ð»Ð¸Ð¾ÑеÑнÑÑ
меÑодов.\
+ Ðанное иÑклÑÑение Ð¼Ð¾Ð¶ÐµÑ ÑведомлÑÑÑ Ð¾ двÑÑ
ÑипаÑ
иÑклÑÑиÑелÑнÑÑ
ÑиÑÑаÑий:
+
++-------
+public class APIException extends Exception {
+
+ public static enum Type {
+ INFO,
+ REQUEST
+ }
+ ...
+}
++-------
+
+ ÐолÑÑиÑÑ Ñип возникÑего иÑклÑÑÐµÐ½Ð¸Ñ Ð¼Ð¾Ð¶Ð½Ð¾ пÑи помоÑи меÑода <<>>.
+
+ Тип <<>> ÑообÑÐ°ÐµÑ ÐºÐ»Ð¸ÐµÐ½ÑÑÐºÐ¾Ð¼Ñ Ð¿ÑÐ¸Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ Ð¾ Ñом, ÑÑо возникÑее иÑклÑÑение не ÑвлÑеÑÑÑ
+ кÑиÑиÑеÑким и не ÑвÑзано Ñ Ð½ÐµÐ²Ð¾Ð·Ð¼Ð¾Ð¶Ð½Ð¾ÑÑÑÑ Ð¿Ð¾Ð»ÑÑиÑÑ Ð¿Ð¾Ð»ÐµÐ·Ð½ÑÑ Ð¸Ð½ÑоÑмаÑиÑ.
+ РабоÑа пÑÐ¸Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ Ð¼Ð¾Ð¶ÐµÑ Ð±ÑÑÑ Ð¿Ñодолжена поÑле обнаÑÑÐ¶ÐµÐ½Ð¸Ñ Ð´Ð°Ð½Ð½Ð¾Ð³Ð¾ Ñипа иÑклÑÑÐµÐ½Ð¸Ñ Ð±ÐµÐ·
+ ÑеÑÑезнÑÑ
поÑледÑÑвий, но Ñ Ð¾Ð¿ÑеделеннÑми коÑÑекÑиÑовками в далÑнейÑем ÑабоÑем ÑÑнкÑионале.
+
+ Тип <<>> ÑообÑÐ°ÐµÑ ÐºÐ»Ð¸ÐµÐ½ÑÑÐºÐ¾Ð¼Ñ Ð¿ÑÐ¸Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ Ð¾ Ñом, ÑÑо возникÑее иÑклÑÑение ÑвÑзано
+ Ñ Ð¿ÑоÑеÑÑом полÑÑÐµÐ½Ð¸Ñ Ð¿Ð¾Ð»ÐµÐ·Ð½Ð¾Ð¹ инÑоÑмаÑии Ñ Ð¿Ð¾ÑÑала {{{http://snooker.org/}snooker.org}}, либо
+ Ñ Ð½ÐµÐ²Ð¾Ð·Ð¼Ð¾Ð¶Ð½Ð¾ÑÑÑÑ Ð¾Ð±ÑабоÑаÑÑ Ð¿Ð¾Ð»ÑÑеннÑÑ Ð¸Ð½ÑоÑмаÑиÑ.\
+ ÐаннÑй Ñип иÑклÑÑÐµÐ½Ð¸Ñ Ð¼Ð¾Ð¶ÐµÑ Ð²Ð¾Ð·Ð½Ð¸ÐºÐ½ÑÑÑ Ð¿Ð¾ неÑколÑким пÑиÑинам:
+
+ <<1.>> ÐаннÑе, пеÑеданнÑе API-меÑодÑ, некоÑÑекÑнÑ. Такое Ð¼Ð¾Ð¶ÐµÑ Ð²Ð¾Ð·Ð½Ð¸ÐºÐ½ÑÑÑ Ð² ÑлÑÑае пеÑедаÑи
+ некоÑÑекÑного вÑ
одного ID (ÑÑÑниÑа, игÑока и пÑ.) или же <>-паÑамеÑÑа. Рданном ÑлÑÑае
+ ÑабоÑа пÑÐ¸Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ Ð¼Ð¾Ð¶ÐµÑ Ð±ÑÑÑ Ð¿Ñодолжена поÑле коÑÑекÑиÑовки пеÑедаваемÑÑ
паÑамеÑÑов.
+
+ <<2.>> ÐаÑÑÑение канала ÑвÑзи (доÑÑÑпа к поÑÑалÑ). ÐнÑоÑмаÑÐ¸Ñ Ð¿ÑоÑÑо не Ð¼Ð¾Ð¶ÐµÑ Ð±ÑÑÑ Ð¿Ð¾Ð»ÑÑена.
+ Рданном ÑлÑÑае клиенÑÑкое пÑиложение не Ð¼Ð¾Ð¶ÐµÑ Ð¿ÑодолжаÑÑ ÑабоÑаÑÑ Ð´Ð¾ ÑÑÑÐ°Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ Ð½Ð¾ÑмалÑного
+ инÑеÑнеÑ-ÑоединениÑ.
+
+ <<3.>> API Ñамого поÑÑала пÑеÑеÑпело изменениÑ. ÐÑ
одÑÑие даннÑе не могÑÑ Ð±ÑÑÑ ÐºÐ¾ÑÑекÑно обÑабоÑанÑ.
+ ÐÑÐ¾Ñ ÑлÑÑай ÑамÑй ÑÑÑеÑÑвеннÑй. Ðн ознаÑаеÑ, ÑÑо ÑекÑÑÐ°Ñ Ð²ÐµÑÑÐ¸Ñ Ð±Ð¸Ð±Ð»Ð¸Ð¾Ñеки Ñже не Ð¼Ð¾Ð¶ÐµÑ ÑÑиÑаÑÑÑÑ
+ ÑабоÑоÑпоÑобной. ÐеобÑ
одимо пÑовеÑиÑÑ Ð½Ð°Ð»Ð¸Ñие более Ñвежей веÑÑии данной библиоÑеки, и еÑли ÑаковаÑ
+ оÑÑÑÑÑÑвÑеÑ, Ñо ÑообÑиÑÑ ÑазÑабоÑÑÐ¸ÐºÑ Ð¾ вÑÑвленном неÑооÑвеÑÑÑвии API библиоÑеки
+ и поÑÑала {{{http://api.snooker.org/}api.snooker.org}}.
diff --git a/src/site/ru/apt/examples/use-sort-in-collections.apt.vm b/src/site/ru/apt/examples/use-sort-in-collections.apt.vm
new file mode 100644
index 0000000..244cb61
--- /dev/null
+++ b/src/site/ru/apt/examples/use-sort-in-collections.apt.vm
@@ -0,0 +1,88 @@
+ ------
+ ÐÑполÑзование ÑоÑÑиÑовки полÑÑеннÑÑ
даннÑÑ
+ ------
+ Dmitry Samoshin aka gotty
+ ------
+ 2017-01-27
+ ------
+
+~~ Copyright (c) 2017. Developed by Hedgecode.
+~~
+~~ Licensed under the Apache License, Version 2.0 (the "License");
+~~ you may not use this file except in compliance with the License.
+~~ You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing, software
+~~ distributed under the License is distributed on an "AS IS" BASIS,
+~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+~~ See the License for the specific language governing permissions and
+~~ limitations under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+ÐÑполÑзование ÑоÑÑиÑовки полÑÑеннÑÑ
даннÑÑ
+
+ ÐаннÑе, полÑÑаемÑе пÑи вÑзоваÑ
API-меÑодов оÑновного инÑеÑÑейÑа библиоÑеки, в болÑÑинÑÑве Ñвоем
+ пÑедÑÑавлÑÑÑ ÐºÐ»Ð°ÑÑÑ-коллекÑии (<<>>, <<>>, <<>>), к коÑоÑÑм Ð´Ð»Ñ ÑдобÑÑва
+ далÑнейÑего иÑполÑÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ Ð² клиенÑÑкиÑ
пÑиложениÑÑ
можно пÑименÑÑÑ ÑоÑÑиÑÐ¾Ð²ÐºÑ Ð¿Ð¾ опÑеделеннÑм паÑамеÑÑам.
+
+ Ðиже пеÑеÑиÑÐ»ÐµÐ½Ñ Ð²Ð¸Ð´Ñ Ð²Ð¾Ð·Ð¼Ð¾Ð¶Ð½ÑÑ
ÑоÑÑиÑовок Ð´Ð»Ñ ÐºÐ¾Ð½ÐºÑеÑнÑÑ
клаÑÑов-коллекÑий.
+
+===
+
+ <<>> - клаÑÑ-ÑÑÑноÑÑÑ, в коÑоÑом ÑодеÑжиÑÑÑ Ð²ÑбоÑка игÑоков по опÑеделеннÑм паÑамеÑÑам.\
+ ÐаннÑй клаÑÑ Ð¿ÑедоÑÑавлÑÐµÑ Ð´Ð²Ð° вида ÑоÑÑиÑовки:
+
+ <<1.>> СоÑÑиÑовка игÑоков по имени.
+
+ <<2.>> СоÑÑиÑовка игÑоков по возÑаÑÑÑ, как по ÑбÑваниÑ, Ñак и по возÑаÑÑаниÑ.
+
+ Ðиже пÑедÑÑавлен Java-код, демонÑÑÑиÑÑÑÑий вÑе вÑÑеÑказаннÑе ÑпоÑÐ¾Ð±Ñ ÑоÑÑиÑовки:
+
++-------
+Players players = Snooker.API().getPlayers(...);
+...
+players.sortByName();
+...
+players.sortByAge();
+players.sortByAgeDesc();
+...
++-------
+
+===
+
+ <<>> - клаÑÑ-ÑÑÑноÑÑÑ, в коÑоÑом ÑодеÑжиÑÑÑ Ð²ÑбоÑка ÑÑÑниÑов по опÑеделеннÑм паÑамеÑÑам.
+
+ Ðиже пÑедÑÑавлен Java-код, демонÑÑÑиÑÑÑÑий ÑоÑÑиÑÐ¾Ð²ÐºÑ ÑÑÑниÑов по даÑе:
+
++-------
+Events events = Snooker.API().getSeasonEvents((...);
+...
+events.sortByDate();
+...
++-------
+
+===
+
+ <<>> - клаÑÑ-ÑÑÑноÑÑÑ, в коÑоÑом ÑодеÑжиÑÑÑ Ð²ÑбоÑка маÑÑей по опÑеделеннÑм паÑамеÑÑам.\
+ ÐаннÑй клаÑÑ Ð¿ÑедоÑÑавлÑÐµÑ Ð´Ð²Ð° вида ÑоÑÑиÑовки:
+
+ <<1.>> СоÑÑиÑовка маÑÑей по номеÑÑ.\
+ ÐаннÑй Ñип ÑоÑÑиÑовки бÑÐ´ÐµÑ Ð¿Ð¾Ð»ÐµÐ·ÐµÐ½ Ñогда, когда вÑбоÑка ÑодеÑÐ¶Ð¸Ñ Ð²Ñе маÑÑи оÑделÑно взÑÑого ÑÑÑниÑа.
+
+ <<2.>> СоÑÑиÑовка маÑÑей по ÑÑÑниÑам.\
+ ÐаннÑй Ñип ÑоÑÑиÑовки бÑÐ´ÐµÑ Ð¿Ð¾Ð»ÐµÐ·ÐµÐ½ Ñогда, когда вÑбоÑка ÑодеÑÐ¶Ð¸Ñ Ð²Ñе маÑÑи оÑделÑно взÑÑого игÑока за Ñезон в ÑазнÑÑ
ÑÑÑниÑаÑ
.
+
+ Ðиже пÑедÑÑавлен Java-код, демонÑÑÑиÑÑÑÑий вÑе вÑÑеÑказаннÑе ÑпоÑÐ¾Ð±Ñ ÑоÑÑиÑовки:
+
++-------
+Matches matches = Snooker.API().getEventMatches((...);
+...
+matches.sortByNumber();
+...
+matches.sortByEvent();
+...
++-------
diff --git a/src/site/ru/apt/examples/work-with-the-cached-api.apt.vm b/src/site/ru/apt/examples/work-with-the-cached-api.apt.vm
new file mode 100644
index 0000000..1c8f111
--- /dev/null
+++ b/src/site/ru/apt/examples/work-with-the-cached-api.apt.vm
@@ -0,0 +1,84 @@
+ ------
+ РабоÑа Ñ ÐºÑÑиÑÑÑÑей веÑÑией API
+ ------
+ Dmitry Samoshin aka gotty
+ ------
+ 2017-01-27
+ ------
+
+~~ Copyright (c) 2017. Developed by Hedgecode.
+~~
+~~ Licensed under the Apache License, Version 2.0 (the "License");
+~~ you may not use this file except in compliance with the License.
+~~ You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing, software
+~~ distributed under the License is distributed on an "AS IS" BASIS,
+~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+~~ See the License for the specific language governing permissions and
+~~ limitations under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+РабоÑа Ñ ÐºÑÑиÑÑÑÑей веÑÑией API
+
+ ÐÑи пеÑвонаÑалÑном вÑзове API-меÑода Ð´Ð»Ñ Ð¿Ð¾Ð»ÑÑÐµÐ½Ð¸Ñ Ð¾Ñновного инÑеÑÑейÑа библиоÑеки
+
++-------
+SnookerScoreAPI api = Snooker.API();
++-------
+
+ Ð¼Ñ Ð¿Ð¾ ÑмолÑÐ°Ð½Ð¸Ñ Ð¸Ð¼ÐµÐµÐ¼ дело Ñ ÐºÑÑиÑÑÑÑей ÑеализаÑией API-инÑеÑÑейÑа <<>>.\
+ Ð Ñем же ÐµÑ Ð¿ÑеимÑÑеÑÑва?
+
+===
+
+ Ðо-пеÑвÑÑ
, пÑи ÑабоÑе Ñ ÐºÑÑиÑÑÑÑей веÑÑией инÑеÑÑейÑа пÑи ÑазлиÑнÑÑ
запÑоÑаÑ
Ð²Ñ Ð¿Ð¾Ð»ÑÑаеÑе
+ более полнÑй обÑÑм полезной инÑоÑмаÑии. ÐапÑимеÑ, пÑи запÑоÑе ÑекÑÑиÑ
маÑÑей в вÑбоÑке бÑдÑÑ
+ ÑодеÑжаÑÑÑÑ, помимо дÑÑгой инÑоÑмаÑии, ÑÑÑлки на ÑÑÑÐ½Ð¸Ñ (обÑÐµÐºÑ <<>>), а Ñакже на игÑоков,
+ ÑÑаÑÑвÑÑÑиÑ
в каждом маÑÑе (обÑекÑÑ <<>>):
+
++-------
+SnookerScoreAPI api = Snooker.API();
+OngoingMatches matches = api.getOngoingMatches();
+for (OngoingMatch match : matches) {
+ Event event = match.event();
+ Player player1 = match.player1();
+ Player player2 = match.player2();
+}
++-------
+
+ Тогда как пÑи ÑабоÑе Ñ Ð½ÐµÐºÑÑиÑÑÑÑей веÑÑией инÑеÑÑейÑа вам пÑидÑÑÑÑ Ð´ÐµÐ»Ð°ÑÑ Ð´Ð¾Ð¿Ð¾Ð»Ð½Ð¸ÑелÑнÑе запÑоÑÑ
+ о ÑÑÑниÑе и игÑокаÑ
, ÑÑÐ¾Ð±Ñ Ð¿Ð¾Ð»ÑÑиÑÑ Ð¿Ð¾Ð»Ð½ÑÑ Ð¸Ð½ÑоÑмаÑÐ¸Ñ Ð¾ пÑоÑ
одÑÑиÑ
маÑÑаÑ
:
+
++-------
+SnookerScoreAPI api = Snooker.uncachedAPI();
+OngoingMatches matches = api.getOngoingMatches();
+for (OngoingMatch match : matches) {
+ Event event = api.getEvent(match.eventId());
+ Player player1 = api.getPlayer(match.player1Id());
+ Player player2 = api.getPlayer(match.player2Id());
+}
++-------
+
+===
+
+ Ðо-вÑоÑÑÑ
, в кÑÑиÑÑÑÑей веÑÑии инÑеÑÑейÑа вам пÑедоÑÑавлÑеÑÑÑ Ð²Ð¾Ð·Ð¼Ð¾Ð¶Ð½Ð¾ÑÑÑ Ð·Ð°Ð´Ð°ÑÑ ÑекÑÑий Ñезон,
+ Ñ ÑобÑÑиÑми коÑоÑого в далÑнейÑем Ð²Ñ ÑобиÑаеÑеÑÑ ÑабоÑаÑÑ Ð¿ÑÑем запÑоÑов ÑÑÑниÑов и маÑÑей:
+
++-------
+SnookerScoreAPI api = Snooker.API();
+api.setCurrentSeason(Season.getSeason(2015));
++-------
+
+===
+
+ P.S. ÐÑли вам необÑ
одимо иÑполÑзоваÑÑ Ð½ÐµÐºÑÑиÑÑÑÑÑÑ Ð²ÐµÑÑÐ¸Ñ API-инÑеÑÑейÑа,
+ Ñо ÐµÑ Ð¼Ð¾Ð¶Ð½Ð¾ полÑÑиÑÑ ÑледÑÑÑим обÑазом:
+
++-------
+SnookerScoreAPI uncachedApi = Snooker.uncachedAPI();
++-------
diff --git a/src/site/ru/apt/index.apt.vm b/src/site/ru/apt/index.apt.vm
new file mode 100644
index 0000000..80db9d3
--- /dev/null
+++ b/src/site/ru/apt/index.apt.vm
@@ -0,0 +1,58 @@
+ ------
+ Ðведение
+ ------
+ Dmitry Samoshin aka gotty
+ ------
+ 2017-01-22
+ ------
+
+~~ Copyright (c) 2017. Developed by Hedgecode.
+~~
+~~ Licensed under the Apache License, Version 2.0 (the "License");
+~~ you may not use this file except in compliance with the License.
+~~ You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing, software
+~~ distributed under the License is distributed on an "AS IS" BASIS,
+~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+~~ See the License for the specific language governing permissions and
+~~ limitations under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+${project.name}
+
+ Hedgecode Snooker Score пÑедÑÑавлÑÐµÑ Ñобой библиоÑÐµÐºÑ Ñ Ð½Ð°Ð±Ð¾Ñом API ÑÑÑноÑÑей, коÑоÑаÑ
+ Ð¼Ð¾Ð¶ÐµÑ Ð¸ÑполÑзоваÑÑÑÑ Ð² клиенÑÑкиÑ
Java-пÑиложениÑÑ
, имеÑÑиÑ
Ñвоей ÑелÑÑ Ð¸Ð½ÑоÑмиÑование
+ о ÑезÑлÑÑаÑаÑ
ÑнÑкеÑнÑÑ
маÑÑей, а Ñакже о пÑоÑей ÑÑаÑиÑÑиÑеÑкой инÑоÑмаÑии из миÑа ÑнÑкеÑа.
+
+ ÐÑÑ Ð¿Ð¾Ð»ÐµÐ·Ð½Ð°Ñ Ð¸Ð½ÑоÑмаÑÐ¸Ñ Ð·Ð°Ð³ÑÑжаеÑÑÑ Ð¿Ð¾ пÑоÑÐ¾ÐºÐ¾Ð»Ñ HTTP Ñ Ð¿Ð¾ÑÑала {{{http://snooker.org/}snooker.org}},
+ поÑÑÐ¾Ð¼Ñ Ð´Ð»Ñ ÑÑнкÑиониÑÐ¾Ð²Ð°Ð½Ð¸Ñ Ð¿Ñиложений, иÑполÑзÑÑÑиÑ
даннÑÑ Ð±Ð¸Ð±Ð»Ð¸Ð¾ÑекÑ, необÑ
одим доÑÑÑп в ÐнÑеÑнеÑ.
+
+ ТекÑÑÐ°Ñ Ð²ÐµÑÑÐ¸Ñ Ð±Ð¸Ð±Ð»Ð¸Ð¾Ñеки:
+ {{{http://repo.hedgecode.org/content/repositories/releases/org/hedgecode/snooker/${project.artifactId}/${project.version}/${project.artifactId}-${project.version}.jar}${project.version}}}
+
+ <<ÐÑимеÑание>>: <ÐÑе веÑÑии библиоÑеки до веÑÑии 1.0 не могÑÑ ÑÑиÑаÑÑÑÑ Ð¿Ð¾Ð»Ð½Ð¾ÑÑÑÑ ÑÑабилÑнÑми.>
+
+* ÐÑполÑзование
+
+ ÐбÑие инÑÑÑÑкÑии о Ñом, как иÑполÑзоваÑÑ Ð´Ð°Ð½Ð½ÑÑ Ð±Ð¸Ð±Ð»Ð¸Ð¾ÑÐµÐºÑ Ð¼Ð¾Ð¶Ð½Ð¾ найÑи на {{{./usage.html}ÑÑой ÑÑÑаниÑе}}.
+
+ ÐпиÑание ÑабоÑÑ Ð¾ÑновнÑÑ
меÑодов библиоÑеки наÑ
одиÑÑÑ Ð² Ñазделе {{{./faq.html}ЧаÐо}}.
+
+ ÐекоÑоÑÑе более конкÑеÑнÑе ÑлÑÑаи иÑполÑÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ Ð¾Ð¿Ð¸ÑÐ°Ð½Ñ Ð² пÑимеÑаÑ
, пÑиведеннÑÑ
ниже.
+
+* ÐÑимеÑÑ
+
+ ЧÑÐ¾Ð±Ñ Ð»ÑÑÑе понÑÑÑ Ð¾Ð¿Ð¸ÑÑваемÑÑ Ð±Ð¸Ð±Ð»Ð¸Ð¾ÑекÑ, Ð²Ñ Ð¼Ð¾Ð¶ÐµÑе обÑаÑиÑÑÑÑ Ðº ÑледÑÑÑим пÑимеÑам:
+
+ * {{{./examples/work-with-the-cached-api.html}РабоÑа Ñ ÐºÑÑиÑÑÑÑей веÑÑией API}}
+
+ * {{{./examples/use-sort-in-collections.html}ÐÑполÑзование ÑоÑÑиÑовки полÑÑеннÑÑ
даннÑÑ
}}
+
+ * {{{./examples/handle-the-api-exceptions.html}ÐбÑабоÑка иÑклÑÑений, возникаÑÑиÑ
пÑи ÑабоÑе Ñ API}}
+
+ []
diff --git a/src/site/ru/apt/usage.apt.vm b/src/site/ru/apt/usage.apt.vm
new file mode 100644
index 0000000..0a74c70
--- /dev/null
+++ b/src/site/ru/apt/usage.apt.vm
@@ -0,0 +1,125 @@
+ ------
+ ÐÑполÑзование
+ ------
+ Dmitry Samoshin aka gotty
+ ------
+ 2017-01-22
+ ------
+
+~~ Copyright (c) 2017. Developed by Hedgecode.
+~~
+~~ Licensed under the Apache License, Version 2.0 (the "License");
+~~ you may not use this file except in compliance with the License.
+~~ You may obtain a copy of the License at
+~~
+~~ http://www.apache.org/licenses/LICENSE-2.0
+~~
+~~ Unless required by applicable law or agreed to in writing, software
+~~ distributed under the License is distributed on an "AS IS" BASIS,
+~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+~~ See the License for the specific language governing permissions and
+~~ limitations under the License.
+
+~~ NOTE: For help with the syntax of this file, see:
+~~ http://maven.apache.org/doxia/references/apt-format.html
+
+ÐÑполÑзование
+
+* ÐодклÑÑение библиоÑеки Ð´Ð»Ñ Ð¸ÑполÑÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ Ð² Java-пÑиложениÑÑ
+
+ Шаблон подклÑÑÐµÐ½Ð¸Ñ Ð´Ð°Ð½Ð½Ð¾Ð¹ библиоÑеки Ð´Ð»Ñ ÑазÑабоÑки Java-пÑиложений Ñ
+ иÑполÑзованием конÑигÑÑаÑионного Maven-Ñайла pom.xml пÑедÑÑавлен ниже:
+
++-----
+
+ ...
+
+
+ ${project.groupId}
+ ${project.artifactId}
+ ${project.version}
+
+
+ ...
+
++-----
+
+ <<ÐÑимеÑание>>: Maven 3.0 бÑÐ´ÐµÑ Ð²ÑдаваÑÑ Ð¿ÑедÑпÑеждение,
+ еÑли Ð²Ñ Ð½Ðµ ÑкажиÑе веÑÑÐ¸Ñ Ð¿Ð»Ð°Ð³Ð¸Ð½Ð°.
+
+* РабоÑа Ñ Java-кодом библиоÑеки
+
+ ÐоÑле подклÑÑÐµÐ½Ð¸Ñ Ð±Ð¸Ð±Ð»Ð¸Ð¾Ñеки к пÑоекÑÑ Ð¼Ð¾Ð¶Ð½Ð¾ наÑинаÑÑ ÑабоÑаÑÑ Ñ ÐµÑ ÐºÐ¾Ð´Ð¾Ð¼.\
+ ÐÐ»Ñ Ñого, ÑÑÐ¾Ð±Ñ Ð¿Ð¾Ð»ÑÑиÑÑ ÑкземплÑÑ Ð¾Ñновного инÑеÑÑейÑа библиоÑеки, нÑжно
+ вÑполниÑÑ ÑледÑÑÑий код:
+
++-----
+SnookerScoreAPI api = Snooker.API();
++-----
+
+ <<>> пÑедÑÑавлÑÐµÑ Ñобой инÑеÑÑÐµÐ¹Ñ Ñ Ð½Ð°Ð±Ð¾Ñом вÑеÑ
оÑновнÑÑ
меÑодов,
+ коÑоÑÑе позволÑÑÑ ÑеÑез обÑекÑÑ-ÑÑÑноÑÑи полÑÑиÑÑ Ð´Ð¾ÑÑÑп к инÑоÑмаÑии о ÑезонаÑ
,
+ ÑÑÑниÑаÑ
, маÑÑаÑ
, игÑокаÑ
и иÑ
ÑейÑингаÑ
.
+
+ ÐиблиоÑека пÑедоÑÑавлÑÐµÑ Ð´Ð²Ðµ ÑеализаÑии вÑÑеÑказанного инÑеÑÑейÑа: Ñ ÐºÑÑиÑованием
+ даннÑÑ
по игÑокам и ÑобÑÑиÑм (ÑÑÑниÑам) внÑÑÑи библиоÑеки и без кÑÑиÑованиÑ.
+ РеализаÑÐ¸Ñ Ð¸Ð½ÑеÑÑейÑа Ñ ÐºÑÑиÑованием ÑвлÑеÑÑÑ ÑеализаÑией "по ÑмолÑаниÑ".\
+ ÐоÑÑÑп к каждой из двÑÑ
ÑеализаÑий инÑеÑÑейÑа Ð¼Ð¾Ð¶ÐµÑ Ð±ÑÑÑ Ð¿Ð¾Ð»ÑÑен пÑÑÑм вÑполнениÑ
+ ÑледÑÑÑиÑ
вÑзовов:
+
++-----
+SnookerScoreAPI cachedApi = Snooker.cachedAPI(); /* API with cache */
+...
+SnookerScoreAPI uncachedApi = Snooker.uncachedAPI(); /* API without cache */
++-----
+
+ ÐалÑнейÑÐ°Ñ ÑабоÑа Ñ Ð±Ð¸Ð±Ð»Ð¸Ð¾Ñекой пÑедÑÑавлÑÐµÑ Ñобой поÑледоваÑелÑноÑÑÑ Ð²Ñзовов меÑодов
+ инÑеÑÑейÑа <<>> Ð´Ð»Ñ Ð¿Ð¾Ð»ÑÑÐµÐ½Ð¸Ñ ÑпиÑков ÑÑÑниÑов, игÑоков, ÑекÑÑиÑ
маÑÑей
+ и пÑоÑей ÑÑаÑиÑÑиÑеÑкой инÑоÑмаÑии.\
+ ÐапÑимеÑ, ÑÑÐ¾Ð±Ñ Ð¿Ð¾Ð»ÑÑиÑÑ Ð¸Ð½ÑоÑмаÑÐ¸Ñ Ð¿Ð¾ маÑÑам, пÑоÑ
одÑÑим в даннÑй моменÑ, доÑÑаÑоÑно
+ вÑполниÑÑ ÑледÑÑÑий код:
+
++-----
+SnookerScoreAPI api = Snooker.API();
+OngoingMatches matches = api.getOngoingMatches();
++-----
+
+ ÐпиÑание ÑабоÑÑ Ð±Ð¾Ð»ÑÑинÑÑва меÑодов инÑеÑÑейÑа можно найÑи в Ñазделе {{{./faq.html}ЧаÐо}},
+ а на ÑÑÑаниÑаÑ
Ñ Ð¿ÑимеÑами ÑаÑÑмоÑÑÐµÐ½Ñ Ð½Ð°Ð¸Ð±Ð¾Ð»ÐµÐµ ÑаÑÑо вÑÑÑеÑаÑÑиеÑÑ ÑиÑÑаÑии.
+ СигнаÑÑÑа меÑодов, а Ñакже инÑоÑмаÑÐ¸Ñ Ð¿Ð¾ дÑÑгим ÑÑÑноÑÑÑм библиоÑеки, пÑедÑÑавлена в
+ {{{./apidocs/}JavaDoc}}.
+
+* ÐапÑÑк библиоÑеки из командной ÑÑÑоки
+
+ Рданной библиоÑеке имееÑÑÑ Ð²Ð¾Ð·Ð¼Ð¾Ð¶Ð½Ð¾ÑÑÑ Ð¿ÑоизвеÑÑи запÑÑк из командной ÑÑÑоки Ð´Ð»Ñ Ð¿ÑовеÑки
+ коÑÑекÑноÑÑи ÑÐ¾ÐµÐ´Ð¸Ð½ÐµÐ½Ð¸Ñ Ñ Ð¸Ð½ÑоÑмаÑионнÑм поÑÑалом {{{http://snooker.org/}snooker.org}}.
+ ÐапÑÑк библиоÑеки из командной ÑÑÑоки оÑÑÑеÑÑвлÑеÑÑÑ ÑледÑÑÑим обÑазом:
+
++-----
+java -jar ${project.artifactId}-${project.version}.jar
++-----
+
+ ÐÑли пÑогÑамма оÑÑабоÑÐ°ÐµÑ ÐºÐ¾ÑÑекÑно, Ñо можно бÑÐ´ÐµÑ ÑвидеÑÑ ÑпиÑок ÑекÑÑиÑ
и пÑедÑÑоÑÑиÑ
+ ÑÑÑниÑов по ÑнÑкеÑÑ.\
+ ÐÑимеÑнÑй ÑезÑлÑÑÐ°Ñ Ð²Ñвода пÑогÑÐ°Ð¼Ð¼Ñ Ð¿ÑедÑÑавлен ниже:
+
++-----
+********************************************************************************
+ Welcome to Hedgecode Snooker Score API!
+ -----------------------------------------------
+ It is an API library for portal snooker.org, which contains
+ the results of snooker competitions and other snooker information.
+ This library provides a set of entity objects that can be used in client
+ applications (to inform about the results of snooker), developed in Java.
+********************************************************************************
+ Current Snooker Events:
+ China Open Qualifiers [24.01.2017 - 27.01.2017] (England, Preston)
+********************************************************************************
+ Upcoming Snooker Events:
+ German Masters [01.02.2017 - 05.02.2017] (Germany, Berlin)
+ World Grand Prix [06.02.2017 - 12.02.2017] (England, Preston)
+ Welsh Open [13.02.2017 - 19.02.2017] (Wales, Cardiff)
+ Connie Gough Memorial Trophy [18.02.2017 - 18.02.2017] (England, Dunstable)
+ Championship League - Group 5 [20.02.2017 - 21.02.2017] (England, Coventry)
+********************************************************************************
++-----
diff --git a/src/site/ru/fml/faq.fml b/src/site/ru/fml/faq.fml
new file mode 100644
index 0000000..f4d4262
--- /dev/null
+++ b/src/site/ru/fml/faq.fml
@@ -0,0 +1,138 @@
+
+
+
+
+
+
+ ÐÑновнÑе вопÑоÑÑ:
+
+
+ Ðак полÑÑиÑÑ Ð¿Ð¾Ð»Ð½ÑÑ Ð¸Ð½ÑоÑмаÑÐ¸Ñ Ð¿Ð¾ конкÑеÑÐ½Ð¾Ð¼Ñ ÑÑÑниÑÑ?
+
+
+ Event event = Snooker.API().getEvent(eventId);
+ где паÑамеÑÑ eventId
- ID ÑÑÑниÑа.
+
+
+
+
+
+ Ðак полÑÑиÑÑ Ð¿Ð¾Ð»Ð½ÑÑ Ð¸Ð½ÑоÑмаÑÐ¸Ñ Ð¿Ð¾ конкÑеÑÐ½Ð¾Ð¼Ñ Ð¼Ð°ÑÑÑ?
+
+
+ Match match = Snooker.API().getMatch(eventId, roundId, matchNumber);
+ где паÑамеÑÑ eventId
- ID ÑÑÑниÑа, в коÑоÑом игÑаеÑÑÑ Ð¸ÑкомÑй маÑÑ;
+ roundId
- ID ÑаÑнда ÑÑÑниÑа; matchNumber
- Ð½Ð¾Ð¼ÐµÑ Ð¼Ð°ÑÑа в ÑаÑнде.
+
+
+
+
+
+ Ðак полÑÑиÑÑ Ð¿Ð¾Ð»Ð½ÑÑ Ð¸Ð½ÑоÑмаÑÐ¸Ñ Ð¿Ð¾ конкÑеÑÐ½Ð¾Ð¼Ñ Ð¸Ð³ÑокÑ?
+
+
+ Player player = Snooker.API().getPlayer(int playerId);
+ где паÑамеÑÑ playerId
- ID игÑока.
+
+
+
+
+
+ Ðак полÑÑиÑÑ Ð¸Ð½ÑоÑмаÑÐ¸Ñ Ð¿Ð¾ вÑем ÑÑÑниÑам в Ñезоне?
+
+
+ Events seasonEvents = Snooker.API().getSeasonEvents(season);
+ где паÑамеÑÑ season
- обÑÐµÐºÑ ÐºÐ»Ð°ÑÑа Season
, задаÑÑий
+ конкÑеÑнÑй Ñезон, или же Season.ALL
- Ð´Ð»Ñ Ð²ÑеÑ
доÑÑÑпнÑÑ
Ñезонов.
+
+
+
+
+
+ Ðак полÑÑиÑÑ Ð¸Ð½ÑоÑмаÑÐ¸Ñ Ð¿Ð¾ вÑем маÑÑам конкÑеÑного ÑÑÑниÑа?
+
+
+ Matches eventMatches = Snooker.API().getEventMatches(eventId);
+ где паÑамеÑÑ eventId
- ID ÑÑÑниÑа.
+
+
+
+
+
+ Ðак полÑÑиÑÑ Ð¸Ð½ÑоÑмаÑÐ¸Ñ Ð¿Ð¾ маÑÑам, коÑоÑÑе пÑоÑ
одÑÑ Ð² даннÑм моменÑ?
+
+
+ OngoingMatches matches = Snooker.API().getOngoingMatches();
+
+
+
+
+
+ Ðак полÑÑиÑÑ Ð¸Ð½ÑоÑмаÑÐ¸Ñ Ð¿Ð¾ вÑем маÑÑам конкÑеÑного игÑока в Ñезоне?
+
+
+ Matches playerMatches = Snooker.API().getPlayerMatches(playerId, season);
+ где паÑамеÑÑ playerId
- ID игÑока,
+ а season
- обÑÐµÐºÑ ÐºÐ»Ð°ÑÑа Season
, задаÑÑий
+ конкÑеÑнÑй Ñезон, или же Season.ALL
- Ð´Ð»Ñ Ð²ÑеÑ
доÑÑÑпнÑÑ
Ñезонов.
+
+
+
+
+
+ Ðак полÑÑиÑÑ Ð¸Ð½ÑоÑмаÑÐ¸Ñ Ð¿Ð¾ вÑем игÑокам в конкÑеÑном ÑÑÑниÑе?
+
+
+ Players eventPlayers = Snooker.API().getEventPlayers(eventId);
+ где паÑамеÑÑ eventId
- ID ÑÑÑниÑа.
+
+
+
+
+
+ Ðак полÑÑиÑÑ Ð¸Ð½ÑоÑмаÑÐ¸Ñ Ð¿Ð¾ вÑем игÑокам в конкÑеÑном Ñезоне?
+
+
+ Players players = Snooker.API().getPlayers(season, category);
+ где паÑамеÑÑ season
- обÑÐµÐºÑ ÐºÐ»Ð°ÑÑа Season
, задаÑÑий
+ конкÑеÑнÑй Ñезон, или же Season.ALL
- Ð´Ð»Ñ Ð²ÑеÑ
доÑÑÑпнÑÑ
Ñезонов,
+ а category
- обÑÐµÐºÑ ÐºÐ»Ð°ÑÑа PlayerCategory
,
+ задаÑÑий каÑегоÑÐ¸Ñ Ð¸Ð³Ñоков (напÑимеÑ, PlayerCategory.PRO
).
+
+
+
+
+
+ ÐополниÑелÑно:
+
+
+ Ðак полÑÑиÑÑ Ð¸Ð½ÑоÑмаÑÐ¸Ñ Ð¿Ð¾ ÑейÑингам/заÑабоÑаннÑм ÑÑммам вÑеÑ
игÑоков в Ñезоне?
+
+
+ Rankings rankings = Snooker.API().getRankings(season, rankingType);
+ где паÑамеÑÑ season
- обÑÐµÐºÑ ÐºÐ»Ð°ÑÑа Season
, задаÑÑий
+ конкÑеÑнÑй Ñезон, или же Season.ALL
- Ð´Ð»Ñ Ð²ÑеÑ
доÑÑÑпнÑÑ
Ñезонов,
+ а rankingType
- обÑÐµÐºÑ ÐºÐ»Ð°ÑÑа RankingType
,
+ задаÑÑий Ñип ÑейÑинга (напÑимеÑ, RankingType.MoneyRankings
).
+
+
+
+
+
diff --git a/src/site/ru/xdoc/download.xml.vm b/src/site/ru/xdoc/download.xml.vm
new file mode 100644
index 0000000..fdbd3c8
--- /dev/null
+++ b/src/site/ru/xdoc/download.xml.vm
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+ СкаÑаÑÑ
+
+
+
+
+ ${project.name} ${project.version} доÑÑÑпен как в двоиÑном ÑоÑмаÑе (JAR аÑÑеÑакÑ), Ñак и в иÑÑ
однÑÑ
кодаÑ
.
+
+
+
+ ТекÑÑÐ°Ñ ÑÑабилÑÐ½Ð°Ñ Ð²ÐµÑÑÐ¸Ñ ${project.name}:
+ ${project.artifactId}-${project.version}.jar
+ и ÐµÑ MD5 ÑÑмма.
+
+
+
+
+ СÑаÑÑе release-веÑÑии ${project.artifactId} доÑÑÑÐ¿Ð½Ñ Ð½Ð° ÑÑÑаниÑе Hedgecode Release Repository.
+ СÑаÑÑе snapshot-веÑÑии ${project.artifactId} доÑÑÑÐ¿Ð½Ñ Ð½Ð° ÑÑÑаниÑе Hedgecode Snapshot Repository.
+
+
+
+ ÐÑÑ
Ð¸Ð²Ñ Ñ javadoc и иÑÑ
однÑми кодами ÑекÑÑей веÑÑии библиоÑеки:
+ javadoc,
+ sources.
+
+ ÐÑÑ
однÑй код ${project.artifactId} доÑÑÑпен в Hedgecode Subversion Repository.
+ ÐÑÑ
однÑй код ${project.name} ÑаÑпÑоÑÑÑанÑеÑÑÑ Ð¿Ð¾Ð´ лиÑензией Apache License, version 2.0.
+
+
+
+
+
+
diff --git a/src/site/site.xml b/src/site/site.xml
new file mode 100644
index 0000000..d099627
--- /dev/null
+++ b/src/site/site.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/site/site_ru.xml b/src/site/site_ru.xml
new file mode 100644
index 0000000..b19fe08
--- /dev/null
+++ b/src/site/site_ru.xml
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/site/xdoc/download.xml.vm b/src/site/xdoc/download.xml.vm
new file mode 100644
index 0000000..7bedc4a
--- /dev/null
+++ b/src/site/xdoc/download.xml.vm
@@ -0,0 +1,53 @@
+
+
+
+
+
+
+ Download
+
+
+
+
+
+