Moderní webové aplikace

Dovoluji si prilozit k nahlednuti mou bakalarku. Anotace je uvedena dale, prace je ke stazeni ve formatu PDF, mirne oklestena od smlouvy…

 

Dovoluji si prilozit k nahlednuti mou bakalarku. Anotace je uvedena dale, prace je ke stazeni ve formatu PDF, mirne oklestena od smlouvy…

 

Anotace

Tato práce se zabývá analýzou dostupných systémů pro správu dokumentů a obsahu, výběrem vhodného systému a realizací základní funkčnosti portálu pro správu multimediálních dat. V úvodní části se zabývá využívanými technologiemi a druhy systémů pro správu obsahu, v další části je provedeno srovnání používaných systémů a výběr vhodného kandidáta pro realizaci portálu pro uchování multimediálních dat, v závěrečné fázi části je popsána realizace základní funkčnosti komponent tohoto systému. Jedná se o součást Projektu MPO ČR evid. č. FT-TA3/121 „Výzkum a ověření systému pro záznam a dlouhodobou archivaci multimediálních dat s inteligentním vyhledáváním“.

Klíčová slova

CMS, DMS, Java, JSF, Alfresco, Portal, Multimedia

Abstract

The objectives of this project are to analyse systems for content or data managing, and to find suitable systém for realisation base functions of multimedia content portal. The project contains comparison of systems in use, selection of suitable candidate and parts of realization of this project – multimedia content portal. This portal is a part of Ministry of Industry and Trade of the Czech Republic project evid. nr. FT-TA3/121 „Research and verification system for record and longtime archiving multimedia data with intelligent searching“.

Keywords

CMS, DMS, Java, JSF, Alfresco, Portal, Multimedia

PDF ke stazeni

Hacking Alfresco, III

In last article I wrote about defining custom actions in Alfresco, in this one i want to continue with simple custom dialog triggered by this action.

In last article I wrote about defining custom actions in Alfresco, in this one i want to continue with simple custom dialog triggered by this action.

So, like actions, dialogs are defined in web-client-config-custom.xml too. Definition is simple:

<dialogs>
<dialog name="createSession" page="/jsp/extension/create-session.jsp" managed-bean="CreateSessionDialog"
icon="/images/icons/add_content_large.gif" title="Create session"
description="Create a new user session" />
</dialogs>

Name is name of the dialog, referenced by action tag (<action>dialog:createSession</action>) in action definition. Page is a .jsp page with some content and managed-bean is an managed bean 🙂 defined in faces-config-beans.xml. So, lets add some bean to the session scope:

<managed-bean>
<managed-bean-name>CreateSessionDialog</managed-bean-name>
<managed-bean-class>cz.shmoula.CreateSessionDialog</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>retezec</property-name>
<value>bomdigibom :-)</value>
</managed-property>
</managed-bean>

Now we need to create cz.shmoula.CreateSessionDialog class, which extends the BaseDialogBean:

public class CreateSessionDialog extends BaseDialogBean{
protected String aspect;
protected String retezec;

@Override
protected String finishImpl(FacesContext context, String outcome) throws Exception{
return outcome;
}

@Override
public boolean getFinishButtonDisabled(){
return false;
}

public void setRetezec(String retezec){
this.retezec = retezec;
}

public String getRetezec(){
return this.retezec;
}
}

This bean implements two buttons (see Dialog Framework wiki): OK button action and visibility (ie isDisabled) of OK button, in this case it is not disabled, so it is possible to click it and ends this dialog without any intervention to system ;-).

The Retezec variable is set by bean definition to some funny string, so after creating a .jsp page and packing together all this stuff do following: In case of click on space_browse_menu it compares name of that space and if it equals with "Archivace" string, it displays "Create session" action link. After click on this link a custom dialog is opened, as you can see on image below.

Free Image Hosting at www.ImageShack.us

displayed simple dialog

 

.jsp page is very simple too, it doesn't need no headers due to viewing inside of Alfresco UI:

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>

<h:outputText value="#{CreateSessionDialog.retezec} " />

Hacking Alfresco, II

My second try was to create some custom action in some menu or bar and to view a simple dialog in Alfresco UI triggered by this action. There are topics covering this theme in Alfresco wiki too (see Custom Action UI and Dialog Framework) for detailed informations. But i wanted to create a simple and working example to see if it really works :-).

