-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMediaDetail.cfm
218 lines (217 loc) · 7.58 KB
/
MediaDetail.cfm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
<cfinclude template="/includes/_header.cfm">
<cfoutput>
<cfquery name="findIDs" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#" cachedwithin="#createtimespan(0,0,60,0)#">
select
media.media_id,
media.media_uri,
media.mime_type,
media.media_type,
media.preview_uri,
ctmedia_license.uri,
ctmedia_license.display,
doi
from
media,
ctmedia_license,
doi
where
media.media_license_id=ctmedia_license.media_license_id (+) and
media.media_id=doi.media_id (+) and
media.media_id = #media_id#
</cfquery>
<cfif isdefined("session.roles") and listcontainsnocase(session.roles,"manage_media")>
<cfset h="/media.cfm?action=newMedia">
<cfif isdefined("url.relationship__1") and isdefined("url.related_primary_key__1")>
<cfif url.relationship__1 is "cataloged_item">
<cfset h=h & '&collection_object_id=#url.related_primary_key__1#'>
( find Media and pick an item to link to existing Media )<br>
</cfif>
</cfif>
<a href="#h#">[ Create media ]</a>
</cfif>
<cfquery name="labels_raw" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
select
media_label,
label_value,
agent_name
from
media_labels,
preferred_agent_name
where
media_labels.assigned_by_agent_id=preferred_agent_name.agent_id (+) and
media_id=#media_id#
</cfquery>
<cfquery name="labels" dbtype="query">
select media_label,label_value from labels_raw where media_label != 'description'
</cfquery>
<cfquery name="desc" dbtype="query">
select label_value from labels_raw where media_label='description'
</cfquery>
<cfset alt="#findIDs.media_uri#">
<cfif desc.recordcount is 1 and findIDs.recordcount is 1>
<cfset title = desc.label_value>
<cfset alt=desc.label_value>
</cfif>
<cfinvoke component="/component/functions" method="getMediaPreview" returnVariable="mp">
<cfinvokeargument name="preview_uri" value="#findIDs.preview_uri#">
<cfinvokeargument name="media_type" value="#findIDs.media_type#">
</cfinvoke>
<cfquery name="coord" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
select coordinates from media_flat where coordinates is not null and media_id=#media_id#
</cfquery>
<table>
<tr>
<td align="middle">
<cfif findIDs.mime_type is "audio/mpeg3">
<br>
<audio controls>
<source src="#findIDs.media_uri#" type="audio/mp3">
<a href="/exit.cfm?target=#findIDs.media_uri#" target="_blank">
<img src="#mp#" alt="#alt#" style="max-width:250px;max-height:250px;">
</a>
</audio>
<cfelse>
<a href="/exit.cfm?target=#findIDs.media_uri#" target="_blank">
<img src="#mp#" alt="#alt#" style="max-width:250px;max-height:250px;">
</a>
</cfif>
<br>
<span style='font-size:small'>#findIDs.media_type# (#findIDs.mime_type#)</span>
<cfif len(findIDs.display) gt 0>
<br>
<span style='font-size:small'>License: <a href="#findIDs.uri#" target="_blank" class="external">#findIDs.display#</a></span>
<cfelse>
<br><span style='font-size:small'>unlicensed</span>
</cfif>
</td>
<td>
<cfif coord.recordcount is 1>
<cfinvoke component="component.functions" method="getMap" returnvariable="contents">
<cfinvokeargument name="media_id" value="#media_id#">
<cfinvokeargument name="size" value="100x100">
</cfinvoke>
#contents#
</cfif>
</td>
<td>
<cfif len(findIDs.doi) gt 0>
<ul><li>DOI: #findIDs.doi#</li></ul>
<cfelse>
<cfif isdefined("session.roles") and listfindnocase(session.roles,"coldfusion_user")>
<ul><li><a href="/tools/doi.cfm?media_id=#media_id#">get a DOI</a></li></ul>
</cfif>
</cfif>
<cfif len(desc.label_value) gt 0>
<ul><li>#desc.label_value#</li></ul>
</cfif>
<cfif labels.recordcount gt 0>
<ul>
<cfloop query="labels">
<li>#media_label#: #label_value#</li>
</cfloop>
</ul>
</cfif>
<cfset mrel=getMediaRelations(findIDs.media_id)>
<cfif mrel.recordcount gt 0>
<ul>
<cfloop query="mrel">
<li>
#media_relationship#
<cfif len(link) gt 0>
<a href="#link#" target="_blank">#summary#</a>
<cfelse>
#summary#
</cfif>
</li>
</cfloop>
</ul>
</cfif>
</td>
</tr>
<tr>
<td colspan="3" align="center">
<cfquery name="tag" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
select count(*) n from tag where media_id=#media_id#
</cfquery>
<cfif findIDs.media_type is "multi-page document">
<a href="/document.cfm?media_id=#findIDs.media_id#">[ view as document ]</a>
</cfif>
<cfif isdefined("session.roles") and listcontainsnocase(session.roles,"manage_media")>
<a href="/media.cfm?action=edit&media_id=#media_id#">[ edit media ]</a>
<a href="/TAG.cfm?media_id=#media_id#">[ add or edit TAGs ]</a>
</cfif>
<cfif tag.n gt 0>
<a href="/showTAG.cfm?media_id=#media_id#">[ View #tag.n# TAGs ]</a>
</cfif>
</td>
</tr>
<cfquery name="relM" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
select
media.media_id,
media.media_type,
media.mime_type,
media.preview_uri,
media.media_uri
from
media,
media_relations
where
media.media_id=media_relations.related_primary_key and
media_relationship like '% media'
and media_relations.media_id =#media_id#
and media.media_id != #media_id#
UNION
select media.media_id, media.media_type,
media.mime_type, media.preview_uri, media.media_uri
from media, media_relations
where
media.media_id=media_relations.media_id and
media_relationship like '% media' and
media_relations.related_primary_key=#media_id#
and media.media_id != #media_id#
</cfquery>
<tr>
<td colspan="3">
<cfif relM.recordcount gt 0>
<br>Related Media
<div class="thumbs">
<div class="thumb_spcr"> </div>
<cfloop query="relM">
<cfinvoke component="/component/functions" method="getMediaPreview" returnVariable="puri">
<cfinvokeargument name="preview_uri" value="#preview_uri#">
<cfinvokeargument name="media_type" value="#media_type#">
</cfinvoke>
<cfquery name="labels" datasource="user_login" username="#session.dbuser#" password="#decrypt(session.epw,session.sessionKey)#">
select
media_label,
label_value
from
media_labels
where
media_id=#media_id#
</cfquery>
<cfquery name="desc" dbtype="query">
select label_value from labels where media_label='description'
</cfquery>
<cfset alt="Media Preview Image">
<cfif desc.recordcount is 1>
<cfset alt=desc.label_value>
</cfif>
<div class="one_thumb">
<a href="/exit.cfm?target=#media_uri#" target="_blank"><img src="#puri#" alt="#alt#" class="theThumb"></a>
<p>
#media_type# (#mime_type#)
<br><a href="/media/#media_id#">Media Details</a>
<br>#alt#
</p>
</div>
</cfloop>
<div class="thumb_spcr"> </div>
</div>
</div>
</cfif>
</td>
</tr>
</table>
</cfoutput>
<cfinclude template="/includes/_footer.cfm">