From: gotty <gotty@fb0bcced-7025-49ed-a12f-f98bce993226> 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 <a href=\u0022http:\u002F\u002Fwww.worldsnooker.livesport.tv\u002F\u0022>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 <<<APIException>>> 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 <<<APIException.getType()>>>. + + The type <<<INFO>>> 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 <<<REQUEST>>> 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 <<null>> 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 (<<<Players>>>, <<<Events>>>, <<<Matches>>>) + 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. + +=== + + <<<Players>>> - 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(); +... ++------- + +=== + + <<<Events>>> - 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(); +... ++------- + +=== + + <<<Matches>>> - 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 <<<SnookerScoreAPI>>>.\ + 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 <<<Event>>>) as well as to the players + participating in each match (objects <<<Player>>>) 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}}} + + <<Note>>: <All versions of the library up to version 1.0 can not be considered completely stable.> + +* 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> + ... + <dependencies> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </dependency> + </dependencies> + ... +</project> ++----- + + <<Note>>: 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(); ++----- + + <<<SnookerScoreAPI>>> 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 <<<SnookerScoreAPI>>> 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 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + ~ 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. +--> + +<faqs xmlns="http://maven.apache.org/FML/1.0.1" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/FML/1.0.1 http://maven.apache.org/xsd/fml-1.0.1.xsd" + title="Frequently Asked Questions"> + <part id="general"> + <title>General:</title> + <faq id="how-to-get-event"> + <question> + How to get full information on a specific tournament? + </question> + <answer> + <p><pre>Event event = Snooker.API().getEvent(eventId);</pre> + where parameter <code>eventId</code> is ID of the tournament. + </p> + </answer> + </faq> + <faq id="how-to-get-match"> + <question> + How to get full information on a specific match? + </question> + <answer> + <p><pre>Match match = Snooker.API().getMatch(eventId, roundId, matchNumber);</pre> + where parameter <code>eventId</code> is ID of the tournament which the match is played; + <code>roundId</code> is ID of the round of the tournament; + <code>matchNumber</code> is number of the match in the round. + </p> + </answer> + </faq> + <faq id="how-to-get-player"> + <question> + How to get full information on a specific player? + </question> + <answer> + <p><pre>Player player = Snooker.API().getPlayer(int playerId);</pre> + where parameter <code>playerId</code> is ID of the player. + </p> + </answer> + </faq> + <faq id="how-to-get-season-events"> + <question> + How to get information on all tournaments in the season? + </question> + <answer> + <p><pre>Events seasonEvents = Snooker.API().getSeasonEvents(season);</pre> + where parameter <code>season</code> is object of class <code>Season</code> + that specify a season or <code>Season.ALL</code> for all available seasons. + </p> + </answer> + </faq> + <faq id="how-to-get-event-matches"> + <question> + How to get information on all matches of a specific tournament? + </question> + <answer> + <p><pre>Matches eventMatches = Snooker.API().getEventMatches(eventId);</pre> + where parameter <code>eventId</code> is ID of the tournament. + </p> + </answer> + </faq> + <faq id="how-to-get-ongoing-matches"> + <question> + How to get information on the matches which take place in this moment? + </question> + <answer> + <p><pre>OngoingMatches matches = Snooker.API().getOngoingMatches();</pre> + </p> + </answer> + </faq> + <faq id="how-to-get-player-matches"> + <question> + How to get information on all matches of a specific player in the season? + </question> + <answer> + <p><pre>Matches playerMatches = Snooker.API().getPlayerMatches(playerId, season);</pre> + where parameter <code>playerId</code> is ID of the player + and <code>season</code> is object of class <code>Season</code> + that specify a season or <code>Season.ALL</code> for all available seasons. + </p> + </answer> + </faq> + <faq id="how-to-get-event-players"> + <question> + How to get information on all players in a specific tournament? + </question> + <answer> + <p><pre>Players eventPlayers = Snooker.API().getEventPlayers(eventId);</pre> + where parameter <code>eventId</code> is ID of the tournament. + </p> + </answer> + </faq> + <faq id="how-to-get-players"> + <question> + How to get information on all players in a specific season? + </question> + <answer> + <p><pre>Players players = Snooker.API().getPlayers(season, category);</pre> + where parameter <code>season</code> is object of class <code>Season</code> + that specify a season or <code>Season.ALL</code> for all available seasons + and <code>category</code> is object of class <code>PlayerCategory</code> + that specify a category of players (for example, <code>PlayerCategory.PRO</code>). + </p> + </answer> + </faq> + </part> + <part id="additional"> + <title>Additional:</title> + <faq id="how-to-get-rankings"> + <question> + How to get information on the ratings/earnings of all players in the season? + </question> + <answer> + <p><pre>Rankings rankings = Snooker.API().getRankings(season, rankingType);</pre> + where parameter <code>season</code> is object of class <code>Season</code> + that specify a season or <code>Season.ALL</code> for all available seasons + and <code>rankingType</code> is object of class <code>RankingType</code> + that specify a rating type (for example, <code>RankingType.MoneyRankings</code>). + </p> + </answer> + </faq> + </part> +</faqs> 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 + + Рданной библиоÑеке Ñеализовано оÑновное иÑклÑÑение <<<APIException>>>, коÑоÑое + пÑи возникновении иÑклÑÑиÑелÑнÑÑ ÑиÑÑаÑий Ð¼Ð¾Ð¶ÐµÑ ÑообÑаÑÑ ÐºÐ»Ð¸ÐµÐ½ÑÑÐºÐ¾Ð¼Ñ Ð¿ÑÐ¸Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ + о Ñипе возникÑей оÑибке в пÑоÑеÑÑе иÑполÑÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ Ð±Ð¸Ð±Ð»Ð¸Ð¾ÑеÑнÑÑ Ð¼ÐµÑодов.\ + Ðанное иÑклÑÑение Ð¼Ð¾Ð¶ÐµÑ ÑведомлÑÑÑ Ð¾ двÑÑ ÑÐ¸Ð¿Ð°Ñ Ð¸ÑклÑÑиÑелÑнÑÑ ÑиÑÑаÑий: + ++------- +public class APIException extends Exception { + + public static enum Type { + INFO, + REQUEST + } + ... +} ++------- + + ÐолÑÑиÑÑ Ñип возникÑего иÑклÑÑÐµÐ½Ð¸Ñ Ð¼Ð¾Ð¶Ð½Ð¾ пÑи помоÑи меÑода <<<APIException.getType()>>>. + + Тип <<<INFO>>> ÑообÑÐ°ÐµÑ ÐºÐ»Ð¸ÐµÐ½ÑÑÐºÐ¾Ð¼Ñ Ð¿ÑÐ¸Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ Ð¾ Ñом, ÑÑо возникÑее иÑклÑÑение не ÑвлÑеÑÑÑ + кÑиÑиÑеÑким и не ÑвÑзано Ñ Ð½ÐµÐ²Ð¾Ð·Ð¼Ð¾Ð¶Ð½Ð¾ÑÑÑÑ Ð¿Ð¾Ð»ÑÑиÑÑ Ð¿Ð¾Ð»ÐµÐ·Ð½ÑÑ Ð¸Ð½ÑоÑмаÑиÑ. + РабоÑа пÑÐ¸Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ Ð¼Ð¾Ð¶ÐµÑ Ð±ÑÑÑ Ð¿Ñодолжена поÑле обнаÑÑÐ¶ÐµÐ½Ð¸Ñ Ð´Ð°Ð½Ð½Ð¾Ð³Ð¾ Ñипа иÑклÑÑÐµÐ½Ð¸Ñ Ð±ÐµÐ· + ÑеÑÑезнÑÑ Ð¿Ð¾ÑледÑÑвий, но Ñ Ð¾Ð¿ÑеделеннÑми коÑÑекÑиÑовками в далÑнейÑем ÑабоÑем ÑÑнкÑионале. + + Тип <<<REQUEST>>> ÑообÑÐ°ÐµÑ ÐºÐ»Ð¸ÐµÐ½ÑÑÐºÐ¾Ð¼Ñ Ð¿ÑÐ¸Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ Ð¾ Ñом, ÑÑо возникÑее иÑклÑÑение ÑвÑзано + Ñ Ð¿ÑоÑеÑÑом полÑÑÐµÐ½Ð¸Ñ Ð¿Ð¾Ð»ÐµÐ·Ð½Ð¾Ð¹ инÑоÑмаÑии Ñ Ð¿Ð¾ÑÑала {{{http://snooker.org/}snooker.org}}, либо + Ñ Ð½ÐµÐ²Ð¾Ð·Ð¼Ð¾Ð¶Ð½Ð¾ÑÑÑÑ Ð¾Ð±ÑабоÑаÑÑ Ð¿Ð¾Ð»ÑÑеннÑÑ Ð¸Ð½ÑоÑмаÑиÑ.\ + ÐаннÑй Ñип иÑклÑÑÐµÐ½Ð¸Ñ Ð¼Ð¾Ð¶ÐµÑ Ð²Ð¾Ð·Ð½Ð¸ÐºÐ½ÑÑÑ Ð¿Ð¾ неÑколÑким пÑиÑинам: + + <<1.>> ÐаннÑе, пеÑеданнÑе API-меÑодÑ, некоÑÑекÑнÑ. Такое Ð¼Ð¾Ð¶ÐµÑ Ð²Ð¾Ð·Ð½Ð¸ÐºÐ½ÑÑÑ Ð² ÑлÑÑае пеÑедаÑи + некоÑÑекÑного Ð²Ñ Ð¾Ð´Ð½Ð¾Ð³Ð¾ ID (ÑÑÑниÑа, игÑока и пÑ.) или же <<null>>-паÑамеÑÑа. Рданном ÑлÑÑае + ÑабоÑа пÑÐ¸Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ Ð¼Ð¾Ð¶ÐµÑ Ð±ÑÑÑ Ð¿Ñодолжена поÑле коÑÑекÑиÑовки пеÑедаваемÑÑ Ð¿Ð°ÑамеÑÑов. + + <<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-меÑодов оÑновного инÑеÑÑейÑа библиоÑеки, в болÑÑинÑÑве Ñвоем + пÑедÑÑавлÑÑÑ ÐºÐ»Ð°ÑÑÑ-коллекÑии (<<<Players>>>, <<<Events>>>, <<<Matches>>>), к коÑоÑÑм Ð´Ð»Ñ ÑдобÑÑва + далÑнейÑего иÑполÑÐ·Ð¾Ð²Ð°Ð½Ð¸Ñ Ð² клиенÑÑÐºÐ¸Ñ Ð¿ÑиложениÑÑ Ð¼Ð¾Ð¶Ð½Ð¾ пÑименÑÑÑ ÑоÑÑиÑÐ¾Ð²ÐºÑ Ð¿Ð¾ опÑеделеннÑм паÑамеÑÑам. + + Ðиже пеÑеÑиÑÐ»ÐµÐ½Ñ Ð²Ð¸Ð´Ñ Ð²Ð¾Ð·Ð¼Ð¾Ð¶Ð½ÑÑ ÑоÑÑиÑовок Ð´Ð»Ñ ÐºÐ¾Ð½ÐºÑеÑнÑÑ ÐºÐ»Ð°ÑÑов-коллекÑий. + +=== + + <<<Players>>> - клаÑÑ-ÑÑÑноÑÑÑ, в коÑоÑом ÑодеÑжиÑÑÑ Ð²ÑбоÑка игÑоков по опÑеделеннÑм паÑамеÑÑам.\ + ÐаннÑй клаÑÑ Ð¿ÑедоÑÑавлÑÐµÑ Ð´Ð²Ð° вида ÑоÑÑиÑовки: + + <<1.>> СоÑÑиÑовка игÑоков по имени. + + <<2.>> СоÑÑиÑовка игÑоков по возÑаÑÑÑ, как по ÑбÑваниÑ, Ñак и по возÑаÑÑаниÑ. + + Ðиже пÑедÑÑавлен Java-код, демонÑÑÑиÑÑÑÑий вÑе вÑÑеÑказаннÑе ÑпоÑÐ¾Ð±Ñ ÑоÑÑиÑовки: + ++------- +Players players = Snooker.API().getPlayers(...); +... +players.sortByName(); +... +players.sortByAge(); +players.sortByAgeDesc(); +... ++------- + +=== + + <<<Events>>> - клаÑÑ-ÑÑÑноÑÑÑ, в коÑоÑом ÑодеÑжиÑÑÑ Ð²ÑбоÑка ÑÑÑниÑов по опÑеделеннÑм паÑамеÑÑам. + + Ðиже пÑедÑÑавлен Java-код, демонÑÑÑиÑÑÑÑий ÑоÑÑиÑÐ¾Ð²ÐºÑ ÑÑÑниÑов по даÑе: + ++------- +Events events = Snooker.API().getSeasonEvents((...); +... +events.sortByDate(); +... ++------- + +=== + + <<<Matches>>> - клаÑÑ-ÑÑÑноÑÑÑ, в коÑоÑом ÑодеÑжиÑÑÑ Ð²ÑбоÑка маÑÑей по опÑеделеннÑм паÑамеÑÑам.\ + ÐаннÑй клаÑÑ Ð¿ÑедоÑÑавлÑÐµÑ Ð´Ð²Ð° вида ÑоÑÑиÑовки: + + <<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>>>.\ + Ð Ñем же ÐµÑ Ð¿ÑеимÑÑеÑÑва? + +=== + + Ðо-пеÑвÑÑ , пÑи ÑабоÑе Ñ ÐºÑÑиÑÑÑÑей веÑÑией инÑеÑÑейÑа пÑи ÑазлиÑнÑÑ Ð·Ð°Ð¿ÑоÑÐ°Ñ Ð²Ñ Ð¿Ð¾Ð»ÑÑаеÑе + более полнÑй обÑÑм полезной инÑоÑмаÑии. ÐапÑимеÑ, пÑи запÑоÑе ÑекÑÑÐ¸Ñ Ð¼Ð°ÑÑей в вÑбоÑке бÑдÑÑ + ÑодеÑжаÑÑÑÑ, помимо дÑÑгой инÑоÑмаÑии, ÑÑÑлки на ÑÑÑÐ½Ð¸Ñ (обÑÐµÐºÑ <<<Event>>>), а Ñакже на игÑоков, + ÑÑаÑÑвÑÑÑÐ¸Ñ Ð² каждом маÑÑе (обÑекÑÑ <<<Player>>>): + ++------- +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> + ... + <dependencies> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>${project.artifactId}</artifactId> + <version>${project.version}</version> + </dependency> + </dependencies> + ... +</project> ++----- + + <<ÐÑимеÑание>>: Maven 3.0 бÑÐ´ÐµÑ Ð²ÑдаваÑÑ Ð¿ÑедÑпÑеждение, + еÑли Ð²Ñ Ð½Ðµ ÑкажиÑе веÑÑÐ¸Ñ Ð¿Ð»Ð°Ð³Ð¸Ð½Ð°. + +* РабоÑа Ñ Java-кодом библиоÑеки + + ÐоÑле подклÑÑÐµÐ½Ð¸Ñ Ð±Ð¸Ð±Ð»Ð¸Ð¾Ñеки к пÑоекÑÑ Ð¼Ð¾Ð¶Ð½Ð¾ наÑинаÑÑ ÑабоÑаÑÑ Ñ ÐµÑ ÐºÐ¾Ð´Ð¾Ð¼.\ + ÐÐ»Ñ Ñого, ÑÑÐ¾Ð±Ñ Ð¿Ð¾Ð»ÑÑиÑÑ ÑкземплÑÑ Ð¾Ñновного инÑеÑÑейÑа библиоÑеки, нÑжно + вÑполниÑÑ ÑледÑÑÑий код: + ++----- +SnookerScoreAPI api = Snooker.API(); ++----- + + <<<SnookerScoreAPI>>> пÑедÑÑавлÑÐµÑ Ñобой инÑеÑÑÐµÐ¹Ñ Ñ Ð½Ð°Ð±Ð¾Ñом вÑÐµÑ Ð¾ÑновнÑÑ Ð¼ÐµÑодов, + коÑоÑÑе позволÑÑÑ ÑеÑез обÑекÑÑ-ÑÑÑноÑÑи полÑÑиÑÑ Ð´Ð¾ÑÑÑп к инÑоÑмаÑии о ÑÐµÐ·Ð¾Ð½Ð°Ñ , + ÑÑÑниÑÐ°Ñ , маÑÑÐ°Ñ , игÑÐ¾ÐºÐ°Ñ Ð¸ Ð¸Ñ ÑейÑÐ¸Ð½Ð³Ð°Ñ . + + ÐиблиоÑека пÑедоÑÑавлÑÐµÑ Ð´Ð²Ðµ ÑеализаÑии вÑÑеÑказанного инÑеÑÑейÑа: Ñ ÐºÑÑиÑованием + даннÑÑ Ð¿Ð¾ игÑокам и ÑобÑÑиÑм (ÑÑÑниÑам) внÑÑÑи библиоÑеки и без кÑÑиÑованиÑ. + РеализаÑÐ¸Ñ Ð¸Ð½ÑеÑÑейÑа Ñ ÐºÑÑиÑованием ÑвлÑеÑÑÑ ÑеализаÑией "по ÑмолÑаниÑ".\ + ÐоÑÑÑп к каждой из двÑÑ ÑеализаÑий инÑеÑÑейÑа Ð¼Ð¾Ð¶ÐµÑ Ð±ÑÑÑ Ð¿Ð¾Ð»ÑÑен пÑÑÑм вÑÐ¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ + ÑледÑÑÑÐ¸Ñ Ð²Ñзовов: + ++----- +SnookerScoreAPI cachedApi = Snooker.cachedAPI(); /* API with cache */ +... +SnookerScoreAPI uncachedApi = Snooker.uncachedAPI(); /* API without cache */ ++----- + + ÐалÑнейÑÐ°Ñ ÑабоÑа Ñ Ð±Ð¸Ð±Ð»Ð¸Ð¾Ñекой пÑедÑÑавлÑÐµÑ Ñобой поÑледоваÑелÑноÑÑÑ Ð²Ñзовов меÑодов + инÑеÑÑейÑа <<<SnookerScoreAPI>>> Ð´Ð»Ñ Ð¿Ð¾Ð»ÑÑÐµÐ½Ð¸Ñ ÑпиÑков ÑÑÑниÑов, игÑоков, ÑекÑÑÐ¸Ñ Ð¼Ð°ÑÑей + и пÑоÑей ÑÑаÑиÑÑиÑеÑкой инÑоÑмаÑии.\ + ÐапÑимеÑ, ÑÑÐ¾Ð±Ñ Ð¿Ð¾Ð»ÑÑиÑÑ Ð¸Ð½ÑоÑмаÑÐ¸Ñ Ð¿Ð¾ маÑÑам, пÑÐ¾Ñ Ð¾Ð´ÑÑим в даннÑй моменÑ, доÑÑаÑоÑно + вÑполниÑÑ ÑледÑÑÑий код: + ++----- +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 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + ~ 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. +--> + +<faqs xmlns="http://maven.apache.org/FML/1.0.1" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/FML/1.0.1 http://maven.apache.org/xsd/fml-1.0.1.xsd" + title="ЧаÑÑо ÐадаваемÑе ÐопÑоÑÑ"> + <part id="general"> + <title>ÐÑновнÑе вопÑоÑÑ:</title> + <faq id="how-to-get-event"> + <question> + Ðак полÑÑиÑÑ Ð¿Ð¾Ð»Ð½ÑÑ Ð¸Ð½ÑоÑмаÑÐ¸Ñ Ð¿Ð¾ конкÑеÑÐ½Ð¾Ð¼Ñ ÑÑÑниÑÑ? + </question> + <answer> + <p><pre>Event event = Snooker.API().getEvent(eventId);</pre> + где паÑамеÑÑ <code>eventId</code> - ID ÑÑÑниÑа. + </p> + </answer> + </faq> + <faq id="how-to-get-match"> + <question> + Ðак полÑÑиÑÑ Ð¿Ð¾Ð»Ð½ÑÑ Ð¸Ð½ÑоÑмаÑÐ¸Ñ Ð¿Ð¾ конкÑеÑÐ½Ð¾Ð¼Ñ Ð¼Ð°ÑÑÑ? + </question> + <answer> + <p><pre>Match match = Snooker.API().getMatch(eventId, roundId, matchNumber);</pre> + где паÑамеÑÑ <code>eventId</code> - ID ÑÑÑниÑа, в коÑоÑом игÑаеÑÑÑ Ð¸ÑкомÑй маÑÑ; + <code>roundId</code> - ID ÑаÑнда ÑÑÑниÑа; <code>matchNumber</code> - Ð½Ð¾Ð¼ÐµÑ Ð¼Ð°ÑÑа в ÑаÑнде. + </p> + </answer> + </faq> + <faq id="how-to-get-player"> + <question> + Ðак полÑÑиÑÑ Ð¿Ð¾Ð»Ð½ÑÑ Ð¸Ð½ÑоÑмаÑÐ¸Ñ Ð¿Ð¾ конкÑеÑÐ½Ð¾Ð¼Ñ Ð¸Ð³ÑокÑ? + </question> + <answer> + <p><pre>Player player = Snooker.API().getPlayer(int playerId);</pre> + где паÑамеÑÑ <code>playerId</code> - ID игÑока. + </p> + </answer> + </faq> + <faq id="how-to-get-season-events"> + <question> + Ðак полÑÑиÑÑ Ð¸Ð½ÑоÑмаÑÐ¸Ñ Ð¿Ð¾ вÑем ÑÑÑниÑам в Ñезоне? + </question> + <answer> + <p><pre>Events seasonEvents = Snooker.API().getSeasonEvents(season);</pre> + где паÑамеÑÑ <code>season</code> - обÑÐµÐºÑ ÐºÐ»Ð°ÑÑа <code>Season</code>, задаÑÑий + конкÑеÑнÑй Ñезон, или же <code>Season.ALL</code> - Ð´Ð»Ñ Ð²ÑÐµÑ Ð´Ð¾ÑÑÑпнÑÑ Ñезонов. + </p> + </answer> + </faq> + <faq id="how-to-get-event-matches"> + <question> + Ðак полÑÑиÑÑ Ð¸Ð½ÑоÑмаÑÐ¸Ñ Ð¿Ð¾ вÑем маÑÑам конкÑеÑного ÑÑÑниÑа? + </question> + <answer> + <p><pre>Matches eventMatches = Snooker.API().getEventMatches(eventId);</pre> + где паÑамеÑÑ <code>eventId</code> - ID ÑÑÑниÑа. + </p> + </answer> + </faq> + <faq id="how-to-get-ongoing-matches"> + <question> + Ðак полÑÑиÑÑ Ð¸Ð½ÑоÑмаÑÐ¸Ñ Ð¿Ð¾ маÑÑам, коÑоÑÑе пÑÐ¾Ñ Ð¾Ð´ÑÑ Ð² даннÑм моменÑ? + </question> + <answer> + <p><pre>OngoingMatches matches = Snooker.API().getOngoingMatches();</pre> + </p> + </answer> + </faq> + <faq id="how-to-get-player-matches"> + <question> + Ðак полÑÑиÑÑ Ð¸Ð½ÑоÑмаÑÐ¸Ñ Ð¿Ð¾ вÑем маÑÑам конкÑеÑного игÑока в Ñезоне? + </question> + <answer> + <p><pre>Matches playerMatches = Snooker.API().getPlayerMatches(playerId, season);</pre> + где паÑамеÑÑ <code>playerId</code> - ID игÑока, + а <code>season</code> - обÑÐµÐºÑ ÐºÐ»Ð°ÑÑа <code>Season</code>, задаÑÑий + конкÑеÑнÑй Ñезон, или же <code>Season.ALL</code> - Ð´Ð»Ñ Ð²ÑÐµÑ Ð´Ð¾ÑÑÑпнÑÑ Ñезонов. + </p> + </answer> + </faq> + <faq id="how-to-get-event-players"> + <question> + Ðак полÑÑиÑÑ Ð¸Ð½ÑоÑмаÑÐ¸Ñ Ð¿Ð¾ вÑем игÑокам в конкÑеÑном ÑÑÑниÑе? + </question> + <answer> + <p><pre>Players eventPlayers = Snooker.API().getEventPlayers(eventId);</pre> + где паÑамеÑÑ <code>eventId</code> - ID ÑÑÑниÑа. + </p> + </answer> + </faq> + <faq id="how-to-get-players"> + <question> + Ðак полÑÑиÑÑ Ð¸Ð½ÑоÑмаÑÐ¸Ñ Ð¿Ð¾ вÑем игÑокам в конкÑеÑном Ñезоне? + </question> + <answer> + <p><pre>Players players = Snooker.API().getPlayers(season, category);</pre> + где паÑамеÑÑ <code>season</code> - обÑÐµÐºÑ ÐºÐ»Ð°ÑÑа <code>Season</code>, задаÑÑий + конкÑеÑнÑй Ñезон, или же <code>Season.ALL</code> - Ð´Ð»Ñ Ð²ÑÐµÑ Ð´Ð¾ÑÑÑпнÑÑ Ñезонов, + а <code>category</code> - обÑÐµÐºÑ ÐºÐ»Ð°ÑÑа <code>PlayerCategory</code>, + задаÑÑий каÑегоÑÐ¸Ñ Ð¸Ð³Ñоков (напÑимеÑ, <code>PlayerCategory.PRO</code>). + </p> + </answer> + </faq> + </part> + <part id="additional"> + <title>ÐополниÑелÑно:</title> + <faq id="how-to-get-rankings"> + <question> + Ðак полÑÑиÑÑ Ð¸Ð½ÑоÑмаÑÐ¸Ñ Ð¿Ð¾ ÑейÑингам/заÑабоÑаннÑм ÑÑммам вÑÐµÑ Ð¸Ð³Ñоков в Ñезоне? + </question> + <answer> + <p><pre>Rankings rankings = Snooker.API().getRankings(season, rankingType);</pre> + где паÑамеÑÑ <code>season</code> - обÑÐµÐºÑ ÐºÐ»Ð°ÑÑа <code>Season</code>, задаÑÑий + конкÑеÑнÑй Ñезон, или же <code>Season.ALL</code> - Ð´Ð»Ñ Ð²ÑÐµÑ Ð´Ð¾ÑÑÑпнÑÑ Ñезонов, + а <code>rankingType</code> - обÑÐµÐºÑ ÐºÐ»Ð°ÑÑа <code>RankingType</code>, + задаÑÑий Ñип ÑейÑинга (напÑимеÑ, <code>RankingType.MoneyRankings</code>). + </p> + </answer> + </faq> + </part> +</faqs> 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 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + ~ 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. +--> + +<document> + <properties> + <title>СкаÑаÑÑ</title> + </properties> + <body> + <section name="ÐагÑÑзка ${project.name}"> + + <p>${project.name} ${project.version} доÑÑÑпен как в двоиÑном ÑоÑмаÑе (JAR аÑÑеÑакÑ), Ñак и в иÑÑ Ð¾Ð´Ð½ÑÑ ÐºÐ¾Ð´Ð°Ñ .</p> + + <subsection name="${project.name} ${project.version} ÐвоиÑнÑй ФоÑмаÑ"> + <p> + ТекÑÑÐ°Ñ ÑÑабилÑÐ½Ð°Ñ Ð²ÐµÑÑÐ¸Ñ ${project.name}: + <a href="http://repo.hedgecode.org/content/repositories/releases/org/hedgecode/snooker/${project.artifactId}/${project.version}/${project.artifactId}-${project.version}.jar">${project.artifactId}-${project.version}.jar</a> + и ÐµÑ <a href="http://repo.hedgecode.org/content/repositories/releases/org/hedgecode/snooker/${project.artifactId}/${project.version}/${project.artifactId}-${project.version}.jar.md5">MD5</a> ÑÑмма. + </p> + </subsection> + + <subsection name="ÐÑедÑдÑÑие ÐеÑÑии"> + <p>СÑаÑÑе release-веÑÑии ${project.artifactId} доÑÑÑÐ¿Ð½Ñ Ð½Ð° ÑÑÑаниÑе <a href="http://repo.hedgecode.org/content/repositories/releases/org/hedgecode/snooker/${project.artifactId}/">Hedgecode Release Repository</a>.</p> + <p>СÑаÑÑе snapshot-веÑÑии ${project.artifactId} доÑÑÑÐ¿Ð½Ñ Ð½Ð° ÑÑÑаниÑе <a href="http://repo.hedgecode.org/content/repositories/snapshots/org/hedgecode/snooker/${project.artifactId}/">Hedgecode Snapshot Repository</a>.</p> + </subsection> + + <subsection name="${project.name} ${project.version} ÐÑÑ Ð¾Ð´Ð½Ñй Ðод"> + <p>ÐÑÑ Ð¸Ð²Ñ Ñ javadoc и иÑÑ Ð¾Ð´Ð½Ñми кодами ÑекÑÑей веÑÑии библиоÑеки: + <a href="http://repo.hedgecode.org/content/repositories/releases/org/hedgecode/snooker/${project.artifactId}/${project.version}/${project.artifactId}-${project.version}-javadoc.jar">javadoc</a>, + <a href="http://repo.hedgecode.org/content/repositories/releases/org/hedgecode/snooker/${project.artifactId}/${project.version}/${project.artifactId}-${project.version}-sources.jar">sources</a>. + </p> + <p>ÐÑÑ Ð¾Ð´Ð½Ñй код ${project.artifactId} доÑÑÑпен в <a href="http://svn.hedgecode.org/lib/${project.artifactId}/trunk/">Hedgecode Subversion Repository</a>.</p> + <p>ÐÑÑ Ð¾Ð´Ð½Ñй код ${project.name} ÑаÑпÑоÑÑÑанÑеÑÑÑ Ð¿Ð¾Ð´ лиÑензией <a href="http://www.apache.org/licenses/">Apache License, version 2.0</a>.</p> + </subsection> + + </section> + </body> +</document> + 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 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + ~ 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. +--> + +<project xmlns="http://maven.apache.org/DECORATION/1.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 http://maven.apache.org/xsd/decoration-1.0.0.xsd"> + <body> + <breadcrumbs> + <item name="${project.artifactId}" href="/"/> + </breadcrumbs> + <links> + <item name="ENG" href="index.html"/> + <item name="RUS" href="ru/index.html"/> + </links> + <menu name="Overview"> + <item name="Introduction" href="index.html"/> + <item name="Usage" href="usage.html"/> + <item name="FAQ" href="faq.html"/> + <item name="License" href="http://www.apache.org/licenses/"/> + <item name="Download" href="download.html"/> + </menu> + <menu name="Examples"> + <item name="Work with cached API" href="examples/work-with-the-cached-api.html"/> + <item name="Use data sorting" href="examples/use-sort-in-collections.html"/> + <item name="Handle API Exceptions" href="examples/handle-the-api-exceptions.html"/> + </menu> + <menu ref="reports"/> + </body> +</project> 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 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + ~ 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. +--> + +<project xmlns="http://maven.apache.org/DECORATION/1.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 http://maven.apache.org/xsd/decoration-1.0.0.xsd"> + <body> + <breadcrumbs> + <item name="${project.artifactId}" href="/"/> + </breadcrumbs> + <links> + <item name="ENG" href="../index.html"/> + <item name="RUS" href="index.html"/> + </links> + <menu name="ÐпиÑание"> + <item name="Ðведение" href="index.html"/> + <item name="ÐÑполÑзование" href="usage.html"/> + <item name="ЧаÐо" href="faq.html"/> + <item name="ÐиÑензиÑ" href="http://www.apache.org/licenses/"/> + <item name="СкаÑаÑÑ" href="download.html"/> + </menu> + <menu name="ÐÑимеÑÑ"> + <item name="РабоÑа Ñ ÐºÑÑиÑÑÑÑей веÑÑией API" href="examples/work-with-the-cached-api.html"/> + <item name="ÐÑполÑзование ÑоÑÑиÑовки полÑÑеннÑÑ Ð´Ð°Ð½Ð½ÑÑ " href="examples/use-sort-in-collections.html"/> + <item name="ÐбÑабоÑка иÑклÑÑений, возникаÑÑÐ¸Ñ Ð¿Ñи ÑабоÑе Ñ API" href="examples/handle-the-api-exceptions.html"/> + </menu> + <menu ref="reports"/> + </body> +</project> 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 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + ~ 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. +--> + +<document> + <properties> + <title>Download</title> + </properties> + <body> + <section name="Download ${project.name}"> + + <p>${project.name} ${project.version} is distributed in ready-made binary format (jar artifact) and source format.</p> + + <subsection name="${project.name} ${project.version} Binary Format"> + <p> + The current stable version of ${project.name}: + <a href="http://repo.hedgecode.org/content/repositories/releases/org/hedgecode/maven/plugins/${project.artifactId}/${project.version}/${project.artifactId}-${project.version}.jar">${project.artifactId}-${project.version}.jar</a> + and its <a href="http://repo.hedgecode.org/content/repositories/releases/org/hedgecode/maven/plugins/${project.artifactId}/${project.version}/${project.artifactId}-${project.version}.jar.md5">MD5</a> sum. + </p> + </subsection> + + <subsection name="Previous Versions"> + <p>Older releases can be found on ${project.artifactId} page of <a href="http://repo.hedgecode.org/content/repositories/releases/org/hedgecode/maven/plugins/${project.artifactId}/">Hedgecode Release Repository</a>.</p> + <p>Older snapshots can be found on ${project.artifactId} page of <a href="http://repo.hedgecode.org/content/repositories/snapshots/org/hedgecode/maven/plugins/${project.artifactId}/">Hedgecode Snapshot Repository</a>.</p> + </subsection> + + <subsection name="${project.name} ${project.version} Source Code"> + <p>Javadoc and Sources archives of the current version of the library: + <a href="http://repo.hedgecode.org/content/repositories/releases/org/hedgecode/maven/plugins/${project.artifactId}/${project.version}/${project.artifactId}-${project.version}-javadoc.jar">javadoc</a>, + <a href="http://repo.hedgecode.org/content/repositories/releases/org/hedgecode/maven/plugins/${project.artifactId}/${project.version}/${project.artifactId}-${project.version}-sources.jar">sources</a>. + </p> + <p>Source code of the ${project.artifactId} can be found on <a href="http://svn.hedgecode.org/maven/plugins/trunk/${project.artifactId}/">Hedgecode Subversion Repository</a>.</p> + <p>${project.name} source code is distributed under the <a href="http://www.apache.org/licenses/">Apache License, version 2.0</a>.</p> + </subsection> + + </section> + </body> +</document> +