cancel
Showing results for 
Search instead for 
Did you mean: 

FDK Installation

jpashley
Champ in-the-making
Champ in-the-making
Hi,
I am trying to install the FDK in Alfresco version 3.4.c and following the instructions in http://wiki.alfresco.com/wiki/3.3_Forms_Development_Kit.
I have installed the alfresco-community-fdk-3.4.c.amp successfully modifying and backing up the share.war.
When I list the alfresco-fdk-3.4.c.jar I see that the files listed are not being put into the directory structure e.g. alfresco/site-data/template-instances/fdk-unit-tests.xml
I have tried copying the alfresco-fdk-3.4.c.jar into both <tomcat>/shared/lib and <tomcat>/webapps/<appname>/WEB-INF/lib and restarting the services but the files listed in alfresco-fdk-3.4.c.jar to not appear anywhere in the directory structure. Note: appname is share (maybe it should be alfresco?)
I can start the FDK using http://localhost:8080/share/page/fdk and can view a nodeRef but that is all.
Q: How to solve?
Environment: MS Windows XP SP 3. Standard Alfresco Community 3.4.c. installation.
John
20 REPLIES 20

jpashley
Champ in-the-making
Champ in-the-making
Hi,

I added ${catalina.base}/shared/lib/*.jar to common.loader but this did not bring the desired result.

I noticed that ${catalina.base}/shared/lib/*.jar is already included in shared.loader.

Q: What is (if any) the difference?

John

stevegreenbaum
Champ in-the-making
Champ in-the-making
You only need the shared.loader entry.  In previous releases the shared/lib entry was missing so you had to manually add it.  With v3.4c it looks like the entry is already there. I installed FDK in v3.4b by adding the AMP, JAR and modifying catalina.properties.  Everything worked fine after that. 

Did you role back the Share.war to the previous version after moving the amp to alfresco.war?

jpashley
Champ in-the-making
Champ in-the-making
Hi,

I took your advise and reverted to version 3.4.b and did the following:

1. Installed Alfresco Community Edition 3.4.b, started and tested it
2. Copied alfresco-community-fdk-3.4.b.amp into c:\java\alfresco\amps
3. Installed alfresco-community-fdk-3.4.b.amp into alfresco.war using c:\java\alfresco\bin\alfresco-mmt.jar
4. Checked the contents of alfresco.war with the following result:
Module 'org_alfresco_module_wcmquickstart' installed in 'alfresco.war'
   -    Title:        WCM Quick Start
   -    Version:      1.0
   -    Install Date: Sat Jan 15 14:07:46 CET 2011
   -    Desription:   WCM Quick Start
Module 'org_alfresco_module_dod5015' installed in 'alfresco.war'
   -    Title:        DOD 5015 Records Management
   -    Version:      1.0
   -    Install Date: Sat Jan 15 14:06:30 CET 2011
   -    Desription:   Alfresco DOD 5015 Record Management Extension
Module 'org.alfresco.module.vti' installed in 'alfresco.war'
   -    Title:        Vti
   -    Version:      1.2
   -    Install Date: Sat Jan 15 14:07:22 CET 2011
   -    Desription:   Alfresco Vti Extension
Module 'org_alfresco_module_fdk' installed in 'alfresco.war'
   -    Title:        Forms Development Kit
   -    Version:      1.0
   -    Install Date: Sat Jan 15 14:28:08 CET 2011
   -    Desription:   Alfresco Forms Development Kit
Module 'org.alfresco.module.quickr' installed in 'alfresco.war'
   -    Title:        Quickr
   -    Version:      1.0
   -    Install Date: Sat Jan 15 14:06:56 CET 2011
   -    Desription:   Alfresco Quickr Extension
5. Copied alfresco-fdk-3.4.b.jar into c:\java\alfresco\tomcat\shared\lib
6. Changed catalina.properties by adding ${catalina.base}/shared/lib/*.jar as follows:
shared.loader=C:/Java/alfresco/tomcat/shared/classes,${catalina.base}/shared/lib/*.jar
7. Restarted the services and logged on to Share as admin and created a site “test01”.
8. Created a Plain Text “content” (test01) in the Document Library.
9. Successfully added EXIF as Aspect (as described in the Wiki)
10. Tried to change the Type to Everything -> “Could not change type for ‘test01’”
11. Checked the stdout_20110115.log
14:44:44,936  ERROR [extensions.webscripts.AbstractRuntime] Exception from executeScript - redirecting to status template error: 00150002 Wrapped Exception (with status template): 00150003 Failed to execute script 'classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/type.post.json.js': Namespace prefix fdk is not mapped to a namespace URI
org.springframework.extensions.webscripts.WebScriptException: 00150002 Wrapped Exception (with status template): 00150003 Failed to execute script 'classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/type.post.json.js': Namespace prefix fdk is not mapped to a namespace URI
   at org.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:749)
12. Logged on to http://localhost:8080/share/page/form-console
13. Entered the id for the “content” test01 workspace://SpacesStore/799ffe18-8f05-4bc9-b7bf-61de31873ec3
14. Clicked “Show Form” and got the following:
Form Console
Item Details
Kind: node Id: workspace://SpacesStore/799ffe18-8f05-4bc9-b7bf-61de31873ec3
Destination:
Form Details
Id: Mode: View Edit Create Submit Type: Multipart JSON URL Encoded
Redirect:
Name:*
Title:
Description: test01
Mimetype: Plain Text
Author:
Tags:
Select
Submit Cancel

I think I did everything correctly but can’t understand why I can’t move forward.
What have I missed?
Very much appreciate your help.
John

stevegreenbaum
Champ in-the-making
Champ in-the-making
The steps you provided look correct to me.  I'm thinking that the jar file is still not being picked up since you aren't able to specialize the type to "Everything" due to the error message “Could not change type for ‘test01’”.  The only difference I see from my installation is that I didn't use ${catalina.base}, I spelled out the path: c:/alfresco/……..

jpashley
Champ in-the-making
Champ in-the-making
Hi,

I very much appreciate your continuing support but your suggested modification did not bring the the desired success.

I tried adding "C:/Java/alfresco/tomcat/shared/lib/alfresco-fdk-3.4.b.jar" to both common.loader and shared.loader - in turn but not together. (Q: Which would normally be correct?)

I just want to confirm that the "change type" action is conducted in Share and not Explorer.

I tried to change the type in Explorer but "Everything" was not listed.

I then changed the type - in Explorer - to Article.

I then checked in Share and found that the types "Gadget, etc." were no longer listed in the pull-down box.

So it seems that a change is being made to the file but not to the type "Everything".

The only thing I can think of is that if Alfresco is not installed in the root, i.e. c:\alfresco but c:\Java\alfresco this could make a difference?

I still get the same error message in the stdout_???.log
08:52:00,682  ERROR [extensions.webscripts.AbstractRuntime] Exception from executeScript - redirecting to status template error: 00160001 Wrapped Exception (with status template): 00160004 Failed to execute script 'classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/type.post.json.js': Namespace prefix fdk is not mapped to a namespace URI
org.springframework.extensions.webscripts.WebScriptException: 00160001 Wrapped Exception (with status template): 00160004 Failed to execute script 'classpath*:alfresco/templates/webscripts/org/alfresco/slingshot/documentlibrary/type.post.json.js': Namespace prefix fdk is not mapped to a namespace URI

The "form-console" is loading correctly, i.e. I can access http://localhost:8080/share/page/form-console and the expected screen appears.

Many thanks
John

stevegreenbaum
Champ in-the-making
Champ in-the-making
On my installation I only needed to add the statement to the shared.loader.

I don't run my installation from the root either, so I don't think that is the issue.

Wild guess - 1) is it possible you added the amp to a alfresco.war that is in a different instance.  I have numerous instances on my machine and occasionally apply an amp in the wrong instance. See if you can find tomcat\webapps\alfresco\WEB-INF\classes\alfresco\module\org_alfresco_module_fdk\fdk-context.xml 2) skip the exif aspect step, it's not needed

jpashley
Champ in-the-making
Champ in-the-making
Hi,

I changed back to the shared.loader.

I then checked alfresco.war:
Size:  alfresco.war 125'166'056 bytes
Size: alfresco.war-1295098053856.bak 125'161'207 bytes
Difference 4849 bytes

I checked for the existance of any and all alfresco.war files on my system and removed any duplicates.

I checked once again the contents of alfresco.war to find that the amp was indeed there.

Module 'org_alfresco_module_wcmquickstart' installed in 'alfresco.war'
   -    Title:        WCM Quick Start
   -    Version:      1.0
   -    Install Date: Sat Jan 15 14:07:46 CET 2011
   -    Desription:   WCM Quick Start
Module 'org_alfresco_module_dod5015' installed in 'alfresco.war'
   -    Title:        DOD 5015 Records Management
   -    Version:      1.0
   -    Install Date: Sat Jan 15 14:06:30 CET 2011
   -    Desription:   Alfresco DOD 5015 Record Management Extension
Module 'org.alfresco.module.vti' installed in 'alfresco.war'
   -    Title:        Vti
   -    Version:      1.2
   -    Install Date: Sat Jan 15 14:07:22 CET 2011
   -    Desription:   Alfresco Vti Extension
Module 'org_alfresco_module_fdk' installed in 'alfresco.war'
   -    Title:        Forms Development Kit
   -    Version:      1.0
   -    Install Date: Sat Jan 15 14:28:08 CET 2011
   -    Desription:   Alfresco Forms Development Kit
Module 'org.alfresco.module.quickr' installed in 'alfresco.war'
   -    Title:        Quickr
   -    Version:      1.0
   -    Install Date: Sat Jan 15 14:06:56 CET 2011
   -    Desription:   Alfresco Quickr Extension

I did not find a directory c:\java\alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\module\org_alfresco_module_fdk

So I copied the contents of alfresco-community-fdk-3.4.b.amp to get:
c:\java\alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\module\org_alfresco_module_fdk\fdk-context.xml
c:\java\alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\module\org_alfresco_module_fdk\fdk-model.properties
c:\java\alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\module\org_alfresco_module_fdk\fdk-model.xml
c:\java\alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\module\org_alfresco_module_fdk\module-context.xml
c:\java\alfresco\tomcat\webapps\alfresco\WEB-INF\classes\alfresco\module\org_alfresco_module_fdk\module.properties

And voilà it seems to work. I can now change the file type and access the form-console showing the desired functionality.

Q1: Why is tomcat not picking up alfresco-community-fdk-3.4.b.amp in alfresco.war?
Q2: I have the file alfresco-community-fdk-3.4.b.amp in c:\java\alfresco\amps and not ..\amps_share. Is this correct?
Q3: Are the files above in the correct structure?

Having got this far, can you point me in the direction of how to create my own forms?

Once again, many thanks for your kind, professional and creative assistance.

John

stevegreenbaum
Champ in-the-making
Champ in-the-making
Glad you got that working. 

q1.  not sure why the amp is not being picked up, I haven't seen something like this before.

Regarding forms here are a couple of links that I found hlepful:
http://wiki.alfresco.com/wiki/3.3_Forms_Developer_Guide 
http://wiki.alfresco.com/wiki/Forms_Examples

jpashley
Champ in-the-making
Champ in-the-making
Hi,

not quite out of the woods yet.

The Wiki talks about "The FDK also provides an extension point (alfresco/web-extension/fdk-config-custom.xml) so that further form configuration can be provided and tested via the form console page."

Given that my amp is not being picked up correctly and I'm having to revert to manually copying the amp contents, this "fdk-config-custom.xml" is not being installed.

What to do and are there any other bits which need copying?

Many tks.
John

stevegreenbaum
Champ in-the-making
Champ in-the-making
I think I had to create that file manually also, so I don't think there are other files that are still missing beyond that.  This is the file where you will put the new forms you want to test.  I don't recall where I got the default content for this file, but here is what I have:

<alfresco-config>

   <config evaluator="node-type" condition="fdk:everything">
      <forms>

         <form id="sgform">
            <field-visibility>
               <show id="fdk:text" />
               <show id="fdk:textMultiple" />
               <show id="fdk:mltext" />
               <show id="fdk:any" />
            </field-visibility>
            <appearance>
               <field id="fdk:textMultiple" help="My test Enter multiple values by separating them with commas" />
            </appearance>
         </form>
      </forms> 
   </config>
</alfresco-config>