05-05-2009 10:18 AM
/**
* Action listener for handle http online(inline) editing action. E.g "edit_doc_online_http" action
*
* @param event ActionEvent
*/
public void handleHttpEditing(ActionEvent event)
{
handle(event);
Node workingCopyNode = property.getDocument();
if (workingCopyNode != null)
{
ContentReader reader = property.getContentService().getReader(workingCopyNode.getNodeRef(), ContentModel.PROP_CONTENT);
if (reader != null)
{
String mimetype = reader.getMimetype();
// calculate which editor screen to display
if (MimetypeMap.MIMETYPE_TEXT_PLAIN.equals(mimetype) || MimetypeMap.MIMETYPE_XML.equals(mimetype)
|| MimetypeMap.MIMETYPE_TEXT_CSS.equals(mimetype)
|| MimetypeMap.MIMETYPE_JAVASCRIPT.equals(mimetype))
{
// make content available to the text editing screen
property.setEditorOutput(reader.getContentString());
// navigate to appropriate screen
FacesContext fc = FacesContext.getCurrentInstance();
fc.getApplication().getNavigationHandler().handleNavigation(fc, null, "dialog:close:browse");
this.navigator.setupDispatchContext(workingCopyNode);
fc.getApplication().getNavigationHandler().handleNavigation(fc, null, "dialog:editTextInline");
}
else
{
// make content available to the html editing screen
property.setDocumentContent(reader.getContentString());
property.setEditorOutput(null);
// navigate to appropriate screen
FacesContext fc = FacesContext.getCurrentInstance();
fc.getApplication().getNavigationHandler().handleNavigation(fc, null, "dialog:close:browse");
this.navigator.setupDispatchContext(workingCopyNode);
fc.getApplication().getNavigationHandler().handleNavigation(fc, null, "dialog:editHtmlInline");
}
}
}
}
else if (mimetype.equals("application/vnd.openxmlformats-officedocument.wordprocessingml.document")) {
<dialog name="editHtmlInline" page="/jsp/content/edit-html-inline.jsp" managed-bean="CCEditHtmlInlineDialog"
icon="/images/icons/edit_online_large.gif" title-id="editfile_description"
description-id="editfileinline_description" />
<dialog name="editTextInline" page="/jsp/content/edit-text-inline.jsp" managed-bean="CCEditTextInlineDialog"
icon="/images/icons/edit_online_large.gif" title-id="editfile_description"
description-id="editfileinline_description" /> <dialog name="editDocxInline" page="/jsp/content/edit-docx-inline.jsp" managed-bean="CCEditDocxInlineDialog"
icon="/images/icons/edit_online_large.gif" title-id="editfile_description"
description-id="editfileinline_description" />05-06-2009 02:39 AM
ContentWriter writer = property.getContentService().getWriter(node.getNodeRef(),
ContentModel.PROP_CONTENT, true);
writer.putContent(property.getEditorOutput());
<h:inputHidden id="editorOutput" value="#{CCProperties.editorOutput}" />
<dialog name="editDocxInline" page="/jsp/content/edit-docx-inline.jsp" managed-bean="CCEditDocxInlineDialog"
icon="/images/icons/edit_online_large.gif" title-id="editfile_description"
description-id="editfileinline_description" show-ok-button="false">
<buttons>
<button id="finish-button"
label="Save"
action="#{DialogManager.finish}"
onclick="javascript:mySave()" />
</buttons>
</dialog>
01-16-2010 08:41 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.