Ambrosia
view release on metacpan or search on metacpan
share/Templates/Common/HandlerModule.xsl
share/Templates/Common/ListManager.xsl
share/Templates/Common/MListManager.xsl
share/Templates/Common/MainManager.xsl
share/Templates/Common/SaveManager.xsl
share/Templates/Common/ServiceHandlerModule.xsl
share/Templates/Common/SysUser.xsl
share/Templates/Common/TreeManager.xsl
share/Templates/Common/Validator.xsl
share/Templates/Templates/XSLT+DOJO/authorize.xsl
share/Templates/Templates/XSLT+DOJO/edit_json.xsl
share/Templates/Templates/XSLT+DOJO/incDojo_JS_Css.xsl
share/Templates/Templates/XSLT+DOJO/list_json.xsl
share/Templates/Templates/XSLT+DOJO/main.xsl
share/Templates/Templates/XSLT+DOJO/message.xsl
share/Templates/Templates/XSLT+DOJO/tree_json.xsl
share/Templates/db2xml.xsl
share/Templates/incName.xsl
share/Templates/incTypes.xsl
share/Templates/incUtils.xsl
share/XSD/AmbrosiaDL.xsd
lib/Ambrosia/EntityDataModel.pm view on Meta::CPAN
}
sub source_path
{
my $driver = storage()->driver($_[0]->driver_type(), $_[0]->source_name());
return $driver->catalog, $driver->schema, $_[0]->table();
}
#РедакÑиÑÑемÑе Ð¿Ð¾Ð»Ñ (ÑоÑ
ÑанÑемÑе в ÐÐ). Ðо ÑмолÑÐ°Ð½Ð¸Ñ Ð²Ñе public Ð¿Ð¾Ð»Ñ ÐºÐ»Ð°ÑÑа
#Edited fields (storage in Data Source). Default all publick fields of class.
sub edit_fields
{
return $_[0]->fields();
}
sub fields_mapping()
{
my $proto = shift;
return map { $proto->_map->{$_} || $_ } $proto->edit_fields();
}
#ÐозвÑаÑÐ°ÐµÑ Ð¸Ð¼Ñ ÐºÐ»ÑÑа клаÑÑа.
#СооÑвеÑÑÑвÑÐµÑ Ð°Ð²ÑоинкÑеменÑÐ½Ð¾Ð¼Ñ Ð¿Ð¾Ð»Ñ Ð² ÐÐ.
#ÐÑли поле не авÑоинкÑеменÑное иÑполÑзÑем key
sub primary_key
{
}
#СоÑÑÑавной клÑÑ
lib/Ambrosia/EntityDataModel.pm view on Meta::CPAN
my $q = $driver->reset()
->source( $self->source_path() )
->update()
->what( $self->fields_mapping() );
foreach ( pare_list($self->key, $self->key_value) )
{
$q->predicate($_->[0], '=', $_->[1]);
}
$q->execute($self->value($self->edit_fields));
}
sub find
{
my $proto = shift;
my $class = ref($proto) || $proto;
my $var = shift || my $entity;
my $driver = storage->driver($class->driver_type, $class->source_name);
assert {$driver} 'Unknown source for find data: ' . ($class->source_name || 'undefined source');
share/Managers/buildApp.pm view on Meta::CPAN
}
elsif( config->TemplateStyle->{htmltemplate} eq 'tt' )
{
$tpl_path = 'TOOLKIT';
$ex = '.ttkt.html';
}
if ( config->TemplateStyle->{jsframework} eq 'dojo' )
{
$tpl_path .= '+DOJO';
}
$self->makeEntityCode($hDir{dirTemplates}, $tmplPath . '/Templates/Templates/' . $tpl_path . '/edit_json.xsl', '_edit_json' . $ex, 1, '@Type!="BIND" and @Type!="VIEW"');
copy($tmplPath . '/Templates/Templates/' . $tpl_path . '/message.xsl',
$hDir{dirTemplates} . '/_message.xsl') or die "Copy failed: $! ['${tmplPath}/Templates/Templates/${tpl_path}/message.xsl']";
copy($tmplPath . '/Templates/incUtils.xsl',
$hDir{dirTemplates} . '/_inc_utils.xsl') or die "Copy failed: $! ['${tmplPath}/Templates/incUtils.xsl']";
{#make main.xsl
my $style_doc = $self->parser->parse_file($tmplPath . '/Templates/Templates/' . $tpl_path . '/main.xsl');
($style_doc->getElementsByLocalName('output'))[0]->setAttribute( encoding => $encoding );
my $stylesheet = $self->xslt->parse_stylesheet($style_doc);
share/Managers/buildConfig.pm view on Meta::CPAN
);
close $fh;
}
my $message = <<MESSAGE;
#######################################################################
#
# Config file "${projectName}.conf" has been created successfully.
#
# Now you can additionally edit ${projectName}.conf and run:
# ambrosia -c ${projectName}.conf -a db2xml
#
#######################################################################
MESSAGE
Context->repository->set( Message => $message );
}
sub proces_template
{
share/Managers/buildConfig.pm view on Meta::CPAN
ID => '##NAME##',
#Application label (title)
Label => '##TITLE##',
#Template charset
Charset => '##CHARSET##',
#The path to templates of Ambrosia Builder
TemplatePath => '##SHARE_DIR##',
#Now only so. Don't edit this.
TemplateStyle => { jsframework => 'dojo', htmltemplate => 'xslt' },
#You must load Dojo Toolkit 1.7.2 from http://download.dojotoolkit.org/release-1.7.2/dojo-release-1.7.2.tar.gz
#and extract it into this directory
DojoToolkitPath => '##DOJO_TOOLKIT_PATH##',
#parameters for project
ServerName => '##HTTP_SERVER_NAME##',
ServerPort => ##HTTP_PORT##,
#The path to the directory where the project will be deployed
share/Managers/buildXml.pm view on Meta::CPAN
$path_to_app = '';
}
my $projectName = config()->ID;
my $message = <<MESSAGE;
#######################################################################
#
# ADL file ${projectName}.xml has been created successfully.
#
# Now you can additionally edit ${projectName}.xml and run:
# ambrosia -c ${projectName}.conf -d ${projectName}.xml -a xml2app
#
#######################################################################
MESSAGE
chomp(my $hostname = `hostname`);
Context->repository->set( config => {
name => config->ID,
label => config->Label,
share/Templates/Common/Config.xsl view on Meta::CPAN
</xsl:if>
<xsl:text>
</xsl:text>
<xsl:for-each select="./atns:Entitys/atns:Entity">
<xsl:variable name="entityName" select="translate(@Name, $vUppercaseChars_CONST, $vLowercaseChars_CONST)"/>
<xsl:variable name="typeEntity" select="translate(@Type, $vLowercaseChars_CONST, $vUppercaseChars_CONST)"/>
<xsl:if test="$typeEntity='TABLE' or $typeEntity='TREE'">
'/get/<xsl:value-of select="$entityName"/>' => {
manager => '<xsl:value-of select="../../@Name"/>::Managers::<xsl:value-of select="@Name"/>EditManager',
template => '<xsl:value-of select="$entityName"/>_edit_json.xsl',
access => $EDIT_<xsl:value-of select="@Name"/>
},
'/save/<xsl:value-of select="$entityName"/>' => {
manager => '<xsl:value-of select="../../@Name"/>::Managers::<xsl:value-of select="@Name"/>SaveManager',
access => $EDIT_<xsl:value-of select="@Name"/>
},
</xsl:if>
<xsl:if test="$typeEntity!='ABSTRACT' and $typeEntity!='BIND' and $typeEntity!='TREE'">
'/list/<xsl:value-of select="$entityName"/>' => {
manager => '<xsl:value-of select="../../@Name"/>::Managers::<xsl:value-of select="@Name"/>ListManager',
( run in 0.356 second using v1.01-cache-2.11-cpan-de7293f3b23 )