mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
- make edit of renditions bring up form editor rather than the editor for the file type.
- disable finish button on first screen of create web content wizard. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@4239 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -649,7 +649,7 @@ create_form_step1_desc=Upload an XML Schema
|
|||||||
create_form_step2_title=Configure Rendering Engines
|
create_form_step2_title=Configure Rendering Engines
|
||||||
create_form_step2_desc=Select rendering engines and rendering engine template to render form instance data processed by the form.
|
create_form_step2_desc=Select rendering engines and rendering engine template to render form instance data processed by the form.
|
||||||
selected_rendering_engines=Selected Rendering Engines
|
selected_rendering_engines=Selected Rendering Engines
|
||||||
configure_rendering_engines_step1_desc=Upload rendering engine template and specify the extension to use for its generated assets.
|
configure_rendering_engines_step1_desc=Upload rendering engine template and specify the extension to use for its renditions.
|
||||||
rendering_engine_file=Rendering Engine Template File
|
rendering_engine_file=Rendering Engine Template File
|
||||||
rendering_engine_type=Rendering Engine Type
|
rendering_engine_type=Rendering Engine Type
|
||||||
extension_for_renditions=Extension for renditions
|
extension_for_renditions=Extension for renditions
|
||||||
|
@@ -33,12 +33,12 @@ import org.alfresco.service.cmr.repository.ContentService;
|
|||||||
import org.alfresco.service.cmr.repository.ContentWriter;
|
import org.alfresco.service.cmr.repository.ContentWriter;
|
||||||
import org.alfresco.service.cmr.repository.NodeRef;
|
import org.alfresco.service.cmr.repository.NodeRef;
|
||||||
import org.alfresco.service.cmr.repository.NodeService;
|
import org.alfresco.service.cmr.repository.NodeService;
|
||||||
|
import org.alfresco.util.Pair;
|
||||||
import org.alfresco.web.app.AlfrescoNavigationHandler;
|
import org.alfresco.web.app.AlfrescoNavigationHandler;
|
||||||
import org.alfresco.web.app.Application;
|
import org.alfresco.web.app.Application;
|
||||||
import org.alfresco.web.app.servlet.DownloadContentServlet;
|
import org.alfresco.web.app.servlet.DownloadContentServlet;
|
||||||
import org.alfresco.web.bean.CheckinCheckoutBean;
|
import org.alfresco.web.bean.CheckinCheckoutBean;
|
||||||
import org.alfresco.web.bean.FileUploadBean;
|
import org.alfresco.web.bean.FileUploadBean;
|
||||||
import org.alfresco.web.bean.repository.Node;
|
|
||||||
import org.alfresco.web.bean.repository.Repository;
|
import org.alfresco.web.bean.repository.Repository;
|
||||||
import org.alfresco.web.forms.Form;
|
import org.alfresco.web.forms.Form;
|
||||||
import org.alfresco.web.forms.FormProcessor;
|
import org.alfresco.web.forms.FormProcessor;
|
||||||
@@ -55,7 +55,7 @@ import org.w3c.dom.Document;
|
|||||||
*/
|
*/
|
||||||
public class AVMEditBean
|
public class AVMEditBean
|
||||||
{
|
{
|
||||||
private static Log logger = LogFactory.getLog(AVMEditBean.class);
|
private static final Log LOGGER = LogFactory.getLog(AVMEditBean.class);
|
||||||
|
|
||||||
private static final String MSG_ERROR_UPDATE = "error_update";
|
private static final String MSG_ERROR_UPDATE = "error_update";
|
||||||
private static final String MSG_UPLOAD_SUCCESS = "file_upload_success";
|
private static final String MSG_UPLOAD_SUCCESS = "file_upload_success";
|
||||||
@@ -143,7 +143,8 @@ public class AVMEditBean
|
|||||||
*/
|
*/
|
||||||
public String getUrl()
|
public String getUrl()
|
||||||
{
|
{
|
||||||
return DownloadContentServlet.generateDownloadURL(AVMNodeConverter.ToNodeRef(-1, getAvmNode().getPath()), getAvmNode().getName());
|
return DownloadContentServlet.generateDownloadURL(AVMNodeConverter.ToNodeRef(-1, getAvmNode().getPath()),
|
||||||
|
getAvmNode().getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -264,13 +265,25 @@ public class AVMEditBean
|
|||||||
|
|
||||||
// retrieve the content reader for this node
|
// retrieve the content reader for this node
|
||||||
NodeRef avmRef = AVMNodeConverter.ToNodeRef(-1, getAvmNode().getPath());
|
NodeRef avmRef = AVMNodeConverter.ToNodeRef(-1, getAvmNode().getPath());
|
||||||
if (logger.isDebugEnabled())
|
if (this.nodeService.hasAspect(avmRef, WCMModel.ASPECT_RENDITION))
|
||||||
logger.debug("Editing AVM node: " + avmRef.toString());
|
{
|
||||||
|
if (LOGGER.isDebugEnabled())
|
||||||
|
LOGGER.debug(avmRef + " is a rendition, editing primary rendition instead");
|
||||||
|
avmRef = (NodeRef)this.nodeService.getProperty(avmRef, WCMModel.PROP_PRIMARY_FORM_INSTANCE_DATA);
|
||||||
|
|
||||||
|
final Pair<Integer, String> p = AVMNodeConverter.ToAVMVersionPath(avmRef);
|
||||||
|
if (LOGGER.isDebugEnabled())
|
||||||
|
LOGGER.debug("Editing primary form instance data " + p.getSecond() + " version " + p.getFirst());
|
||||||
|
final AVMNode avmNode = new AVMNode(this.avmService.lookup(p.getFirst(), p.getSecond()));
|
||||||
|
this.avmBrowseBean.setAvmActionNode(avmNode);
|
||||||
|
}
|
||||||
|
if (LOGGER.isDebugEnabled())
|
||||||
|
LOGGER.debug("Editing AVM node: " + avmRef.toString());
|
||||||
ContentReader reader = contentService.getReader(avmRef, ContentModel.PROP_CONTENT);
|
ContentReader reader = contentService.getReader(avmRef, ContentModel.PROP_CONTENT);
|
||||||
if (reader != null)
|
if (reader != null)
|
||||||
{
|
{
|
||||||
String mimetype = reader.getMimetype();
|
String mimetype = reader.getMimetype();
|
||||||
|
String outcome = null;
|
||||||
// calculate which editor screen to display
|
// calculate which editor screen to display
|
||||||
if (MimetypeMap.MIMETYPE_TEXT_PLAIN.equals(mimetype) ||
|
if (MimetypeMap.MIMETYPE_TEXT_PLAIN.equals(mimetype) ||
|
||||||
MimetypeMap.MIMETYPE_XML.equals(mimetype) ||
|
MimetypeMap.MIMETYPE_XML.equals(mimetype) ||
|
||||||
@@ -281,17 +294,10 @@ public class AVMEditBean
|
|||||||
setEditorOutput(reader.getContentString());
|
setEditorOutput(reader.getContentString());
|
||||||
|
|
||||||
// navigate to appropriate screen
|
// navigate to appropriate screen
|
||||||
FacesContext fc = FacesContext.getCurrentInstance();
|
outcome = ((MimetypeMap.MIMETYPE_XML.equals(mimetype) &&
|
||||||
String outcome;
|
this.nodeService.hasAspect(avmRef, WCMModel.ASPECT_FORM_INSTANCE_DATA))
|
||||||
if (MimetypeMap.MIMETYPE_XML.equals(mimetype))
|
? "dialog:editAvmXmlInline"
|
||||||
{
|
: "dialog:editAvmTextInline");
|
||||||
outcome = "dialog:editAvmXmlInline";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
outcome = "dialog:editAvmTextInline";
|
|
||||||
}
|
|
||||||
fc.getApplication().getNavigationHandler().handleNavigation(fc, null, outcome);
|
|
||||||
}
|
}
|
||||||
else if (MimetypeMap.MIMETYPE_HTML.equals(mimetype))
|
else if (MimetypeMap.MIMETYPE_HTML.equals(mimetype))
|
||||||
{
|
{
|
||||||
@@ -300,15 +306,16 @@ public class AVMEditBean
|
|||||||
setEditorOutput(null);
|
setEditorOutput(null);
|
||||||
|
|
||||||
// navigate to appropriate screen
|
// navigate to appropriate screen
|
||||||
FacesContext fc = FacesContext.getCurrentInstance();
|
outcome = "dialog:editAvmHtmlInline";
|
||||||
fc.getApplication().getNavigationHandler().handleNavigation(fc, null, "dialog:editAvmHtmlInline");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// normal downloadable document
|
// normal downloadable document
|
||||||
FacesContext fc = FacesContext.getCurrentInstance();
|
outcome = "dialog:editAvmFile";
|
||||||
fc.getApplication().getNavigationHandler().handleNavigation(fc, null, "dialog:editAvmFile");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final FacesContext fc = FacesContext.getCurrentInstance();
|
||||||
|
fc.getApplication().getNavigationHandler().handleNavigation(fc, null, outcome);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -355,8 +362,8 @@ public class AVMEditBean
|
|||||||
// commit the transaction
|
// commit the transaction
|
||||||
tx.commit();
|
tx.commit();
|
||||||
|
|
||||||
// TODO: regenerate form content
|
// regenerate form content
|
||||||
if (nodeService.getProperty(avmRef, WCMModel.PROP_PARENT_FORM) != null)
|
if (nodeService.hasAspect(avmRef, WCMModel.ASPECT_FORM_INSTANCE_DATA))
|
||||||
{
|
{
|
||||||
final FormsService fs = FormsService.getInstance();
|
final FormsService fs = FormsService.getInstance();
|
||||||
fs.regenerateRenditions(avmRef);
|
fs.regenerateRenditions(avmRef);
|
||||||
|
@@ -297,8 +297,7 @@ public final class FormsService
|
|||||||
|
|
||||||
props = new HashMap<QName, Serializable>(2, 1.0f);
|
props = new HashMap<QName, Serializable>(2, 1.0f);
|
||||||
props.put(WCMModel.PROP_PARENT_RENDERING_ENGINE, re.getNodeRef());
|
props.put(WCMModel.PROP_PARENT_RENDERING_ENGINE, re.getNodeRef());
|
||||||
props.put(WCMModel.PROP_PRIMARY_FORM_INSTANCE_DATA,
|
props.put(WCMModel.PROP_PRIMARY_FORM_INSTANCE_DATA, formInstanceDataNodeRef);
|
||||||
AVMNodeConverter.ToNodeRef(-1, parentPath + formInstanceDataFileName));
|
|
||||||
nodeService.addAspect(renditionNodeRef, WCMModel.ASPECT_RENDITION, props);
|
nodeService.addAspect(renditionNodeRef, WCMModel.ASPECT_RENDITION, props);
|
||||||
|
|
||||||
props = new HashMap<QName, Serializable>(1, 1.0f);
|
props = new HashMap<QName, Serializable>(1, 1.0f);
|
||||||
|
@@ -44,7 +44,7 @@
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
document.getElementById("wizard:next-button").disabled = false;
|
document.getElementById("wizard:next-button").disabled = false;
|
||||||
document.getElementById("wizard:finish-button").disabled = false;
|
document.getElementById("wizard:finish-button").disabled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user