Archive 2012

icefaces : refresh whole page with code

     public void refreshPage() {
        FacesContext context = FacesContext.getCurrentInstance();
        Application application = context.getApplication();
        ViewHandler viewHandler = application.getViewHandler();
        UIViewRoot viewRoot = viewHandler.createView(context, context.getViewRoot().getViewId());
        context.setViewRoot(viewRoot);
    }

icefaces : force refresh a portion of page

    public void refreshUI(String componentId) {
        UIComponent uiComp = BaseBean.findComponentInRoot(componentId);
        if (uiComp != null) {
            uiComp.getChildren().clear();
        }
    }

    public static UIComponent findComponentInRoot(String id) {
        UIComponent component = null;

        FacesContext facesContext = FacesContext.getCurrentInstance();
        if (facesContext != null) {
            UIComponent root = facesContext.getViewRoot();
            component = findComponent(root, id);
        }

        return component;
    }

    public static UIComponent findComponent(UIComponent base, String id) {
        if (id.equals(base.getId())) {
            return base;
        }

        UIComponent kid = null;
        UIComponent result = null;
        Iterator kids = base.getFacetsAndChildren();
        while (kids.hasNext() && (result == null)) {
            kid = kids.next();
            if (id.equals(kid.getId())) {
                result = kid;
                break;
            }
            result = findComponent(kid, id);
            if (result != null) {
                break;
            }
        }
        return result;
    }

exception : maven release error : Could not read chunk Size: secure connection truncated


October 11, 2012

