How do you turn off or ignore a facet on a new Document type?

I created a new document type that extends a File. I want it to behave like a file except I don't want it to be publishable. What are my options?

Is there a way to turn off this facet? Or…do I have to extend from a Document, and include all the schemas and facets except the Publishable one that is defined for a File, like this…

<doctype extends="Document" name="myFile">
  <schema name="common"/>
  <schema name="file"/>
  <schema name="dublincore"/>
  <schema name="uid"/>
  <schema name="files"/>
  <facet name="Downloadable"/>
  <facet name="Versionable"/>
  <facet name="Commentable"/>
  <facet name="HasRelatedText"/>
</doctype>

I do not want to overwrite the original File Document type. Thanks,

0 votes

1 answers

2532 views

ANSWER

Hi,

I guess that yes, you have redefine your document extending Document in order to resolve your problem (facet cannot be deactivated).

But what is your goal exactly? Do you want to hide the publish action tab only?

12/19/2012

Yes, my goal is to hide the publish tab…
12/19/2012



Here is the contribution for publish tab:

<action id="TAB_PUBLISH" link="/incl/tabs/document_publish.xhtml" order="53"
        label="action.publish.content" icon="/icons/file.gif">
  <category>VIEW_ACTION_LIST</category>
  <filter-id>publish_document</filter-id>
  <filter-id>mutable_document</filter-id>
</action>

If you want to deactivate it all the time, you can put enable=“false” like this way:

<action id="TAB_PUBLISH" enabled="false"/>

And thats it.

If you want to put a new filter according to your needs, you can define one. Here is publish_document filter instance:

<filter id="publish_document">
  <rule grant="true">
    <facet>Publishable</facet>
  </rule>
</filter>

Hope that it can help!

0 votes



Thank you so much. It worked.
12/19/2012