You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by an...@apache.org on 2005/03/14 14:10:58 UTC
svn commit: r157420 -
lenya/trunk/src/webapp/lenya/pubs/blog/java/src/org/apache/lenya/cms/site/usecases/CreateBlogEntry.java
Author: andreas
Date: Mon Mar 14 05:10:56 2005
New Revision: 157420
URL: http://svn.apache.org/viewcvs?view=rev&rev=157420
Log:
[minor change] updated to new DocumentFactory method signature
Modified:
lenya/trunk/src/webapp/lenya/pubs/blog/java/src/org/apache/lenya/cms/site/usecases/CreateBlogEntry.java
Modified: lenya/trunk/src/webapp/lenya/pubs/blog/java/src/org/apache/lenya/cms/site/usecases/CreateBlogEntry.java
URL: http://svn.apache.org/viewcvs/lenya/trunk/src/webapp/lenya/pubs/blog/java/src/org/apache/lenya/cms/site/usecases/CreateBlogEntry.java?view=diff&r1=157419&r2=157420
==============================================================================
--- lenya/trunk/src/webapp/lenya/pubs/blog/java/src/org/apache/lenya/cms/site/usecases/CreateBlogEntry.java (original)
+++ lenya/trunk/src/webapp/lenya/pubs/blog/java/src/org/apache/lenya/cms/site/usecases/CreateBlogEntry.java Mon Mar 14 05:10:56 2005
@@ -17,10 +17,6 @@
package org.apache.lenya.cms.site.usecases;
import java.io.File;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Collections;
-import java.util.Date;
import java.util.Map;
import java.util.HashMap;
@@ -41,7 +37,7 @@
/**
* Usecase to create a document.
- *
+ *
* @version $Id$
*/
public class CreateBlogEntry extends DocumentUsecase {
@@ -59,12 +55,12 @@
Document parent = getSourceDocument();
setParameter(PARENT_ID, parent.getId());
}
-
+
/**
* @see org.apache.lenya.cms.usecase.AbstractUsecase#doCheckExecutionConditions()
*/
protected void doCheckExecutionConditions() throws Exception {
-
+
String documentId = getParameterAsString(DOCUMENT_ID);
if (documentId.equals("")) {
@@ -77,7 +73,7 @@
super.doCheckExecutionConditions();
}
-
+
protected void doExecute() throws Exception {
super.doExecute();
@@ -104,7 +100,10 @@
}
String area = parent.getArea();
- Document document = parent.getIdentityMap().getFactory().get(area, documentId, language);
+ Document document = parent.getIdentityMap().getFactory().get(parent.getPublication(),
+ area,
+ documentId,
+ language);
DocumentType documentType = DocumentTypeBuilder.buildDocumentType(documentTypeName,
publication);
@@ -117,7 +116,7 @@
HashMap allParameters = new HashMap();
allParameters.put(Identity.class.getName(), session.getAttribute(Identity.class.getName()));
allParameters.put("title", title);
-
+
documentType.getCreator().create(new File(doctypesDirectory, "samples"),
new File(publication.getContentDirectory(area), ""),
childId,
@@ -125,7 +124,7 @@
title,
language,
allParameters);
-
+
}
/**
@@ -134,4 +133,4 @@
protected String getDocumentTypeName() {
return getParameterAsString(DOCUMENT_TYPE);
}
-}
+}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org