Skip to content

Instantly share code, notes, and snippets.

@ethanbustad
Last active August 29, 2015 14:09
Show Gist options
  • Save ethanbustad/074ce74d2f0c86f813c8 to your computer and use it in GitHub Desktop.
Save ethanbustad/074ce74d2f0c86f813c8 to your computer and use it in GitHub Desktop.
<%--
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
--%>
<%!
public abstract static class BaseMicroblogsEntryComposite implements Comparable<BaseMicroblogsEntryComposite> {
@Override
public int compareTo(BaseMicroblogsEntryComposite baseMicroblogsEntryComposite) {
return DateUtil.compareTo(getCreateDate(), baseMicroblogsEntryComposite.getCreateDate());
}
public List<BaseMicroblogsEntryComposite> getCommentMicroblogsEntryComposites() {
if (commentMicroblogsEntryComposites == null) {
commentMicroblogsEntryComposites = new ArrayList<BaseMicroblogsEntryComposite>();
commentMicroblogsEntryComposites.add(this);
}
return commentMicroblogsEntryComposites;
}
public int getCommentMicroblogsEntryCompositesCount() {
List<BaseMicroblogsEntryComposite> commentMicroblogsEntryComposites = getCommentMicroblogsEntryComposites();
return commentMicroblogsEntryComposites.size();
}
public String getContent() {
return microblogsEntry.getContent();
}
public Date getCreateDate() {
return microblogsEntry.getCreateDate();
}
public long getCreatorClassNameId() {
return microblogsEntry.getCreatorClassNameId();
}
public long getCreatorClassPK() {
return microblogsEntry.getCreatorClassPK();
}
public long getMicroblogsEntryId() {
return microblogsEntry.getMicroblogsEntryId();
}
public abstract String getName();
public abstract boolean getPermissionDelete();
public abstract boolean getPermissionUpdate();
public abstract String getPortraitURL() throws Exception;
public int getType() {
return microblogsEntry.getType();
}
public long getUserId() {
return microblogsEntry.getUserId();
}
protected List<BaseMicroblogsEntryComposite> commentMicroblogsEntryComposites;
protected MicroblogsEntry microblogsEntry;
protected ThemeDisplay themeDisplay;
}
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment