Display of media assets
parent
b89e15479d
commit
28fd511f95
|
|
@ -1,24 +1,38 @@
|
||||||
<#macro "org.librecms.assets.AudioAsset" asset>
|
<#macro "org.librecms.assets.AudioAsset" asset>
|
||||||
<pre>AudioAsset</pre>
|
<figure>
|
||||||
|
<audio controls
|
||||||
|
src="/content-sections/${asset.contentSection}/audiomedia${asset.assetPath}"
|
||||||
|
width="240"></audio>
|
||||||
|
<figcaption>${asset.description}</figcaption>
|
||||||
|
</figure>
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
||||||
<#macro "org.librecms.assets.ExternalAudioAsset" asset>
|
<#macro "org.librecms.assets.ExternalAudioAsset" asset>
|
||||||
<pre>ExternalAudioAsset</pre>
|
<figure>
|
||||||
|
<audio controls src="${asset.url}" width="240"></audio>
|
||||||
|
<figcaption>${asset.description}</figcaption>
|
||||||
|
</figure>
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
||||||
<#macro "org.librecms.assets.ExternalVideoAsset" asset>
|
<#macro "org.librecms.assets.ExternalVideoAsset" asset>
|
||||||
<pre>ExternalVideoAsset</pre>
|
<figure>
|
||||||
|
<video controls src="${asset.url}" width="240"></video>
|
||||||
|
<figcaption>${asset.description}</figcaption>
|
||||||
|
</figure>
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
||||||
<#macro "org.librecms.assets.FileAsset" asset>
|
<#macro "org.librecms.assets.FileAsset" asset>
|
||||||
<h3><a href="/content-sections/${asset.contentSection}/files${asset.assetPath}">${asset.title}</a></h3>
|
<h3><a href="/content-sections/${asset.contentSection}/files${asset.assetPath}">${asset.title}</a></h3>
|
||||||
<p>${asset.description}</p>
|
<p>${asset.description}</p>
|
||||||
<small>${asset.mimeType} ${asset.size} Bytes</small>
|
<small>${asset.mimeType} ${asset.size} Bytes</small>
|
||||||
<#-- <p><code>A file asset</code></p> -->
|
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
||||||
<#macro "org.librecms.assets.Image" asset>
|
<#macro "org.librecms.assets.Image" asset>
|
||||||
<pre>Image</pre>
|
<figure>
|
||||||
|
<img src="/content-sections/${asset.contentSection}/images${asset.assetPath}"
|
||||||
|
width="240" />
|
||||||
|
<figcaption>${asset.description}</figcaption>
|
||||||
|
</figure>
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -40,5 +54,10 @@
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
||||||
<#macro "org.librecms.assets.VideoAsset" asset>
|
<#macro "org.librecms.assets.VideoAsset" asset>
|
||||||
<pre>VideoAsset</pre>
|
<figure>
|
||||||
|
<video controls
|
||||||
|
src="/content-sections/${asset.contentSection}/videos${asset.assetPath}"
|
||||||
|
width="240"></video>
|
||||||
|
<figcaption>${asset.description}</figcaption>
|
||||||
|
</figure>
|
||||||
</#macro>
|
</#macro>
|
||||||
|
|
|
||||||
|
|
@ -18,15 +18,6 @@
|
||||||
*/
|
*/
|
||||||
package org.librecms.contentsection.rs;
|
package org.librecms.contentsection.rs;
|
||||||
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
|
||||||
import org.apache.logging.log4j.Logger;
|
|
||||||
import org.librecms.assets.BinaryAssetDataService;
|
|
||||||
import org.librecms.assets.AudioAsset;
|
|
||||||
import org.librecms.contentsection.Asset;
|
|
||||||
import org.librecms.contentsection.AssetRepository;
|
|
||||||
import org.librecms.contentsection.ContentSection;
|
|
||||||
import org.librecms.contentsection.ContentSectionRepository;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
@ -40,6 +31,15 @@ import javax.ws.rs.WebApplicationException;
|
||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
import javax.ws.rs.core.StreamingOutput;
|
import javax.ws.rs.core.StreamingOutput;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.librecms.assets.AudioAsset;
|
||||||
|
import org.librecms.assets.BinaryAssetDataService;
|
||||||
|
import org.librecms.contentsection.Asset;
|
||||||
|
import org.librecms.contentsection.AssetRepository;
|
||||||
|
import org.librecms.contentsection.ContentSection;
|
||||||
|
import org.librecms.contentsection.ContentSectionRepository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
|
@ -84,7 +84,7 @@ public class AudioMedia {
|
||||||
}
|
}
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("/{path:^(?!uuid).+$}")
|
@Path("/{path:.+}")
|
||||||
public Response getAudio(
|
public Response getAudio(
|
||||||
@PathParam("content-section") final String sectionName,
|
@PathParam("content-section") final String sectionName,
|
||||||
@PathParam("path") final String path
|
@PathParam("path") final String path
|
||||||
|
|
|
||||||
|
|
@ -18,14 +18,6 @@
|
||||||
*/
|
*/
|
||||||
package org.librecms.contentsection.rs;
|
package org.librecms.contentsection.rs;
|
||||||
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
|
||||||
import org.apache.logging.log4j.Logger;
|
|
||||||
import org.librecms.assets.Image;
|
|
||||||
import org.librecms.contentsection.Asset;
|
|
||||||
import org.librecms.contentsection.AssetRepository;
|
|
||||||
import org.librecms.contentsection.ContentSection;
|
|
||||||
import org.librecms.contentsection.ContentSectionRepository;
|
|
||||||
|
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
@ -45,6 +37,14 @@ import javax.ws.rs.PathParam;
|
||||||
import javax.ws.rs.QueryParam;
|
import javax.ws.rs.QueryParam;
|
||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.librecms.assets.Image;
|
||||||
|
import org.librecms.contentsection.Asset;
|
||||||
|
import org.librecms.contentsection.AssetRepository;
|
||||||
|
import org.librecms.contentsection.ContentSection;
|
||||||
|
import org.librecms.contentsection.ContentSectionRepository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
|
@ -139,7 +139,7 @@ public class Images {
|
||||||
* @return A {@link Response} containing the scaled image or an error value.
|
* @return A {@link Response} containing the scaled image or an error value.
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/{path:^(?!uuid).+$}")
|
@Path("/{path:.+}")
|
||||||
public Response getImage(
|
public Response getImage(
|
||||||
@PathParam("content-section") final String sectionName,
|
@PathParam("content-section") final String sectionName,
|
||||||
@PathParam("path") final String path,
|
@PathParam("path") final String path,
|
||||||
|
|
|
||||||
|
|
@ -18,15 +18,6 @@
|
||||||
*/
|
*/
|
||||||
package org.librecms.contentsection.rs;
|
package org.librecms.contentsection.rs;
|
||||||
|
|
||||||
import org.apache.logging.log4j.LogManager;
|
|
||||||
import org.apache.logging.log4j.Logger;
|
|
||||||
import org.librecms.assets.BinaryAssetDataService;
|
|
||||||
import org.librecms.assets.VideoAsset;
|
|
||||||
import org.librecms.contentsection.Asset;
|
|
||||||
import org.librecms.contentsection.AssetRepository;
|
|
||||||
import org.librecms.contentsection.ContentSection;
|
|
||||||
import org.librecms.contentsection.ContentSectionRepository;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
@ -40,6 +31,15 @@ import javax.ws.rs.WebApplicationException;
|
||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
import javax.ws.rs.core.StreamingOutput;
|
import javax.ws.rs.core.StreamingOutput;
|
||||||
|
|
||||||
|
import org.apache.logging.log4j.LogManager;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.librecms.assets.BinaryAssetDataService;
|
||||||
|
import org.librecms.assets.VideoAsset;
|
||||||
|
import org.librecms.contentsection.Asset;
|
||||||
|
import org.librecms.contentsection.AssetRepository;
|
||||||
|
import org.librecms.contentsection.ContentSection;
|
||||||
|
import org.librecms.contentsection.ContentSectionRepository;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
* @author <a href="mailto:jens.pelzetter@googlemail.com">Jens Pelzetter</a>
|
||||||
|
|
@ -84,7 +84,7 @@ public class Videos {
|
||||||
}
|
}
|
||||||
|
|
||||||
@GET
|
@GET
|
||||||
@Path("/{path:^(?!uuid).+$}")
|
@Path("/{path:.+}")
|
||||||
public Response getVideo(
|
public Response getVideo(
|
||||||
@PathParam("content-section") final String sectionName,
|
@PathParam("content-section") final String sectionName,
|
||||||
@PathParam("path") final String path
|
@PathParam("path") final String path
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue