CSS not loading in Jira server report - css

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.

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>

Extending the current publishing/unpublishing screen

I have a requirement where I need to show a an alert/popup when an editor clicks on the Unpublish menu command. I will show the popup with an Yes/No Button, if Yes is selected we proceed and show the existing UnPub screen. If No is selected No activity happens and the user return back to the screen.
How this can be achieved ?
Can we extend/override the existing CME command's without creating a new Command for ourselves?
I just learned how to do this yesterday (Thank to Nuno Linhares) - you need to be familiar with making a new Editor for the GUI first.
Next step is to find the name of the command that you want to overwrite (Probably "UnPublish" in your case). The easiest way to do that is to use "inspect element" with Chrome or FieFox in the GUI, and look for something like c:command="UnPublish" on the button you wish to extend.
Once you have a basic editor set up, you need to add your new command to overwrite your existing one something like this:
<extensions>
<ext:dataextenders />
<ext:editorextensions>
<ext:editorextension target="CME">
<ext:editurls />
<ext:listdefinitions />
<ext:taskbars />
<ext:commands />
<ext:commandextensions>
<ext:commands>
<ext:command name="UnPublish" extendingcommand="CustomUnPublishCommand"/>
</ext:commands>
<ext:dependencies>
<cfg:dependency>CustomUnPublish.CommandSet</cfg:dependency>
</ext:dependencies>
</ext:commandextensions>
<ext:contextmenus />
<ext:lists />
<ext:tabpages />
<ext:toolbars />
<ext:ribbontoolbars />
</ext:editorextension>
</ext:editorextensions>
</extensions>
Add all your dependencies (JS and CSS etc) and command references in the normal way.
Then write your JS execute function as you would any other GUI command, and call the existing command after you have worked on your popup, something like this:
CustomUnPublish.prototype._execute = function CustomUnPublish$_execute(selection, pipeline) {
//Insert some logic to make a popup and confirm
blnOkToProceed = true;
//
if (blnOkToProceed) {
//EDIT: Original code
$cme.getCommand("UnPublish")._execute(selection, pipeline);
//EDIT: Or using the suggestion from #Peter below
$commands.executeCommand("UnPublish", selection, pipeline);
//End Edit
}
return;
};

Binding unique URLs to XML site map ASP.NET

So, I'm new to ASP.NET and website development in general. I've run into a problem using data binding to an XML file to build a site map for an ASP.NET application. Here's the first portion of the sitemap:
<Privo>
<child display="Current Projects">
<child display="Amifostin">
<child display="Experiments">
<leaf>HTT</leaf>
<leaf>MTT</leaf>
<leaf>HPLC</leaf>
<leaf>UV-Spec</leaf>
</child>
And the data binding from the site.master file:
<DataBindings>
<asp:TreeNodeBinding DataMember="child" TextField="display" />
<asp:TreeNodeBinding DataMember="leaf" TextField="#InnerText" />
</DataBindings>
What'd I'd like to do it something like this:
<leaf url="ExperimentsView.aspx/HTT">HTT<leaf>
and
<asp:TreeNodeBinding DataMember="leaf" TextField="#InnnerText" NavigateUrl="url"/>
BUT, here's the problem: when I try to bind the NavigateUrl, the only thing I can do is bind a type of node to a url - meaning, every leaf will link the the same url. Is there a way to bind a field of the leaf nodes to a (unique) url, or will I have to make different DataMembers for each unique url?
Note: yes, I know about Web.sitemap. That's what I was using when the project lead told me that he wants to use XML data binding.
You will need to use the NavigateUrlField property to do this (see http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.treenodebinding.navigateurlfield.aspx)

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

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

Define CSS class's on tables in Sitecore

In one of my Sitecore solutions the user needs to have some predefined CSS class's that they can put on their tables created in the richtext editor from the back office.
When I go to the Table wizard I can see the CSS class dropdown list, but the only option that's available is one called "Clear class".
How can I define some more class's in that drop down list?
You want to find the following setting in the web.config:
<!-- WEB SITE STYLESHEET
CSS file for HTML content of Sitecore database.
The file pointed to by WebStylesheet setting is automatically included in Html and Rich Text fields.
By using it, you can make the content of HTML fields look the same as the actual Web Site
-->
<setting name="WebStylesheet" value="/default.css" />
Whatever that CSS file is, that's the one where you can add your new classes. Once you change it, clear your browser cache and re-open the browser. The RTE should then get the new classes.
Problem:
Need to add predefined css in external css to RadEditor in Sitecore CMS
Solution:
Add css class to default.css which can be found in WEB_ROOT/Web.config on the following line:
<setting name="WebStylesheet" value="/default.css" />
Example css:
.cufon {
font-weight: bold;
color: #666;
}
Modify the ToolsFile.xml defined in where the Sitecore uses the RadEditor (in my case: WEB_ROOT/sitecore/shell/Controls/Rich Text Editor/Default.aspx) and add the following lines:
<classes>
<class name="Clear Class" value="" />
<class name="Cufon Book" value=".cufonBook" />
<class name="Cufon Light" value=".cufonLight" />
</classes>
Reference:
RadControls – CSS Styles http://www.telerik.com/help/aspnet-ajax/cssstyles.html
how to load css classes from my own project specfic css in Sitecore’s RAD editor? how to load css classes from my own project specfic css in Sitecore's RAD editor?

Resources