My second try was to create some custom action in some menu or bar and to view a simple dialog in Alfresco UI triggered by this action. There are topics covering this theme in Alfresco wiki too (see Custom Action UI and Dialog Framework) for detailed informations. But i wanted to create a simple and working example to see if it really works :-).

So, lets start with some action ;-). Actions are defined in web-client-config-custom.xml configuration file like this:

<actions>
<action id="create_session">
<label>Create session</label>
<image>/images/icons/add.gif</image>
<action>dialog:createSession</action>
<evaluator>cz.shmoula.CreateSessionEvaluator</evaluator>
</action>

<action-group id="space_browse_menu">
<action idref="create_session" />
</action-group>

</actions>

Items are self explaining, i hope :-). Action is to create dialog, which is defined in dialogs section with name createSession and evaluator is class which implements ActionEvaluator and indicates that this action is viewed or not. In my CreateSessionEvaluator i have just a simple condition.

Id attribute of action-group tag specifies a place in which is this action (a link) viewed, in my example it is space_browse_menu, which is the context menu of space object. Action groups are defined in web-client-config-actions.xml. Examples of some action groups are at following pictures:

Free Image Hosting at www.ImageShack.us

space_browse_menu action group

 

Free Image Hosting at www.ImageShack.us

1 – add_content_menu, 2 – browse_actions_menu

An action link is viewed at first image – "Create session". If evaluator is specified, action is viewed just in case of true evaluation. My simple evaluator is following:

public class CreateSessionEvaluator implements ActionEvaluator{

public boolean evaluate(Node node){
if(node.getName().equals("Archivace"))
return true;
else
return false;
}
}

It just compares space name (in case of space_browse_menu action group) with some string, nothing more :-). So, if they correspond, "Create session" link is displayed.

Hacking Alfresco

There are many wiki pages at Alfresco dev sites, but no working simple excercises at all. At these days i'm playing with this CMS/DMS, so i'll try to collect some remarks about actions i'm doing, maybe it'll be helpful for someone. So, i'm experimenting with Content Metadata Extracters with intention to create some kind of Video Extracter (to save bitrate, resolution, codec… to metadata with that object).

There are many wiki pages at Alfresco dev sites, but no working simple excercises at all. At these days i'm playing with this CMS/DMS, so i'll try to collect some remarks about actions i'm doing, maybe it'll be helpful for someone. So, i'm experimenting with Content Metadata Extracters with intention to create some kind of Video Extracter (to save bitrate, resolution, codec… to metadata with that object).

There is a simple wiki page describing that problem, so if you want to know some background, you have to start there. If you dont (or if you prefer very simple way), let's continue. So, what Content Metadata Extracters (CME) are? Imagine following simple situation: you have repository with some multimedia document, let's say mp3 files. Every mp3 file has a header with some informations (id3), for example artist, album, music style, etc. And you want to your document system to create all needed metadata automaticaly, when user uploads his mp3 file. This is work of CME. In my following example I'm not going to extract data from anywhere to keep things simple, but there is also a source of MP3 Metadata Extracter and many more, all inside of the Alfresco SDK.

I'm going to try to "how this stuff works part by part", so i'm going to create an "empty extractor" which just creates some metadata. So, first thing to do is to add my own bean to content-services-context.xml. In Wiki there is a way through editing a custom-metadata-extrators-context.xml controller, but this way doesn't work for me, so i added my definition right into content-services-context.xml:

<bean id="extracter.ASD" class="cz.shmoula.ASDMetadataExtracter" parent="baseMetadataExtracter" />

So, id is identificator of created bean and class is my class in my package extending AbstractMappingMetadataExtracter. I chose name of ASDMetadataExtracter due to retaining of name convention of *MetadataExtrater and ASD due to my personaly liked phrase "asdfghj…" :-). And parent will automaticaly register this bean with metadataExtracterRegistry to handle mimetypes declared in my "Extractor".

Then i have to create some properties file with defined namespace prefixes and mappings on them. Alfresco for content model uses a namespace http://www.alfresco.org/model/content/1.0 and for lucidity there is a prefix cm binded with that. So my own ASDMetadataExtracter.properties file looks like this:

