@Produces(value={"text/html","application/json","application/xml","application/x-www-form-urlencoded"}) @Consumes(value={"application/json","application/xml","application/x-www-form-urlencoded"}) public class TemplateRestResource extends AbstractResource implements OptionsCapable
Modifier and Type | Field and Description |
---|---|
protected String |
childID |
protected ConfigModel |
childModel |
protected Dom |
entity |
static LocalStringManagerImpl |
localStrings |
protected Dom |
parent |
protected String |
tagName |
locatorBridge, logger, requestHeaders, securityContext, serviceLocator, subjectRef, uriInfo
Constructor and Description |
---|
TemplateRestResource()
Creates a new instance of xxxResource
|
Modifier and Type | Method and Description |
---|---|
protected ActionReportResult |
buildActionReportResult(boolean showEntityValues) |
static HashMap<String,String> |
createDataBasedOnForm(org.glassfish.jersey.media.multipart.FormDataMultiPart formData)
allows for remote files to be put in a tmp area and we pass the
local location of this file to the corresponding command instead of the content of the file
* Yu need to add enctype="multipart/form-data" in the form
for ex:
|
javax.ws.rs.core.Response |
createOrUpdateEntity(HashMap<String,String> data) |
javax.ws.rs.core.Response |
createOrUpdateEntityLegacyFormat(HashMap<String,String> data) |
javax.ws.rs.core.Response |
delete(Map<String,String> data) |
protected RestActionReporter |
doCreateOrUpdate(Map<String,String> data)
This method performs the creation or updating of an entity, regardless of the
request's mime type.
|
protected ActionReport.ExitCode |
doDelete(Map<String,String> data) |
protected String[][] |
getCommandResourcesPaths() |
protected String |
getDeleteCommand() |
Dom |
getEntity() |
Map<String,String> |
getEntity(int expandLevel) |
ActionReportResult |
getEntityLegacyFormat(int expandLevel) |
javax.ws.rs.core.UriInfo |
getUriInfo() |
protected javax.ws.rs.core.Response |
handleError(javax.ws.rs.core.Response.Status error,
String message) |
RestResourceMetadata |
options() |
ActionReportResult |
optionsLegacyFormat() |
Object |
post(org.glassfish.jersey.media.multipart.FormDataMultiPart formData) |
Object |
postLegacyFormat(org.glassfish.jersey.media.multipart.FormDataMultiPart formData)
allows for remote files to be put in a tmp area and we pass the
local location of this file to the corresponding command instead of the content of the file
* Yu need to add enctype="multipart/form-data" in the form
for ex:
<form action="http://localhost:4848/management/domain/applications/application" method="post" enctype="multipart/form-data">
then any param of type="file" will be uploaded, stored locally and the param will use the local location
on the server side (ie. |
protected void |
removeAttributesToBeSkipped(Map<String,String> data) |
void |
setBeanByKey(List<Dom> parentList,
String id,
String tag) |
void |
setEntity(Dom p) |
void |
setParentAndTagName(Dom parent,
String tagName) |
void |
setUriInfo(javax.ws.rs.core.UriInfo uriInfo) |
protected void |
throwError(javax.ws.rs.core.Response.Status error,
String message) |
getAuthenticatedUser, getSubject
protected Dom entity
protected Dom parent
protected String tagName
protected ConfigModel childModel
protected String childID
public static final LocalStringManagerImpl localStrings
public TemplateRestResource()
@GET public ActionReportResult getEntityLegacyFormat(@QueryParam(value="expandLevel") @DefaultValue(value="1") int expandLevel)
@GET @Produces(value="application/vnd.oracle.glassfish+json") public Map<String,String> getEntity(@QueryParam(value="expandLevel") @DefaultValue(value="1") int expandLevel)
@POST public javax.ws.rs.core.Response createOrUpdateEntityLegacyFormat(HashMap<String,String> data)
@POST @Produces(value="application/vnd.oracle.glassfish+json") public javax.ws.rs.core.Response createOrUpdateEntity(HashMap<String,String> data)
@POST @Consumes(value="multipart/form-data") public Object postLegacyFormat(org.glassfish.jersey.media.multipart.FormDataMultiPart formData)
<form action="http://localhost:4848/management/domain/applications/application" method="post" enctype="multipart/form-data">
then any param of type="file" will be uploaded, stored locally and the param will use the local location
on the server side (ie. just the path)@POST @Consumes(value="multipart/form-data") @Produces(value="application/vnd.oracle.glassfish+json") public Object post(org.glassfish.jersey.media.multipart.FormDataMultiPart formData)
@OPTIONS @Produces(value="application/json") public ActionReportResult optionsLegacyFormat()
@OPTIONS @Produces(value="application/vnd.oracle.glassfish+json") public RestResourceMetadata options()
protected RestActionReporter doCreateOrUpdate(Map<String,String> data)
WebApplicationException
is thrown, so if the method returns, the create/update was successful.data
- protected ActionReport.ExitCode doDelete(Map<String,String> data)
public javax.ws.rs.core.UriInfo getUriInfo()
getUriInfo
in interface OptionsCapable
public void setUriInfo(javax.ws.rs.core.UriInfo uriInfo)
setUriInfo
in interface OptionsCapable
public void setEntity(Dom p)
public Dom getEntity()
public static HashMap<String,String> createDataBasedOnForm(org.glassfish.jersey.media.multipart.FormDataMultiPart formData)
protected ActionReportResult buildActionReportResult(boolean showEntityValues)
protected String[][] getCommandResourcesPaths()
protected String getDeleteCommand()
protected void throwError(javax.ws.rs.core.Response.Status error, String message) throws javax.ws.rs.WebApplicationException
javax.ws.rs.WebApplicationException
protected javax.ws.rs.core.Response handleError(javax.ws.rs.core.Response.Status error, String message) throws javax.ws.rs.WebApplicationException
javax.ws.rs.WebApplicationException
Copyright © 2019. All rights reserved.