mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
implementing the regenerate renditions wizard
- refactoring to centralize regenerate code - adding onchange event to UISelectList to trigger reload of page - reorganizing some webproject code for better reuse - fix for submit from create web content (a webproject property was added to submitdialog but not createwebcontent) git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5889 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -38,7 +38,6 @@ import javax.faces.event.ActionEvent;
|
||||
import javax.faces.model.DataModel;
|
||||
import javax.faces.model.ListDataModel;
|
||||
|
||||
import org.alfresco.error.AlfrescoRuntimeException;
|
||||
import org.alfresco.model.ApplicationModel;
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.model.WCMAppModel;
|
||||
@@ -97,8 +96,6 @@ public class CreateWebsiteWizard extends BaseWizardBean
|
||||
protected String webapp = WEBAPP_DEFAULT;
|
||||
protected List<String> deployTo;
|
||||
|
||||
protected String websitesFolderId = null;
|
||||
|
||||
protected AVMService avmService;
|
||||
protected WorkflowService workflowService;
|
||||
protected PersonService personService;
|
||||
@@ -163,10 +160,10 @@ public class CreateWebsiteWizard extends BaseWizardBean
|
||||
protected String finishImpl(FacesContext context, String outcome) throws Exception
|
||||
{
|
||||
// create the website space in the correct parent folder
|
||||
String websiteParentId = getWebsitesFolderId();
|
||||
final NodeRef websiteParent = WebProject.getWebsitesFolder();
|
||||
|
||||
FileInfo fileInfo = this.fileFolderService.create(
|
||||
new NodeRef(Repository.getStoreRef(), websiteParentId),
|
||||
websiteParent,
|
||||
this.name,
|
||||
WCMAppModel.TYPE_AVMWEBFOLDER);
|
||||
NodeRef nodeRef = fileInfo.getNodeRef();
|
||||
@@ -218,7 +215,7 @@ public class CreateWebsiteWizard extends BaseWizardBean
|
||||
saveWebProjectModel(nodeRef);
|
||||
|
||||
// navigate to the Websites folder so we can see the newly created folder
|
||||
this.navigator.setCurrentNodeId(websiteParentId);
|
||||
this.navigator.setCurrentNodeId(websiteParent.getId());
|
||||
|
||||
outcome = AlfrescoNavigationHandler.CLOSE_WIZARD_OUTCOME;
|
||||
}
|
||||
@@ -803,37 +800,6 @@ public class CreateWebsiteWizard extends BaseWizardBean
|
||||
// ------------------------------------------------------------------------------
|
||||
// Helper methods
|
||||
|
||||
/**
|
||||
* Helper to get the ID of the 'Websites' system folder
|
||||
*
|
||||
* @return ID of the 'Websites' system folder
|
||||
*
|
||||
* @throws AlfrescoRuntimeException if unable to find the required folder
|
||||
*/
|
||||
private String getWebsitesFolderId()
|
||||
{
|
||||
if (this.websitesFolderId == null)
|
||||
{
|
||||
// get the template from the special Content Templates folder
|
||||
FacesContext fc = FacesContext.getCurrentInstance();
|
||||
String xpath = Application.getRootPath(fc) + "/" + Application.getWebsitesFolderName(fc);
|
||||
|
||||
NodeRef rootNodeRef = this.nodeService.getRootNode(Repository.getStoreRef());
|
||||
NamespaceService resolver = Repository.getServiceRegistry(fc).getNamespaceService();
|
||||
List<NodeRef> results = this.searchService.selectNodes(rootNodeRef, xpath, null, resolver, false);
|
||||
if (results.size() == 1)
|
||||
{
|
||||
this.websitesFolderId = results.get(0).getId();
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new AlfrescoRuntimeException("Unable to find 'Websites' system folder at: " + xpath);
|
||||
}
|
||||
}
|
||||
|
||||
return this.websitesFolderId;
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------
|
||||
// Inner classes
|
||||
|
Reference in New Issue
Block a user