How to move the documentactions viewlet from a viewletmanager to another? - plone

Once again back with a Plone question.
I have Plone 4 installed and I need to show the Document action icons at the top instead of bottom. having trouble in getting this to work. can someone help.

If you just need to move that viewlet (with same class and template), first you have to register a viewlet with same class to your desired viewletmanager (let's say for ex. plone.app.layout.viewlets.interfaces.IAboveContentBody):
<browser:viewlet
name="plone.abovecontenttitle.documentactions"
manager="plone.app.layout.viewlets.interfaces.IAboveContentBody"
class="plone.app.layout.viewlets.content.DocumentActionsViewlet"
permission="zope2.View"
/>
and then add this in your genericsetup profile (file viewlets.xml) :
<?xml version="1.0"?>
<object>
<order manager="plone.abovecontentbody" skinname="Plone Default">
<!-- this will place your viewlet before all the others.
you can also use a viewlet's name for a relative position -->
<viewlet name="plone.abovecontenttitle.documentactions" insert-before="*"/>
</order>
<hidden manager="plone.belowcontentbody" skinname="Plone Default">
<viewlet name="plone.abovecontenttitle.documentactions"/>
</hidden>
</object>
More info:
http://plone.org/documentation/kb/customization-for-developers/viewlets
http://collective-docs.readthedocs.org/en/latest/views/viewlets.html

Related

Structuring scorm package with just one item

I recently packaged a Scorm course, and everything looks ok, but when they launch the course they have to click first in one menu button from the LMS, and open a submenu and they have to click again, in other courses they just click in the parent item. I think it's something to do with the structure in the Manifest file, the thing is that I have just one item so the menu is not really necesary.
This is what my client sees:
<?xml version="1.0" standalone="no" ?>
<!--
Single SCO content packaging example. SCORM 2004 2nd Edition.
Provided by Rustici Software - http://www.scorm.com
This example demonstrates the simplest possible manifest, containing just one SCO and
no metdata or sequencing information.
-->
<!--
The manifest node contains a unique identifer for this course and the course's version number.
The schema declartions are important to ensure you are delivering valid XML. For the most part
these should remain static. Other schema prefixes are allowed, but can limit interoperabilty.
-->
<manifest identifier="com.scorm.golfsamples.contentpackaging.singlesco.20042nd" version="1"
xmlns="http://www.imsglobal.org/xsd/imscp_v1p1"
xmlns:adlcp="http://www.adlnet.org/xsd/adlcp_v1p3"
xmlns:adlseq="http://www.adlnet.org/xsd/adlseq_v1p3"
xmlns:adlnav="http://www.adlnet.org/xsd/adlnav_v1p3"
xmlns:imsss="http://www.imsglobal.org/xsd/imsss"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.imsglobal.org/xsd/imscp_v1p1 imscp_v1p1.xsd
http://www.adlnet.org/xsd/adlcp_v1p3 adlcp_v1p3.xsd
http://www.adlnet.org/xsd/adlseq_v1p3 adlseq_v1p3.xsd
http://www.adlnet.org/xsd/adlnav_v1p3 adlnav_v1p3.xsd
http://www.imsglobal.org/xsd/imsss imsss_v1p0.xsd">
<!--The metadata node simply declares which SCORM version this course operates under.
"CAM 1.3" is the notation for SCORM 2004 2nd Edition.-->
<metadata>
<schema>ADL SCORM</schema>
<schemaversion>CAM 1.3</schemaversion>
</metadata>
<!-- There is just one organization. The organization contains just one item.-->
<organizations default="control_interno" adlseq:objectivesGlobalToSystem="false">
<organization identifier="control_interno">
<title>Control Interno</title>
<item identifier="item_1" identifierref="resource_1">
<title>Control Interno</title>
</item>
<imsss:sequencing>
<imsss:controlMode choice="true" flow="true" />
</imsss:sequencing>
</organization>
</organizations>
<!--
There is just one resource that represents the single SCO that comprises the entirety of this course.
The href attribute points to the launch URL for the course and all of the files required by the course
are listed.
-->
<resources>
<resource identifier="resource_1" type="webcontent" adlcp:scormType="sco" href="./control_interno/index.html">
<file href="./control_interno/index.html"/>
</resource>
</resources>
</manifest>

CSS not loading in Jira server report

I am developing a jira server report and I am not able to load my css file.
In my atlassian-plugin.xml I define my web-resource like this:
<web-resource key="jira-reports-resources" name="wl-jira-report-plugin Web Resources">
<dependency>com.atlassian.auiplugin:ajs</dependency>
<resource type="download" name="jira-report-plugin.css" location="/css/jira-report-plugin.css"/>
<resource type="download" name="jira-report-plugin.js" location="/js/jira-report-plugin.js"/>
<resource type="download" name="images/" location="/images"/>
<context>jira-reports-context</context>
</web-resource>
and my report like this:
<report name="Massnahmen Verantwortlichkeit Report" i18n-name-key="report.massnahme.name"
key="massnahme-report" class="com.example.reports.massnahme.MassnahmeReport">
<description key="report.massnahme.description"></description>
<resource name="view" type="velocity" location="/templates/reports/massnahme/view.vm"/>
<resource name="i18n" type="i18n" location="report-massnahme"/>
<label key="report.massnahme.label"></label>
<!-- the properties of this report which the user must select before running it -->
<properties>
<property>
<key>departmentLeaderId</key>
<name>report.massnahme.input.user.name</name>
<description>report.massnahme.input.user.description</description>
<type>multiselect</type>
<values class="com.example.reports.massnahme.generator.MassnahmeUserGenerator"/>
</property>
</properties>
</report>
In my report java class I add the WebResourceManager into the velocityParams and in my view.vm I call it in the first row:
$webResourceManager.requireResourcesForContext("jira-reports-context")
In my view.vm I use a table-based presentation and I want to use a accordion technique to fold rows in my table. My javascript is loaded and the click listener works as intended. But my css file is completely ignored. When I inspect the page in chrome the css classes are not loaded at all. I tried some easy things like
.test-table{
border: 1px solid black;
}
and nothing is showing up.
How do I have to define my css class for using it in a report? I was surprised to see that I can not add css or javascript to the report element itself. Or do I have an error in my code definition? Any ideas?
Try this
webResourceManager.requireResource("groupId.artifactid:web-resource").
Example from the below link:
webResourceManager.requireResource("com.avvd.jira.plugin.inquirer:inquirer-resources")
https://community.atlassian.com/t5/Answers-Developer-Questions/Velocity-don-t-load-resource/qaq-p/489704
Thanks
Try not to use "-" in your context string, replace all the "-" with "."
<context>jira.reports.context</context>
and
$webResourceManager.requireResourcesForContext("jira.reports.context")
Even the answer was not quite correct, the link #MrKumar posted showed me the correct way. Apparently for CustomFields the approach using the method requireResource() is outdated and one should put these resources in <context>atl.general</context>. It worked directly with my reports too.

"external_login_url" customize Plone-login-form

I need to customize Plone login form without make changes in plone original login-form https://github.com/plone/Products.CMFPlone/blob/master/Products/CMFPlone/skins/plone_login/login_form.cpt so there are two ways first i use override.zcml to change login-form :
<browser:page
for="OFS.interfaces.IApplication"
name="plone-root-login"
class="Products.CMFPlone.browser.admin.RootLoginRedirect"
permission="cmf.ManagePortal"
template="templates/login.pt"
/>
and another a simple login.pt file.It generating an Trace:
File "/Plone/buildout-cache/eggs/Products.CMFPlone-4.3.3-py2.7.egg/Products/CMFPlone/browser/admin.zcml", line 43.2-48.8
<browser:page
for="OFS.interfaces.IApplication"
name="plone-root-login"
class=".admin.RootLoginRedirect"
permission="cmf.ManagePortal"
/>
File "/Plone/buildout-cache/eggs/my_app.egg/my/app/browser/overrides.zcml", line 7.4-12.10
<browser:page
for="OFS.interfaces.IApplication"
name="plone-root-login"
class=".admin.RootLoginRedirect"
permission="cmf.ManagePortal"
/>
And Second Method: external_login_url in default/propertiesTool.xml i tried but changes not reflected

Customize Plone view class without touching the template

If a view is registered like this, with the template definition in zcml:
<browser:page
name="original-view"
class=".original_view.View"
permission="zope2.View"
for="*"
template="original_template.pt"
/>
and i want to customize only his class in my product, is there a way to do it without customizing also the template?
You have to wrap the browser:page by <configure package='XXXX'>
That means your then in scope of this packge.
Example:
<configure package="original.package.browser">
<!-- custom view -->
<browser:page
name="original-view"
class="your.package.browser.View" <!-- Full dotted name to you custom view class -->
permission="zope2.View"
for="*"
layer="your.package.interfaces.IYourPackageLayer" <!-- You should provide a browserlayer, otherwise you got a configuration conflict -->
template="original_template.pt" <!-- template from original.package.browser -->
/>
</configure>
EDIT:
As #sdupton mentioned, I updated the example code snipped with a layer
If you can't use a layer (BrowserLayer) you can put the code, without layer attribute into a overrides.zcml
You can also specify a more precise Interface in the for attribute

Alfresco: Finding out the type of a piece of content

When I log into http://localhost:8080/alfresco I can navigate to a folder and see four content items. So far so good. But there is no indication as to what the type is of each content type, except for a PDF icon.
Is there a way for me to specify an icon for my custom content types?
I would like the icon to be dependent on my custom type.
<types>
<type name="sc:doc">
<title>Someco Content</title>
<parent>cm:content</parent>
<icon>boring-icon.png</icon> <-- something like this
</type>
<type name="sc:marketingDoc">
<title>Marketing Document</title>
<parent>bnp:doc</parent>
<icon>fancy-marketing-icon.png</icon> <-- something like this
</type>
</types>
If it matters, I am using Alfresco 3.3 (Enterprise).
Take a look here http://docs.alfresco.com/3.4/tasks/kb-code-explorer-add.html
e.g. web-client-config-custom.xml (sc:marketingDocis the Alfresco content type):
<!-- Specify icon for the kb:document instances -->
<config evaluator="string-compare" condition="sc:marketingDoc icons">
<icons>
<icon name="sc_marketingDoc-icon" path="/images/icons/your_custom_icon.gif" />
</icons>
</config>
Are you informed, that Alfresco Explorer is deprecated & you should use Share instead?

Resources