public void createDraftForForward( String userID, int userVersion, CorporateDirectives directives) { Hashtable data = getProperties(); if (!data.get(PROPERTY_STATUS).equals(EMAIL_STATE_RECEIVED) && !data.get(PROPERTY_STATUS).equals(EMAIL_STATE_SENT)) { return; } String rcpts = ""; String author = as.getEmailAddress(userID); // ### null String subject = "FW:" + (String) data.get(PROPERTY_SUBJECT); String date = ""; String msgText = formatPassedMsgText(data, ""); String topicID = as.cm.getNewTopicID(); as.cm.createTopic(topicID, 1, TOPICTYPE_EMAIL, 1, subject); Hashtable elementData = new Hashtable(); elementData.put(PROPERTY_FROM, author); elementData.put(PROPERTY_TO, rcpts); elementData.put(PROPERTY_SUBJECT, subject); elementData.put("UID", "0"); elementData.put(PROPERTY_STATUS, EMAIL_STATE_DRAFT); elementData.put(PROPERTY_DATE, date); elementData.put(PROPERTY_TEXT, msgText); as.cm.setTopicData(topicID, 1, elementData); String assocID = as.cm.getNewAssociationID(); as.cm.createAssociation(assocID, 1, ASSOCTYPE_ASSOCIATION, 1, topicID, 1, userID, userVersion); Vector vAssocs = copyAttachsAssocs(topicID); PresentableTopic presTopic = new PresentableTopic(topicID, 1, TOPICTYPE_EMAIL, 1, subject, getID(), ""); directives.add(DIRECTIVE_SHOW_TOPIC, presTopic, Boolean.TRUE, ""); showAssocs(vAssocs, directives); }
public void showAssocs(Vector vAssocs, CorporateDirectives directives) { Enumeration assocs = vAssocs.elements(); while (assocs.hasMoreElements()) { PresentableAssociation presAssoc = (PresentableAssociation) assocs.nextElement(); directives.add(DIRECTIVE_SHOW_ASSOCIATION, presAssoc, Boolean.TRUE, ""); } }
public CorporateDirectives executeCommand( String command, Session session, String topicmapID, String viewmode) { CorporateDirectives directives = new CorporateDirectives(); StringTokenizer st = new StringTokenizer(command, ":"); String cmd = st.nextToken(); if (cmd.equals(CMD_LOCK_GEOMETRY) || cmd.equals(CMD_UNLOCK_GEOMETRY)) { String value = cmd.equals(CMD_LOCK_GEOMETRY) ? SWITCH_ON : SWITCH_OFF; directives.add( as.setTopicProperty( getID(), getVersion(), PROPERTY_LOCKED_GEOMETRY, value, topicmapID, viewmode, session)); } else { return super.executeCommand(command, session, topicmapID, viewmode); } return directives; }