Project

General

Profile

« Previous | Next » 

Revision 60764

reverted to version 56067 - attempt to use relative URLs sadly failed

View differences:

modules/dnet-vocabulary-publisher/trunk/src/main/java/eu/dnetlib/vocabularies/publisher/controller/VocabularyPublisherController.java
31 31
	private VocabularyRetriever vocabularyRetriever;
32 32
	@Value("${vocabulary.publisher.title}")
33 33
	private String title;
34
	@Value("${vocabulary.publisher.baseURL}")
35
	private String baseURL;
34 36
	@Value("${container.context}")
35 37
	private String context;
36 38

  
37

  
38 39
	@RequestMapping(value = "/vocabularies", method = RequestMethod.GET, produces = { "application/json" })
39 40
	public @ResponseBody
40 41
	List<Vocabulary> listVocabularies() {
......
72 73
	@RequestMapping(value = "/vocabularies", method = RequestMethod.GET, produces = { "text/html" })
73 74
	public void listVocabularies(final ModelMap map) {
74 75
		map.addAttribute("vocabularies", listVocabularies());
76
		map.addAttribute("title", title);
77
		map.addAttribute("baseURL", baseURL);
75 78
		map.addAttribute("context", context);
76
		map.addAttribute("title", title);
77 79
	}
78 80

  
79 81
	@RequestMapping(value = "/vocabularies/{code}", method = RequestMethod.GET, produces = { "text/html" })
......
82 84
			final ModelMap map) throws VocabularyNotFoundException {
83 85

  
84 86
		map.addAttribute("vocabulary", getVocabulary(code));
87
		map.addAttribute("baseURL", baseURL);
85 88
		map.addAttribute("context", context);
86 89
		return "displayVocabulary";
87 90
	}
......
93 96
			final ModelMap map) throws VocabularyNotFoundException {
94 97
		map.addAttribute("vocabulary", getVocabulary(code));
95 98
		map.addAttribute("term", getTermSynonyms(code, request));
99
		map.addAttribute("baseURL", baseURL);
96 100
		map.addAttribute("context", context);
97 101
		return "displaySynonyms";
98 102
	}
modules/dnet-vocabulary-publisher/trunk/src/main/resources/eu/dnetlib/vocabularies/publisher/applicationContext-dnet-vocabulary-publisher.properties
1
vocabulary.publisher.title		=	Controlled Vocabularies
1
vocabulary.publisher.title		=	Controlled Vocabularies
2
vocabulary.publisher.baseURL	=	http://${container.hostname}:${container.port}/${container.context}/mvc/vocabularies
modules/dnet-vocabulary-publisher/trunk/src/main/resources/eu/dnetlib/vocabularies/views/master.st
24 24
            <span class="icon-bar"></span>
25 25
            <span class="icon-bar"></span>
26 26
          </button>
27
          <a class="navbar-brand" href="vocabularies/">Vocabularies</a>
27
          <a class="navbar-brand" href="$baseURL$">Vocabularies</a>
28 28
          $navbars$
29 29
      </div>
30 30
	
modules/dnet-vocabulary-publisher/trunk/src/main/resources/eu/dnetlib/vocabularies/views/displayVocabulary.st
1 1
$master( title={$vocabulary.name$}, 
2 2
navbars={
3
	<a class="navbar-brand" href="$vocabulary.code$">$vocabulary.name$</a>
3
	<a class="navbar-brand" href="$baseURL$/$vocabulary.code$">$vocabulary.name$</a>
4 4
	},
5 5
	content = {
6 6
	<div><h4>Description: $vocabulary.description$</h4></div>
......
14 14
			<tbody>
15 15
			$vocabulary.terms:{ term | 
16 16
				<tr>
17
				    <td>$term.englishName$</td><td><a class="btn btn-link" href="$vocabulary.code$/$term.code$" role="button" data-toggle="tooltip" data-placement="top" title="Click to view the synonyms">$term.code$</a></td>
17
				    <td>$term.englishName$</td><td><a class="btn btn-link" href="$baseURL$/$vocabulary.code$/$term.code$" role="button" data-toggle="tooltip" data-placement="top" title="Click to view the synonyms">$term.code$</a></td>
18 18
				</tr>
19 19
			}$
20 20
			</tbody>
21 21
		</table>
22 22
		</div>
23 23
 		<hr>
24
        <div>Click <a href="$vocabulary.code$.json">here</a> to view the machine readable version of this page.</div>
24
        <div>Click <a href="$baseURL$/$vocabulary.code$.json">here</a> to view the machine readable version of this page.</div>
25 25
	})$
26 26

  
modules/dnet-vocabulary-publisher/trunk/src/main/resources/eu/dnetlib/vocabularies/views/vocabularies.st
7 7
			</thead>
8 8
			<tbody>
9 9
			$vocabularies:{ voc | 
10
				<tr><td>$voc.name$</br><a class="btn btn-link" href="$voc.code$" role="button">View terms &raquo;</a></td>
10
				<tr><td>$voc.name$</br><a class="btn btn-link" href="$baseURL$/$voc.code$" role="button">View terms &raquo;</a></td>
11 11
				<td>$voc.description$</td>
12 12
				</tr>
13 13
			}$
......
15 15
		</table>
16 16
	</div>
17 17
	<hr/>
18
    <div>Click <a href="vocabularies.json">here</a> to view the machine readable version of this page.</div>
18
    <div>Click <a href="$baseURL$.json">here</a> to view the machine readable version of this page.</div>
19 19
})$
20 20

  
21 21

  
modules/dnet-vocabulary-publisher/trunk/src/main/resources/eu/dnetlib/vocabularies/views/displaySynonyms.st
1 1
$master( title={$vocabulary.name$},
2 2
navbars={
3
	<a class="navbar-brand" href="$vocabulary.code$">$vocabulary.name$ / $term.englishName$</a>
3
	<a class="navbar-brand" href="$baseURL$/$vocabulary.code$">$vocabulary.name$ / $term.englishName$</a>
4 4
	},
5 5
	content = {
6 6
	<div><h4>English name: $term.englishName$</h4></div>
......
24 24
		</table>
25 25
		</div>
26 26
 		<hr>
27
        <div>Click <a href="$vocabulary.code$/$term.code$.json">here</a> to view the machine readable version of this page.</div>
27
        <div>Click <a href="$baseURL$/$vocabulary.code$/$term.code$.json">here</a> to view the machine readable version of this page.</div>
28 28
	})$
29 29

  

Also available in: Unified diff