1 31 32 package org.opencms.file; 33 34 import org.opencms.db.CmsDbUtil; 35 import org.opencms.util.CmsUUID; 36 37 import java.sql.Timestamp ; 38 import java.util.List ; 39 40 49 public class CmsBackupProject extends CmsProject implements Cloneable { 50 51 52 private long m_datePublished; 53 54 55 private String m_nameGroupManagers; 56 57 58 private String m_nameGroupUsers; 59 60 61 private String m_nameOwner; 62 63 64 private String m_namePublisher; 65 66 67 private List m_projectResources; 68 69 70 private CmsUUID m_userPublished; 71 72 73 private int m_versionId; 74 75 96 public CmsBackupProject( 97 int versionId, 98 int projectId, 99 String name, 100 String description, 101 int taskId, 102 CmsUUID ownerId, 103 CmsUUID groupId, 104 CmsUUID managerGroupId, 105 long dateCreated, 106 int type, 107 Timestamp datePublished, 108 CmsUUID userPublished, 109 String namePublisher, 110 String nameOwner, 111 String nameGroupUsers, 112 String nameGroupManagers, 113 List projectResources) { 114 115 super(projectId, name, description, taskId, ownerId, groupId, managerGroupId, 0, dateCreated, type); 116 117 m_versionId = versionId; 118 if (datePublished != null) { 119 m_datePublished = datePublished.getTime(); 120 } else { 121 m_datePublished = CmsDbUtil.UNKNOWN_ID; 122 } 123 m_userPublished = userPublished; 124 m_namePublisher = namePublisher; 125 m_nameOwner = nameOwner; 126 m_nameGroupUsers = nameGroupUsers; 127 m_nameGroupManagers = nameGroupManagers; 128 m_projectResources = projectResources; 129 } 130 131 136 public Object clone() { 137 138 return new CmsBackupProject( 139 m_versionId, 140 getId(), 141 getName(), 142 getDescription(), 143 getTaskId(), 144 getOwnerId(), 145 getGroupId(), 146 getManagerGroupId(), 147 this.getDateCreated(), 148 getType(), 149 new Timestamp (this.m_datePublished), 150 m_userPublished, 151 m_namePublisher, 152 m_nameOwner, 153 m_nameGroupUsers, 154 m_nameGroupManagers, 155 m_projectResources); 156 } 157 158 161 public boolean equals(Object obj) { 162 163 if (obj == this) { 164 return true; 165 } 166 if (obj instanceof CmsBackupProject) { 167 return ((CmsBackupProject)obj).getId() == getId(); 168 } 169 return false; 170 } 171 172 177 public String getGroupName() { 178 179 return m_nameGroupUsers; 180 } 181 182 187 public String getManagerGroupName() { 188 189 return m_nameGroupManagers; 190 } 191 192 197 public String getOwnerName() { 198 199 return m_nameOwner; 200 } 201 202 207 public List getProjectResources() { 208 209 return m_projectResources; 210 } 211 212 217 public CmsUUID getPublishedBy() { 218 219 return m_userPublished; 220 } 221 222 227 public String getPublishedByName() { 228 229 return m_namePublisher; 230 } 231 232 237 public long getPublishingDate() { 238 239 return m_datePublished; 240 } 241 242 247 public int getVersionId() { 248 249 return m_versionId; 250 } 251 252 255 public int hashCode() { 256 257 return (new Long (m_datePublished)).hashCode(); 258 } 259 } | Popular Tags |