DM Forms - fix create web form from create/edit web project, fix edit DM form content

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@7403 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Jan Vonka
2007-11-16 23:22:12 +00:00
parent 7fbac7c987
commit a3325bff9e
3 changed files with 27 additions and 5 deletions

View File

@@ -34,6 +34,7 @@ import javax.faces.event.ActionEvent;
import org.alfresco.model.ApplicationModel;
import org.alfresco.model.ContentModel;
import org.alfresco.model.WCMAppModel;
import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.transaction.RetryingTransactionHelper;
import org.alfresco.repo.transaction.RetryingTransactionHelper.RetryingTransactionCallback;
@@ -53,6 +54,7 @@ import org.alfresco.web.app.servlet.DownloadContentServlet;
import org.alfresco.web.bean.dialog.BaseDialogBean;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.repository.Repository;
import org.alfresco.web.forms.FormNotFoundException;
import org.alfresco.web.ui.common.Utils;
import org.alfresco.web.ui.common.component.UIActionLink;
import org.apache.commons.logging.Log;
@@ -282,8 +284,20 @@ public class CheckinCheckoutDialog extends BaseDialogBean
boolean editingInline = false;
Node node = setupContentDocument(id);
if (node.hasAspect(WCMAppModel.ASPECT_FORM_INSTANCE_DATA))
{
editingInline = true;
// editable form document
FacesContext fc = FacesContext.getCurrentInstance();
this.navigator.setupDispatchContext(node);
// TODO - rename editContent Wizard since it only deals with editing form content
fc.getApplication().getNavigationHandler().handleNavigation(fc, null, "wizard:editContent");
}
// detect the inline editing aspect to see which edit mode to use
if (node.hasAspect(ApplicationModel.ASPECT_INLINEEDITABLE) &&
else if (node.hasAspect(ApplicationModel.ASPECT_INLINEEDITABLE) &&
node.getProperties().get(ApplicationModel.PROP_EDITINLINE) != null &&
((Boolean)node.getProperties().get(ApplicationModel.PROP_EDITINLINE)).booleanValue() == true)
{

View File

@@ -235,9 +235,17 @@ public class CreateFormWizard
if (LOGGER.isDebugEnabled())
LOGGER.debug("creating form " + this.getFormName());
// get the node ref of the node that will contain the content (either Forms or Web Forms dictionary space)
final NodeRef contentFormsNodeRef = this.navigator.getCurrentNode().getNodeRef();
// get the node ref of the node that will contain the content
// TODO - need better way to determine WCM vs ECM context
// can create form from CreateWebProject Wizard, or from Forms DataDictionary space or Web Forms DataDictionary space
NodeRef contentFormsNodeRef = this.formsService.getWebContentFormsNodeRef();
if (this.navigator.getCurrentNode().getNodeRef().equals(this.formsService.getContentFormsNodeRef()))
{
// ECM form, store in Forms DataDictionary space
contentFormsNodeRef = this.formsService.getContentFormsNodeRef();
}
final FileInfo folderInfo =
this.fileFolderService.create(contentFormsNodeRef,
this.getFormName(),