09-26-2011 04:30 AM
<extension>
<modules>
<module>
<id>Edit Metadata with Preview</id>
<description>Adding document preview to edit metadata page</description>
<customizations>
<customization>
<targetPackageRoot>org.alfresco</targetPackageRoot>
<sourcePackageRoot>se.loftux</sourcePackageRoot>
</customization>
</customizations>
<components>
<component>
<region-id>metadata-web-preview</region-id>
<source-id>edit-metadata</source-id>
<scope>template</scope>
<sub-components>
<sub-component id="metadatapreview" index="25">
<url>/components/preview/web-preview</url>
<properties>
<nodeRef>{nodeRef}</nodeRef>
</properties>
</sub-component>
</sub-components>
</component>
</components>
</module>
</modules>
</extension>
- added templates/se/loftux/edit-metadata.ftl with content<@region id="metadata-web-preview" target="edit-metadata" action="after" scope="template" />
-deployed the extension module.09-26-2011 05:46 AM
<component>
<region-id>metadata-web-preview</region-id>
<source-id>global</source-id>
<scope>global</scope>
<url>/components/preview/web-preview</url>
<properties>
<nodeRef>{nodeRef}</nodeRef>
</properties>
</component>
<@region id="metadata-web-preview" target="edit-metadata" action="after" scope="global" />
09-26-2011 08:07 AM
<extension>
<modules>
<module>
<id>Edit Metadata with Preview</id>
<description>Adding document preview to edit metadata page</description>
<components>
<component>
<region-id>edit-metadata</region-id>
<source-id>edit-metadata</source-id>
<scope>template</scope>
<sub-components>
<sub-component id="metadatapreview" index="200">
<url>/components/preview/web-preview</url>
<properties>
<nodeRef>{nodeRef}</nodeRef>
</properties>
</sub-component>
</sub-components>
</component>
</components>
</module>
</modules>
</extension>
If I had index="25" the preview rendered before the form, changed to 200 it is rendered after (now know what the index is for ). So what is the default index for a component, SurfBug didn't show that (or i didn't look close enough)?
09-26-2011 10:24 AM
09-27-2011 04:16 AM
<div class="yui-gc">
<div class="yui-u first>Existing edit-metadata component goes here</div>
<div class="yui-u>New preview component goes here</div>
</div>
I know how I would do the "old way"09-27-2011 06:00 AM
<div class="yui-gc">
<div class="yui-u first>
…before the default Sub-Component for edit metadata, and then Sub-Component 2 could add…</div>
<div class="yui-u>
Sub-Component 3 would reference the preview WebScript and then Sub-Component 4 could add… </div>
</div>
…to close off the DIV elements (obviously you'd need to create the WebScripts for adding the opening and closing DIV elements).<customizations>
<customization>
<targetPackageRoot>org.alfresco</targetPackageRoot>
<sourcePackageRoot>org.thirdparty.extension</sourcePackageRoot>
<dependencies>
<css>/res/dependencies/addition_styles.css</css>
</dependencies>
</customization>
</customizations>
09-27-2011 06:24 AM
</div><div class="yui-gc">
<div class="yui-u first><div>
to "neutrialize" the component div, but ended up with a div mess that made Adobe Muse look good <div class="yui-u">
<@region id="document-actions" scope="template"/>
<@region id="document-tags" scope="template"/>
<@region id="document-links" scope="template"/>
<@region id="document-metadata" scope="template"/>
<@region id="document-permissions" scope="template"/>
<@region id="document-workflows" scope="template"/>
<@region id="document-versions" scope="template"/>
<@region id="document-publishing" scope="template"/>
</div>
Each is declared as its own component. If we instead would in template-instance/document-details.xml would have just one component "document-panels" with each of the above components as a sub-component, am I right to assume that I could just have re-ordered them with index declaration in my extension module?09-27-2011 09:42 AM
09-29-2011 08:08 AM
<@region id="document-metadata" target="document-metadata" action="remove" scope="template" />
<@region id="document-metadata" target="document-tags" action="before" scope="template" />
metadata is moved as you would expect before tags and after actions.<@region id="document-metadata" target="document-metadata" action="remove" scope="template" />
<@region id="document-metadata" target="document-actions" action="before" scope="template" />
metadata not only moves before "document-actions", but moves another step in the components hierarchy and after comments, thus breaking out of div placements tags. So the before "document-actions" actually becomes after "comments", and the "document-metadata" renders below the comments, not in the right pane. Not sure if I would say this is a bug.<@region id="document-metadata" target="document-metadata" action="remove" scope="template" />
<@region id="document-metadata" target="document-tags" action="before" scope="template" />
<@region id="document-actions" target="document-actions" action="remove" scope="template" />
<@region id="document-actions" target="document-tags" action="before" scope="template" />
This change would have been far easier with just swapping places of the components in the original ftl, but I definitely see the advantages where you can deploy/undeploy (in this case if you don't like my re-ordering, just un-deploy), or that you can use evaluators for when you extension will kick in.
09-29-2011 10:36 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.