- Create Folder action dialog added to website browsing screen

- Fix to bug in client AVMNode where it was not correctly dealing with additional avm node properties set using the nodeservice

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3951 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2006-09-27 17:12:56 +00:00
parent ccdc66bf16
commit 280cff0999
9 changed files with 313 additions and 3 deletions

View File

@@ -26,6 +26,7 @@ import org.alfresco.repo.avm.AVMNodeConverter;
import org.alfresco.repo.domain.PropertyValue;
import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.namespace.QName;
import org.alfresco.service.namespace.QNameMap;
@@ -95,7 +96,7 @@ public class AVMNode implements Map<String, Object>
for (QName qname: props.keySet())
{
PropertyValue propValue = props.get(qname);
this.properties.put(qname.toString(), propValue.getSerializableValue());
this.properties.put(qname.toString(), propValue.getValue(DataTypeDefinition.ANY));
}
}

View File

@@ -0,0 +1,124 @@
/*
* Copyright (C) 2005 Alfresco, Inc.
*
* Licensed under the Mozilla Public License version 1.1
* with a permitted attribution clause. You may obtain a
* copy of the License at
*
* http://www.alfresco.org/legal/license.txt
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific
* language governing permissions and limitations under the
* License.
*/
package org.alfresco.web.bean.wcm;
import javax.faces.context.FacesContext;
import org.alfresco.model.ContentModel;
import org.alfresco.repo.avm.AVMNodeConverter;
import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.web.bean.dialog.BaseDialogBean;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Bean implementation for the AVM "Create Folder" dialog
*
* @author Kevin Roast
*/
public class CreateFolderDialog extends BaseDialogBean
{
private static final Log logger = LogFactory.getLog(CreateFolderDialog.class);
protected AVMService avmService;
protected AVMBrowseBean avmBrowseBean;
protected NodeService nodeService;
private String name;
private String description;
/**
* @param avmBrowseBean The avmBrowseBean to set.
*/
public void setAvmBrowseBean(AVMBrowseBean avmBrowseBean)
{
this.avmBrowseBean = avmBrowseBean;
}
/**
* @param avmService The avmService to set.
*/
public void setAvmService(AVMService avmService)
{
this.avmService = avmService;
}
/**
* @param nodeService The NodeService to set.
*/
public void setNodeService(NodeService nodeService)
{
this.nodeService = nodeService;
}
/**
* @return Returns the description.
*/
public String getDescription()
{
return this.description;
}
/**
* @param description The description to set.
*/
public void setDescription(String description)
{
this.description = description;
}
/**
* @return Returns the name.
*/
public String getName()
{
return this.name;
}
/**
* @param name The name to set.
*/
public void setName(String name)
{
this.name = name;
}
// ------------------------------------------------------------------------------
// Dialog implementation
/**
* @see org.alfresco.web.bean.dialog.BaseDialogBean#finishImpl(javax.faces.context.FacesContext, java.lang.String)
*/
@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception
{
String parent = this.avmBrowseBean.getCurrentPath();
this.avmService.createDirectory(parent, this.name);
String path = parent + '/' + this.name;
if (this.description != null && this.description.length() != 0)
{
NodeRef nodeRef = AVMNodeConverter.ToNodeRef(-1, path);
this.nodeService.setProperty(nodeRef, ContentModel.PROP_DESCRIPTION, this.description);
}
return outcome;
}
}

View File

@@ -272,6 +272,7 @@ public class CreateWebsiteWizard extends BaseWizardBean
* Identifier for store-types: .sandbox.staging.main and .sandbox.staging.preview
* Store-id: .sandbox-id.<guid> (unique across all stores in the sandbox)
* DNS: .dns.<store> = <path-to-webapps-root>
* Website Name: .website.name = website name
*
* @param name The store name to create the sandbox for
*/
@@ -328,6 +329,12 @@ public class CreateWebsiteWizard extends BaseWizardBean
this.avmService.setStoreProperty(previewStore,
QName.createQName(null, sandboxIdProp),
new PropertyValue(DataTypeDefinition.TEXT, null));
if (logger.isDebugEnabled())
{
dumpStoreProperties(stagingStore);
dumpStoreProperties(previewStore);
}
}
/**
@@ -412,6 +419,12 @@ public class CreateWebsiteWizard extends BaseWizardBean
new PropertyValue(DataTypeDefinition.TEXT, null));
this.avmService.setStoreProperty(previewStore, QName.createQName(null, sandboxIdProp),
new PropertyValue(DataTypeDefinition.TEXT, null));
if (logger.isDebugEnabled())
{
dumpStoreProperties(userStore);
dumpStoreProperties(previewStore);
}
}
/**
@@ -428,4 +441,18 @@ public class CreateWebsiteWizard extends BaseWizardBean
this.avmService.setStoreProperty(store, QName.createQName(null, dnsProp),
new PropertyValue(DataTypeDefinition.TEXT, path));
}
/**
* Debug helper method to dump the properties of a store
*
* @param store Store name to dump properties for
*/
private void dumpStoreProperties(String store)
{
Map<QName, PropertyValue> props = avmService.getStoreProperties(store);
for (QName name : props.keySet())
{
logger.debug(" " + name + ": " + props.get(name));
}
}
}