Changeset 10784
- Timestamp:
- 01/29/07 01:51:22 (2 years ago)
- Files:
-
- org.nuxeo.project.sample/trunk/NXSample/.classpath (modified) (1 diff)
- org.nuxeo.project.sample/trunk/NXSample/build.xml (modified) (2 diffs)
- org.nuxeo.project.sample/trunk/NXSample/pom.xml (modified) (1 diff)
- org.nuxeo.project.sample/trunk/NXSample/src/org/nuxeo/project/sample/SampleAction.java (modified) (1 diff)
- org.nuxeo.project.sample/trunk/NXSample/src/org/nuxeo/project/sample/SampleActionBean.java (modified) (3 diffs)
- org.nuxeo.project.sample/trunk/NXSample/web/incl/tabs/sample_view.xhtml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
org.nuxeo.project.sample/trunk/NXSample/.classpath
r10655 r10784 10 10 <classpathentry kind="lib" path="/Nuxeo/lib/jboss-seam.jar" sourcepath="/install/jboss-seam-1.1.0.GA/src"/> 11 11 <classpathentry combineaccessrules="false" kind="src" path="/Nuxeo"/> 12 <classpathentry combineaccessrules="false" kind="src" path="/NXCoreFacade"/> 12 13 <classpathentry kind="output" path="bin"/> 13 14 </classpath> org.nuxeo.project.sample/trunk/NXSample/build.xml
r10655 r10784 25 25 </fileset> 26 26 <fileset dir="${deploy.dir}/${nuxeo.ear}"> 27 <include name="NXSchema.jar"/> 27 28 <include name="NXCoreAPI.jar"/> 28 29 <include name="NXCore.jar"/> 29 <include name="NX Schema.jar"/>30 <include name="NXCoreFacade.jar"/> 30 31 <include name="nuxeo.jar"/> 31 32 </fileset> 32 33 <!-- 34 <fileset dir="../NXSchema/dist"> 35 <include name="NXSchema.jar"/> 36 </fileset> 33 37 <fileset dir="../NXCoreAPI/dist"> 34 38 <include name="NXCoreAPI.jar"/> … … 37 41 <include name="NXCore.jar"/> 38 42 </fileset> 39 <fileset dir="../NX Schema/dist">40 <include name="NX Schema.jar"/>43 <fileset dir="../NXCoreFacade/dist"> 44 <include name="NXCoreFacade.jar"/> 41 45 </fileset> 42 46 <fileset dir="../Nuxeo/dist"> org.nuxeo.project.sample/trunk/NXSample/pom.xml
r10419 r10784 23 23 <dependency> 24 24 <groupId>org.nuxeo.ecm</groupId> 25 <artifactId>NXJCRConnector</artifactId> 26 <version>0.0-SNAPSHOT</version> 27 </dependency> 28 <dependency> 29 <groupId>org.nuxeo.ecm</groupId> 30 <artifactId>NXFileManager</artifactId> 25 <artifactId>NXCoreFacade</artifactId> 31 26 <version>0.0-SNAPSHOT</version> 32 27 </dependency> org.nuxeo.project.sample/trunk/NXSample/src/org/nuxeo/project/sample/SampleAction.java
r10653 r10784 5 5 import javax.ejb.Local; 6 6 7 import org.nuxeo.ecm.core.api.ClientException; 8 7 9 @Local 8 10 public interface SampleAction extends Serializable { 9 11 10 public String doSomething() ;12 public String doSomething() throws ClientException; 11 13 12 14 public String getSampleName(); 13 15 14 public void setSampleName(String sampleName);15 16 16 public void destroy(); 17 17 } org.nuxeo.project.sample/trunk/NXSample/src/org/nuxeo/project/sample/SampleActionBean.java
r10655 r10784 4 4 5 5 import javax.ejb.Remove; 6 import javax.ejb.Stateful;7 6 8 7 import org.apache.commons.logging.Log; … … 14 13 import org.jboss.seam.annotations.Scope; 15 14 import org.jboss.seam.contexts.Contexts; 15 import org.nuxeo.ecm.core.api.ClientException; 16 16 import org.nuxeo.ecm.core.api.DocumentModel; 17 import org.nuxeo.ecm. ui.web.context.NavigationContext;17 import org.nuxeo.ecm.core.api.ejb.DocumentManager; 18 18 19 19 // XXX: when contributed outside of Nuxeo, seam components do not get injected 20 20 // in the bean if it's declared stateful... 21 @Stateful21 // @Stateful 22 22 @Scope(SESSION) 23 23 @Name("sampleActions") … … 32 32 //protected NavigationContext navigationContext; 33 33 34 protected String sampleName = "click"; 34 @In(create = true) 35 protected DocumentManager documentManager; 35 36 36 37 public String getSampleName() { 37 return sampleName; 38 DocumentModel doc = (DocumentModel) Contexts.getSessionContext().get("currentItem"); 39 if (doc == null) { 40 log.info("doc null"); 41 return "null doc!"; 42 } 43 return (String) doc.getProperty("dublincore", "title"); 38 44 } 39 45 40 public void setSampleName(String sampleName) { 41 this.sampleName = sampleName; 42 } 46 public String doSomething() throws ClientException { 47 log.info("Doing something"); 43 48 44 public String doSomething() { 45 log.info("Doing something"); 49 //XXX injected incorrectly 46 50 //DocumentModel doc = navigationContext.getCurrentDocument(); 47 51 DocumentModel doc = (DocumentModel) Contexts.getSessionContext().get("currentItem"); 48 52 if (doc == null) { 49 53 log.info("doc null"); 50 sampleName = "null doc!"; 51 } else { 52 sampleName = sampleName + " " + doc.getType(); 54 return null; 53 55 } 56 if (documentManager == null) { 57 log.info("dm null"); 58 return null; 59 } 60 61 String title = (String) doc.getProperty("dublincore", "title"); 62 title += " do"; 63 doc.setProperty("dublincore", "title", title); 64 documentManager.saveDocument(doc); 65 documentManager.save(); 54 66 return null; 55 67 } org.nuxeo.project.sample/trunk/NXSample/web/incl/tabs/sample_view.xhtml
r10653 r10784 33 33 <h:form> 34 34 <h:panelGrid> 35 <h: inputText value="#{sampleActions.sampleName}"/>35 <h:outputText value="#{sampleActions.sampleName}"/> 36 36 <h:commandButton type="submit" 37 37 value="Do Something" styleClass="button"
