/** * Construct as a copy of another. * * @param id * The other to copy. */ public BaseMessageChannelEdit(MessageChannel other) { // set the ids m_context = other.getContext(); m_id = other.getId(); // setup for properties m_properties = new BaseResourcePropertiesEdit(); m_properties.addAll(other.getProperties()); } // BaseMessageChannelEdit
/** * Clean up. */ protected void finalize() { // catch the case where an edit was made but never resolved if ((m_active) && (m_channel != null)) { m_channel.cancelMessage(this); } } // finalize
/** * Access the internal reference which can be used to access the resource from within the system. * * @return The the internal reference which can be used to access the resource from within the system. */ public String getReference() { if (m_channel == null) return ""; return messageReference(m_channel.getContext(), m_channel.getId(), getId()); } // getReference
if (siteChannel != null) if (allowGetChannel(siteChannel.getReference())) if(merged || siteChannel.getContext().equals(site.getId())) messageList.addAll(siteChannel.getMessages(filter,order));
Element containerElement = channel.toXml(doc, stack); stack.push(containerElement); Iterator messages = channel.getMessages(null, true).iterator(); while (messages.hasNext())
return filterGroupAccess(msgs, c.getContext(), c.getReference());
Collection allowedGroups = ((BaseMessageEdit) m_message).m_channel.getGroupsAllowRemoveMessage(own); Collection allowedGroups = ((BaseMessageEdit) m_message).m_channel.getGroupsAllowAddMessage();
MessageEdit edit = channel.mergeMessage(element3); channel.commitMessage(edit, NotificationService.NOTI_NONE); count++;
rv = channel.getProperties();
public List getSiteContent(String context) { List<String> all = new ArrayList<String>(); List l = messageService.getChannelIds(context); for (Iterator i = l.iterator(); i.hasNext();) { String chanellId = (String) i.next(); try { MessageChannel c = messageService.getChannel(messageService .channelReference(context, chanellId)); List messages = c.getMessages(null, true); // WARNING: I think the implementation caches on thread, if this // is // a builder // thread this may not work for (Iterator mi = messages.iterator(); mi.hasNext();) { Message m = (Message) mi.next(); all.add(m.getReference()); } } catch (Exception ex) { ex.printStackTrace(); log.warn("Failed to get channel " + chanellId); //$NON-NLS-1$ } } return all; }
m_channelCache.put(channel.getReference(), channel);
/** * @inheritDoc */ public void clearGroupAccess() throws PermissionException { // is there any change? If we are already channel, ignore the call if (m_access == MessageAccess.CHANNEL) return; // there should not be a case where there's no message or a message with no channel... -ggolden if ((m_message == null) || ((BaseMessageEdit) m_message).m_channel == null) { log.warn("clearGroupAccess() called with null message: " + ((m_message == null) ? "null" : ((BaseMessageEdit) m_message).toString()) + " or channel: " + ((m_message == null) ? "" : ((BaseMessageEdit) m_message).m_channel.toString())); throw new PermissionException(m_sessionManager.getCurrentSessionUserId(), "access:channel", ((m_message == null) ? "" : ((BaseMessageEdit) m_message).getReference())); } // verify that the user has permission to add in the channel context boolean allowed = (m_message != null) && (((BaseMessageEdit) m_message).m_channel).allowAddChannelMessage(); if (!allowed) { throw new PermissionException(m_sessionManager.getCurrentSessionUserId(), "access:channel", ((BaseMessageEdit) m_message).getReference()); } // we are clear to perform this m_access = MessageAccess.CHANNEL; m_groups.clear(); }
/** * Access the internal reference which can be used to access the resource from within the system. * * @return The the internal reference which can be used to access the resource from within the system. */ public String getReference() { if (m_channel == null) return ""; return messageReference(m_channel.getContext(), m_channel.getId(), getId()); } // getReference
Element containerElement = channel.toXml(doc, stack); stack.push(containerElement); Iterator messages = channel.getMessages(null, true).iterator(); while (messages.hasNext())
return filterGroupAccess(msgs, c.getContext(), c.getReference());
Collection allowedGroups = ((BaseMessageEdit) m_message).m_channel.getGroupsAllowRemoveMessage(own); Collection allowedGroups = ((BaseMessageEdit) m_message).m_channel.getGroupsAllowAddMessage();
MessageEdit edit = channel.mergeMessage(element3); channel.commitMessage(edit, NotificationService.NOTI_NONE); count++;
rv = channel.getProperties();
try messages = mc.getMessages(null, true, pages); if ( messages != null && messages.size() > 0 )
/** * @inheritDoc */ public void clearGroupAccess() throws PermissionException { // is there any change? If we are already channel, ignore the call if (m_access == MessageAccess.CHANNEL) return; // there should not be a case where there's no message or a message with no channel... -ggolden if ((m_message == null) || ((BaseMessageEdit) m_message).m_channel == null) { log.warn("clearGroupAccess() called with null message: " + ((m_message == null) ? "null" : ((BaseMessageEdit) m_message).toString()) + " or channel: " + ((m_message == null) ? "" : ((BaseMessageEdit) m_message).m_channel.toString())); throw new PermissionException(m_sessionManager.getCurrentSessionUserId(), "access:channel", ((m_message == null) ? "" : ((BaseMessageEdit) m_message).getReference())); } // verify that the user has permission to add in the channel context boolean allowed = (m_message != null) && (((BaseMessageEdit) m_message).m_channel).allowAddChannelMessage(); if (!allowed) { throw new PermissionException(m_sessionManager.getCurrentSessionUserId(), "access:channel", ((BaseMessageEdit) m_message).getReference()); } // we are clear to perform this m_access = MessageAccess.CHANNEL; m_groups.clear(); }