cancel
Showing results for 
Search instead for 
Did you mean: 

props for extended cm:folder type not prompted for on create

jcblitz
Champ in-the-making
Champ in-the-making
I have a custom data type called "Experiment" with no properties that has a parent of cm:folder and a mandatory aspect of "ExperimentProperties" which has 20 various properties. When I create a new space using the "Create Space Wizard" then "From Scratch", it doesn't ask me for any of those properties, unlike when I create new content that follows a similar setup. When I go to edit the space though, I am then prompted for those properties.

Is there any way I can configure this so I am prompted for these properties on creation?

I've included a quick screencast to demonstrate what I'm talking about if it wasn't clear…and I like playing with screencasts: http://tinyurl.com/25tpfv
2 REPLIES 2

jcblitz
Champ in-the-making
Champ in-the-making
Does anyone have any suggestions on this?

acis
Champ in-the-making
Champ in-the-making
Hello jcblitz,

I had the same problem as you and to do that, I redefined a custom space wizard which opens a jsp showing the properties at the end.

At first, I edited faces-config-beans.xml and modified the "CreateSpaceWizard" bean to use my class (if I redefine all the space wizard in the web-client-config-custom.xml, I have an error, that's why I modified the Alfresco file) :


<managed-bean>
      <description>
         The bean that backs up the Create Space Wizard
      </description>
      <managed-bean-name>CreateSpaceWizard</managed-bean-name>
      <managed-bean-class>org.alfresco.sample.CreateCustomSpaceWizard</managed-bean-class>
      <managed-bean-scope>session</managed-bean-scope>
      <managed-property>
         <property-name>nodeService</property-name>
         <value>#{NodeService}</value>
      </managed-property>
      …
      <managed-property>
         <property-name>namespaceService</property-name>
         <value>#{NamespaceService}</value>
      </managed-property>
</managed-bean>

Then I created my CreateCustomSpaceWizard class which call a new dialog at the end :


package org.alfresco.sample;

import javax.faces.context.FacesContext;

import org.alfresco.service.namespace.QName;
import org.alfresco.web.app.AlfrescoNavigationHandler;
import org.alfresco.web.bean.repository.Node;
import org.alfresco.web.bean.spaces.CreateSpaceWizard;

public class CreateCustomSpaceWizard extends CreateSpaceWizard {

   @Override
   protected String doPostCommitProcessing(FacesContext context, String outcome) {
      return getDefaultFinishOutcome() + AlfrescoNavigationHandler.OUTCOME_SEPARATOR + "dialog:setSpaceProperties";
   }
}

In web-client-config-custom.xml, I added my new dialog (I use the managed bean SetContentPropertiesDialog, it should be better to use a new bean):


<config>
   <dialogs>
      <dialog name="setSpaceProperties" page="/jsp/extension/edit-space-properties.jsp"
      managed-bean="SetContentPropertiesDialog" icon="/images/icons/edit_properties_large.gif"
      title-id="space_properties_title"
      description-id="space_properties_desc" />
   </dialogs>
</config>

And to finish, I created the edit-space-properties.jsp :


<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="/WEB-INF/alfresco.tld" prefix="a" %>
<%@ taglib uri="/WEB-INF/repo.tld" prefix="r" %>

<h:panelGrid columns="1" cellpadding="2" style="padding-top: 4px; padding-bottom: 4px;"
width="100%" rowClasses="wizardSectionHeading">
<h:outputText value=" #{msg.properties}" escape="false" />
</h:panelGrid>

<r:propertySheetGrid id="content-props" value="#{DialogManager.bean.editableNode}" var="editSpaceProps" columns="1" />

I don't know if it's the good solution, but it works Smiley Happy.

P.S.: I modified the code I pasted to be easier to understand than my real code (I do a little more things in the jsp and in the java class), so it could have some errors.