001/* 002 * Copyright 2019 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.content.autosave; 017 018import javax.jcr.Node; 019 020import org.ametys.cms.repository.IndexableJCRAmetysObject; 021import org.ametys.cms.repository.SimpleIndexableAmetysObject; 022import org.ametys.plugins.repository.AmetysObject; 023import org.ametys.plugins.repository.AmetysRepositoryException; 024import org.ametys.plugins.repository.jcr.DefaultTraversableAmetysObjectFactory; 025 026/** 027 * Implementation of a {@link IndexableJCRAmetysObject}, for content backup.<br> 028 * This implementation heavily relies on its {@link ContentBackupAmetysObjectFactory} counterpart. 029 */ 030public class ContentBackupAmetysObject extends SimpleIndexableAmetysObject<ContentBackupAmetysObjectFactory> 031{ 032 /** Content identifier data name */ 033 public static final String AUTOSAVE_CONTENT_ID = "contentId"; 034 /** Creator data name */ 035 public static final String AUTOSAVE_CREATOR = "creator"; 036 /** Temporary date data name */ 037 public static final String AUTOSAVE_TEMP_DATE = "tempContentDate"; 038 /** Valid values data name */ 039 public static final String AUTOSAVE_VALUES = "values"; 040 /** Invalid values data name */ 041 public static final String AUTOSAVE_INVALID_VALUES = "invalid"; 042 /** Repeaters data name */ 043 public static final String AUTOSAVE_REPEATERS = "repeaters"; 044 045 /** Attribute name data name for values (valid and invalid) data */ 046 public static final String ATTRIBUTE_NAME = "name"; 047 /** Attribute value data name for values (valid and invalid) data */ 048 public static final String ATTRIBUTE_VALUE = "value"; 049 050 /** Repeater name data name */ 051 public static final String REPEATER_NAME = "name"; 052 /** Repeater count data name */ 053 public static final String REPEATER_COUNT = "count"; 054 /** Repeater prefix data name */ 055 public static final String REPEATER_PREFIX = "prefix"; 056 057 /** 058 * Creates a DefaultTraversableAmetysObject. 059 * @param node the node backing this {@link AmetysObject}. 060 * @param parentPath the parent path in the Ametys hierarchy. 061 * @param factory the {@link DefaultTraversableAmetysObjectFactory} which creates the AmetysObject. 062 * @throws AmetysRepositoryException if an error occurs. 063 */ 064 public ContentBackupAmetysObject(Node node, String parentPath, ContentBackupAmetysObjectFactory factory) throws AmetysRepositoryException 065 { 066 super(node, parentPath, factory); 067 } 068}