Solprovider Lenya Kongregate Registration for Free Flash Games and Chat with solprovider

"New Document" Creates All Language Versions

20050911: Bug was fixed. The languages must be hard-coded.


This will create every language version when creating a new document. It is a hack. Lenya should check the available languages for the publication, create the default language, then create all the other language versions. This "patch" hardcodes the languages. Even worse, it is a server-wide change.

If your Lenya has publications that do not use identical available languages, you should modify global-sitemap.xmap so usecase.xmap uses fallback. I did not do that because I have only one publication per Lenya instance.

Hide language on "New Document" Form so always creates default language


FILE: {pub}\lenya\xslt\authoring\create.xsl
With the other <input type="hidden" ..., add:
<input type="hidden" name="properties.create.language" value="en"/>
Change the value if "en" is not your default language.

Delete the line:
<xsl:apply-templates select="allowedLanguages"/>

There is other code later that can be removed if you want a clean file.

Fix pipelines


FILE: usecase.xmap
After:
<map:match pattern="create" type="step">
<!-- Make sure the child-id doesn't exist yet -->
<map:act type="document-id-exists">
<map:parameter name="document-id" value="{request-param:properties.create.parent-id}/{request-param:properties.create.child-id}"/>
<map:act type="task">
<map:parameter name="task-id" value="create"/>


Add this line once, changing "en" to your default language:
<map:parameter name="properties.create.language" value="en"/>

Paste the following code once for additional language. In each copy, change the "en" to your default language (must match the above line), and the "xx" to the another additional language:
<map:act type="task">
<map:parameter name="task-id" value="create-language"/>
<map:parameter name="properties.create.doctype" value="{page-envelope:document-type}"/>
<map:parameter name="properties.create.document-id" value="{request-param:properties.create.parent-id}/{request-param:properties.create.child-id}"/>
<map:parameter name="properties.create.old.language" value="en"/>
<map:parameter name="properties.create.new.language" value="xx"/>
</map:act>


<< Delete User ErrorSet Title >>

Contact Solprovider
Paul Ercolino