namespace.prefix.cm=http://www.alfresco.org/model/content/1.0

namespace.prefix.shm=http://www.shmoula.cz/model/content/asd

description=cm:description

pokus=shm:pokus

And last thing to do is to create a class, which fills in those metadata. I uploaded whole code to pastebin, so you can browse it online, its really simple, it has just 45 lines of code!!! But some snipets:

…

private static final String KEY_POKUS = "pokus"; // definitions of metadata names, binded with properties

… MimetypeMap.MIMETYPE_TEXT_PLAIN … // i'm using this "transformer" for text/plain mime

…

putRawValue(KEY_POKUS, Long.toString(size), rawProperties); // assigning of value to metadata

…

// TempFileProvider routines are provided just for testing purposes 😉

// Files uploaded (opened) with these routines are temporary saved in <tomcat>tempAlfresco*

So, that's all, folks :-). And what does it do? After upload of document of type text/plain it fills metadata binded. Now i'm going to solve how to view them, modify them and make a sorts based on them.

Image Hosted by ImageShack.us

Content type needs to correspond with predefined values in Extractor

 

Image Hosted by ImageShack.us

In column "popis" there is value defined through "putRawValue(KEY_DESCRIPTION,…"

 

 

České Dráhy? Ale fuj!

Když už mám dneska takovou prudicí náladu, přidám jeden zážitek (nejenom) z dnešního rána.

Když už mám dneska takovou prudicí náladu, přidám jeden zážitek (nejenom) z dnešního rána.

Do práce i z práce jezdím (od zavedení IDS-JMK) vlakem i busem. Dříve, kdy jsem nemusel v půli cesty přestupovat na vlak, autobusy jezdily víceméně včas a to i v zimě. Letos naštěstí nebylo moc sněhu, tak i vlaky jezdí poměrně včas (když nepočítám pravidelný desetiminutový spoždění večer). Ale o tomhle jsem mluvit nechtěl…

480 minut, je to tak, bohužel…

Prostě si tak jedu ráno vlakem a najednou se vynoří kočena (ne žádná fiflena v kožichu se slunečníma brýlema přes půl xichtu, ale prostě „obyčejná“ krásná holka) a tradá přímo na záchod (akutním krokem ;-)). Ještě ani nedovře dvéře a už odtud s výrazem děsu prchá (nedivím se jí, minulý týden jsem byl nucen tuto zapovězenou místnost taky navštívít a i když vykonávám potřebu bohudík ve stoje, měl jsem co dělat, abych udržel obsah žaludku v sobě…a houpáním, kolíbáním a poskakováním vozu to rozhodně nebylo).

Ráno pravidelně cestuju ve stoje na chodbičce, proto jsem tentokrát ocenil, že dveře do sedícího oddělení byly nezavíratelné (takže v každé zatáčce se otvíraly a zavíraly) a mohl jsem tak slyšet, jak se baví se dvěma Angličany (tipuju přízvuk), že příště radši pojedou busem.
Tahle příhoda mě pobavila, tak jsem se alespoň usmíval a měl celkově dobrou náladu do startu nového dne.

To však nebylo všechno… Vjeli jsme do tunelu a rázem byli potmě, protože (neptejte se mě, nevím proč) na tomto úseku trati světla vždycky zhasnou a vlak „vyhodí kvalt“, takže jejich hovor a smích rázem přestal. Můj bohužel taky, protože jsem se začal nehorázně stydět.

Jak by se dala takováhle situace řešit? Nepomohlo by, kdyby stát přestal lít do ČD příspěvky a přestal uměle nahánět lidi (formou IDS)? Ano, jako firma by asi ČD chcíply, ale patří jim to s takovýmahle službama! Možná by semoloch rozbil na menší celky, který by byly schopny se o zákazníka lépe postarat a uměly by si jej i vážit… Opravdu by mě zajímalo, jestli je někdo s Českými Drahami spokojen a to jak v řadách cestujících, tak zaměstnanců. Myslel jsem, že státní podniky, kde je všechno všech, nic nikoho a nikdo se o nic nezajímá a nic nedělá jsou už dávno přežitek. Bohužel, zřejmě ne.