How to add images in Protege - annotations

How can I describe class instances with images (e.g. abc.png) and display them inside Protege 5.2.0? I have read the tutorial which uses widgets, but the Forms tab is no longer available in current version of Protege-Owl.

There is a project which intends to provide such ontology : Schema.org.
It is also possible to fully describe a picture thank to the use a of metadata ontology (ISO, ...).
schema:image annotation property may provide what you intend to do.

For annotation values that are URLs that point to images, Protégé displays thumbnails of the images.
More info: https://github.com/protegeproject/protege/issues/315.
Update
You should add the schema:image annotation property (or another suitable annotation property) first:

You can add pictures both for classes and instances.
Be aware until this moment you only can add picture from the web.
I'm going to show you how to add a picture for a class.
First go to Annotation tab and click on + button:
A window will be opened. At this window, you should add schema:image as an annotation property:
After adding schema:image, go to IRI Editor tab at the same window and paste the picture URL into the box (for copying the picture URL, right-click on the image on the web and then click on copy image address):
By clicking on OK you can see the thumbnail of the picture:
Now if you click on this thumbnail, the full image will be opened in a new tab in your browser and you can see it in full size.

Related

Customization of login screen is not working in Keycloak application?

provide configuration for customization of login page.
https://www.keycloak.org/docs/latest/server_development/index.html#_themes
Tried the above tutorial but its not working.
Do i need any permission for customization?
I wanted to change the logo, so I tried following the official tutorial, but it did not change. After all, I found that we should add few html lines containing the css class (resources/*.css) to display the logo instead of the default text. Steps below:
Select you Realm
Go to Realms Settings
Tab General
Fill the HTML Display Name field (by default it is blank) with the content having class kc-logo-text (login.css related) or your custom class (you can see the Master realm did it) in order to make the logo appeared.
Save
Tab Themes
Select your custom theme
Save
// For example:
HTML Display Name: <div class="kc-logo-text"><span>Keycloak</span></div>
Solution derived after I read https://lists.jboss.org/pipermail/keycloak-user/2019-September/019320.html

How to set up a TypoScript Playground in Typo 3?

How can one play around with TypoScript code shown in documentations about TypoScript?
Tested with a local Typo3 test instance, Typo3 version 9.5.5, Official Introduction Package installed.
In the backend, create a new page in the tree. Rightclick -> enable it (the red overlay should disappear). Make sure it is selected in the tree.
Click on the blue Template button on the left. Usually it will show you the blue No Template message.
Make sure on the top Info/Modify is selected from the drop down.
Click the gray + (New record) button under the drop down.
On the bottom, click Edit the whole template record.
Optionally give it a speaking template and website title, like 'Playaround' and 'Play Around'.
Optionally, under tab Options -> Clear, select Constants and Setup - this will clear everything this Template has inherited from parent templates, but will also disable the debug infos at the bottom of the frontend for this page (if you have installed the Official Introduction Package).
Under the tab General -> text entry Setup, enter the following TypoScript:
page = PAGE
page.10 = TEXT
page.10.value = Hello World
press the Save and then the View button.
A new tab opens, showing you the frontend for your page, printing the text 'Hello World'.
Now you can play around with the code examples given in eg. the TypoScript Reference.
Funnily enough, I just found out that Typoscript is by definition not a programming language, but a configuration description. That's why Typo3 is needed as a substructure for this, I think. There seem to be online demos of Typo3 on the net, but I don't know whether they are up to date and whether you can test TypoScript there. Therefore access local containers / installations as suggested. Or if the possibility exists a dev subdomain.

How can I maintain image class when using mc:edit in a MailChimp template?

I'm trying to create a MailChimp template where an image is editable using mc:edit
Here's the code:
<img class="flexibleImage" mc:edit="top_image">
This seems all good, but once I edit this image using the MailChimp editor, I lose the original class "flexibleImage" and all other class and style info related to that img element.
How can I create a template with an editable image and maintain (or add) that class?
For anyone else with the problme, this answer is based on a response from MailChimp support:
It looks like it isn't possible to keep a custom class attached to an
editable image. What you could do instead though is apply the class
to the image's containing element. So if the image is in a <div>, add
flexibleImage to the div, and then update your CSS rules to point to
.flexibleImage>img.
This happens because the image you want to edit is inside an mc:repeatable block that in turn is inside another mc:repeatable block
Even four years later this is still an issue.
The other route is to put mc:edit on the parent container, and have images managed through there, but you lose the Image uploader box, which is poor user experience.
You can go into Settings when you have uploaded a new image and put the sizes in there. Not ideal, but Mailchimp is to blame here (no such issue on Campaign Monitor templates).

AEM Page Image in Page Properties Doesn't Apply a sling:resourceType

Using Adobe Experience Manager 5.6.1 (AEM) (Formerly CQ5) I am trying to create a new tab similar to the Image tab in Page Properties. It would be titled "Logo".
I basically just copied the Image tab to create a logo tab and renamed the paths to reflect the logo purpose. For instance, I set the fileReferenceParamater to ./logo/fileReference and requestSuffix to /logo.img.png.
When I edit the properties, I can drag an image into the tab just as I can with the "Image" tab, however, the image never appears there. I am guessing this is because the default image handler is not picking up the request. The error is:
Cannot serve request to
/content/my-site/home-page/en_us/jcr:content/logo.img.png in
org.apache.sling.servlets.get.DefaultGetServlet
When I looked at the content node there was no sling:resourceType. When I added a resource type of foundation/components/adaptiveimage then it worked. However, I noticed that the "Image" node didn't have a sling:resourceType. I guess the img.png.java servlet in the foundation page is handling that request.
I tried creating a logo.img.png.jsp file in my page component to handle the request, but that didn't seem to work.
How can I get AEM to either add the sling:resourceType or to handle the request?
I was facing the similar problem and I found a simpler way to resolve. All you need to do is to add a hidden xtype under the your logo image as below:
<yourlogo
jcr:primaryType="cq:Widget"
<-- other properties -->
xtype="html5smartimage">
<items jcr:primaryType="cq:WidgetCollection">
<resType
jcr:primaryType="cq:Widget"
ignoreData="{Boolean}true"
name="./logo/sling:resourceType"
value="foundation/components/image"
xtype="hidden"/>
</items>
</yourlogo>
Well, after some time experimenting, this is what I ended up doing to get this to work. If there is an easier way, I would be happy to know it.
First, I copied the /libs/foundation/components/page/img.png.java file and added it to my compiled package with some modifications.
#SlingServlet(
resourceTypes = "sling/servlet/default",
selectors = "imgnode",
extensions = {"png","jpg","jpeg","gif"},
methods = "GET"
)
public class SimpleImageServlet extends AbstractImageServlet {
Where img.png.java had the following line:
Image image = new Image(c.resource, "image");
I changed it to:
Image image = new Image(c.resource);
This relies on SCR annotations to generate the OSGi configuration so that this servlet will handle image requests having the imgnode selector. Instead of looking for a child image node it just expects the current resource to be an image.
Second, I added a component to the body.jsp overlay of the page component, like so.
<cq:include path="logo" resourceType="/apps/my-site/components/logo" />
This maps the logo path to a component for rendering.
Third, within the logo.jsp on the component I set the selector to imgnode rather than img.
Image img = new Image(resourcePage, "logo");
img.setSelector("imgnode");
I believe this step would be similar if the adaptiveimage were overlayed. You just need to render out URLs that include the imgnode selector.
Fourth, I setup the logo image dialog tab in page properties to use the expected requestSuffix and set the other properties to point to the logo sub-node.
Examples:
requestSuffix = "/logo.imgnode.png"
fileReferenceParameter = "./logo/fileReference"
Fifth, I made sure that the image dialog tab for the /apps/my-site/components/logo component pointed to itself.
Examples:
requestSuffix = ".imgnode.png"
fileReferenceParameter = "./fileReference"
Now whether it is in page properties, component editing, or final rendering, the image is handled appropriately.
this is a bit of a nuisance with using the image widget controls--only the image component nicely handles the data, and the servlet that handles ".img" is tied to the image component resourceType.
the easiest thing is to just use the value of the fileReference property instead of referencing the image as part of the page. since you're using assets from DAM, this is a reasonable approach.
this doesn't address the issue with a user uploading an image directly. i wanted to suggest having a hidden field like "./logo/sling:resourceType", but testing that locally resulted in an error when trying to save the dialog.
another approach is the following:
<sling:include resourceType="foundation/components/adaptiveimage" resource="${resource.path}/logo" />
(assuming resource is jcr:content). this is effectively the same as adding a sling:resourceType, but there are at least 2 downsides:
the image becomes authorable at that point as opposed to in the dialog
this method only works for rendering a normal tag. it won't work for any sort of background image

Make Eclipse RCP Intro part of a perspective

For a product we are creating, we want to be able to have the welcome screen display in a perspective (which we are calling "Start Here"). The intro is the only thing that needs to be in that perspective, however, when I try to add our intro view to the perspective, it says that the view already exists in the layout.
I have tried programmatically closing the intro, messing around with standby mode etc but I cant get it working.
The intro is an XHTML one and we use internal Eclipse "action links" (e.g. http://org.eclipse...?runAction etc) extensively (hence the reason that we need to use the intro framework.
Does anyone have any ideas as to how I could get it added to a perspective, or at the very least get the intro fully maximised when you select a specific perspective (using the "showIntro" method results in it displaying oddly, bunched to one side).
Thanks!
Intro view is a sticky view, so its placeholder is created by default to every perspective, to the right of editor area. There's no public API to remove a placeholder once it is created and when you try to create one you get the error that it already exists.
You can maximize Intro view like this:
IWorkbenchPage page =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
page.setPartState(page.findViewReference("org.eclipse.ui.internal.introview"),
IWorkbenchPage.STATE_MAXIMIZED);
This should probably be done in IPerspectiveListener.perspectiveChanged() rather than in perspective factory.
Instead of adding the view to the perspective, call IIntroManager.showIntro() or WorkbenchWindowAdvisor.openIntro()