You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by sn...@apache.org on 2005/06/24 06:51:42 UTC
svn commit: r201565 - in
/incubator/roller/branches/roller_2.0/src/org/roller: pojos/
presentation/bookmarks/tags/ presentation/velocity/
presentation/weblog/actions/ presentation/weblog/tags/
presentation/website/tags/
Author: snoopdave
Date: Thu Jun 23 21:51:40 2005
New Revision: 201565
URL: http://svn.apache.org/viewcvs?rev=201565&view=rev
Log:
still cleaning up after breaking website/user relationship
Added:
incubator/roller/branches/roller_2.0/src/org/roller/pojos/ObjectAuditData.java
incubator/roller/branches/roller_2.0/src/org/roller/pojos/WebsiteObject.java
Removed:
incubator/roller/branches/roller_2.0/src/org/roller/presentation/bookmarks/tags/
incubator/roller/branches/roller_2.0/src/org/roller/presentation/velocity/Macros.java
incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/actions/BakeWeblogAction.java
incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/tags/ViewWeblogEntriesTag.java
incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/tags/WeblogCategoryChooserTag.java
incubator/roller/branches/roller_2.0/src/org/roller/presentation/weblog/tags/WeblogEntryMacros.java
incubator/roller/branches/roller_2.0/src/org/roller/presentation/website/tags/AuthorizeUserTag.java
Added: incubator/roller/branches/roller_2.0/src/org/roller/pojos/ObjectAuditData.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/pojos/ObjectAuditData.java?rev=201565&view=auto
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/pojos/ObjectAuditData.java (added)
+++ incubator/roller/branches/roller_2.0/src/org/roller/pojos/ObjectAuditData.java Thu Jun 23 21:51:40 2005
@@ -0,0 +1,121 @@
+/*
+ * Copyright 2005 Sun Microsystems, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.roller.pojos;
+
+import java.util.Date;
+
+/**
+ * Records change that a user has made to an object.
+ * @ejb:bean name="ObjectAuditData"
+ * @struts.form include-all="true"
+ * @hibernate.class table="roller_audit_log"
+ *
+ * @author Dave Johnson
+ */
+public class ObjectAuditData extends PersistentObject
+{
+ private String id; // primary key
+ private String userId; // user that made change
+ private String objectId; // id of associated object, if any
+ private String objectClass; // name of associated object class (e.g. WeblogEntryData)
+ private String comment; // description of change
+ private Date changeTime; // time that change was made
+
+ public void setData(PersistentObject vo)
+ {
+ }
+
+ /**
+ * @ejb:persistent-field
+ * @hibernate.id column="id" type="string"
+ * generator-class="uuid.hex" unsaved-value="null"
+ */
+ public String getId()
+ {
+ return id;
+ }
+ /** @ejb:persistent-field */
+ public void setId(String id)
+ {
+ this.id = id;
+ }
+ /**
+ * @ejb:persistent-field
+ * @hibernate.property column="change_time" non-null="true" unique="false"
+ */
+ public Date getChangeTime()
+ {
+ return changeTime;
+ }
+ /** @ejb:persistent-field */
+ public void setChangeTime(Date changeTime)
+ {
+ this.changeTime = changeTime;
+ }
+ /**
+ * @ejb:persistent-field
+ * @hibernate.property column="comment" non-null="true" unique="false"
+ */
+ public String getComment()
+ {
+ return comment;
+ }
+ /** @ejb:persistent-field */
+ public void setComment(String comment)
+ {
+ this.comment = comment;
+ }
+ /**
+ * @ejb:persistent-field
+ * @hibernate.property column="object_class" non-null="true" unique="false"
+ */
+ public String getObjectClass()
+ {
+ return objectClass;
+ }
+ /** @ejb:persistent-field */
+ public void setObjectClass(String objectClass)
+ {
+ this.objectClass = objectClass;
+ }
+ /**
+ * @ejb:persistent-field
+ * @hibernate.property column="object_id" non-null="true" unique="false"
+ */
+ public String getObjectId()
+ {
+ return objectId;
+ }
+ /** @ejb:persistent-field */
+ public void setObjectId(String objectId)
+ {
+ this.objectId = objectId;
+ }
+ /**
+ * @ejb:persistent-field
+ * @hibernate.property column="user_id" non-null="true" unique="false"
+ */
+ public String getUserId()
+ {
+ return userId;
+ }
+ /** @ejb:persistent-field */
+ public void setUserId(String userId)
+ {
+ this.userId = userId;
+ }
+}
Added: incubator/roller/branches/roller_2.0/src/org/roller/pojos/WebsiteObject.java
URL: http://svn.apache.org/viewcvs/incubator/roller/branches/roller_2.0/src/org/roller/pojos/WebsiteObject.java?rev=201565&view=auto
==============================================================================
--- incubator/roller/branches/roller_2.0/src/org/roller/pojos/WebsiteObject.java (added)
+++ incubator/roller/branches/roller_2.0/src/org/roller/pojos/WebsiteObject.java Thu Jun 23 21:51:40 2005
@@ -0,0 +1,29 @@
+package org.roller.pojos;
+
+import org.roller.RollerException;
+import org.roller.model.Roller;
+import org.roller.model.RollerFactory;
+
+/**
+ * Base class for any object that belongs to a website.
+ */
+public abstract class WebsiteObject extends PersistentObject
+{
+ public abstract WebsiteData getWebsite();
+
+ public boolean canSave() throws RollerException
+ {
+ Roller roller = RollerFactory.getRoller();
+ if (roller.getUser().equals(UserData.SYSTEM_USER))
+ {
+ return true;
+ }
+ if (getWebsite().hasUserPermissions(
+ roller.getUser(), (short)(PermissionsData.ADMIN|PermissionsData.AUTHOR)))
+ {
+ return true;
+ }
+ return false;
+ }
+}
+