de.smartics.properties.admin.resources.controller
Class PropertyResource

Package class diagram package PropertyResource
java.lang.Object
  extended by de.smartics.properties.admin.resources.controller.PropertyResource

@Path(value="")
@RolesAllowed(value="view")
public class PropertyResource
     
     
extends Object

Provides access to properties used by the application.


Constructor Summary
PropertyResource()
           
 
Method Summary
 javax.ws.rs.core.Response getAsDotXml(String configurationKey, String propertyKey)
          Returns the property value for a given property key in its SDoc XML representation.
 javax.ws.rs.core.Response getAsHtml(String configurationKey, String propertyKey)
          Returns the property value for a given property key.
 javax.ws.rs.core.Response getAsText(String configurationKey, String propertyKey)
          Returns the property value for a given property key.
 javax.ws.rs.core.Response getAsXml(String configurationKey, String propertyKey)
          Returns the property value for a given property key in its SDoc XML representation.
 javax.ws.rs.core.Response postAsHtml(String configurationKey, String propertyKey, String propertyValue)
          Changes the property value and returns the representation of the changed property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyResource

public PropertyResource()
Method Detail

getAsText

@GET
@Path(value="/configurations/{configuration : .+}/keys/{key}")
@Produces(value="text/plain")
public javax.ws.rs.core.Response getAsText(@PathParam(value="configuration")
                                                             String configurationKey,
                                                             @PathParam(value="key")
                                                             String propertyKey)
Returns the property value for a given property key.

Parameters:
configurationKey - the configuration key.
propertyKey - the key to the requested property.
Returns:
the string representation.

getAsHtml

@GET
@Path(value="/configurations/{configuration : .+}/keys/{key}")
@Produces(value="text/html")
public javax.ws.rs.core.Response getAsHtml(@PathParam(value="configuration")
                                                             String configurationKey,
                                                             @PathParam(value="key")
                                                             String propertyKey)
Returns the property value for a given property key.

Parameters:
configurationKey - the configuration.
propertyKey - the key to the requested property.
Returns:
the HTML representation.

postAsHtml

@POST
@Path(value="/configurations/{configuration : .+}/keys/{key}")
@Produces(value="text/html")
@RolesAllowed(value="edit-property")
public javax.ws.rs.core.Response postAsHtml(@PathParam(value="configuration")
                                                                            String configurationKey,
                                                                            @PathParam(value="key")
                                                                            String propertyKey,
                                                                            @FormParam(value="value")
                                                                            String propertyValue)
                                     throws de.smartics.properties.api.core.domain.PropertyValidationException,
                                            de.smartics.properties.api.core.domain.ReadOnlyPropertyException
Changes the property value and returns the representation of the changed property.

Parameters:
configurationKey - the configuration .
propertyKey - the key to the requested property.
propertyValue - the new value to set.
Returns:
the HTML representation.
Throws:
de.smartics.properties.api.core.domain.PropertyValidationException - if the propertyValue is not successfully validated.
de.smartics.properties.api.core.domain.ReadOnlyPropertyException - if the property referenced by propertyKey is read-only and therefore cannot be changed.

getAsDotXml

@GET
@Path(value="/configurations/{configuration : .+}/keys/{key}.xml")
@Produces(value="*/*")
public javax.ws.rs.core.Response getAsDotXml(@PathParam(value="configuration")
                                                               String configurationKey,
                                                               @PathParam(value="key")
                                                               String propertyKey)
Returns the property value for a given property key in its SDoc XML representation.

Parameters:
configurationKey - the configuration .
propertyKey - the key to the requested property.
Returns:
the HTML representation.

getAsXml

@GET
@Path(value="/configurations/{configuration : .+}/keys/{key}")
@Produces(value={"application/xml","text/xml"})
public javax.ws.rs.core.Response getAsXml(@PathParam(value="configuration")
                                                            String configurationKey,
                                                            @PathParam(value="key")
                                                            String propertyKey)
Returns the property value for a given property key in its SDoc XML representation.

Parameters:
configurationKey - the configuration .
propertyKey - the key to the requested property.
Returns:
the HTML representation.


Copyright © 2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.