Could not read chunk Size: secure connection truncated
http://adventuresindotnet.blogspot.fr/2010/09/svn-trouble.html
– svn server 1.6.11
– eclipse juno + svnkit 1.3.8
– apache maven 2.2.1
quand je fait une maven release tout va bien jusqu’au tag de la version. mais après quand il essaye de récupérer le tag avec un “svn checkout” ça montre qu’il récupère les fichiers du svn… mais après un certain temps ça plante avec un message d’erreur svn (could not read chunk size: secure connection truncated). côté serveur apache httpd (message d’erreur : comme dans l’article)
même problème que dans l’article. j’ai augmenté le timeout sans que cela résout le pb. Solution: changer le client svn : j’ai svn-win32-1.5.6 .j’ai essayé 1.6.6 / 1.6.11 / 1.6.15  (téléchargeables ici http://sourceforge.net/projects/win32svn/files/) et essayer dans une ligne de commande dos “svn checkout –username xxx –password xxx https://svn.xxx.fr/project/tags/xxx” en vain.
Avec la dernière version du svn client 1.7.6, le svn checkout ça marche. Mais quand j’essaye avec maven release-prepare => erreur : working copy is too old (c’est normal la copie dans svn est format 10 créé avec un svn server 1.6.11) et le client est plus récent 1.7.6.
enfin j’ai essayé un svn checkout avec le client svn-win32-1.6.19 ça marche. bingo

requête qui cherche dans tous les composants apex (à améliorer constemment)


May 2, 2012

–accept search_text prompt “Enter search text: “

select application_id, page_id, ‘Region’ objtype, region_name obj_name, region_source source
from   apex_application_page_regions
where lower(region_source) like lower(‘%&search_text%’)

UNION ALL
select application_id, page_id, ‘Region (condition)’ obj_type, region_name obj_name, to_clob(‘–EXPR1:’||CHR(13)||CHR(10)||condition_expression1||CHR(13)||CHR(10)||CHR(13)||CHR(10)||’–EXPR2:’||CHR(13)||CHR(10) || condition_expression2) source
from   apex_application_page_regions
where  lower(condition_expression1 || ‘ ‘ || condition_expression2) like  lower(‘%&search_text%’)

UNION ALL
select application_id, page_id, ‘Item’ obj_type, item_name obj_name, to_clob(item_source) source
from   apex_application_page_items
where  lower(item_source) like  lower(‘%&search_text%’)

UNION ALL
select application_id, page_id, ‘Item (condition)’ obj_type, item_name obj_name, to_clob(‘–EXPR1:’||CHR(13)||CHR(10)||condition_expression1||CHR(13)||CHR(10)||CHR(13)||CHR(10)||’–EXPR2:’||CHR(13)||CHR(10) || condition_expression2) source
from   apex_application_page_items
where  lower(condition_expression1 || ‘ ‘ || condition_expression2) like  lower(‘%&search_text%’)

UNION ALL
select application_id, page_id, ‘Item (default value)’ obj_type, item_name obj_name, to_clob(item_default) source
from   apex_application_page_items
where  lower(item_default) like  lower(‘%&search_text%’)

UNION ALL
select application_id, page_id, ‘Item (lov)’ obj_type, item_name obj_name, to_clob(lov_definition) source
from   apex_application_page_items
where  lower(lov_definition) like  lower(‘%&search_text%’)

UNION ALL
select application_id, page_id, ‘Item (post computation)’ obj_type, item_name obj_name, to_clob(source_post_computation) source
from   apex_application_page_items
where  lower(source_post_computation) like  lower(‘%&search_text%’)

UNION ALL
select application_id, page_id, ‘Item (readOnly condition)’ obj_type, item_name obj_name, to_clob(read_only_condition_exp1) source
from   apex_application_page_items
where  lower(read_only_condition_exp1) like  lower(‘%&search_text%’)

UNION ALL
select application_id, page_id, ‘Process’ obj_type, process_name obj_name, process_source source
from   apex_application_page_proc
where  lower(process_source) like  lower(‘%&search_text%’)

UNION ALL
select application_id, page_id, ‘Process (condition)’ obj_type, process_name obj_name, to_clob(‘–EXPR1:’||CHR(13)||CHR(10)||condition_expression1||CHR(13)||CHR(10)||CHR(13)||CHR(10)||’–EXPR2:’||CHR(13)||CHR(10) || condition_expression2) source
from   apex_application_page_proc
where  lower(condition_expression1 || ‘ ‘ || condition_expression2) like  lower(‘%&search_text%’)

UNION ALL
select application_id, page_id, ‘Calcul’ obj_type, execution_sequence||’ ‘||item_name obj_name, to_clob(computation) source
from   apex_application_page_comp
where  lower(computation) like  lower(‘%&search_text%’)

UNION ALL
select application_id, page_id, ‘Calcul (condition)’ obj_type, execution_sequence||’ ‘||item_name obj_name, to_clob(‘–EXPR1:’||CHR(13)||CHR(10)||condition_expression1||CHR(13)||CHR(10)||CHR(13)||CHR(10)||’–EXPR2:’||CHR(13)||CHR(10) || condition_expression2) source
from   apex_application_page_comp
where  lower(condition_expression1 || ‘ ‘ || condition_expression2) like  lower(‘%&search_text%’)

UNION ALL
select application_id, page_id, ‘Branch’ obj_type, TO_CHAR(process_sequence) obj_name, to_clob(branch_action) source
from   apex_application_page_branches
where  lower(branch_action) like  lower(‘%&search_text%’)

UNION ALL
select application_id, page_id, ‘Branch (condition)’ obj_type, to_char(process_sequence) obj_name, to_clob(‘–EXPR1:’||CHR(13)||CHR(10)||condition_expression1||CHR(13)||CHR(10)||CHR(13)||CHR(10)||’–EXPR2:’||CHR(13)||CHR(10) || condition_expression2) source
from   apex_application_page_branches
where  lower(condition_expression1 || ‘ ‘ || condition_expression2) like  lower(‘%&search_text%’)

UNION ALL
select application_id, page_id, ‘Button (condition)’ obj_type, BUTTON_SEQUENCE || ‘ ‘ || BUTTON_NAME obj_name, to_clob(‘–EXPR1:’||CHR(13)||CHR(10)||condition_expression1||CHR(13)||CHR(10)||CHR(13)||CHR(10)||’–EXPR2:’||CHR(13)||CHR(10) || condition_expression2) source
from   apex_application_page_buttons
where  lower(condition_expression1 || ‘ ‘ || condition_expression2) like  lower(‘%&search_text%’)

UNION ALL
select application_id, page_id, ‘Validation’ obj_type, VALIDATION_NAME obj_name, to_clob(‘–EXPR1:’||CHR(13)||CHR(10)||validation_expression1||CHR(13)||CHR(10)||CHR(13)||CHR(10)||’–EXPR2:’||CHR(13)||CHR(10) || validation_expression2) source
from   apex_application_page_val
where  lower(validation_expression1 || ‘ ‘ || validation_expression2) like  lower(‘%&search_text%’)

UNION ALL
select application_id, page_id, ‘Validation (condition)’ obj_type, VALIDATION_NAME obj_name, to_clob(‘–EXPR1:’||CHR(13)||CHR(10)||condition_expression1||CHR(13)||CHR(10)||CHR(13)||CHR(10)||’–EXPR2:’||CHR(13)||CHR(10) || condition_expression2) source
from   apex_application_page_val
where  lower(condition_expression1 || ‘ ‘ || condition_expression2) like  lower(‘%&search_text%’)

UNION ALL
select ap.application_id application_id, -1 page_id, ‘application_process’ obj_type, to_char(ap.PROCESS_NAME) obj_name, process source
  from apex_application_processes ap
where  lower(ap.process) like  lower(‘%&search_text%’)

UNION ALL
select aa.application_id application_id, -1 page_id, ‘authorization model’ obj_type, to_char(aa.authorization_scheme_name) obj_name, to_clob(aa.scheme) source
  from apex_application_authorization aa
where  lower(aa.scheme) like  lower(‘%&search_text%’)

———————————————————————
———————————————————————
—- replace authorization model request by the following if APEX 4
/*

UNION ALL
select aa.application_id application_id, -1 page_id, ‘authorization model’ obj_type, to_char(aa.authorization_scheme_name) obj_name,
       to_clob(aa.attribute_01 || ‘ || ‘ || aa.attribute_02 || ‘ || ‘ ||aa.attribute_03 || ‘ || ‘ ||aa.attribute_04 || ‘ || ‘ ||aa.attribute_05 || ‘ || ‘ ||
               aa.attribute_06 || ‘ || ‘ || aa.attribute_07 || ‘ || ‘ ||aa.attribute_08 || ‘ || ‘ ||aa.attribute_09 || ‘ || ‘ ||aa.attribute_10 || ‘ || ‘ ||
               aa.attribute_11 || ‘ || ‘ || aa.attribute_12 || ‘ || ‘ ||aa.attribute_13 || ‘ || ‘ ||aa.attribute_14 || ‘ || ‘ ||aa.attribute_15
       ) source
  from apex_application_authorization aa
where  lower(aa.attribute_01) like  lower(‘%&search_text%’) OR
       lower(aa.attribute_02) like  lower(‘%&search_text%’) OR
       lower(aa.attribute_03) like  lower(‘%&search_text%’) OR
       lower(aa.attribute_04) like  lower(‘%&search_text%’) OR
       lower(aa.attribute_05) like  lower(‘%&search_text%’) OR
       lower(aa.attribute_06) like  lower(‘%&search_text%’) OR
       lower(aa.attribute_07) like  lower(‘%&search_text%’) OR
       lower(aa.attribute_08) like  lower(‘%&search_text%’) OR
       lower(aa.attribute_09) like  lower(‘%&search_text%’) OR
       lower(aa.attribute_10) like  lower(‘%&search_text%’) OR
       lower(aa.attribute_11) like  lower(‘%&search_text%’) OR
       lower(aa.attribute_12) like  lower(‘%&search_text%’) OR
       lower(aa.attribute_13) like  lower(‘%&search_text%’) OR
       lower(aa.attribute_14) like  lower(‘%&search_text%’) OR
       lower(aa.attribute_15) like  lower(‘%&search_text%’)

*/

UNION ALL
select alov.application_id application_id, -1 page_id, ‘lov’ obj_type, to_char(alov.list_of_values_name) obj_name, to_clob(alov.list_of_values_query) source
  from apex_application_lovs alov
where  lower(alov.list_of_values_query) like  lower(‘%&search_text%’)

ORDER BY 1,2,3,4

exit imp prompt (IMP-0002 error)

You are trying to import oracle dump file with imp command, but imp don’t have access to that dump file. You will be prompted to enter a new dump file path name.

IMP-00002: failed to open expdat.dmp for read
Import file: expdat.dmp >

>> use CTRL-D to exit imp prompt

import oracle dump file

import dump file
>> imp witr/passwd@WITRDBIDENT file=/tmp/expdat.dmp fromuser=witr touser=witr log =/tmp/imp.log

import one table from dump file
>> imp witr/passwd@WITRDBIDENT file=/tmp/expdat.dmp fromuser=witr touser=witr tables=T_WITR log =/tmp/imp.log

oublier le mot de passe root mysql ubuntu

March 29, 2012

oublier le mot de passe root mysql ubuntu:

1) sudo service mysql stop
2) sudo mysqld_safe –skip-grant-tables
3) dans un autre terminal : mysql -u root mysql
4) update user set Password=PASSWORD(‘newPassword’) where user=’root’;
4) flush privileges;
5) exit;
6) c’est tout source: http://www.howtoforge.com/reset-forgotten-mysql-root-password