BrightSide Workbench Full Report + Source Code
CalendarParser.java
Go to the documentation of this file.
1
/*
2
* TurrĂ³ i Cutiller Foundation. License notice.
3
* Copyright (C) 2019 Lluis TurrĂ³ Cutiller <http://www.turro.org/>
4
*
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU Affero General Public License as published by
7
* the Free Software Foundation, either version 3 of the License, or
8
* (at your option) any later version.
9
*
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU Affero General Public License for more details.
14
*
15
* You should have received a copy of the GNU Affero General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
19
package
org.turro.parser;
20
21
import
org.turro.string.Strings;
22
import
org.turro.annotation.ExternalParser;
23
import
org.turro.auth.Authentication;
24
import
org.turro.elephant.context.ElephantContext;
25
30
@ExternalParser
31
public
class
CalendarParser
extends
AbstractParser
{
32
33
@Override
34
public
String
getParserName
() {
35
return
"Calendar"
;
36
}
37
38
@Override
39
protected
boolean
doExecute
() {
40
boolean
done =
false
;
41
if
(
"calendar"
.equals(
getMacroName
())) {
42
if
(
"url"
.equals(
getToken
(1))) {
43
out
.write(
ElephantContext
.
getServerUrl
(
"http"
) +
44
"/_reqxdc_/calendar?ses="
+
45
Strings.obfuscate(
Authentication
.
getIContact
().
getId
()));
46
done =
true
;
47
}
48
}
49
return
done;
50
}
51
52
@Override
53
protected
void
explainMacros
(
ParserMacroSet
macros) {
54
macros.
addMacro
(
"calendar"
)
55
.
addParameter
(
"type"
,
false
)
56
.
addPossibleValue
(
"url"
);
57
}
58
59
}
org.turro.auth.Authentication
Definition:
Authentication.java:51
org.turro.auth.Authentication.getIContact
static IContact getIContact()
Definition:
Authentication.java:145
org.turro.elephant.context.ElephantContext
Definition:
ElephantContext.java:59
org.turro.elephant.context.ElephantContext.getServerUrl
static String getServerUrl(String scheme)
Definition:
ElephantContext.java:257
org.turro.parser.AbstractParser
Definition:
AbstractParser.java:35
org.turro.parser.AbstractParser.getMacroName
String getMacroName()
Definition:
AbstractParser.java:71
org.turro.parser.AbstractParser.getToken
String getToken(String name)
Definition:
AbstractParser.java:75
org.turro.parser.AbstractParser.out
PrintWriter out
Definition:
AbstractParser.java:39
org.turro.parser.CalendarParser
Definition:
CalendarParser.java:31
org.turro.parser.CalendarParser.getParserName
String getParserName()
Definition:
CalendarParser.java:34
org.turro.parser.CalendarParser.explainMacros
void explainMacros(ParserMacroSet macros)
Definition:
CalendarParser.java:53
org.turro.parser.CalendarParser.doExecute
boolean doExecute()
Definition:
CalendarParser.java:39
org.turro.parser.ParserMacroSet
Definition:
ParserMacroSet.java:27
org.turro.parser.ParserMacroSet.addMacro
ParserMacro addMacro(String macroName)
Definition:
ParserMacroSet.java:29
org.turro.parser.ParserMacro.addPossibleValue
ParserMacro addPossibleValue(String value)
Definition:
ParserMacro.java:64
org.turro.parser.ParserMacro.addParameter
ParserMacro addParameter(String name, boolean optional)
Definition:
ParserMacro.java:51
org.turro.plugin.contacts.IContact.getId
String getId()
TurroProjects
Public
BrightSide
elephant-calendar
src
main
java
org
turro
parser
CalendarParser.java
Generated on Tue Mar 12 2024 07:01:18 for BrightSide by
1.9.1