By default, your activities, such as writing a document, and uploading a file, are published on the activity stream.
However, you can decide to publish these activities or not by creating a context named _DocumentContext_ for a specific document.
This context stores some auxiliary attributes of the document and helps document listeners make decision
based on these attributes.

This context looks like:

{code:java}public class DocumentContext {
private static ThreadLocal<DocumentContext> current = new ThreadLocal<DocumentContext>();

public static DocumentContext getCurrent() {
   if (current.get() == null) {
      setCurrent(new DocumentContext());
    }
   return current.get();
  }

....
//Each time, attributes are able to set and got via:
/**
  * @return the attributes
  */
  public HashMap<String, Object> getAttributes() {
   return attributes;
  }

 /**
  * @param attributes the attributes to set
  */
  public void setAttributes(HashMap<String, Object> attributes) {
    this.attributes = attributes;
  }
}{code}

*For example*:

When you upload a document to a drive by using _ManageDocumentService_, but do not want to publish this activity on the activity stream, you can do as follows:

{code}DocumentContext.getCurrent().getAttributes().put(DocumentContext.IS_SKIP_RAISE_ACT, true);{code}

Then, this activity is skipped at:

{code:java} Object isSkipRaiseAct = DocumentContext.getCurrent().getAttributes().get(DocumentContext.IS_SKIP_RAISE_ACT);
if (isSkipRaiseAct != null && Boolean.valueOf(isSkipRaiseAct.toString())) {
  return;
 }{code}

{note}
The _DocumentContext_ class is able to help developers manage various kinds of actions with a document based on its auxiliary attributes.
You can be free to define new attributes for yourself.
{note}