001/* 002 * Copyright 2012 Anyware Services 003 * 004 * Licensed under the Apache License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.apache.org/licenses/LICENSE-2.0 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.ametys.cms.repository; 017 018import java.time.ZonedDateTime; 019 020import javax.jcr.Node; 021 022import org.ametys.plugins.repository.AmetysRepositoryException; 023 024/** 025 * Default implementation of a {@link Content}, also versionable, lockable and workflow-aware. 026 * @param <F> the actual type of factory. 027 */ 028public class DefaultWorkflowAwareContent<F extends DefaultWorkflowAwareContentFactory> extends DefaultContent<F> implements WorkflowAwareContent 029{ 030 /** 031 * Creates a JCR-based Content. 032 * @param node the JCR Node backing this Content. 033 * @param parentPath the parent path in the Ametys hierarchy. 034 * @param factory the corresponding {@link ContentFactory}. 035 */ 036 public DefaultWorkflowAwareContent(Node node, String parentPath, F factory) 037 { 038 super(node, parentPath, factory); 039 } 040 041 @Override 042 public long getWorkflowId() throws AmetysRepositoryException 043 { 044 return WorkflowAwareContentHelper.getWorkflowId(this); 045 } 046 047 @Override 048 public void setWorkflowId(long workflowId) throws AmetysRepositoryException 049 { 050 WorkflowAwareContentHelper.setWorkflowId(this, workflowId); 051 } 052 053 @Override 054 public long getCurrentStepId() throws AmetysRepositoryException 055 { 056 return WorkflowAwareContentHelper.getCurrentStepId(this); 057 } 058 059 @Override 060 public void setCurrentStepId (long stepId) throws AmetysRepositoryException 061 { 062 WorkflowAwareContentHelper.setCurrentStepId(this, stepId); 063 } 064 065 @Override 066 public ZonedDateTime getProposalDate() throws AmetysRepositoryException 067 { 068 return WorkflowAwareContentHelper.getProposalDate(this); 069 } 070 071 @Override 072 public void setProposalDate(ZonedDateTime proposalDate) throws AmetysRepositoryException 073 { 074 WorkflowAwareContentHelper.setProposalDate(this, proposalDate); 075 } 076}