use of org.pentaho.platform.repository2.unified.webservices.FileVersioningConfiguration in project pentaho-platform by pentaho.
the class FileResource method doVersioningConfiguration.
/**
* This method is used to determine whether versioning should be active for the given path
*
* <p><b>Example Request:</b><br />
* GET pentaho/api/repo/files/:jmeter-test:test_file_1.ktr/versioningConfiguration
* </pre>
* </p>
*
* @param pathId Colon separated path for the repository file.
*
* @return The Versioning Configuration applicable to the path submitted
*
* <p><b>Example Response:</b></p>
* <pre function="syntax.xml">
* <fileVersioningConfiguration>
* <versionCommentEnabled>true</versionCommentEnabled>
* <versioningEnabled>true</versioningEnabled>
* </fileVersioningConfiguration>
* </pre>
*/
@GET
@Path("{pathId : .+}/versioningConfiguration")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@StatusCodes({ @ResponseCode(code = 200, condition = "Successfully returns the versioning configuration") })
public FileVersioningConfiguration doVersioningConfiguration(@PathParam("pathId") String pathId) {
IRepositoryVersionManager repositoryVersionManager = PentahoSystem.get(IRepositoryVersionManager.class);
String path = FileUtils.idToPath(pathId);
return new FileVersioningConfiguration(repositoryVersionManager.isVersioningEnabled(path), repositoryVersionManager.isVersionCommentEnabled(path));
}
use of org.pentaho.platform.repository2.unified.webservices.FileVersioningConfiguration in project pentaho-kettle by pentaho.
the class RevisionResourceTest method testGetVersioningEnabled.
/**
* @throws Exception
*/
@org.junit.Test
public void testGetVersioningEnabled() throws Exception {
FileVersioningConfiguration conf = revisionResource.doVersioningConfiguration("foo.ktr");
Assert.assertTrue(conf.isVersioningEnabled());
Assert.assertFalse(conf.isVersionCommentEnabled());
}
Aggregations